Bump version to 1.0.9; update JSON schemas; add new APIs

This commit is contained in:
Sebastian Thiel
2019-07-05 11:32:35 +08:00
parent 99e97ceece
commit e42ebc0c2b
2442 changed files with 190984 additions and 71186 deletions

View File

@@ -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.8+20190328*, where *20190328* is the exact revision of the *bigtableadmin:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.8*.
//! This documentation was generated from *Bigtable Admin* crate version *1.0.9+20190506*, where *20190506* is the exact revision of the *bigtableadmin:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.9*.
//!
//! 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) and [*instances update*](struct.ProjectInstanceUpdateCall.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 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)
//!
//!
//!
@@ -224,9 +224,7 @@ use std::mem;
use std::thread::sleep;
use std::time::Duration;
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part,
ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder,
Resource, ErrorResponse, remove_json_null_values};
pub use cmn::*;
// ##############
@@ -367,7 +365,7 @@ impl<'a, C, A> BigtableAdmin<C, A>
BigtableAdmin {
client: RefCell::new(client),
auth: RefCell::new(authenticator),
_user_agent: "google-api-rust-client/1.0.8".to_string(),
_user_agent: "google-api-rust-client/1.0.9".to_string(),
_base_url: "https://bigtableadmin.googleapis.com/".to_string(),
_root_url: "https://bigtableadmin.googleapis.com/".to_string(),
}
@@ -381,7 +379,7 @@ impl<'a, C, A> BigtableAdmin<C, A>
}
/// Set the user-agent header field to use in all requests to the server.
/// It defaults to `google-api-rust-client/1.0.8`.
/// It defaults to `google-api-rust-client/1.0.9`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
@@ -509,8 +507,8 @@ pub struct Binding {
/// Role that is assigned to `members`.
/// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
pub role: Option<String>,
/// Unimplemented. The condition that is associated with this binding.
/// NOTE: an unsatisfied condition will not allow user access via current
/// 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<Expr>,
@@ -617,17 +615,58 @@ impl RequestValue for Instance {}
impl ResponseResult for Instance {}
/// An initial split point for a newly created table.
/// The response message for Locations.ListLocations.
///
/// 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 list projects](struct.ProjectLocationListCall.html) (response)
///
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Split {
/// Row key to use as an initial tablet boundary.
pub key: Option<String>,
pub struct ListLocationsResponse {
/// The standard List next-page token.
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
/// A list of locations that matches the specified filter in the request.
pub locations: Option<Vec<Location>>,
}
impl Part for Split {}
impl ResponseResult for ListLocationsResponse {}
/// 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 get projects](struct.ProjectLocationGetCall.html) (response)
///
#[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<String>,
/// Cross-service attributes for the location. For example
///
/// {"cloud.googleapis.com/region": "us-east1"}
pub labels: Option<HashMap<String, String>>,
/// The canonical id for this location. For example: `"us-east1"`.
#[serde(rename="locationId")]
pub location_id: Option<String>,
/// Resource name for the location, which may vary between implementations.
/// For example: `"projects/example-project/locations/us-east1"`
pub name: Option<String>,
/// Service-specific metadata. For example the available capacity at the given
/// location.
pub metadata: Option<HashMap<String, String>>,
}
impl ResponseResult for Location {}
/// A set of columns within a table which share a common configuration.
@@ -1174,6 +1213,19 @@ pub struct TestIamPermissionsResponse {
impl ResponseResult for TestIamPermissionsResponse {}
/// An initial split point for a newly created 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 Split {
/// Row key to use as an initial tablet boundary.
pub key: Option<String>,
}
impl Part for Split {}
/// Response message for BigtableInstanceAdmin.ListAppProfiles.
///
/// # Activities
@@ -1729,7 +1781,7 @@ impl<'a, C, A> OperationMethods<'a, C, A> {
/// <MemoryStorage as Default>::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(...)` and `instances_update(...)`
/// // 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(...)`
/// // to build up your call.
/// let rb = hub.projects();
/// # }
@@ -1768,6 +1820,23 @@ 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:
///
/// Permanently drop/delete a row range from a specified table. The request can
@@ -1983,6 +2052,26 @@ 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.
///
/// # 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:
///
/// Gets the access control policy for an instance resource. Returns an empty
@@ -3715,6 +3804,254 @@ impl<'a, C, A> ProjectInstanceTableGenerateConsistencyTokenCall<'a, C, A> where
}
/// 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_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())),
/// # <MemoryStorage as Default>::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().locations_get("name")
/// .doit();
/// # }
/// ```
pub struct ProjectLocationGetCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a BigtableAdmin<C, A>,
_name: String,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {}
impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, 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 Delegate = match self._delegate {
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "bigtableadmin.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() + "v2/{+name}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{+name}", "name")].iter() {
let mut replace_with = String::new();
for &(name, ref value) in params.iter() {
if name == param_name {
replace_with = value.to_string();
break;
}
}
if find_this.as_bytes()[1] == '+' as u8 {
replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string();
}
url = url.replace(find_this, &replace_with);
}
{
let mut indices_for_removal: Vec<usize> = Vec::with_capacity(1);
for param_name in ["name"].iter() {
if let Some(index) = params.iter().position(|t| &t.0 == param_name) {
indices_for_removal.push(index);
}
}
for &index in indices_for_removal.iter() {
params.remove(index);
}
}
let url = hyper::Url::parse_with_params(&url, params).unwrap();
loop {
let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) {
Ok(token) => token,
Err(err) => {
match dlg.token(&*err) {
Some(token) => token,
None => {
dlg.finished(false);
return Err(Error::MissingToken(err))
}
}
}
};
let auth_header = Authorization(Bearer { token: token.access_token });
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
dlg.pre_request();
req.send()
};
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
continue;
}
dlg.finished(false);
return Err(Error::HttpError(err))
}
Ok(mut res) => {
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep(d);
continue;
}
dlg.finished(false);
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
res.read_to_string(&mut json_response).unwrap();
match json::from_str(&json_response) {
Ok(decoded) => (res, decoded),
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 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<T>(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
/// Identifies the authorization 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<T, S>(mut self, scope: T) -> ProjectLocationGetCall<'a, C, A>
where T: Into<Option<S>>,
S: AsRef<str> {
match scope.into() {
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
None => None,
};
self
}
}
/// Permanently drop/delete a row range from a specified table. The request can
/// specify whether to delete all rows in a table, or only those that match a
/// particular prefix.
@@ -4573,7 +4910,7 @@ impl<'a, C, A> ProjectInstanceCreateCall<'a, C, A> where C: BorrowMut<hyper::Cli
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_clusters_create(req, "parent")
/// .cluster_id("diam")
/// .cluster_id("ipsum")
/// .doit();
/// # }
/// ```
@@ -4862,7 +5199,7 @@ impl<'a, C, A> ProjectInstanceClusterCreateCall<'a, C, A> where C: BorrowMut<hyp
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_tables_get("name")
/// .view("Lorem")
/// .view("et")
/// .doit();
/// # }
/// ```
@@ -5131,7 +5468,7 @@ impl<'a, C, A> ProjectInstanceTableGetCall<'a, C, A> where C: BorrowMut<hyper::C
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_app_profiles_patch(req, "name")
/// .update_mask("duo")
/// .update_mask("aliquyam")
/// .ignore_warnings(true)
/// .doit();
/// # }
@@ -5431,8 +5768,8 @@ impl<'a, C, A> ProjectInstanceAppProfilePatchCall<'a, C, A> where C: BorrowMut<h
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_app_profiles_list("parent")
/// .page_token("Lorem")
/// .page_size(-75)
/// .page_token("eos")
/// .page_size(-81)
/// .doit();
/// # }
/// ```
@@ -6525,6 +6862,290 @@ impl<'a, C, A> ProjectInstanceTableCheckConsistencyCall<'a, C, A> where C: Borro
}
/// 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_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())),
/// # <MemoryStorage as Default>::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().locations_list("name")
/// .page_token("amet")
/// .page_size(-60)
/// .filter("labore")
/// .doit();
/// # }
/// ```
pub struct ProjectLocationListCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a BigtableAdmin<C, A>,
_name: String,
_page_token: Option<String>,
_page_size: Option<i32>,
_filter: Option<String>,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {}
impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut<hyper::Client>, 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 Delegate = match self._delegate {
Some(d) => d,
None => &mut dd
};
dlg.begin(MethodInfo { id: "bigtableadmin.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() + "v2/{+name}/locations";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{+name}", "name")].iter() {
let mut replace_with = String::new();
for &(name, ref value) in params.iter() {
if name == param_name {
replace_with = value.to_string();
break;
}
}
if find_this.as_bytes()[1] == '+' as u8 {
replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string();
}
url = url.replace(find_this, &replace_with);
}
{
let mut indices_for_removal: Vec<usize> = Vec::with_capacity(1);
for param_name in ["name"].iter() {
if let Some(index) = params.iter().position(|t| &t.0 == param_name) {
indices_for_removal.push(index);
}
}
for &index in indices_for_removal.iter() {
params.remove(index);
}
}
let url = hyper::Url::parse_with_params(&url, params).unwrap();
loop {
let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) {
Ok(token) => token,
Err(err) => {
match dlg.token(&*err) {
Some(token) => token,
None => {
dlg.finished(false);
return Err(Error::MissingToken(err))
}
}
}
};
let auth_header = Authorization(Bearer { token: token.access_token });
let mut req_result = {
let mut client = &mut *self.hub.client.borrow_mut();
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone())
.header(UserAgent(self.hub._user_agent.clone()))
.header(auth_header.clone());
dlg.pre_request();
req.send()
};
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(d);
continue;
}
dlg.finished(false);
return Err(Error::HttpError(err))
}
Ok(mut res) => {
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep(d);
continue;
}
dlg.finished(false);
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
res.read_to_string(&mut json_response).unwrap();
match json::from_str(&json_response) {
Ok(decoded) => (res, decoded),
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 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<T>(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
/// Identifies the authorization 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<T, S>(mut self, scope: T) -> ProjectLocationListCall<'a, C, A>
where T: Into<Option<S>>,
S: AsRef<str> {
match scope.into() {
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
None => None,
};
self
}
}
/// Gets the access control policy for an instance resource. Returns an empty
/// policy if an instance exists but does not have a policy set.
///
@@ -7613,7 +8234,7 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut<hyper::Cli
/// // 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("eirmod")
/// .page_token("Lorem")
/// .doit();
/// # }
/// ```
@@ -8158,9 +8779,9 @@ impl<'a, C, A> ProjectInstanceTableCreateCall<'a, C, A> where C: BorrowMut<hyper
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_tables_list("parent")
/// .view("aliquyam")
/// .page_token("accusam")
/// .page_size(-56)
/// .view("duo")
/// .page_token("et")
/// .page_size(-40)
/// .doit();
/// # }
/// ```
@@ -8347,7 +8968,14 @@ impl<'a, C, A> ProjectInstanceTableListCall<'a, C, A> where C: BorrowMut<hyper::
self
}
/// Maximum number of results per page.
/// CURRENTLY UNIMPLEMENTED AND IGNORED.
///
/// A page_size of zero lets the server choose the number of items to return.
/// A page_size which is strictly positive will return at most that many items.
/// A negative page_size will cause an error.
///
/// Following the first request, subsequent paginated calls are not required
/// to pass a page_size. If a page_size is set in subsequent calls, it must
/// match the page_size given in the first request.
///
/// Sets the *page size* query property to the given value.
pub fn page_size(mut self, new_value: i32) -> ProjectInstanceTableListCall<'a, C, A> {
@@ -8701,7 +9329,7 @@ impl<'a, C, A> ProjectInstanceClusterGetCall<'a, C, A> where C: BorrowMut<hyper:
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_partial_update_instance(req, "name")
/// .update_mask("duo")
/// .update_mask("amet")
/// .doit();
/// # }
/// ```
@@ -9521,7 +10149,7 @@ impl<'a, C, A> ProjectInstanceUpdateCall<'a, C, A> where C: BorrowMut<hyper::Cli
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_list("parent")
/// .page_token("et")
/// .page_token("ea")
/// .doit();
/// # }
/// ```
@@ -9789,7 +10417,7 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut<hyper::Clien
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().instances_app_profiles_create(req, "parent")
/// .ignore_warnings(true)
/// .app_profile_id("consetetur")
/// .app_profile_id("dolor")
/// .doit();
/// # }
/// ```