google_bigtableadmin2/api.rs
1use std::collections::HashMap;
2use std::cell::RefCell;
3use std::default::Default;
4use std::collections::BTreeSet;
5use std::error::Error as StdError;
6use serde_json as json;
7use std::io;
8use std::fs;
9use std::mem;
10
11use hyper::client::connect;
12use tokio::io::{AsyncRead, AsyncWrite};
13use tokio::time::sleep;
14use tower_service;
15use serde::{Serialize, Deserialize};
16
17use crate::{client, client::GetToken, client::serde_with};
18
19// ##############
20// UTILITIES ###
21// ############
22
23/// Identifies the an OAuth2 authorization scope.
24/// A scope is needed when requesting an
25/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
26#[derive(PartialEq, Eq, Ord, PartialOrd, Hash, Debug, Clone, Copy)]
27pub enum Scope {
28 /// Administer your Cloud Bigtable tables and clusters
29 BigtableAdmin,
30
31 /// Administer your Cloud Bigtable clusters
32 BigtableAdminCluster,
33
34 /// Administer your Cloud Bigtable clusters
35 BigtableAdminInstance,
36
37 /// Administer your Cloud Bigtable tables
38 BigtableAdminTable,
39
40 /// Administer your Cloud Bigtable tables and clusters
41 CloudBigtableAdmin,
42
43 /// Administer your Cloud Bigtable clusters
44 CloudBigtableAdminCluster,
45
46 /// Administer your Cloud Bigtable tables
47 CloudBigtableAdminTable,
48
49 /// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
50 CloudPlatform,
51
52 /// View your data across Google Cloud services and see the email address of your Google Account
53 CloudPlatformReadOnly,
54}
55
56impl AsRef<str> for Scope {
57 fn as_ref(&self) -> &str {
58 match *self {
59 Scope::BigtableAdmin => "https://www.googleapis.com/auth/bigtable.admin",
60 Scope::BigtableAdminCluster => "https://www.googleapis.com/auth/bigtable.admin.cluster",
61 Scope::BigtableAdminInstance => "https://www.googleapis.com/auth/bigtable.admin.instance",
62 Scope::BigtableAdminTable => "https://www.googleapis.com/auth/bigtable.admin.table",
63 Scope::CloudBigtableAdmin => "https://www.googleapis.com/auth/cloud-bigtable.admin",
64 Scope::CloudBigtableAdminCluster => "https://www.googleapis.com/auth/cloud-bigtable.admin.cluster",
65 Scope::CloudBigtableAdminTable => "https://www.googleapis.com/auth/cloud-bigtable.admin.table",
66 Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
67 Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only",
68 }
69 }
70}
71
72impl Default for Scope {
73 fn default() -> Scope {
74 Scope::BigtableAdmin
75 }
76}
77
78
79
80// ########
81// HUB ###
82// ######
83
84/// Central instance to access all BigtableAdmin related resource activities
85///
86/// # Examples
87///
88/// Instantiate a new hub
89///
90/// ```test_harness,no_run
91/// extern crate hyper;
92/// extern crate hyper_rustls;
93/// extern crate google_bigtableadmin2 as bigtableadmin2;
94/// use bigtableadmin2::{Result, Error};
95/// # async fn dox() {
96/// use std::default::Default;
97/// use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
98///
99/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
100/// // `client_secret`, among other things.
101/// let secret: oauth2::ApplicationSecret = Default::default();
102/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
103/// // unless you replace `None` with the desired Flow.
104/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
105/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
106/// // retrieve them from storage.
107/// let auth = oauth2::InstalledFlowAuthenticator::builder(
108/// secret,
109/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
110/// ).build().await.unwrap();
111/// let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
112/// // You can configure optional parameters by calling the respective setters at will, and
113/// // execute the final call using `doit()`.
114/// // Values shown here are possibly random and not representative !
115/// let result = hub.operations().projects_operations_list("name")
116/// .page_token("takimata")
117/// .page_size(-52)
118/// .filter("duo")
119/// .doit().await;
120///
121/// match result {
122/// Err(e) => match e {
123/// // The Error enum provides details about what exactly happened.
124/// // You can also just use its `Debug`, `Display` or `Error` traits
125/// Error::HttpError(_)
126/// |Error::Io(_)
127/// |Error::MissingAPIKey
128/// |Error::MissingToken(_)
129/// |Error::Cancelled
130/// |Error::UploadSizeLimitExceeded(_, _)
131/// |Error::Failure(_)
132/// |Error::BadRequest(_)
133/// |Error::FieldClash(_)
134/// |Error::JsonDecodeError(_, _) => println!("{}", e),
135/// },
136/// Ok(res) => println!("Success: {:?}", res),
137/// }
138/// # }
139/// ```
140#[derive(Clone)]
141pub struct BigtableAdmin<S> {
142 pub client: hyper::Client<S, hyper::body::Body>,
143 pub auth: Box<dyn client::GetToken>,
144 _user_agent: String,
145 _base_url: String,
146 _root_url: String,
147}
148
149impl<'a, S> client::Hub for BigtableAdmin<S> {}
150
151impl<'a, S> BigtableAdmin<S> {
152
153 pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> BigtableAdmin<S> {
154 BigtableAdmin {
155 client,
156 auth: Box::new(auth),
157 _user_agent: "google-api-rust-client/5.0.4".to_string(),
158 _base_url: "https://bigtableadmin.googleapis.com/".to_string(),
159 _root_url: "https://bigtableadmin.googleapis.com/".to_string(),
160 }
161 }
162
163 pub fn operations(&'a self) -> OperationMethods<'a, S> {
164 OperationMethods { hub: &self }
165 }
166 pub fn projects(&'a self) -> ProjectMethods<'a, S> {
167 ProjectMethods { hub: &self }
168 }
169
170 /// Set the user-agent header field to use in all requests to the server.
171 /// It defaults to `google-api-rust-client/5.0.4`.
172 ///
173 /// Returns the previously set user-agent.
174 pub fn user_agent(&mut self, agent_name: String) -> String {
175 mem::replace(&mut self._user_agent, agent_name)
176 }
177
178 /// Set the base url to use in all requests to the server.
179 /// It defaults to `https://bigtableadmin.googleapis.com/`.
180 ///
181 /// Returns the previously set base url.
182 pub fn base_url(&mut self, new_base_url: String) -> String {
183 mem::replace(&mut self._base_url, new_base_url)
184 }
185
186 /// Set the root url to use in all requests to the server.
187 /// It defaults to `https://bigtableadmin.googleapis.com/`.
188 ///
189 /// Returns the previously set root url.
190 pub fn root_url(&mut self, new_root_url: String) -> String {
191 mem::replace(&mut self._root_url, new_root_url)
192 }
193}
194
195
196// ############
197// SCHEMAS ###
198// ##########
199/// A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application.
200///
201/// # Activities
202///
203/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
204/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
205///
206/// * [instances app profiles create projects](ProjectInstanceAppProfileCreateCall) (request|response)
207/// * [instances app profiles get projects](ProjectInstanceAppProfileGetCall) (response)
208/// * [instances app profiles patch projects](ProjectInstanceAppProfilePatchCall) (request)
209#[serde_with::serde_as(crate = "::client::serde_with")]
210#[derive(Default, Clone, Debug, Serialize, Deserialize)]
211pub struct AppProfile {
212 /// Long form description of the use case for this AppProfile.
213
214 pub description: Option<String>,
215 /// Strongly validated etag for optimistic concurrency control. Preserve the value returned from `GetAppProfile` when calling `UpdateAppProfile` to fail the request if there has been a modification in the mean time. The `update_mask` of the request need not include `etag` for this protection to apply. See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more details.
216
217 pub etag: Option<String>,
218 /// Use a multi-cluster routing policy.
219 #[serde(rename="multiClusterRoutingUseAny")]
220
221 pub multi_cluster_routing_use_any: Option<MultiClusterRoutingUseAny>,
222 /// The unique name of the app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/_a-zA-Z0-9*`.
223
224 pub name: Option<String>,
225 /// This field has been deprecated in favor of `standard_isolation.priority`. If you set this field, `standard_isolation.priority` will be set instead. The priority of requests sent using this app profile.
226
227 pub priority: Option<String>,
228 /// Use a single-cluster routing policy.
229 #[serde(rename="singleClusterRouting")]
230
231 pub single_cluster_routing: Option<SingleClusterRouting>,
232 /// The standard options used for isolating this app profile's traffic from other use cases.
233 #[serde(rename="standardIsolation")]
234
235 pub standard_isolation: Option<StandardIsolation>,
236}
237
238impl client::RequestValue for AppProfile {}
239impl client::ResponseResult for AppProfile {}
240
241
242/// 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.
243///
244/// This type is not used in any activity, and only used as *part* of another schema.
245///
246#[serde_with::serde_as(crate = "::client::serde_with")]
247#[derive(Default, Clone, Debug, Serialize, Deserialize)]
248pub struct AuditConfig {
249 /// The configuration for logging of each type of permission.
250 #[serde(rename="auditLogConfigs")]
251
252 pub audit_log_configs: Option<Vec<AuditLogConfig>>,
253 /// 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.
254
255 pub service: Option<String>,
256}
257
258impl client::Part for AuditConfig {}
259
260
261/// 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.
262///
263/// This type is not used in any activity, and only used as *part* of another schema.
264///
265#[serde_with::serde_as(crate = "::client::serde_with")]
266#[derive(Default, Clone, Debug, Serialize, Deserialize)]
267pub struct AuditLogConfig {
268 /// Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
269 #[serde(rename="exemptedMembers")]
270
271 pub exempted_members: Option<Vec<String>>,
272 /// The log type that this config enables.
273 #[serde(rename="logType")]
274
275 pub log_type: Option<String>,
276}
277
278impl client::Part for AuditLogConfig {}
279
280
281/// Limits for the number of nodes a Cluster can autoscale up/down to.
282///
283/// This type is not used in any activity, and only used as *part* of another schema.
284///
285#[serde_with::serde_as(crate = "::client::serde_with")]
286#[derive(Default, Clone, Debug, Serialize, Deserialize)]
287pub struct AutoscalingLimits {
288 /// Required. Maximum number of nodes to scale up to.
289 #[serde(rename="maxServeNodes")]
290
291 pub max_serve_nodes: Option<i32>,
292 /// Required. Minimum number of nodes to scale down to.
293 #[serde(rename="minServeNodes")]
294
295 pub min_serve_nodes: Option<i32>,
296}
297
298impl client::Part for AutoscalingLimits {}
299
300
301/// The Autoscaling targets for a Cluster. These determine the recommended nodes.
302///
303/// This type is not used in any activity, and only used as *part* of another schema.
304///
305#[serde_with::serde_as(crate = "::client::serde_with")]
306#[derive(Default, Clone, Debug, Serialize, Deserialize)]
307pub struct AutoscalingTargets {
308 /// The cpu utilization that the Autoscaler should be trying to achieve. This number is on a scale from 0 (no utilization) to 100 (total utilization), and is limited between 10 and 80, otherwise it will return INVALID_ARGUMENT error.
309 #[serde(rename="cpuUtilizationPercent")]
310
311 pub cpu_utilization_percent: Option<i32>,
312 /// The storage utilization that the Autoscaler should be trying to achieve. This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, it will be treated as if it were set to the default value: 2560 for SSD, 8192 for HDD.
313 #[serde(rename="storageUtilizationGibPerNode")]
314
315 pub storage_utilization_gib_per_node: Option<i32>,
316}
317
318impl client::Part for AutoscalingTargets {}
319
320
321/// A backup of a Cloud Bigtable table.
322///
323/// # Activities
324///
325/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
326/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
327///
328/// * [instances clusters backups create projects](ProjectInstanceClusterBackupCreateCall) (request)
329/// * [instances clusters backups get projects](ProjectInstanceClusterBackupGetCall) (response)
330/// * [instances clusters backups patch projects](ProjectInstanceClusterBackupPatchCall) (request|response)
331#[serde_with::serde_as(crate = "::client::serde_with")]
332#[derive(Default, Clone, Debug, Serialize, Deserialize)]
333pub struct Backup {
334 /// Output only. The encryption information for the backup.
335 #[serde(rename="encryptionInfo")]
336
337 pub encryption_info: Option<EncryptionInfo>,
338 /// Output only. `end_time` is the time that the backup was finished. The row data in the backup will be no newer than this timestamp.
339 #[serde(rename="endTime")]
340
341 pub end_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
342 /// Required. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 90 days from the time the request is received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free the resources used by the backup.
343 #[serde(rename="expireTime")]
344
345 pub expire_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
346 /// A globally unique identifier for the backup which cannot be changed. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-zA-Z0-9*` The final segment of the name must be between 1 and 50 characters in length. The backup is stored in the cluster identified by the prefix of the backup name of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
347
348 pub name: Option<String>,
349 /// Output only. Size of the backup in bytes.
350 #[serde(rename="sizeBytes")]
351
352 #[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
353 pub size_bytes: Option<i64>,
354 /// Output only. Name of the backup from which this backup was copied. If a backup is not created by copying a backup, this field will be empty. Values are of the form: projects//instances//clusters//backups/
355 #[serde(rename="sourceBackup")]
356
357 pub source_backup: Option<String>,
358 /// Required. Immutable. Name of the table from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects/{project}/instances/{instance}/tables/{source_table}`.
359 #[serde(rename="sourceTable")]
360
361 pub source_table: Option<String>,
362 /// Output only. `start_time` is the time that the backup was started (i.e. approximately the time the CreateBackup request is received). The row data in this backup will be no older than this timestamp.
363 #[serde(rename="startTime")]
364
365 pub start_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
366 /// Output only. The current state of the backup.
367
368 pub state: Option<String>,
369}
370
371impl client::RequestValue for Backup {}
372impl client::ResponseResult for Backup {}
373
374
375/// Information about a backup.
376///
377/// This type is not used in any activity, and only used as *part* of another schema.
378///
379#[serde_with::serde_as(crate = "::client::serde_with")]
380#[derive(Default, Clone, Debug, Serialize, Deserialize)]
381pub struct BackupInfo {
382 /// Output only. Name of the backup.
383
384 pub backup: Option<String>,
385 /// Output only. This time that the backup was finished. Row data in the backup will be no newer than this timestamp.
386 #[serde(rename="endTime")]
387
388 pub end_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
389 /// Output only. Name of the backup from which this backup was copied. If a backup is not created by copying a backup, this field will be empty. Values are of the form: projects//instances//clusters//backups/
390 #[serde(rename="sourceBackup")]
391
392 pub source_backup: Option<String>,
393 /// Output only. Name of the table the backup was created from.
394 #[serde(rename="sourceTable")]
395
396 pub source_table: Option<String>,
397 /// Output only. The time that the backup was started. Row data in the backup will be no older than this timestamp.
398 #[serde(rename="startTime")]
399
400 pub start_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
401}
402
403impl client::Part for BackupInfo {}
404
405
406/// Associates `members`, or principals, with a `role`.
407///
408/// This type is not used in any activity, and only used as *part* of another schema.
409///
410#[serde_with::serde_as(crate = "::client::serde_with")]
411#[derive(Default, Clone, Debug, Serialize, Deserialize)]
412pub struct Binding {
413 /// The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
414
415 pub condition: Option<Expr>,
416 /// Specifies the principals requesting access for a Google Cloud 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. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `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`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `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. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
417
418 pub members: Option<Vec<String>>,
419 /// Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).
420
421 pub role: Option<String>,
422}
423
424impl client::Part for Binding {}
425
426
427/// Change stream configuration.
428///
429/// This type is not used in any activity, and only used as *part* of another schema.
430///
431#[serde_with::serde_as(crate = "::client::serde_with")]
432#[derive(Default, Clone, Debug, Serialize, Deserialize)]
433pub struct ChangeStreamConfig {
434 /// How long the change stream should be retained. Change stream data older than the retention period will not be returned when reading the change stream from the table. Values must be at least 1 day and at most 7 days, and will be truncated to microsecond granularity.
435 #[serde(rename="retentionPeriod")]
436
437 #[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
438 pub retention_period: Option<client::chrono::Duration>,
439}
440
441impl client::Part for ChangeStreamConfig {}
442
443
444/// Request message for google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency
445///
446/// # Activities
447///
448/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
449/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
450///
451/// * [instances tables check consistency projects](ProjectInstanceTableCheckConsistencyCall) (request)
452#[serde_with::serde_as(crate = "::client::serde_with")]
453#[derive(Default, Clone, Debug, Serialize, Deserialize)]
454pub struct CheckConsistencyRequest {
455 /// Required. The token created using GenerateConsistencyToken for the Table.
456 #[serde(rename="consistencyToken")]
457
458 pub consistency_token: Option<String>,
459}
460
461impl client::RequestValue for CheckConsistencyRequest {}
462
463
464/// Response message for google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency
465///
466/// # Activities
467///
468/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
469/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
470///
471/// * [instances tables check consistency projects](ProjectInstanceTableCheckConsistencyCall) (response)
472#[serde_with::serde_as(crate = "::client::serde_with")]
473#[derive(Default, Clone, Debug, Serialize, Deserialize)]
474pub struct CheckConsistencyResponse {
475 /// True only if the token is consistent. A token is consistent if replication has caught up with the restrictions specified in the request.
476
477 pub consistent: Option<bool>,
478}
479
480impl client::ResponseResult for CheckConsistencyResponse {}
481
482
483/// A resizable group of nodes in a particular cloud location, capable of serving all Tables in the parent Instance.
484///
485/// # Activities
486///
487/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
488/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
489///
490/// * [instances clusters create projects](ProjectInstanceClusterCreateCall) (request)
491/// * [instances clusters get projects](ProjectInstanceClusterGetCall) (response)
492/// * [instances clusters partial update cluster projects](ProjectInstanceClusterPartialUpdateClusterCall) (request)
493/// * [instances clusters update projects](ProjectInstanceClusterUpdateCall) (request)
494#[serde_with::serde_as(crate = "::client::serde_with")]
495#[derive(Default, Clone, Debug, Serialize, Deserialize)]
496pub struct Cluster {
497 /// Configuration for this cluster.
498 #[serde(rename="clusterConfig")]
499
500 pub cluster_config: Option<ClusterConfig>,
501 /// Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.
502 #[serde(rename="defaultStorageType")]
503
504 pub default_storage_type: Option<String>,
505 /// Immutable. The encryption configuration for CMEK-protected clusters.
506 #[serde(rename="encryptionConfig")]
507
508 pub encryption_config: Option<EncryptionConfig>,
509 /// Immutable. 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/{project}/locations/{zone}`.
510
511 pub location: Option<String>,
512 /// The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
513
514 pub name: Option<String>,
515 /// The number of nodes in the cluster. If no value is set, Cloud Bigtable automatically allocates nodes based on your data footprint and optimized for 50% storage utilization.
516 #[serde(rename="serveNodes")]
517
518 pub serve_nodes: Option<i32>,
519 /// Output only. The current state of the cluster.
520
521 pub state: Option<String>,
522}
523
524impl client::RequestValue for Cluster {}
525impl client::ResponseResult for Cluster {}
526
527
528/// Autoscaling config for a cluster.
529///
530/// This type is not used in any activity, and only used as *part* of another schema.
531///
532#[serde_with::serde_as(crate = "::client::serde_with")]
533#[derive(Default, Clone, Debug, Serialize, Deserialize)]
534pub struct ClusterAutoscalingConfig {
535 /// Required. Autoscaling limits for this cluster.
536 #[serde(rename="autoscalingLimits")]
537
538 pub autoscaling_limits: Option<AutoscalingLimits>,
539 /// Required. Autoscaling targets for this cluster.
540 #[serde(rename="autoscalingTargets")]
541
542 pub autoscaling_targets: Option<AutoscalingTargets>,
543}
544
545impl client::Part for ClusterAutoscalingConfig {}
546
547
548/// Configuration for a cluster.
549///
550/// This type is not used in any activity, and only used as *part* of another schema.
551///
552#[serde_with::serde_as(crate = "::client::serde_with")]
553#[derive(Default, Clone, Debug, Serialize, Deserialize)]
554pub struct ClusterConfig {
555 /// Autoscaling configuration for this cluster.
556 #[serde(rename="clusterAutoscalingConfig")]
557
558 pub cluster_autoscaling_config: Option<ClusterAutoscalingConfig>,
559}
560
561impl client::Part for ClusterConfig {}
562
563
564/// The state of a table's data in a particular cluster.
565///
566/// This type is not used in any activity, and only used as *part* of another schema.
567///
568#[serde_with::serde_as(crate = "::client::serde_with")]
569#[derive(Default, Clone, Debug, Serialize, Deserialize)]
570pub struct ClusterState {
571 /// Output only. The encryption information for the table in this cluster. If the encryption key protecting this resource is customer managed, then its version can be rotated in Cloud Key Management Service (Cloud KMS). The primary version of the key and its status will be reflected here when changes propagate from Cloud KMS.
572 #[serde(rename="encryptionInfo")]
573
574 pub encryption_info: Option<Vec<EncryptionInfo>>,
575 /// Output only. The state of replication for the table in this cluster.
576 #[serde(rename="replicationState")]
577
578 pub replication_state: Option<String>,
579}
580
581impl client::Part for ClusterState {}
582
583
584/// A set of columns within a table which share a common configuration.
585///
586/// This type is not used in any activity, and only used as *part* of another schema.
587///
588#[serde_with::serde_as(crate = "::client::serde_with")]
589#[derive(Default, Clone, Debug, Serialize, Deserialize)]
590pub struct ColumnFamily {
591 /// Garbage collection rule specified as a protobuf. Must serialize to at most 500 bytes. NOTE: Garbage collection executes opportunistically in the background, and so it's possible for reads to return a cell even if it matches the active GC expression for its family.
592 #[serde(rename="gcRule")]
593
594 pub gc_rule: Option<GcRule>,
595 /// Output only. Only available with STATS_VIEW, this includes summary statistics about column family contents. For statistics over an entire table, see TableStats above.
596
597 pub stats: Option<ColumnFamilyStats>,
598}
599
600impl client::Part for ColumnFamily {}
601
602
603/// Approximate statistics related to a single column family within a table. This information may change rapidly, interpreting these values at a point in time may already preset out-of-date information. Everything below is approximate, unless otherwise specified.
604///
605/// This type is not used in any activity, and only used as *part* of another schema.
606///
607#[serde_with::serde_as(crate = "::client::serde_with")]
608#[derive(Default, Clone, Debug, Serialize, Deserialize)]
609pub struct ColumnFamilyStats {
610 /// How many cells are present per column qualifier in this column family, averaged over all rows containing any column in the column family. e.g. For column family "family" in a table with 3 rows: * A row with 3 cells in "family:col" and 1 cell in "other:col" (3 cells / 1 column in "family") * A row with 1 cell in "family:col", 7 cells in "family:other_col", and 7 cells in "other:data" (8 cells / 2 columns in "family") * A row with 3 cells in "other:col" (0 columns in "family", "family" not present) would report (3 + 8 + 0)/(1 + 2 + 0) = 3.66 in this field.
611 #[serde(rename="averageCellsPerColumn")]
612
613 pub average_cells_per_column: Option<f64>,
614 /// How many column qualifiers are present in this column family, averaged over all rows in the table. e.g. For column family "family" in a table with 3 rows: * A row with cells in "family:col" and "other:col" (1 column in "family") * A row with cells in "family:col", "family:other_col", and "other:data" (2 columns in "family") * A row with cells in "other:col" (0 columns in "family", "family" not present) would report (1 + 2 + 0)/3 = 1.5 in this field.
615 #[serde(rename="averageColumnsPerRow")]
616
617 pub average_columns_per_row: Option<f64>,
618 /// How much space the data in the column family occupies. This is roughly how many bytes would be needed to read the contents of the entire column family (e.g. by streaming all contents out).
619 #[serde(rename="logicalDataBytes")]
620
621 #[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
622 pub logical_data_bytes: Option<i64>,
623}
624
625impl client::Part for ColumnFamilyStats {}
626
627
628/// The request for CopyBackup.
629///
630/// # Activities
631///
632/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
633/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
634///
635/// * [instances clusters backups copy projects](ProjectInstanceClusterBackupCopyCall) (request)
636#[serde_with::serde_as(crate = "::client::serde_with")]
637#[derive(Default, Clone, Debug, Serialize, Deserialize)]
638pub struct CopyBackupRequest {
639 /// Required. The id of the new backup. The `backup_id` along with `parent` are combined as {parent}/backups/{backup_id} to create the full backup name, of the form: `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This string must be between 1 and 50 characters in length and match the regex _a-zA-Z0-9*.
640 #[serde(rename="backupId")]
641
642 pub backup_id: Option<String>,
643 /// Required. Required. The expiration time of the copied backup with microsecond granularity that must be at least 6 hours and at most 30 days from the time the request is received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free the resources used by the backup.
644 #[serde(rename="expireTime")]
645
646 pub expire_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
647 /// Required. The source backup to be copied from. The source backup needs to be in READY state for it to be copied. Copying a copied backup is not allowed. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form: `projects//instances//clusters//backups/`.
648 #[serde(rename="sourceBackup")]
649
650 pub source_backup: Option<String>,
651}
652
653impl client::RequestValue for CopyBackupRequest {}
654
655
656/// Request message for BigtableInstanceAdmin.CreateInstance.
657///
658/// # Activities
659///
660/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
661/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
662///
663/// * [instances create projects](ProjectInstanceCreateCall) (request)
664#[serde_with::serde_as(crate = "::client::serde_with")]
665#[derive(Default, Clone, Debug, Serialize, Deserialize)]
666pub struct CreateInstanceRequest {
667 /// 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.
668
669 pub clusters: Option<HashMap<String, Cluster>>,
670 /// Required. The instance to create. Fields marked `OutputOnly` must be left blank.
671
672 pub instance: Option<Instance>,
673 /// 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`.
674 #[serde(rename="instanceId")]
675
676 pub instance_id: Option<String>,
677 /// Required. The unique name of the project in which to create the new instance. Values are of the form `projects/{project}`.
678
679 pub parent: Option<String>,
680}
681
682impl client::RequestValue for CreateInstanceRequest {}
683
684
685/// Request message for google.bigtable.admin.v2.BigtableTableAdmin.CreateTable
686///
687/// # Activities
688///
689/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
690/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
691///
692/// * [instances tables create projects](ProjectInstanceTableCreateCall) (request)
693#[serde_with::serde_as(crate = "::client::serde_with")]
694#[derive(Default, Clone, Debug, Serialize, Deserialize)]
695pub struct CreateTableRequest {
696 /// The optional list of row keys that will be used to initially split the table into several tablets (tablets are similar to HBase regions). Given two split keys, `s1` and `s2`, three tablets will be created, spanning the key ranges: `[, s1), [s1, s2), [s2, )`. Example: * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` `"other", "zz"]` * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` * Key assignment: - Tablet 1 `[, apple) => {"a"}.` - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` - Tablet 4 `[customer_2, other) => {"customer_2"}.` - Tablet 5 `[other, ) => {"other", "zz"}.`
697 #[serde(rename="initialSplits")]
698
699 pub initial_splits: Option<Vec<Split>>,
700 /// Required. The Table to create.
701
702 pub table: Option<Table>,
703 /// 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.
704 #[serde(rename="tableId")]
705
706 pub table_id: Option<String>,
707}
708
709impl client::RequestValue for CreateTableRequest {}
710
711
712/// Request message for google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange
713///
714/// # Activities
715///
716/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
717/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
718///
719/// * [instances tables drop row range projects](ProjectInstanceTableDropRowRangeCall) (request)
720#[serde_with::serde_as(crate = "::client::serde_with")]
721#[derive(Default, Clone, Debug, Serialize, Deserialize)]
722pub struct DropRowRangeRequest {
723 /// Delete all rows in the table. Setting this to false is a no-op.
724 #[serde(rename="deleteAllDataFromTable")]
725
726 pub delete_all_data_from_table: Option<bool>,
727 /// Delete all rows that start with this row key prefix. Prefix cannot be zero length.
728 #[serde(rename="rowKeyPrefix")]
729
730 #[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
731 pub row_key_prefix: Option<Vec<u8>>,
732}
733
734impl client::RequestValue for DropRowRangeRequest {}
735
736
737/// 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); }
738///
739/// # Activities
740///
741/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
742/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
743///
744/// * [instances app profiles delete projects](ProjectInstanceAppProfileDeleteCall) (response)
745/// * [instances clusters backups delete projects](ProjectInstanceClusterBackupDeleteCall) (response)
746/// * [instances clusters delete projects](ProjectInstanceClusterDeleteCall) (response)
747/// * [instances tables delete projects](ProjectInstanceTableDeleteCall) (response)
748/// * [instances tables drop row range projects](ProjectInstanceTableDropRowRangeCall) (response)
749/// * [instances delete projects](ProjectInstanceDeleteCall) (response)
750#[serde_with::serde_as(crate = "::client::serde_with")]
751#[derive(Default, Clone, Debug, Serialize, Deserialize)]
752pub struct Empty { _never_set: Option<bool> }
753
754impl client::ResponseResult for Empty {}
755
756
757/// Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected cluster.
758///
759/// This type is not used in any activity, and only used as *part* of another schema.
760///
761#[serde_with::serde_as(crate = "::client::serde_with")]
762#[derive(Default, Clone, Debug, Serialize, Deserialize)]
763pub struct EncryptionConfig {
764 /// Describes the Cloud KMS encryption key that will be used to protect the destination Bigtable cluster. The requirements for this key are: 1) The Cloud Bigtable service account associated with the project that contains this cluster must be granted the `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. 2) Only regional keys can be used and the region of the CMEK key must match the region of the cluster. Values are of the form `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
765 #[serde(rename="kmsKeyName")]
766
767 pub kms_key_name: Option<String>,
768}
769
770impl client::Part for EncryptionConfig {}
771
772
773/// Encryption information for a given resource. If this resource is protected with customer managed encryption, the in-use Cloud Key Management Service (Cloud KMS) key version is specified along with its status.
774///
775/// This type is not used in any activity, and only used as *part* of another schema.
776///
777#[serde_with::serde_as(crate = "::client::serde_with")]
778#[derive(Default, Clone, Debug, Serialize, Deserialize)]
779pub struct EncryptionInfo {
780 /// Output only. The status of encrypt/decrypt calls on underlying data for this resource. Regardless of status, the existing data is always encrypted at rest.
781 #[serde(rename="encryptionStatus")]
782
783 pub encryption_status: Option<Status>,
784 /// Output only. The type of encryption used to protect this resource.
785 #[serde(rename="encryptionType")]
786
787 pub encryption_type: Option<String>,
788 /// Output only. The version of the Cloud KMS key specified in the parent cluster that is in use for the data underlying this table.
789 #[serde(rename="kmsKeyVersion")]
790
791 pub kms_key_version: Option<String>,
792}
793
794impl client::Part for EncryptionInfo {}
795
796
797/// 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.
798///
799/// This type is not used in any activity, and only used as *part* of another schema.
800///
801#[serde_with::serde_as(crate = "::client::serde_with")]
802#[derive(Default, Clone, Debug, Serialize, Deserialize)]
803pub struct Expr {
804 /// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
805
806 pub description: Option<String>,
807 /// Textual representation of an expression in Common Expression Language syntax.
808
809 pub expression: Option<String>,
810 /// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
811
812 pub location: Option<String>,
813 /// 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.
814
815 pub title: Option<String>,
816}
817
818impl client::Part for Expr {}
819
820
821/// Rule for determining which cells to delete during garbage collection.
822///
823/// This type is not used in any activity, and only used as *part* of another schema.
824///
825#[serde_with::serde_as(crate = "::client::serde_with")]
826#[derive(Default, Clone, Debug, Serialize, Deserialize)]
827pub struct GcRule {
828 /// Delete cells that would be deleted by every nested rule.
829
830 pub intersection: Option<Intersection>,
831 /// Delete cells in a column older than the given age. Values must be at least one millisecond, and will be truncated to microsecond granularity.
832 #[serde(rename="maxAge")]
833
834 #[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
835 pub max_age: Option<client::chrono::Duration>,
836 /// Delete all cells in a column except the most recent N.
837 #[serde(rename="maxNumVersions")]
838
839 pub max_num_versions: Option<i32>,
840 /// Delete cells that would be deleted by any nested rule.
841
842 pub union: Option<Union>,
843}
844
845impl client::Part for GcRule {}
846
847
848/// Request message for google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken
849///
850/// # Activities
851///
852/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
853/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
854///
855/// * [instances tables generate consistency token projects](ProjectInstanceTableGenerateConsistencyTokenCall) (request)
856#[serde_with::serde_as(crate = "::client::serde_with")]
857#[derive(Default, Clone, Debug, Serialize, Deserialize)]
858pub struct GenerateConsistencyTokenRequest { _never_set: Option<bool> }
859
860impl client::RequestValue for GenerateConsistencyTokenRequest {}
861
862
863/// Response message for google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken
864///
865/// # Activities
866///
867/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
868/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
869///
870/// * [instances tables generate consistency token projects](ProjectInstanceTableGenerateConsistencyTokenCall) (response)
871#[serde_with::serde_as(crate = "::client::serde_with")]
872#[derive(Default, Clone, Debug, Serialize, Deserialize)]
873pub struct GenerateConsistencyTokenResponse {
874 /// The generated consistency token.
875 #[serde(rename="consistencyToken")]
876
877 pub consistency_token: Option<String>,
878}
879
880impl client::ResponseResult for GenerateConsistencyTokenResponse {}
881
882
883/// Request message for `GetIamPolicy` method.
884///
885/// # Activities
886///
887/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
888/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
889///
890/// * [instances clusters backups get iam policy projects](ProjectInstanceClusterBackupGetIamPolicyCall) (request)
891/// * [instances tables get iam policy projects](ProjectInstanceTableGetIamPolicyCall) (request)
892/// * [instances get iam policy projects](ProjectInstanceGetIamPolicyCall) (request)
893#[serde_with::serde_as(crate = "::client::serde_with")]
894#[derive(Default, Clone, Debug, Serialize, Deserialize)]
895pub struct GetIamPolicyRequest {
896 /// OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
897
898 pub options: Option<GetPolicyOptions>,
899}
900
901impl client::RequestValue for GetIamPolicyRequest {}
902
903
904/// Encapsulates settings provided to GetIamPolicy.
905///
906/// This type is not used in any activity, and only used as *part* of another schema.
907///
908#[serde_with::serde_as(crate = "::client::serde_with")]
909#[derive(Default, Clone, Debug, Serialize, Deserialize)]
910pub struct GetPolicyOptions {
911 /// Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
912 #[serde(rename="requestedPolicyVersion")]
913
914 pub requested_policy_version: Option<i32>,
915}
916
917impl client::Part for GetPolicyOptions {}
918
919
920/// A tablet is a defined by a start and end key and is explained in https://cloud.google.com/bigtable/docs/overview#architecture and https://cloud.google.com/bigtable/docs/performance#optimization. A Hot tablet is a tablet that exhibits high average cpu usage during the time interval from start time to end time.
921///
922/// This type is not used in any activity, and only used as *part* of another schema.
923///
924#[serde_with::serde_as(crate = "::client::serde_with")]
925#[derive(Default, Clone, Debug, Serialize, Deserialize)]
926pub struct HotTablet {
927 /// Tablet End Key (inclusive).
928 #[serde(rename="endKey")]
929
930 pub end_key: Option<String>,
931 /// Output only. The end time of the hot tablet.
932 #[serde(rename="endTime")]
933
934 pub end_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
935 /// The unique name of the hot tablet. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
936
937 pub name: Option<String>,
938 /// Output only. The average CPU usage spent by a node on this tablet over the start_time to end_time time range. The percentage is the amount of CPU used by the node to serve the tablet, from 0% (tablet was not interacted with) to 100% (the node spent all cycles serving the hot tablet).
939 #[serde(rename="nodeCpuUsagePercent")]
940
941 pub node_cpu_usage_percent: Option<f32>,
942 /// Tablet Start Key (inclusive).
943 #[serde(rename="startKey")]
944
945 pub start_key: Option<String>,
946 /// Output only. The start time of the hot tablet.
947 #[serde(rename="startTime")]
948
949 pub start_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
950 /// Name of the table that contains the tablet. Values are of the form `projects/{project}/instances/{instance}/tables/_a-zA-Z0-9*`.
951 #[serde(rename="tableName")]
952
953 pub table_name: Option<String>,
954}
955
956impl client::Part for HotTablet {}
957
958
959/// A collection of Bigtable Tables and the resources that serve them. All tables in an instance are served from all Clusters in the instance.
960///
961/// # Activities
962///
963/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
964/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
965///
966/// * [instances get projects](ProjectInstanceGetCall) (response)
967/// * [instances partial update instance projects](ProjectInstancePartialUpdateInstanceCall) (request)
968/// * [instances update projects](ProjectInstanceUpdateCall) (request|response)
969#[serde_with::serde_as(crate = "::client::serde_with")]
970#[derive(Default, Clone, Debug, Serialize, Deserialize)]
971pub struct Instance {
972 /// Output only. A commit timestamp representing when this Instance was created. For instances created before this field was added (August 2021), this value is `seconds: 0, nanos: 1`.
973 #[serde(rename="createTime")]
974
975 pub create_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
976 /// 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.
977 #[serde(rename="displayName")]
978
979 pub display_name: Option<String>,
980 /// 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. * Label keys must be between 1 and 63 characters long and must conform to the regular expression: `\p{Ll}\p{Lo}{0,62}`. * Label values must be between 0 and 63 characters long and must conform to the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. * No more than 64 labels can be associated with a given resource. * Keys and values must both be under 128 bytes.
981
982 pub labels: Option<HashMap<String, String>>,
983 /// The unique name of the instance. Values are of the form `projects/{project}/instances/a-z+[a-z0-9]`.
984
985 pub name: Option<String>,
986 /// Output only. Reserved for future use.
987 #[serde(rename="satisfiesPzs")]
988
989 pub satisfies_pzs: Option<bool>,
990 /// Output only. The current state of the instance.
991
992 pub state: Option<String>,
993 /// The type of the instance. Defaults to `PRODUCTION`.
994 #[serde(rename="type")]
995
996 pub type_: Option<String>,
997}
998
999impl client::RequestValue for Instance {}
1000impl client::ResponseResult for Instance {}
1001
1002
1003/// A GcRule which deletes cells matching all of the given rules.
1004///
1005/// This type is not used in any activity, and only used as *part* of another schema.
1006///
1007#[serde_with::serde_as(crate = "::client::serde_with")]
1008#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1009pub struct Intersection {
1010 /// Only delete cells which would be deleted by every element of `rules`.
1011
1012 pub rules: Option<Vec<GcRule>>,
1013}
1014
1015impl client::Part for Intersection {}
1016
1017
1018/// Response message for BigtableInstanceAdmin.ListAppProfiles.
1019///
1020/// # Activities
1021///
1022/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1023/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1024///
1025/// * [instances app profiles list projects](ProjectInstanceAppProfileListCall) (response)
1026#[serde_with::serde_as(crate = "::client::serde_with")]
1027#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1028pub struct ListAppProfilesResponse {
1029 /// The list of requested app profiles.
1030 #[serde(rename="appProfiles")]
1031
1032 pub app_profiles: Option<Vec<AppProfile>>,
1033 /// Locations from which AppProfile information could not be retrieved, due to an outage or some other transient condition. AppProfiles from these locations may be missing from `app_profiles`. Values are of the form `projects//locations/`
1034 #[serde(rename="failedLocations")]
1035
1036 pub failed_locations: Option<Vec<String>>,
1037 /// Set if not all app profiles could be returned in a single response. Pass this value to `page_token` in another request to get the next page of results.
1038 #[serde(rename="nextPageToken")]
1039
1040 pub next_page_token: Option<String>,
1041}
1042
1043impl client::ResponseResult for ListAppProfilesResponse {}
1044
1045
1046/// The response for ListBackups.
1047///
1048/// # Activities
1049///
1050/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1051/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1052///
1053/// * [instances clusters backups list projects](ProjectInstanceClusterBackupListCall) (response)
1054#[serde_with::serde_as(crate = "::client::serde_with")]
1055#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1056pub struct ListBackupsResponse {
1057 /// The list of matching backups.
1058
1059 pub backups: Option<Vec<Backup>>,
1060 /// `next_page_token` can be sent in a subsequent ListBackups call to fetch more of the matching backups.
1061 #[serde(rename="nextPageToken")]
1062
1063 pub next_page_token: Option<String>,
1064}
1065
1066impl client::ResponseResult for ListBackupsResponse {}
1067
1068
1069/// Response message for BigtableInstanceAdmin.ListClusters.
1070///
1071/// # Activities
1072///
1073/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1074/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1075///
1076/// * [instances clusters list projects](ProjectInstanceClusterListCall) (response)
1077#[serde_with::serde_as(crate = "::client::serde_with")]
1078#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1079pub struct ListClustersResponse {
1080 /// The list of requested clusters.
1081
1082 pub clusters: Option<Vec<Cluster>>,
1083 /// Locations from which Cluster information could not be retrieved, due to an outage or some other transient condition. Clusters from these locations may be missing from `clusters`, or may only have partial information returned. Values are of the form `projects//locations/`
1084 #[serde(rename="failedLocations")]
1085
1086 pub failed_locations: Option<Vec<String>>,
1087 /// DEPRECATED: This field is unused and ignored.
1088 #[serde(rename="nextPageToken")]
1089
1090 pub next_page_token: Option<String>,
1091}
1092
1093impl client::ResponseResult for ListClustersResponse {}
1094
1095
1096/// Response message for BigtableInstanceAdmin.ListHotTablets.
1097///
1098/// # Activities
1099///
1100/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1101/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1102///
1103/// * [instances clusters hot tablets list projects](ProjectInstanceClusterHotTabletListCall) (response)
1104#[serde_with::serde_as(crate = "::client::serde_with")]
1105#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1106pub struct ListHotTabletsResponse {
1107 /// List of hot tablets in the tables of the requested cluster that fall within the requested time range. Hot tablets are ordered by node cpu usage percent. If there are multiple hot tablets that correspond to the same tablet within a 15-minute interval, only the hot tablet with the highest node cpu usage will be included in the response.
1108 #[serde(rename="hotTablets")]
1109
1110 pub hot_tablets: Option<Vec<HotTablet>>,
1111 /// Set if not all hot tablets could be returned in a single response. Pass this value to `page_token` in another request to get the next page of results.
1112 #[serde(rename="nextPageToken")]
1113
1114 pub next_page_token: Option<String>,
1115}
1116
1117impl client::ResponseResult for ListHotTabletsResponse {}
1118
1119
1120/// Response message for BigtableInstanceAdmin.ListInstances.
1121///
1122/// # Activities
1123///
1124/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1125/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1126///
1127/// * [instances list projects](ProjectInstanceListCall) (response)
1128#[serde_with::serde_as(crate = "::client::serde_with")]
1129#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1130pub struct ListInstancesResponse {
1131 /// Locations from which Instance information could not be retrieved, due to an outage or some other transient condition. Instances whose Clusters are all in one of the failed locations may be missing from `instances`, and Instances with at least one Cluster in a failed location may only have partial information returned. Values are of the form `projects//locations/`
1132 #[serde(rename="failedLocations")]
1133
1134 pub failed_locations: Option<Vec<String>>,
1135 /// The list of requested instances.
1136
1137 pub instances: Option<Vec<Instance>>,
1138 /// DEPRECATED: This field is unused and ignored.
1139 #[serde(rename="nextPageToken")]
1140
1141 pub next_page_token: Option<String>,
1142}
1143
1144impl client::ResponseResult for ListInstancesResponse {}
1145
1146
1147/// The response message for Locations.ListLocations.
1148///
1149/// # Activities
1150///
1151/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1152/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1153///
1154/// * [locations list projects](ProjectLocationListCall) (response)
1155#[serde_with::serde_as(crate = "::client::serde_with")]
1156#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1157pub struct ListLocationsResponse {
1158 /// A list of locations that matches the specified filter in the request.
1159
1160 pub locations: Option<Vec<Location>>,
1161 /// The standard List next-page token.
1162 #[serde(rename="nextPageToken")]
1163
1164 pub next_page_token: Option<String>,
1165}
1166
1167impl client::ResponseResult for ListLocationsResponse {}
1168
1169
1170/// The response message for Operations.ListOperations.
1171///
1172/// # Activities
1173///
1174/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1175/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1176///
1177/// * [projects operations list operations](OperationProjectOperationListCall) (response)
1178#[serde_with::serde_as(crate = "::client::serde_with")]
1179#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1180pub struct ListOperationsResponse {
1181 /// The standard List next-page token.
1182 #[serde(rename="nextPageToken")]
1183
1184 pub next_page_token: Option<String>,
1185 /// A list of operations that matches the specified filter in the request.
1186
1187 pub operations: Option<Vec<Operation>>,
1188}
1189
1190impl client::ResponseResult for ListOperationsResponse {}
1191
1192
1193/// Response message for google.bigtable.admin.v2.BigtableTableAdmin.ListTables
1194///
1195/// # Activities
1196///
1197/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1198/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1199///
1200/// * [instances tables list projects](ProjectInstanceTableListCall) (response)
1201#[serde_with::serde_as(crate = "::client::serde_with")]
1202#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1203pub struct ListTablesResponse {
1204 /// Set if not all tables could be returned in a single response. Pass this value to `page_token` in another request to get the next page of results.
1205 #[serde(rename="nextPageToken")]
1206
1207 pub next_page_token: Option<String>,
1208 /// The tables present in the requested instance.
1209
1210 pub tables: Option<Vec<Table>>,
1211}
1212
1213impl client::ResponseResult for ListTablesResponse {}
1214
1215
1216/// A resource that represents a Google Cloud location.
1217///
1218/// This type is not used in any activity, and only used as *part* of another schema.
1219///
1220#[serde_with::serde_as(crate = "::client::serde_with")]
1221#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1222pub struct Location {
1223 /// The friendly name for this location, typically a nearby city name. For example, "Tokyo".
1224 #[serde(rename="displayName")]
1225
1226 pub display_name: Option<String>,
1227 /// Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"}
1228
1229 pub labels: Option<HashMap<String, String>>,
1230 /// The canonical id for this location. For example: `"us-east1"`.
1231 #[serde(rename="locationId")]
1232
1233 pub location_id: Option<String>,
1234 /// Service-specific metadata. For example the available capacity at the given location.
1235
1236 pub metadata: Option<HashMap<String, json::Value>>,
1237 /// Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`
1238
1239 pub name: Option<String>,
1240}
1241
1242impl client::Part for Location {}
1243
1244
1245/// A create, update, or delete of a particular column family.
1246///
1247/// This type is not used in any activity, and only used as *part* of another schema.
1248///
1249#[serde_with::serde_as(crate = "::client::serde_with")]
1250#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1251pub struct Modification {
1252 /// Create a new column family with the specified schema, or fail if one already exists with the given ID.
1253
1254 pub create: Option<ColumnFamily>,
1255 /// Drop (delete) the column family with the given ID, or fail if no such family exists.
1256
1257 pub drop: Option<bool>,
1258 /// The ID of the column family to be modified.
1259
1260 pub id: Option<String>,
1261 /// Update an existing column family to the specified schema, or fail if no column family exists with the given ID.
1262
1263 pub update: Option<ColumnFamily>,
1264}
1265
1266impl client::Part for Modification {}
1267
1268
1269/// Request message for google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies
1270///
1271/// # Activities
1272///
1273/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1274/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1275///
1276/// * [instances tables modify column families projects](ProjectInstanceTableModifyColumnFamilyCall) (request)
1277#[serde_with::serde_as(crate = "::client::serde_with")]
1278#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1279pub struct ModifyColumnFamiliesRequest {
1280 /// Optional. If true, ignore safety checks when modifying the column families.
1281 #[serde(rename="ignoreWarnings")]
1282
1283 pub ignore_warnings: Option<bool>,
1284 /// 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).
1285
1286 pub modifications: Option<Vec<Modification>>,
1287}
1288
1289impl client::RequestValue for ModifyColumnFamiliesRequest {}
1290
1291
1292/// 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.
1293///
1294/// This type is not used in any activity, and only used as *part* of another schema.
1295///
1296#[serde_with::serde_as(crate = "::client::serde_with")]
1297#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1298pub struct MultiClusterRoutingUseAny {
1299 /// The set of clusters to route to. The order is ignored; clusters will be tried in order of distance. If left empty, all clusters are eligible.
1300 #[serde(rename="clusterIds")]
1301
1302 pub cluster_ids: Option<Vec<String>>,
1303}
1304
1305impl client::Part for MultiClusterRoutingUseAny {}
1306
1307
1308/// This resource represents a long-running operation that is the result of a network API call.
1309///
1310/// # Activities
1311///
1312/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1313/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1314///
1315/// * [projects operations list operations](OperationProjectOperationListCall) (none)
1316/// * [get operations](OperationGetCall) (response)
1317/// * [instances app profiles patch projects](ProjectInstanceAppProfilePatchCall) (response)
1318/// * [instances clusters backups copy projects](ProjectInstanceClusterBackupCopyCall) (response)
1319/// * [instances clusters backups create projects](ProjectInstanceClusterBackupCreateCall) (response)
1320/// * [instances clusters create projects](ProjectInstanceClusterCreateCall) (response)
1321/// * [instances clusters partial update cluster projects](ProjectInstanceClusterPartialUpdateClusterCall) (response)
1322/// * [instances clusters update projects](ProjectInstanceClusterUpdateCall) (response)
1323/// * [instances tables patch projects](ProjectInstanceTablePatchCall) (response)
1324/// * [instances tables restore projects](ProjectInstanceTableRestoreCall) (response)
1325/// * [instances tables undelete projects](ProjectInstanceTableUndeleteCall) (response)
1326/// * [instances create projects](ProjectInstanceCreateCall) (response)
1327/// * [instances partial update instance projects](ProjectInstancePartialUpdateInstanceCall) (response)
1328#[serde_with::serde_as(crate = "::client::serde_with")]
1329#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1330pub struct Operation {
1331 /// 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.
1332
1333 pub done: Option<bool>,
1334 /// The error result of the operation in case of failure or cancellation.
1335
1336 pub error: Option<Status>,
1337 /// 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.
1338
1339 pub metadata: Option<HashMap<String, json::Value>>,
1340 /// 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}`.
1341
1342 pub name: Option<String>,
1343 /// The normal, successful response of the operation. 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`.
1344
1345 pub response: Option<HashMap<String, json::Value>>,
1346}
1347
1348impl client::Resource for Operation {}
1349impl client::ResponseResult for Operation {}
1350
1351
1352/// 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`, or principals, to a single `role`. Principals 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. For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **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/).
1353///
1354/// # Activities
1355///
1356/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1357/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1358///
1359/// * [instances clusters backups get iam policy projects](ProjectInstanceClusterBackupGetIamPolicyCall) (response)
1360/// * [instances clusters backups set iam policy projects](ProjectInstanceClusterBackupSetIamPolicyCall) (response)
1361/// * [instances tables get iam policy projects](ProjectInstanceTableGetIamPolicyCall) (response)
1362/// * [instances tables set iam policy projects](ProjectInstanceTableSetIamPolicyCall) (response)
1363/// * [instances get iam policy projects](ProjectInstanceGetIamPolicyCall) (response)
1364/// * [instances set iam policy projects](ProjectInstanceSetIamPolicyCall) (response)
1365#[serde_with::serde_as(crate = "::client::serde_with")]
1366#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1367pub struct Policy {
1368 /// Specifies cloud audit logging configuration for this policy.
1369 #[serde(rename="auditConfigs")]
1370
1371 pub audit_configs: Option<Vec<AuditConfig>>,
1372 /// Associates a list of `members`, or principals, with 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 principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
1373
1374 pub bindings: Option<Vec<Binding>>,
1375 /// `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.
1376
1377 #[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
1378 pub etag: Option<Vec<u8>>,
1379 /// 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1380
1381 pub version: Option<i32>,
1382}
1383
1384impl client::ResponseResult for Policy {}
1385
1386
1387/// Information about a table restore.
1388///
1389/// This type is not used in any activity, and only used as *part* of another schema.
1390///
1391#[serde_with::serde_as(crate = "::client::serde_with")]
1392#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1393pub struct RestoreInfo {
1394 /// Information about the backup used to restore the table. The backup may no longer exist.
1395 #[serde(rename="backupInfo")]
1396
1397 pub backup_info: Option<BackupInfo>,
1398 /// The type of the restore source.
1399 #[serde(rename="sourceType")]
1400
1401 pub source_type: Option<String>,
1402}
1403
1404impl client::Part for RestoreInfo {}
1405
1406
1407/// The request for RestoreTable.
1408///
1409/// # Activities
1410///
1411/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1412/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1413///
1414/// * [instances tables restore projects](ProjectInstanceTableRestoreCall) (request)
1415#[serde_with::serde_as(crate = "::client::serde_with")]
1416#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1417pub struct RestoreTableRequest {
1418 /// Name of the backup from which to restore. Values are of the form `projects//instances//clusters//backups/`.
1419
1420 pub backup: Option<String>,
1421 /// Required. The id of the table to create and restore to. This table must not already exist. The `table_id` appended to `parent` forms the full table name of the form `projects//instances//tables/`.
1422 #[serde(rename="tableId")]
1423
1424 pub table_id: Option<String>,
1425}
1426
1427impl client::RequestValue for RestoreTableRequest {}
1428
1429
1430/// Request message for `SetIamPolicy` method.
1431///
1432/// # Activities
1433///
1434/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1435/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1436///
1437/// * [instances clusters backups set iam policy projects](ProjectInstanceClusterBackupSetIamPolicyCall) (request)
1438/// * [instances tables set iam policy projects](ProjectInstanceTableSetIamPolicyCall) (request)
1439/// * [instances set iam policy projects](ProjectInstanceSetIamPolicyCall) (request)
1440#[serde_with::serde_as(crate = "::client::serde_with")]
1441#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1442pub struct SetIamPolicyRequest {
1443 /// 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 Google Cloud services (such as Projects) might reject them.
1444
1445 pub policy: Option<Policy>,
1446 /// 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"`
1447 #[serde(rename="updateMask")]
1448
1449 pub update_mask: Option<client::FieldMask>,
1450}
1451
1452impl client::RequestValue for SetIamPolicyRequest {}
1453
1454
1455/// Unconditionally routes all read/write requests to a specific cluster. This option preserves read-your-writes consistency but does not improve availability.
1456///
1457/// This type is not used in any activity, and only used as *part* of another schema.
1458///
1459#[serde_with::serde_as(crate = "::client::serde_with")]
1460#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1461pub struct SingleClusterRouting {
1462 /// Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are allowed by this app profile. It is unsafe to send these requests to the same table/row/column in multiple clusters.
1463 #[serde(rename="allowTransactionalWrites")]
1464
1465 pub allow_transactional_writes: Option<bool>,
1466 /// The cluster to which read/write requests should be routed.
1467 #[serde(rename="clusterId")]
1468
1469 pub cluster_id: Option<String>,
1470}
1471
1472impl client::Part for SingleClusterRouting {}
1473
1474
1475/// An initial split point for a newly created table.
1476///
1477/// This type is not used in any activity, and only used as *part* of another schema.
1478///
1479#[serde_with::serde_as(crate = "::client::serde_with")]
1480#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1481pub struct Split {
1482 /// Row key to use as an initial tablet boundary.
1483
1484 #[serde_as(as = "Option<::client::serde::standard_base64::Wrapper>")]
1485 pub key: Option<Vec<u8>>,
1486}
1487
1488impl client::Part for Split {}
1489
1490
1491/// Standard options for isolating this app profile's traffic from other use cases.
1492///
1493/// This type is not used in any activity, and only used as *part* of another schema.
1494///
1495#[serde_with::serde_as(crate = "::client::serde_with")]
1496#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1497pub struct StandardIsolation {
1498 /// The priority of requests sent using this app profile.
1499
1500 pub priority: Option<String>,
1501}
1502
1503impl client::Part for StandardIsolation {}
1504
1505
1506/// 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).
1507///
1508/// This type is not used in any activity, and only used as *part* of another schema.
1509///
1510#[serde_with::serde_as(crate = "::client::serde_with")]
1511#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1512pub struct Status {
1513 /// The status code, which should be an enum value of google.rpc.Code.
1514
1515 pub code: Option<i32>,
1516 /// A list of messages that carry the error details. There is a common set of message types for APIs to use.
1517
1518 pub details: Option<Vec<HashMap<String, json::Value>>>,
1519 /// 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.
1520
1521 pub message: Option<String>,
1522}
1523
1524impl client::Part for Status {}
1525
1526
1527/// A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster.
1528///
1529/// # Activities
1530///
1531/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1532/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1533///
1534/// * [instances tables create projects](ProjectInstanceTableCreateCall) (response)
1535/// * [instances tables get projects](ProjectInstanceTableGetCall) (response)
1536/// * [instances tables modify column families projects](ProjectInstanceTableModifyColumnFamilyCall) (response)
1537/// * [instances tables patch projects](ProjectInstanceTablePatchCall) (request)
1538#[serde_with::serde_as(crate = "::client::serde_with")]
1539#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1540pub struct Table {
1541 /// If specified, enable the change stream on this table. Otherwise, the change stream is disabled and the change stream is not retained.
1542 #[serde(rename="changeStreamConfig")]
1543
1544 pub change_stream_config: Option<ChangeStreamConfig>,
1545 /// 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`. Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
1546 #[serde(rename="clusterStates")]
1547
1548 pub cluster_states: Option<HashMap<String, ClusterState>>,
1549 /// The column families configured for this table, mapped by column family ID. Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
1550 #[serde(rename="columnFamilies")]
1551
1552 pub column_families: Option<HashMap<String, ColumnFamily>>,
1553 /// Set to true to make the table protected against data loss. i.e. deleting the following resources through Admin APIs are prohibited: * The table. * The column families in the table. * The instance containing the table. Note one can still delete the data stored in the table through Data APIs.
1554 #[serde(rename="deletionProtection")]
1555
1556 pub deletion_protection: Option<bool>,
1557 /// Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored in this table. Timestamps not matching the granularity will be rejected. If unspecified at creation time, the value will be set to `MILLIS`. Views: `SCHEMA_VIEW`, `FULL`.
1558
1559 pub granularity: Option<String>,
1560 /// The unique name of the table. Values are of the form `projects/{project}/instances/{instance}/tables/_a-zA-Z0-9*`. Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `STATS_VIEW`, `FULL`
1561
1562 pub name: Option<String>,
1563 /// Output only. If this table was restored from another data source (e.g. a backup), this field will be populated with information about the restore.
1564 #[serde(rename="restoreInfo")]
1565
1566 pub restore_info: Option<RestoreInfo>,
1567 /// Output only. Only available with STATS_VIEW, this includes summary statistics about the entire table contents. For statistics about a specific column family, see ColumnFamilyStats in the mapped ColumnFamily collection above.
1568
1569 pub stats: Option<TableStats>,
1570}
1571
1572impl client::RequestValue for Table {}
1573impl client::ResponseResult for Table {}
1574
1575
1576/// Approximate statistics related to a table. These statistics are calculated infrequently, while simultaneously, data in the table can change rapidly. Thus the values reported here (e.g. row count) are very likely out-of date, even the instant they are received in this API. Thus, only treat these values as approximate. IMPORTANT: Everything below is approximate, unless otherwise specified.
1577///
1578/// This type is not used in any activity, and only used as *part* of another schema.
1579///
1580#[serde_with::serde_as(crate = "::client::serde_with")]
1581#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1582pub struct TableStats {
1583 /// How many cells are present per column (column family, column qualifier) combinations, averaged over all columns in all rows in the table. e.g. A table with 2 rows: * A row with 3 cells in "family:col" and 1 cell in "other:col" (4 cells / 2 columns) * A row with 1 cell in "family:col", 7 cells in "family:other_col", and 7 cells in "other:data" (15 cells / 3 columns) would report (4 + 15)/(2 + 3) = 3.8 in this field.
1584 #[serde(rename="averageCellsPerColumn")]
1585
1586 pub average_cells_per_column: Option<f64>,
1587 /// How many (column family, column qualifier) combinations are present per row in the table, averaged over all rows in the table. e.g. A table with 2 rows: * A row with cells in "family:col" and "other:col" (2 distinct columns) * A row with cells in "family:col", "family:other_col", and "other:data" (3 distinct columns) would report (2 + 3)/2 = 2.5 in this field.
1588 #[serde(rename="averageColumnsPerRow")]
1589
1590 pub average_columns_per_row: Option<f64>,
1591 /// This is roughly how many bytes would be needed to read the entire table (e.g. by streaming all contents out).
1592 #[serde(rename="logicalDataBytes")]
1593
1594 #[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
1595 pub logical_data_bytes: Option<i64>,
1596 /// How many rows are in the table.
1597 #[serde(rename="rowCount")]
1598
1599 #[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
1600 pub row_count: Option<i64>,
1601}
1602
1603impl client::Part for TableStats {}
1604
1605
1606/// Request message for `TestIamPermissions` method.
1607///
1608/// # Activities
1609///
1610/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1611/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1612///
1613/// * [instances clusters backups test iam permissions projects](ProjectInstanceClusterBackupTestIamPermissionCall) (request)
1614/// * [instances tables test iam permissions projects](ProjectInstanceTableTestIamPermissionCall) (request)
1615/// * [instances test iam permissions projects](ProjectInstanceTestIamPermissionCall) (request)
1616#[serde_with::serde_as(crate = "::client::serde_with")]
1617#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1618pub struct TestIamPermissionsRequest {
1619 /// 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).
1620
1621 pub permissions: Option<Vec<String>>,
1622}
1623
1624impl client::RequestValue for TestIamPermissionsRequest {}
1625
1626
1627/// Response message for `TestIamPermissions` method.
1628///
1629/// # Activities
1630///
1631/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1632/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1633///
1634/// * [instances clusters backups test iam permissions projects](ProjectInstanceClusterBackupTestIamPermissionCall) (response)
1635/// * [instances tables test iam permissions projects](ProjectInstanceTableTestIamPermissionCall) (response)
1636/// * [instances test iam permissions projects](ProjectInstanceTestIamPermissionCall) (response)
1637#[serde_with::serde_as(crate = "::client::serde_with")]
1638#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1639pub struct TestIamPermissionsResponse {
1640 /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1641
1642 pub permissions: Option<Vec<String>>,
1643}
1644
1645impl client::ResponseResult for TestIamPermissionsResponse {}
1646
1647
1648/// Request message for google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable
1649///
1650/// # Activities
1651///
1652/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1653/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1654///
1655/// * [instances tables undelete projects](ProjectInstanceTableUndeleteCall) (request)
1656#[serde_with::serde_as(crate = "::client::serde_with")]
1657#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1658pub struct UndeleteTableRequest { _never_set: Option<bool> }
1659
1660impl client::RequestValue for UndeleteTableRequest {}
1661
1662
1663/// A GcRule which deletes cells matching any of the given rules.
1664///
1665/// This type is not used in any activity, and only used as *part* of another schema.
1666///
1667#[serde_with::serde_as(crate = "::client::serde_with")]
1668#[derive(Default, Clone, Debug, Serialize, Deserialize)]
1669pub struct Union {
1670 /// Delete cells which would be deleted by any element of `rules`.
1671
1672 pub rules: Option<Vec<GcRule>>,
1673}
1674
1675impl client::Part for Union {}
1676
1677
1678
1679// ###################
1680// MethodBuilders ###
1681// #################
1682
1683/// A builder providing access to all methods supported on *operation* resources.
1684/// It is not used directly, but through the [`BigtableAdmin`] hub.
1685///
1686/// # Example
1687///
1688/// Instantiate a resource builder
1689///
1690/// ```test_harness,no_run
1691/// extern crate hyper;
1692/// extern crate hyper_rustls;
1693/// extern crate google_bigtableadmin2 as bigtableadmin2;
1694///
1695/// # async fn dox() {
1696/// use std::default::Default;
1697/// use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
1698///
1699/// let secret: oauth2::ApplicationSecret = Default::default();
1700/// let auth = oauth2::InstalledFlowAuthenticator::builder(
1701/// secret,
1702/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1703/// ).build().await.unwrap();
1704/// let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
1705/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1706/// // like `get(...)` and `projects_operations_list(...)`
1707/// // to build up your call.
1708/// let rb = hub.operations();
1709/// # }
1710/// ```
1711pub struct OperationMethods<'a, S>
1712 where S: 'a {
1713
1714 hub: &'a BigtableAdmin<S>,
1715}
1716
1717impl<'a, S> client::MethodsBuilder for OperationMethods<'a, S> {}
1718
1719impl<'a, S> OperationMethods<'a, S> {
1720
1721 /// Create a builder to help you perform the following task:
1722 ///
1723 /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
1724 ///
1725 /// # Arguments
1726 ///
1727 /// * `name` - The name of the operation's parent resource.
1728 pub fn projects_operations_list(&self, name: &str) -> OperationProjectOperationListCall<'a, S> {
1729 OperationProjectOperationListCall {
1730 hub: self.hub,
1731 _name: name.to_string(),
1732 _page_token: Default::default(),
1733 _page_size: Default::default(),
1734 _filter: Default::default(),
1735 _delegate: Default::default(),
1736 _additional_params: Default::default(),
1737 _scopes: Default::default(),
1738 }
1739 }
1740
1741 /// Create a builder to help you perform the following task:
1742 ///
1743 /// 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.
1744 ///
1745 /// # Arguments
1746 ///
1747 /// * `name` - The name of the operation resource.
1748 pub fn get(&self, name: &str) -> OperationGetCall<'a, S> {
1749 OperationGetCall {
1750 hub: self.hub,
1751 _name: name.to_string(),
1752 _delegate: Default::default(),
1753 _additional_params: Default::default(),
1754 _scopes: Default::default(),
1755 }
1756 }
1757}
1758
1759
1760
1761/// A builder providing access to all methods supported on *project* resources.
1762/// It is not used directly, but through the [`BigtableAdmin`] hub.
1763///
1764/// # Example
1765///
1766/// Instantiate a resource builder
1767///
1768/// ```test_harness,no_run
1769/// extern crate hyper;
1770/// extern crate hyper_rustls;
1771/// extern crate google_bigtableadmin2 as bigtableadmin2;
1772///
1773/// # async fn dox() {
1774/// use std::default::Default;
1775/// use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
1776///
1777/// let secret: oauth2::ApplicationSecret = Default::default();
1778/// let auth = oauth2::InstalledFlowAuthenticator::builder(
1779/// secret,
1780/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1781/// ).build().await.unwrap();
1782/// let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
1783/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1784/// // like `instances_app_profiles_create(...)`, `instances_app_profiles_delete(...)`, `instances_app_profiles_get(...)`, `instances_app_profiles_list(...)`, `instances_app_profiles_patch(...)`, `instances_clusters_backups_copy(...)`, `instances_clusters_backups_create(...)`, `instances_clusters_backups_delete(...)`, `instances_clusters_backups_get(...)`, `instances_clusters_backups_get_iam_policy(...)`, `instances_clusters_backups_list(...)`, `instances_clusters_backups_patch(...)`, `instances_clusters_backups_set_iam_policy(...)`, `instances_clusters_backups_test_iam_permissions(...)`, `instances_clusters_create(...)`, `instances_clusters_delete(...)`, `instances_clusters_get(...)`, `instances_clusters_hot_tablets_list(...)`, `instances_clusters_list(...)`, `instances_clusters_partial_update_cluster(...)`, `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_patch(...)`, `instances_tables_restore(...)`, `instances_tables_set_iam_policy(...)`, `instances_tables_test_iam_permissions(...)`, `instances_tables_undelete(...)`, `instances_test_iam_permissions(...)`, `instances_update(...)` and `locations_list(...)`
1785/// // to build up your call.
1786/// let rb = hub.projects();
1787/// # }
1788/// ```
1789pub struct ProjectMethods<'a, S>
1790 where S: 'a {
1791
1792 hub: &'a BigtableAdmin<S>,
1793}
1794
1795impl<'a, S> client::MethodsBuilder for ProjectMethods<'a, S> {}
1796
1797impl<'a, S> ProjectMethods<'a, S> {
1798
1799 /// Create a builder to help you perform the following task:
1800 ///
1801 /// Creates an app profile within an instance.
1802 ///
1803 /// # Arguments
1804 ///
1805 /// * `request` - No description provided.
1806 /// * `parent` - Required. The unique name of the instance in which to create the new app profile. Values are of the form `projects/{project}/instances/{instance}`.
1807 pub fn instances_app_profiles_create(&self, request: AppProfile, parent: &str) -> ProjectInstanceAppProfileCreateCall<'a, S> {
1808 ProjectInstanceAppProfileCreateCall {
1809 hub: self.hub,
1810 _request: request,
1811 _parent: parent.to_string(),
1812 _ignore_warnings: Default::default(),
1813 _app_profile_id: Default::default(),
1814 _delegate: Default::default(),
1815 _additional_params: Default::default(),
1816 _scopes: Default::default(),
1817 }
1818 }
1819
1820 /// Create a builder to help you perform the following task:
1821 ///
1822 /// Deletes an app profile from an instance.
1823 ///
1824 /// # Arguments
1825 ///
1826 /// * `name` - Required. The unique name of the app profile to be deleted. Values are of the form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
1827 pub fn instances_app_profiles_delete(&self, name: &str) -> ProjectInstanceAppProfileDeleteCall<'a, S> {
1828 ProjectInstanceAppProfileDeleteCall {
1829 hub: self.hub,
1830 _name: name.to_string(),
1831 _ignore_warnings: Default::default(),
1832 _delegate: Default::default(),
1833 _additional_params: Default::default(),
1834 _scopes: Default::default(),
1835 }
1836 }
1837
1838 /// Create a builder to help you perform the following task:
1839 ///
1840 /// Gets information about an app profile.
1841 ///
1842 /// # Arguments
1843 ///
1844 /// * `name` - Required. The unique name of the requested app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
1845 pub fn instances_app_profiles_get(&self, name: &str) -> ProjectInstanceAppProfileGetCall<'a, S> {
1846 ProjectInstanceAppProfileGetCall {
1847 hub: self.hub,
1848 _name: name.to_string(),
1849 _delegate: Default::default(),
1850 _additional_params: Default::default(),
1851 _scopes: Default::default(),
1852 }
1853 }
1854
1855 /// Create a builder to help you perform the following task:
1856 ///
1857 /// Lists information about app profiles in an instance.
1858 ///
1859 /// # Arguments
1860 ///
1861 /// * `parent` - Required. The unique name of the instance for which a list of app profiles is requested. Values are of the form `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list AppProfiles for all Instances in a project, e.g., `projects/myproject/instances/-`.
1862 pub fn instances_app_profiles_list(&self, parent: &str) -> ProjectInstanceAppProfileListCall<'a, S> {
1863 ProjectInstanceAppProfileListCall {
1864 hub: self.hub,
1865 _parent: parent.to_string(),
1866 _page_token: Default::default(),
1867 _page_size: Default::default(),
1868 _delegate: Default::default(),
1869 _additional_params: Default::default(),
1870 _scopes: Default::default(),
1871 }
1872 }
1873
1874 /// Create a builder to help you perform the following task:
1875 ///
1876 /// Updates an app profile within an instance.
1877 ///
1878 /// # Arguments
1879 ///
1880 /// * `request` - No description provided.
1881 /// * `name` - The unique name of the app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/_a-zA-Z0-9*`.
1882 pub fn instances_app_profiles_patch(&self, request: AppProfile, name: &str) -> ProjectInstanceAppProfilePatchCall<'a, S> {
1883 ProjectInstanceAppProfilePatchCall {
1884 hub: self.hub,
1885 _request: request,
1886 _name: name.to_string(),
1887 _update_mask: Default::default(),
1888 _ignore_warnings: Default::default(),
1889 _delegate: Default::default(),
1890 _additional_params: Default::default(),
1891 _scopes: Default::default(),
1892 }
1893 }
1894
1895 /// Create a builder to help you perform the following task:
1896 ///
1897 /// Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the destination instance and project.
1898 ///
1899 /// # Arguments
1900 ///
1901 /// * `request` - No description provided.
1902 /// * `parent` - Required. The name of the destination cluster that will contain the backup copy. The cluster must already exists. Values are of the form: `projects/{project}/instances/{instance}/clusters/{cluster}`.
1903 pub fn instances_clusters_backups_copy(&self, request: CopyBackupRequest, parent: &str) -> ProjectInstanceClusterBackupCopyCall<'a, S> {
1904 ProjectInstanceClusterBackupCopyCall {
1905 hub: self.hub,
1906 _request: request,
1907 _parent: parent.to_string(),
1908 _delegate: Default::default(),
1909 _additional_params: Default::default(),
1910 _scopes: Default::default(),
1911 }
1912 }
1913
1914 /// Create a builder to help you perform the following task:
1915 ///
1916 /// Starts creating a new Cloud Bigtable Backup. The returned backup long-running operation 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.
1917 ///
1918 /// # Arguments
1919 ///
1920 /// * `request` - No description provided.
1921 /// * `parent` - Required. This must be one of the clusters in the instance in which this table is located. The backup will be stored in this cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
1922 pub fn instances_clusters_backups_create(&self, request: Backup, parent: &str) -> ProjectInstanceClusterBackupCreateCall<'a, S> {
1923 ProjectInstanceClusterBackupCreateCall {
1924 hub: self.hub,
1925 _request: request,
1926 _parent: parent.to_string(),
1927 _backup_id: Default::default(),
1928 _delegate: Default::default(),
1929 _additional_params: Default::default(),
1930 _scopes: Default::default(),
1931 }
1932 }
1933
1934 /// Create a builder to help you perform the following task:
1935 ///
1936 /// Deletes a pending or completed Cloud Bigtable backup.
1937 ///
1938 /// # Arguments
1939 ///
1940 /// * `name` - Required. Name of the backup to delete. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
1941 pub fn instances_clusters_backups_delete(&self, name: &str) -> ProjectInstanceClusterBackupDeleteCall<'a, S> {
1942 ProjectInstanceClusterBackupDeleteCall {
1943 hub: self.hub,
1944 _name: name.to_string(),
1945 _delegate: Default::default(),
1946 _additional_params: Default::default(),
1947 _scopes: Default::default(),
1948 }
1949 }
1950
1951 /// Create a builder to help you perform the following task:
1952 ///
1953 /// Gets metadata on a pending or completed Cloud Bigtable Backup.
1954 ///
1955 /// # Arguments
1956 ///
1957 /// * `name` - Required. Name of the backup. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
1958 pub fn instances_clusters_backups_get(&self, name: &str) -> ProjectInstanceClusterBackupGetCall<'a, S> {
1959 ProjectInstanceClusterBackupGetCall {
1960 hub: self.hub,
1961 _name: name.to_string(),
1962 _delegate: Default::default(),
1963 _additional_params: Default::default(),
1964 _scopes: Default::default(),
1965 }
1966 }
1967
1968 /// Create a builder to help you perform the following task:
1969 ///
1970 /// 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.
1971 ///
1972 /// # Arguments
1973 ///
1974 /// * `request` - No description provided.
1975 /// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
1976 pub fn instances_clusters_backups_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S> {
1977 ProjectInstanceClusterBackupGetIamPolicyCall {
1978 hub: self.hub,
1979 _request: request,
1980 _resource: resource.to_string(),
1981 _delegate: Default::default(),
1982 _additional_params: Default::default(),
1983 _scopes: Default::default(),
1984 }
1985 }
1986
1987 /// Create a builder to help you perform the following task:
1988 ///
1989 /// Lists Cloud Bigtable backups. Returns both completed and pending backups.
1990 ///
1991 /// # Arguments
1992 ///
1993 /// * `parent` - Required. The cluster to list backups from. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. Use `{cluster} = '-'` to list backups for all clusters in an instance, e.g., `projects/{project}/instances/{instance}/clusters/-`.
1994 pub fn instances_clusters_backups_list(&self, parent: &str) -> ProjectInstanceClusterBackupListCall<'a, S> {
1995 ProjectInstanceClusterBackupListCall {
1996 hub: self.hub,
1997 _parent: parent.to_string(),
1998 _page_token: Default::default(),
1999 _page_size: Default::default(),
2000 _order_by: Default::default(),
2001 _filter: Default::default(),
2002 _delegate: Default::default(),
2003 _additional_params: Default::default(),
2004 _scopes: Default::default(),
2005 }
2006 }
2007
2008 /// Create a builder to help you perform the following task:
2009 ///
2010 /// Updates a pending or completed Cloud Bigtable Backup.
2011 ///
2012 /// # Arguments
2013 ///
2014 /// * `request` - No description provided.
2015 /// * `name` - A globally unique identifier for the backup which cannot be changed. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-zA-Z0-9*` The final segment of the name must be between 1 and 50 characters in length. The backup is stored in the cluster identified by the prefix of the backup name of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
2016 pub fn instances_clusters_backups_patch(&self, request: Backup, name: &str) -> ProjectInstanceClusterBackupPatchCall<'a, S> {
2017 ProjectInstanceClusterBackupPatchCall {
2018 hub: self.hub,
2019 _request: request,
2020 _name: name.to_string(),
2021 _update_mask: Default::default(),
2022 _delegate: Default::default(),
2023 _additional_params: Default::default(),
2024 _scopes: Default::default(),
2025 }
2026 }
2027
2028 /// Create a builder to help you perform the following task:
2029 ///
2030 /// Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
2031 ///
2032 /// # Arguments
2033 ///
2034 /// * `request` - No description provided.
2035 /// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2036 pub fn instances_clusters_backups_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S> {
2037 ProjectInstanceClusterBackupSetIamPolicyCall {
2038 hub: self.hub,
2039 _request: request,
2040 _resource: resource.to_string(),
2041 _delegate: Default::default(),
2042 _additional_params: Default::default(),
2043 _scopes: Default::default(),
2044 }
2045 }
2046
2047 /// Create a builder to help you perform the following task:
2048 ///
2049 /// Returns permissions that the caller has on the specified Table or Backup resource.
2050 ///
2051 /// # Arguments
2052 ///
2053 /// * `request` - No description provided.
2054 /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2055 pub fn instances_clusters_backups_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S> {
2056 ProjectInstanceClusterBackupTestIamPermissionCall {
2057 hub: self.hub,
2058 _request: request,
2059 _resource: resource.to_string(),
2060 _delegate: Default::default(),
2061 _additional_params: Default::default(),
2062 _scopes: Default::default(),
2063 }
2064 }
2065
2066 /// Create a builder to help you perform the following task:
2067 ///
2068 /// Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.
2069 ///
2070 /// # Arguments
2071 ///
2072 /// * `parent` - Required. The cluster name to list hot tablets. Value is in the following form: `projects/{project}/instances/{instance}/clusters/{cluster}`.
2073 pub fn instances_clusters_hot_tablets_list(&self, parent: &str) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
2074 ProjectInstanceClusterHotTabletListCall {
2075 hub: self.hub,
2076 _parent: parent.to_string(),
2077 _start_time: Default::default(),
2078 _page_token: Default::default(),
2079 _page_size: Default::default(),
2080 _end_time: Default::default(),
2081 _delegate: Default::default(),
2082 _additional_params: Default::default(),
2083 _scopes: Default::default(),
2084 }
2085 }
2086
2087 /// Create a builder to help you perform the following task:
2088 ///
2089 /// Creates a cluster within an instance. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
2090 ///
2091 /// # Arguments
2092 ///
2093 /// * `request` - No description provided.
2094 /// * `parent` - Required. The unique name of the instance in which to create the new cluster. Values are of the form `projects/{project}/instances/{instance}`.
2095 pub fn instances_clusters_create(&self, request: Cluster, parent: &str) -> ProjectInstanceClusterCreateCall<'a, S> {
2096 ProjectInstanceClusterCreateCall {
2097 hub: self.hub,
2098 _request: request,
2099 _parent: parent.to_string(),
2100 _cluster_id: Default::default(),
2101 _delegate: Default::default(),
2102 _additional_params: Default::default(),
2103 _scopes: Default::default(),
2104 }
2105 }
2106
2107 /// Create a builder to help you perform the following task:
2108 ///
2109 /// Deletes a cluster from an instance.
2110 ///
2111 /// # Arguments
2112 ///
2113 /// * `name` - Required. The unique name of the cluster to be deleted. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
2114 pub fn instances_clusters_delete(&self, name: &str) -> ProjectInstanceClusterDeleteCall<'a, S> {
2115 ProjectInstanceClusterDeleteCall {
2116 hub: self.hub,
2117 _name: name.to_string(),
2118 _delegate: Default::default(),
2119 _additional_params: Default::default(),
2120 _scopes: Default::default(),
2121 }
2122 }
2123
2124 /// Create a builder to help you perform the following task:
2125 ///
2126 /// Gets information about a cluster.
2127 ///
2128 /// # Arguments
2129 ///
2130 /// * `name` - Required. The unique name of the requested cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
2131 pub fn instances_clusters_get(&self, name: &str) -> ProjectInstanceClusterGetCall<'a, S> {
2132 ProjectInstanceClusterGetCall {
2133 hub: self.hub,
2134 _name: name.to_string(),
2135 _delegate: Default::default(),
2136 _additional_params: Default::default(),
2137 _scopes: Default::default(),
2138 }
2139 }
2140
2141 /// Create a builder to help you perform the following task:
2142 ///
2143 /// Lists information about clusters in an instance.
2144 ///
2145 /// # Arguments
2146 ///
2147 /// * `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/-`.
2148 pub fn instances_clusters_list(&self, parent: &str) -> ProjectInstanceClusterListCall<'a, S> {
2149 ProjectInstanceClusterListCall {
2150 hub: self.hub,
2151 _parent: parent.to_string(),
2152 _page_token: Default::default(),
2153 _delegate: Default::default(),
2154 _additional_params: Default::default(),
2155 _scopes: Default::default(),
2156 }
2157 }
2158
2159 /// Create a builder to help you perform the following task:
2160 ///
2161 /// Partially updates a cluster within a project. This method is the preferred way to update a Cluster. To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask. To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.
2162 ///
2163 /// # Arguments
2164 ///
2165 /// * `request` - No description provided.
2166 /// * `name` - The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
2167 pub fn instances_clusters_partial_update_cluster(&self, request: Cluster, name: &str) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {
2168 ProjectInstanceClusterPartialUpdateClusterCall {
2169 hub: self.hub,
2170 _request: request,
2171 _name: name.to_string(),
2172 _update_mask: Default::default(),
2173 _delegate: Default::default(),
2174 _additional_params: Default::default(),
2175 _scopes: Default::default(),
2176 }
2177 }
2178
2179 /// Create a builder to help you perform the following task:
2180 ///
2181 /// Updates a cluster within an instance. Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.
2182 ///
2183 /// # Arguments
2184 ///
2185 /// * `request` - No description provided.
2186 /// * `name` - The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
2187 pub fn instances_clusters_update(&self, request: Cluster, name: &str) -> ProjectInstanceClusterUpdateCall<'a, S> {
2188 ProjectInstanceClusterUpdateCall {
2189 hub: self.hub,
2190 _request: request,
2191 _name: name.to_string(),
2192 _delegate: Default::default(),
2193 _additional_params: Default::default(),
2194 _scopes: Default::default(),
2195 }
2196 }
2197
2198 /// Create a builder to help you perform the following task:
2199 ///
2200 /// Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.
2201 ///
2202 /// # Arguments
2203 ///
2204 /// * `request` - No description provided.
2205 /// * `name` - Required. The unique name of the Table for which to check replication consistency. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2206 pub fn instances_tables_check_consistency(&self, request: CheckConsistencyRequest, name: &str) -> ProjectInstanceTableCheckConsistencyCall<'a, S> {
2207 ProjectInstanceTableCheckConsistencyCall {
2208 hub: self.hub,
2209 _request: request,
2210 _name: name.to_string(),
2211 _delegate: Default::default(),
2212 _additional_params: Default::default(),
2213 _scopes: Default::default(),
2214 }
2215 }
2216
2217 /// Create a builder to help you perform the following task:
2218 ///
2219 /// Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.
2220 ///
2221 /// # Arguments
2222 ///
2223 /// * `request` - No description provided.
2224 /// * `parent` - Required. The unique name of the instance in which to create the table. Values are of the form `projects/{project}/instances/{instance}`.
2225 pub fn instances_tables_create(&self, request: CreateTableRequest, parent: &str) -> ProjectInstanceTableCreateCall<'a, S> {
2226 ProjectInstanceTableCreateCall {
2227 hub: self.hub,
2228 _request: request,
2229 _parent: parent.to_string(),
2230 _delegate: Default::default(),
2231 _additional_params: Default::default(),
2232 _scopes: Default::default(),
2233 }
2234 }
2235
2236 /// Create a builder to help you perform the following task:
2237 ///
2238 /// Permanently deletes a specified table and all of its data.
2239 ///
2240 /// # Arguments
2241 ///
2242 /// * `name` - Required. The unique name of the table to be deleted. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2243 pub fn instances_tables_delete(&self, name: &str) -> ProjectInstanceTableDeleteCall<'a, S> {
2244 ProjectInstanceTableDeleteCall {
2245 hub: self.hub,
2246 _name: name.to_string(),
2247 _delegate: Default::default(),
2248 _additional_params: Default::default(),
2249 _scopes: Default::default(),
2250 }
2251 }
2252
2253 /// Create a builder to help you perform the following task:
2254 ///
2255 /// 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. Note that row key prefixes used here are treated as service data. For more information about how service data is handled, see the [Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-notice).
2256 ///
2257 /// # Arguments
2258 ///
2259 /// * `request` - No description provided.
2260 /// * `name` - Required. The unique name of the table on which to drop a range of rows. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2261 pub fn instances_tables_drop_row_range(&self, request: DropRowRangeRequest, name: &str) -> ProjectInstanceTableDropRowRangeCall<'a, S> {
2262 ProjectInstanceTableDropRowRangeCall {
2263 hub: self.hub,
2264 _request: request,
2265 _name: name.to_string(),
2266 _delegate: Default::default(),
2267 _additional_params: Default::default(),
2268 _scopes: Default::default(),
2269 }
2270 }
2271
2272 /// Create a builder to help you perform the following task:
2273 ///
2274 /// Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.
2275 ///
2276 /// # Arguments
2277 ///
2278 /// * `request` - No description provided.
2279 /// * `name` - Required. The unique name of the Table for which to create a consistency token. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2280 pub fn instances_tables_generate_consistency_token(&self, request: GenerateConsistencyTokenRequest, name: &str) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S> {
2281 ProjectInstanceTableGenerateConsistencyTokenCall {
2282 hub: self.hub,
2283 _request: request,
2284 _name: name.to_string(),
2285 _delegate: Default::default(),
2286 _additional_params: Default::default(),
2287 _scopes: Default::default(),
2288 }
2289 }
2290
2291 /// Create a builder to help you perform the following task:
2292 ///
2293 /// Gets metadata information about the specified table.
2294 ///
2295 /// # Arguments
2296 ///
2297 /// * `name` - Required. The unique name of the requested table. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2298 pub fn instances_tables_get(&self, name: &str) -> ProjectInstanceTableGetCall<'a, S> {
2299 ProjectInstanceTableGetCall {
2300 hub: self.hub,
2301 _name: name.to_string(),
2302 _view: Default::default(),
2303 _delegate: Default::default(),
2304 _additional_params: Default::default(),
2305 _scopes: Default::default(),
2306 }
2307 }
2308
2309 /// Create a builder to help you perform the following task:
2310 ///
2311 /// 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.
2312 ///
2313 /// # Arguments
2314 ///
2315 /// * `request` - No description provided.
2316 /// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2317 pub fn instances_tables_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceTableGetIamPolicyCall<'a, S> {
2318 ProjectInstanceTableGetIamPolicyCall {
2319 hub: self.hub,
2320 _request: request,
2321 _resource: resource.to_string(),
2322 _delegate: Default::default(),
2323 _additional_params: Default::default(),
2324 _scopes: Default::default(),
2325 }
2326 }
2327
2328 /// Create a builder to help you perform the following task:
2329 ///
2330 /// Lists all tables served from a specified instance.
2331 ///
2332 /// # Arguments
2333 ///
2334 /// * `parent` - Required. The unique name of the instance for which tables should be listed. Values are of the form `projects/{project}/instances/{instance}`.
2335 pub fn instances_tables_list(&self, parent: &str) -> ProjectInstanceTableListCall<'a, S> {
2336 ProjectInstanceTableListCall {
2337 hub: self.hub,
2338 _parent: parent.to_string(),
2339 _view: Default::default(),
2340 _page_token: Default::default(),
2341 _page_size: Default::default(),
2342 _delegate: Default::default(),
2343 _additional_params: Default::default(),
2344 _scopes: Default::default(),
2345 }
2346 }
2347
2348 /// Create a builder to help you perform the following task:
2349 ///
2350 /// Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.
2351 ///
2352 /// # Arguments
2353 ///
2354 /// * `request` - No description provided.
2355 /// * `name` - Required. The unique name of the table whose families should be modified. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2356 pub fn instances_tables_modify_column_families(&self, request: ModifyColumnFamiliesRequest, name: &str) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S> {
2357 ProjectInstanceTableModifyColumnFamilyCall {
2358 hub: self.hub,
2359 _request: request,
2360 _name: name.to_string(),
2361 _delegate: Default::default(),
2362 _additional_params: Default::default(),
2363 _scopes: Default::default(),
2364 }
2365 }
2366
2367 /// Create a builder to help you perform the following task:
2368 ///
2369 /// Updates a specified table.
2370 ///
2371 /// # Arguments
2372 ///
2373 /// * `request` - No description provided.
2374 /// * `name` - The unique name of the table. Values are of the form `projects/{project}/instances/{instance}/tables/_a-zA-Z0-9*`. Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `STATS_VIEW`, `FULL`
2375 pub fn instances_tables_patch(&self, request: Table, name: &str) -> ProjectInstanceTablePatchCall<'a, S> {
2376 ProjectInstanceTablePatchCall {
2377 hub: self.hub,
2378 _request: request,
2379 _name: name.to_string(),
2380 _update_mask: Default::default(),
2381 _delegate: Default::default(),
2382 _additional_params: Default::default(),
2383 _scopes: Default::default(),
2384 }
2385 }
2386
2387 /// Create a builder to help you perform the following task:
2388 ///
2389 /// Create a new table by restoring from a completed backup. The returned table long-running operation can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreTableMetadata. The response type is Table, if successful.
2390 ///
2391 /// # Arguments
2392 ///
2393 /// * `request` - No description provided.
2394 /// * `parent` - Required. The name of the instance in which to create the restored table. Values are of the form `projects//instances/`.
2395 pub fn instances_tables_restore(&self, request: RestoreTableRequest, parent: &str) -> ProjectInstanceTableRestoreCall<'a, S> {
2396 ProjectInstanceTableRestoreCall {
2397 hub: self.hub,
2398 _request: request,
2399 _parent: parent.to_string(),
2400 _delegate: Default::default(),
2401 _additional_params: Default::default(),
2402 _scopes: Default::default(),
2403 }
2404 }
2405
2406 /// Create a builder to help you perform the following task:
2407 ///
2408 /// Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
2409 ///
2410 /// # Arguments
2411 ///
2412 /// * `request` - No description provided.
2413 /// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2414 pub fn instances_tables_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceTableSetIamPolicyCall<'a, S> {
2415 ProjectInstanceTableSetIamPolicyCall {
2416 hub: self.hub,
2417 _request: request,
2418 _resource: resource.to_string(),
2419 _delegate: Default::default(),
2420 _additional_params: Default::default(),
2421 _scopes: Default::default(),
2422 }
2423 }
2424
2425 /// Create a builder to help you perform the following task:
2426 ///
2427 /// Returns permissions that the caller has on the specified Table or Backup resource.
2428 ///
2429 /// # Arguments
2430 ///
2431 /// * `request` - No description provided.
2432 /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2433 pub fn instances_tables_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceTableTestIamPermissionCall<'a, S> {
2434 ProjectInstanceTableTestIamPermissionCall {
2435 hub: self.hub,
2436 _request: request,
2437 _resource: resource.to_string(),
2438 _delegate: Default::default(),
2439 _additional_params: Default::default(),
2440 _scopes: Default::default(),
2441 }
2442 }
2443
2444 /// Create a builder to help you perform the following task:
2445 ///
2446 /// Restores a specified table which was accidentally deleted.
2447 ///
2448 /// # Arguments
2449 ///
2450 /// * `request` - No description provided.
2451 /// * `name` - Required. The unique name of the table to be restored. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
2452 pub fn instances_tables_undelete(&self, request: UndeleteTableRequest, name: &str) -> ProjectInstanceTableUndeleteCall<'a, S> {
2453 ProjectInstanceTableUndeleteCall {
2454 hub: self.hub,
2455 _request: request,
2456 _name: name.to_string(),
2457 _delegate: Default::default(),
2458 _additional_params: Default::default(),
2459 _scopes: Default::default(),
2460 }
2461 }
2462
2463 /// Create a builder to help you perform the following task:
2464 ///
2465 /// Create an instance within a project. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
2466 ///
2467 /// # Arguments
2468 ///
2469 /// * `request` - No description provided.
2470 /// * `parent` - Required. The unique name of the project in which to create the new instance. Values are of the form `projects/{project}`.
2471 pub fn instances_create(&self, request: CreateInstanceRequest, parent: &str) -> ProjectInstanceCreateCall<'a, S> {
2472 ProjectInstanceCreateCall {
2473 hub: self.hub,
2474 _request: request,
2475 _parent: parent.to_string(),
2476 _delegate: Default::default(),
2477 _additional_params: Default::default(),
2478 _scopes: Default::default(),
2479 }
2480 }
2481
2482 /// Create a builder to help you perform the following task:
2483 ///
2484 /// Delete an instance from a project.
2485 ///
2486 /// # Arguments
2487 ///
2488 /// * `name` - Required. The unique name of the instance to be deleted. Values are of the form `projects/{project}/instances/{instance}`.
2489 pub fn instances_delete(&self, name: &str) -> ProjectInstanceDeleteCall<'a, S> {
2490 ProjectInstanceDeleteCall {
2491 hub: self.hub,
2492 _name: name.to_string(),
2493 _delegate: Default::default(),
2494 _additional_params: Default::default(),
2495 _scopes: Default::default(),
2496 }
2497 }
2498
2499 /// Create a builder to help you perform the following task:
2500 ///
2501 /// Gets information about an instance.
2502 ///
2503 /// # Arguments
2504 ///
2505 /// * `name` - Required. The unique name of the requested instance. Values are of the form `projects/{project}/instances/{instance}`.
2506 pub fn instances_get(&self, name: &str) -> ProjectInstanceGetCall<'a, S> {
2507 ProjectInstanceGetCall {
2508 hub: self.hub,
2509 _name: name.to_string(),
2510 _delegate: Default::default(),
2511 _additional_params: Default::default(),
2512 _scopes: Default::default(),
2513 }
2514 }
2515
2516 /// Create a builder to help you perform the following task:
2517 ///
2518 /// Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.
2519 ///
2520 /// # Arguments
2521 ///
2522 /// * `request` - No description provided.
2523 /// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2524 pub fn instances_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceGetIamPolicyCall<'a, S> {
2525 ProjectInstanceGetIamPolicyCall {
2526 hub: self.hub,
2527 _request: request,
2528 _resource: resource.to_string(),
2529 _delegate: Default::default(),
2530 _additional_params: Default::default(),
2531 _scopes: Default::default(),
2532 }
2533 }
2534
2535 /// Create a builder to help you perform the following task:
2536 ///
2537 /// Lists information about instances in a project.
2538 ///
2539 /// # Arguments
2540 ///
2541 /// * `parent` - Required. The unique name of the project for which a list of instances is requested. Values are of the form `projects/{project}`.
2542 pub fn instances_list(&self, parent: &str) -> ProjectInstanceListCall<'a, S> {
2543 ProjectInstanceListCall {
2544 hub: self.hub,
2545 _parent: parent.to_string(),
2546 _page_token: Default::default(),
2547 _delegate: Default::default(),
2548 _additional_params: Default::default(),
2549 _scopes: Default::default(),
2550 }
2551 }
2552
2553 /// Create a builder to help you perform the following task:
2554 ///
2555 /// Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.
2556 ///
2557 /// # Arguments
2558 ///
2559 /// * `request` - No description provided.
2560 /// * `name` - The unique name of the instance. Values are of the form `projects/{project}/instances/a-z+[a-z0-9]`.
2561 pub fn instances_partial_update_instance(&self, request: Instance, name: &str) -> ProjectInstancePartialUpdateInstanceCall<'a, S> {
2562 ProjectInstancePartialUpdateInstanceCall {
2563 hub: self.hub,
2564 _request: request,
2565 _name: name.to_string(),
2566 _update_mask: Default::default(),
2567 _delegate: Default::default(),
2568 _additional_params: Default::default(),
2569 _scopes: Default::default(),
2570 }
2571 }
2572
2573 /// Create a builder to help you perform the following task:
2574 ///
2575 /// Sets the access control policy on an instance resource. Replaces any existing policy.
2576 ///
2577 /// # Arguments
2578 ///
2579 /// * `request` - No description provided.
2580 /// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2581 pub fn instances_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceSetIamPolicyCall<'a, S> {
2582 ProjectInstanceSetIamPolicyCall {
2583 hub: self.hub,
2584 _request: request,
2585 _resource: resource.to_string(),
2586 _delegate: Default::default(),
2587 _additional_params: Default::default(),
2588 _scopes: Default::default(),
2589 }
2590 }
2591
2592 /// Create a builder to help you perform the following task:
2593 ///
2594 /// Returns permissions that the caller has on the specified instance resource.
2595 ///
2596 /// # Arguments
2597 ///
2598 /// * `request` - No description provided.
2599 /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2600 pub fn instances_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceTestIamPermissionCall<'a, S> {
2601 ProjectInstanceTestIamPermissionCall {
2602 hub: self.hub,
2603 _request: request,
2604 _resource: resource.to_string(),
2605 _delegate: Default::default(),
2606 _additional_params: Default::default(),
2607 _scopes: Default::default(),
2608 }
2609 }
2610
2611 /// Create a builder to help you perform the following task:
2612 ///
2613 /// Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.
2614 ///
2615 /// # Arguments
2616 ///
2617 /// * `request` - No description provided.
2618 /// * `name` - The unique name of the instance. Values are of the form `projects/{project}/instances/a-z+[a-z0-9]`.
2619 pub fn instances_update(&self, request: Instance, name: &str) -> ProjectInstanceUpdateCall<'a, S> {
2620 ProjectInstanceUpdateCall {
2621 hub: self.hub,
2622 _request: request,
2623 _name: name.to_string(),
2624 _delegate: Default::default(),
2625 _additional_params: Default::default(),
2626 _scopes: Default::default(),
2627 }
2628 }
2629
2630 /// Create a builder to help you perform the following task:
2631 ///
2632 /// Lists information about the supported locations for this service.
2633 ///
2634 /// # Arguments
2635 ///
2636 /// * `name` - The resource that owns the locations collection, if applicable.
2637 pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, S> {
2638 ProjectLocationListCall {
2639 hub: self.hub,
2640 _name: name.to_string(),
2641 _page_token: Default::default(),
2642 _page_size: Default::default(),
2643 _filter: Default::default(),
2644 _delegate: Default::default(),
2645 _additional_params: Default::default(),
2646 _scopes: Default::default(),
2647 }
2648 }
2649}
2650
2651
2652
2653
2654
2655// ###################
2656// CallBuilders ###
2657// #################
2658
2659/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
2660///
2661/// A builder for the *projects.operations.list* method supported by a *operation* resource.
2662/// It is not used directly, but through a [`OperationMethods`] instance.
2663///
2664/// # Example
2665///
2666/// Instantiate a resource method builder
2667///
2668/// ```test_harness,no_run
2669/// # extern crate hyper;
2670/// # extern crate hyper_rustls;
2671/// # extern crate google_bigtableadmin2 as bigtableadmin2;
2672/// # async fn dox() {
2673/// # use std::default::Default;
2674/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
2675///
2676/// # let secret: oauth2::ApplicationSecret = Default::default();
2677/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
2678/// # secret,
2679/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2680/// # ).build().await.unwrap();
2681/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
2682/// // You can configure optional parameters by calling the respective setters at will, and
2683/// // execute the final call using `doit()`.
2684/// // Values shown here are possibly random and not representative !
2685/// let result = hub.operations().projects_operations_list("name")
2686/// .page_token("gubergren")
2687/// .page_size(-51)
2688/// .filter("gubergren")
2689/// .doit().await;
2690/// # }
2691/// ```
2692pub struct OperationProjectOperationListCall<'a, S>
2693 where S: 'a {
2694
2695 hub: &'a BigtableAdmin<S>,
2696 _name: String,
2697 _page_token: Option<String>,
2698 _page_size: Option<i32>,
2699 _filter: Option<String>,
2700 _delegate: Option<&'a mut dyn client::Delegate>,
2701 _additional_params: HashMap<String, String>,
2702 _scopes: BTreeSet<String>
2703}
2704
2705impl<'a, S> client::CallBuilder for OperationProjectOperationListCall<'a, S> {}
2706
2707impl<'a, S> OperationProjectOperationListCall<'a, S>
2708where
2709 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
2710 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
2711 S::Future: Send + Unpin + 'static,
2712 S::Error: Into<Box<dyn StdError + Send + Sync>>,
2713{
2714
2715
2716 /// Perform the operation you have build so far.
2717 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListOperationsResponse)> {
2718 use std::io::{Read, Seek};
2719 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
2720 use client::{ToParts, url::Params};
2721 use std::borrow::Cow;
2722
2723 let mut dd = client::DefaultDelegate;
2724 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
2725 dlg.begin(client::MethodInfo { id: "bigtableadmin.operations.projects.operations.list",
2726 http_method: hyper::Method::GET });
2727
2728 for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() {
2729 if self._additional_params.contains_key(field) {
2730 dlg.finished(false);
2731 return Err(client::Error::FieldClash(field));
2732 }
2733 }
2734
2735 let mut params = Params::with_capacity(6 + self._additional_params.len());
2736 params.push("name", self._name);
2737 if let Some(value) = self._page_token.as_ref() {
2738 params.push("pageToken", value);
2739 }
2740 if let Some(value) = self._page_size.as_ref() {
2741 params.push("pageSize", value.to_string());
2742 }
2743 if let Some(value) = self._filter.as_ref() {
2744 params.push("filter", value);
2745 }
2746
2747 params.extend(self._additional_params.iter());
2748
2749 params.push("alt", "json");
2750 let mut url = self.hub._base_url.clone() + "v2/{+name}/operations";
2751 if self._scopes.is_empty() {
2752 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
2753 }
2754
2755 for &(find_this, param_name) in [("{+name}", "name")].iter() {
2756 url = params.uri_replacement(url, param_name, find_this, true);
2757 }
2758 {
2759 let to_remove = ["name"];
2760 params.remove_params(&to_remove);
2761 }
2762
2763 let url = params.parse_with_url(&url);
2764
2765
2766
2767 loop {
2768 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
2769 Ok(token) => token,
2770 Err(e) => {
2771 match dlg.token(e) {
2772 Ok(token) => token,
2773 Err(e) => {
2774 dlg.finished(false);
2775 return Err(client::Error::MissingToken(e));
2776 }
2777 }
2778 }
2779 };
2780 let mut req_result = {
2781 let client = &self.hub.client;
2782 dlg.pre_request();
2783 let mut req_builder = hyper::Request::builder()
2784 .method(hyper::Method::GET)
2785 .uri(url.as_str())
2786 .header(USER_AGENT, self.hub._user_agent.clone());
2787
2788 if let Some(token) = token.as_ref() {
2789 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2790 }
2791
2792
2793 let request = req_builder
2794 .body(hyper::body::Body::empty());
2795
2796 client.request(request.unwrap()).await
2797
2798 };
2799
2800 match req_result {
2801 Err(err) => {
2802 if let client::Retry::After(d) = dlg.http_error(&err) {
2803 sleep(d).await;
2804 continue;
2805 }
2806 dlg.finished(false);
2807 return Err(client::Error::HttpError(err))
2808 }
2809 Ok(mut res) => {
2810 if !res.status().is_success() {
2811 let res_body_string = client::get_body_as_string(res.body_mut()).await;
2812 let (parts, _) = res.into_parts();
2813 let body = hyper::Body::from(res_body_string.clone());
2814 let restored_response = hyper::Response::from_parts(parts, body);
2815
2816 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
2817
2818 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
2819 sleep(d).await;
2820 continue;
2821 }
2822
2823 dlg.finished(false);
2824
2825 return match server_response {
2826 Some(error_value) => Err(client::Error::BadRequest(error_value)),
2827 None => Err(client::Error::Failure(restored_response)),
2828 }
2829 }
2830 let result_value = {
2831 let res_body_string = client::get_body_as_string(res.body_mut()).await;
2832
2833 match json::from_str(&res_body_string) {
2834 Ok(decoded) => (res, decoded),
2835 Err(err) => {
2836 dlg.response_json_decode_error(&res_body_string, &err);
2837 return Err(client::Error::JsonDecodeError(res_body_string, err));
2838 }
2839 }
2840 };
2841
2842 dlg.finished(true);
2843 return Ok(result_value)
2844 }
2845 }
2846 }
2847 }
2848
2849
2850 /// The name of the operation's parent resource.
2851 ///
2852 /// Sets the *name* path property to the given value.
2853 ///
2854 /// Even though the property as already been set when instantiating this call,
2855 /// we provide this method for API completeness.
2856 pub fn name(mut self, new_value: &str) -> OperationProjectOperationListCall<'a, S> {
2857 self._name = new_value.to_string();
2858 self
2859 }
2860 /// The standard list page token.
2861 ///
2862 /// Sets the *page token* query property to the given value.
2863 pub fn page_token(mut self, new_value: &str) -> OperationProjectOperationListCall<'a, S> {
2864 self._page_token = Some(new_value.to_string());
2865 self
2866 }
2867 /// The standard list page size.
2868 ///
2869 /// Sets the *page size* query property to the given value.
2870 pub fn page_size(mut self, new_value: i32) -> OperationProjectOperationListCall<'a, S> {
2871 self._page_size = Some(new_value);
2872 self
2873 }
2874 /// The standard list filter.
2875 ///
2876 /// Sets the *filter* query property to the given value.
2877 pub fn filter(mut self, new_value: &str) -> OperationProjectOperationListCall<'a, S> {
2878 self._filter = Some(new_value.to_string());
2879 self
2880 }
2881 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2882 /// while executing the actual API request.
2883 ///
2884 /// ````text
2885 /// It should be used to handle progress information, and to implement a certain level of resilience.
2886 /// ````
2887 ///
2888 /// Sets the *delegate* property to the given value.
2889 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationProjectOperationListCall<'a, S> {
2890 self._delegate = Some(new_value);
2891 self
2892 }
2893
2894 /// Set any additional parameter of the query string used in the request.
2895 /// It should be used to set parameters which are not yet available through their own
2896 /// setters.
2897 ///
2898 /// Please note that this method must not be used to set any of the known parameters
2899 /// which have their own setter method. If done anyway, the request will fail.
2900 ///
2901 /// # Additional Parameters
2902 ///
2903 /// * *$.xgafv* (query-string) - V1 error format.
2904 /// * *access_token* (query-string) - OAuth access token.
2905 /// * *alt* (query-string) - Data format for response.
2906 /// * *callback* (query-string) - JSONP
2907 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2908 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2909 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2910 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2911 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2912 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2913 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2914 pub fn param<T>(mut self, name: T, value: T) -> OperationProjectOperationListCall<'a, S>
2915 where T: AsRef<str> {
2916 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
2917 self
2918 }
2919
2920 /// Identifies the authorization scope for the method you are building.
2921 ///
2922 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2923 /// [`Scope::BigtableAdmin`].
2924 ///
2925 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2926 /// tokens for more than one scope.
2927 ///
2928 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2929 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2930 /// sufficient, a read-write scope will do as well.
2931 pub fn add_scope<St>(mut self, scope: St) -> OperationProjectOperationListCall<'a, S>
2932 where St: AsRef<str> {
2933 self._scopes.insert(String::from(scope.as_ref()));
2934 self
2935 }
2936 /// Identifies the authorization scope(s) for the method you are building.
2937 ///
2938 /// See [`Self::add_scope()`] for details.
2939 pub fn add_scopes<I, St>(mut self, scopes: I) -> OperationProjectOperationListCall<'a, S>
2940 where I: IntoIterator<Item = St>,
2941 St: AsRef<str> {
2942 self._scopes
2943 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2944 self
2945 }
2946
2947 /// Removes all scopes, and no default scope will be used either.
2948 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2949 /// for details).
2950 pub fn clear_scopes(mut self) -> OperationProjectOperationListCall<'a, S> {
2951 self._scopes.clear();
2952 self
2953 }
2954}
2955
2956
2957/// 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.
2958///
2959/// A builder for the *get* method supported by a *operation* resource.
2960/// It is not used directly, but through a [`OperationMethods`] instance.
2961///
2962/// # Example
2963///
2964/// Instantiate a resource method builder
2965///
2966/// ```test_harness,no_run
2967/// # extern crate hyper;
2968/// # extern crate hyper_rustls;
2969/// # extern crate google_bigtableadmin2 as bigtableadmin2;
2970/// # async fn dox() {
2971/// # use std::default::Default;
2972/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
2973///
2974/// # let secret: oauth2::ApplicationSecret = Default::default();
2975/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
2976/// # secret,
2977/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2978/// # ).build().await.unwrap();
2979/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
2980/// // You can configure optional parameters by calling the respective setters at will, and
2981/// // execute the final call using `doit()`.
2982/// // Values shown here are possibly random and not representative !
2983/// let result = hub.operations().get("name")
2984/// .doit().await;
2985/// # }
2986/// ```
2987pub struct OperationGetCall<'a, S>
2988 where S: 'a {
2989
2990 hub: &'a BigtableAdmin<S>,
2991 _name: String,
2992 _delegate: Option<&'a mut dyn client::Delegate>,
2993 _additional_params: HashMap<String, String>,
2994 _scopes: BTreeSet<String>
2995}
2996
2997impl<'a, S> client::CallBuilder for OperationGetCall<'a, S> {}
2998
2999impl<'a, S> OperationGetCall<'a, S>
3000where
3001 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
3002 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
3003 S::Future: Send + Unpin + 'static,
3004 S::Error: Into<Box<dyn StdError + Send + Sync>>,
3005{
3006
3007
3008 /// Perform the operation you have build so far.
3009 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
3010 use std::io::{Read, Seek};
3011 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
3012 use client::{ToParts, url::Params};
3013 use std::borrow::Cow;
3014
3015 let mut dd = client::DefaultDelegate;
3016 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
3017 dlg.begin(client::MethodInfo { id: "bigtableadmin.operations.get",
3018 http_method: hyper::Method::GET });
3019
3020 for &field in ["alt", "name"].iter() {
3021 if self._additional_params.contains_key(field) {
3022 dlg.finished(false);
3023 return Err(client::Error::FieldClash(field));
3024 }
3025 }
3026
3027 let mut params = Params::with_capacity(3 + self._additional_params.len());
3028 params.push("name", self._name);
3029
3030 params.extend(self._additional_params.iter());
3031
3032 params.push("alt", "json");
3033 let mut url = self.hub._base_url.clone() + "v2/{+name}";
3034 if self._scopes.is_empty() {
3035 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
3036 }
3037
3038 for &(find_this, param_name) in [("{+name}", "name")].iter() {
3039 url = params.uri_replacement(url, param_name, find_this, true);
3040 }
3041 {
3042 let to_remove = ["name"];
3043 params.remove_params(&to_remove);
3044 }
3045
3046 let url = params.parse_with_url(&url);
3047
3048
3049
3050 loop {
3051 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
3052 Ok(token) => token,
3053 Err(e) => {
3054 match dlg.token(e) {
3055 Ok(token) => token,
3056 Err(e) => {
3057 dlg.finished(false);
3058 return Err(client::Error::MissingToken(e));
3059 }
3060 }
3061 }
3062 };
3063 let mut req_result = {
3064 let client = &self.hub.client;
3065 dlg.pre_request();
3066 let mut req_builder = hyper::Request::builder()
3067 .method(hyper::Method::GET)
3068 .uri(url.as_str())
3069 .header(USER_AGENT, self.hub._user_agent.clone());
3070
3071 if let Some(token) = token.as_ref() {
3072 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3073 }
3074
3075
3076 let request = req_builder
3077 .body(hyper::body::Body::empty());
3078
3079 client.request(request.unwrap()).await
3080
3081 };
3082
3083 match req_result {
3084 Err(err) => {
3085 if let client::Retry::After(d) = dlg.http_error(&err) {
3086 sleep(d).await;
3087 continue;
3088 }
3089 dlg.finished(false);
3090 return Err(client::Error::HttpError(err))
3091 }
3092 Ok(mut res) => {
3093 if !res.status().is_success() {
3094 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3095 let (parts, _) = res.into_parts();
3096 let body = hyper::Body::from(res_body_string.clone());
3097 let restored_response = hyper::Response::from_parts(parts, body);
3098
3099 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
3100
3101 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
3102 sleep(d).await;
3103 continue;
3104 }
3105
3106 dlg.finished(false);
3107
3108 return match server_response {
3109 Some(error_value) => Err(client::Error::BadRequest(error_value)),
3110 None => Err(client::Error::Failure(restored_response)),
3111 }
3112 }
3113 let result_value = {
3114 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3115
3116 match json::from_str(&res_body_string) {
3117 Ok(decoded) => (res, decoded),
3118 Err(err) => {
3119 dlg.response_json_decode_error(&res_body_string, &err);
3120 return Err(client::Error::JsonDecodeError(res_body_string, err));
3121 }
3122 }
3123 };
3124
3125 dlg.finished(true);
3126 return Ok(result_value)
3127 }
3128 }
3129 }
3130 }
3131
3132
3133 /// The name of the operation resource.
3134 ///
3135 /// Sets the *name* path property to the given value.
3136 ///
3137 /// Even though the property as already been set when instantiating this call,
3138 /// we provide this method for API completeness.
3139 pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, S> {
3140 self._name = new_value.to_string();
3141 self
3142 }
3143 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3144 /// while executing the actual API request.
3145 ///
3146 /// ````text
3147 /// It should be used to handle progress information, and to implement a certain level of resilience.
3148 /// ````
3149 ///
3150 /// Sets the *delegate* property to the given value.
3151 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationGetCall<'a, S> {
3152 self._delegate = Some(new_value);
3153 self
3154 }
3155
3156 /// Set any additional parameter of the query string used in the request.
3157 /// It should be used to set parameters which are not yet available through their own
3158 /// setters.
3159 ///
3160 /// Please note that this method must not be used to set any of the known parameters
3161 /// which have their own setter method. If done anyway, the request will fail.
3162 ///
3163 /// # Additional Parameters
3164 ///
3165 /// * *$.xgafv* (query-string) - V1 error format.
3166 /// * *access_token* (query-string) - OAuth access token.
3167 /// * *alt* (query-string) - Data format for response.
3168 /// * *callback* (query-string) - JSONP
3169 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3170 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3171 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3172 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3173 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3174 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3175 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3176 pub fn param<T>(mut self, name: T, value: T) -> OperationGetCall<'a, S>
3177 where T: AsRef<str> {
3178 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
3179 self
3180 }
3181
3182 /// Identifies the authorization scope for the method you are building.
3183 ///
3184 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3185 /// [`Scope::BigtableAdmin`].
3186 ///
3187 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3188 /// tokens for more than one scope.
3189 ///
3190 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3191 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3192 /// sufficient, a read-write scope will do as well.
3193 pub fn add_scope<St>(mut self, scope: St) -> OperationGetCall<'a, S>
3194 where St: AsRef<str> {
3195 self._scopes.insert(String::from(scope.as_ref()));
3196 self
3197 }
3198 /// Identifies the authorization scope(s) for the method you are building.
3199 ///
3200 /// See [`Self::add_scope()`] for details.
3201 pub fn add_scopes<I, St>(mut self, scopes: I) -> OperationGetCall<'a, S>
3202 where I: IntoIterator<Item = St>,
3203 St: AsRef<str> {
3204 self._scopes
3205 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3206 self
3207 }
3208
3209 /// Removes all scopes, and no default scope will be used either.
3210 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3211 /// for details).
3212 pub fn clear_scopes(mut self) -> OperationGetCall<'a, S> {
3213 self._scopes.clear();
3214 self
3215 }
3216}
3217
3218
3219/// Creates an app profile within an instance.
3220///
3221/// A builder for the *instances.appProfiles.create* method supported by a *project* resource.
3222/// It is not used directly, but through a [`ProjectMethods`] instance.
3223///
3224/// # Example
3225///
3226/// Instantiate a resource method builder
3227///
3228/// ```test_harness,no_run
3229/// # extern crate hyper;
3230/// # extern crate hyper_rustls;
3231/// # extern crate google_bigtableadmin2 as bigtableadmin2;
3232/// use bigtableadmin2::api::AppProfile;
3233/// # async fn dox() {
3234/// # use std::default::Default;
3235/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
3236///
3237/// # let secret: oauth2::ApplicationSecret = Default::default();
3238/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
3239/// # secret,
3240/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3241/// # ).build().await.unwrap();
3242/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
3243/// // As the method needs a request, you would usually fill it with the desired information
3244/// // into the respective structure. Some of the parts shown here might not be applicable !
3245/// // Values shown here are possibly random and not representative !
3246/// let mut req = AppProfile::default();
3247///
3248/// // You can configure optional parameters by calling the respective setters at will, and
3249/// // execute the final call using `doit()`.
3250/// // Values shown here are possibly random and not representative !
3251/// let result = hub.projects().instances_app_profiles_create(req, "parent")
3252/// .ignore_warnings(true)
3253/// .app_profile_id("invidunt")
3254/// .doit().await;
3255/// # }
3256/// ```
3257pub struct ProjectInstanceAppProfileCreateCall<'a, S>
3258 where S: 'a {
3259
3260 hub: &'a BigtableAdmin<S>,
3261 _request: AppProfile,
3262 _parent: String,
3263 _ignore_warnings: Option<bool>,
3264 _app_profile_id: Option<String>,
3265 _delegate: Option<&'a mut dyn client::Delegate>,
3266 _additional_params: HashMap<String, String>,
3267 _scopes: BTreeSet<String>
3268}
3269
3270impl<'a, S> client::CallBuilder for ProjectInstanceAppProfileCreateCall<'a, S> {}
3271
3272impl<'a, S> ProjectInstanceAppProfileCreateCall<'a, S>
3273where
3274 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
3275 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
3276 S::Future: Send + Unpin + 'static,
3277 S::Error: Into<Box<dyn StdError + Send + Sync>>,
3278{
3279
3280
3281 /// Perform the operation you have build so far.
3282 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, AppProfile)> {
3283 use std::io::{Read, Seek};
3284 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
3285 use client::{ToParts, url::Params};
3286 use std::borrow::Cow;
3287
3288 let mut dd = client::DefaultDelegate;
3289 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
3290 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.appProfiles.create",
3291 http_method: hyper::Method::POST });
3292
3293 for &field in ["alt", "parent", "ignoreWarnings", "appProfileId"].iter() {
3294 if self._additional_params.contains_key(field) {
3295 dlg.finished(false);
3296 return Err(client::Error::FieldClash(field));
3297 }
3298 }
3299
3300 let mut params = Params::with_capacity(6 + self._additional_params.len());
3301 params.push("parent", self._parent);
3302 if let Some(value) = self._ignore_warnings.as_ref() {
3303 params.push("ignoreWarnings", value.to_string());
3304 }
3305 if let Some(value) = self._app_profile_id.as_ref() {
3306 params.push("appProfileId", value);
3307 }
3308
3309 params.extend(self._additional_params.iter());
3310
3311 params.push("alt", "json");
3312 let mut url = self.hub._base_url.clone() + "v2/{+parent}/appProfiles";
3313 if self._scopes.is_empty() {
3314 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
3315 }
3316
3317 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
3318 url = params.uri_replacement(url, param_name, find_this, true);
3319 }
3320 {
3321 let to_remove = ["parent"];
3322 params.remove_params(&to_remove);
3323 }
3324
3325 let url = params.parse_with_url(&url);
3326
3327 let mut json_mime_type = mime::APPLICATION_JSON;
3328 let mut request_value_reader =
3329 {
3330 let mut value = json::value::to_value(&self._request).expect("serde to work");
3331 client::remove_json_null_values(&mut value);
3332 let mut dst = io::Cursor::new(Vec::with_capacity(128));
3333 json::to_writer(&mut dst, &value).unwrap();
3334 dst
3335 };
3336 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
3337 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
3338
3339
3340 loop {
3341 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
3342 Ok(token) => token,
3343 Err(e) => {
3344 match dlg.token(e) {
3345 Ok(token) => token,
3346 Err(e) => {
3347 dlg.finished(false);
3348 return Err(client::Error::MissingToken(e));
3349 }
3350 }
3351 }
3352 };
3353 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
3354 let mut req_result = {
3355 let client = &self.hub.client;
3356 dlg.pre_request();
3357 let mut req_builder = hyper::Request::builder()
3358 .method(hyper::Method::POST)
3359 .uri(url.as_str())
3360 .header(USER_AGENT, self.hub._user_agent.clone());
3361
3362 if let Some(token) = token.as_ref() {
3363 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3364 }
3365
3366
3367 let request = req_builder
3368 .header(CONTENT_TYPE, json_mime_type.to_string())
3369 .header(CONTENT_LENGTH, request_size as u64)
3370 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
3371
3372 client.request(request.unwrap()).await
3373
3374 };
3375
3376 match req_result {
3377 Err(err) => {
3378 if let client::Retry::After(d) = dlg.http_error(&err) {
3379 sleep(d).await;
3380 continue;
3381 }
3382 dlg.finished(false);
3383 return Err(client::Error::HttpError(err))
3384 }
3385 Ok(mut res) => {
3386 if !res.status().is_success() {
3387 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3388 let (parts, _) = res.into_parts();
3389 let body = hyper::Body::from(res_body_string.clone());
3390 let restored_response = hyper::Response::from_parts(parts, body);
3391
3392 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
3393
3394 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
3395 sleep(d).await;
3396 continue;
3397 }
3398
3399 dlg.finished(false);
3400
3401 return match server_response {
3402 Some(error_value) => Err(client::Error::BadRequest(error_value)),
3403 None => Err(client::Error::Failure(restored_response)),
3404 }
3405 }
3406 let result_value = {
3407 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3408
3409 match json::from_str(&res_body_string) {
3410 Ok(decoded) => (res, decoded),
3411 Err(err) => {
3412 dlg.response_json_decode_error(&res_body_string, &err);
3413 return Err(client::Error::JsonDecodeError(res_body_string, err));
3414 }
3415 }
3416 };
3417
3418 dlg.finished(true);
3419 return Ok(result_value)
3420 }
3421 }
3422 }
3423 }
3424
3425
3426 ///
3427 /// Sets the *request* property to the given value.
3428 ///
3429 /// Even though the property as already been set when instantiating this call,
3430 /// we provide this method for API completeness.
3431 pub fn request(mut self, new_value: AppProfile) -> ProjectInstanceAppProfileCreateCall<'a, S> {
3432 self._request = new_value;
3433 self
3434 }
3435 /// Required. The unique name of the instance in which to create the new app profile. Values are of the form `projects/{project}/instances/{instance}`.
3436 ///
3437 /// Sets the *parent* path property to the given value.
3438 ///
3439 /// Even though the property as already been set when instantiating this call,
3440 /// we provide this method for API completeness.
3441 pub fn parent(mut self, new_value: &str) -> ProjectInstanceAppProfileCreateCall<'a, S> {
3442 self._parent = new_value.to_string();
3443 self
3444 }
3445 /// If true, ignore safety checks when creating the app profile.
3446 ///
3447 /// Sets the *ignore warnings* query property to the given value.
3448 pub fn ignore_warnings(mut self, new_value: bool) -> ProjectInstanceAppProfileCreateCall<'a, S> {
3449 self._ignore_warnings = Some(new_value);
3450 self
3451 }
3452 /// 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`.
3453 ///
3454 /// Sets the *app profile id* query property to the given value.
3455 pub fn app_profile_id(mut self, new_value: &str) -> ProjectInstanceAppProfileCreateCall<'a, S> {
3456 self._app_profile_id = Some(new_value.to_string());
3457 self
3458 }
3459 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3460 /// while executing the actual API request.
3461 ///
3462 /// ````text
3463 /// It should be used to handle progress information, and to implement a certain level of resilience.
3464 /// ````
3465 ///
3466 /// Sets the *delegate* property to the given value.
3467 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceAppProfileCreateCall<'a, S> {
3468 self._delegate = Some(new_value);
3469 self
3470 }
3471
3472 /// Set any additional parameter of the query string used in the request.
3473 /// It should be used to set parameters which are not yet available through their own
3474 /// setters.
3475 ///
3476 /// Please note that this method must not be used to set any of the known parameters
3477 /// which have their own setter method. If done anyway, the request will fail.
3478 ///
3479 /// # Additional Parameters
3480 ///
3481 /// * *$.xgafv* (query-string) - V1 error format.
3482 /// * *access_token* (query-string) - OAuth access token.
3483 /// * *alt* (query-string) - Data format for response.
3484 /// * *callback* (query-string) - JSONP
3485 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3486 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3487 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3488 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3489 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3490 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3491 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3492 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceAppProfileCreateCall<'a, S>
3493 where T: AsRef<str> {
3494 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
3495 self
3496 }
3497
3498 /// Identifies the authorization scope for the method you are building.
3499 ///
3500 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3501 /// [`Scope::BigtableAdmin`].
3502 ///
3503 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3504 /// tokens for more than one scope.
3505 ///
3506 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3507 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3508 /// sufficient, a read-write scope will do as well.
3509 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceAppProfileCreateCall<'a, S>
3510 where St: AsRef<str> {
3511 self._scopes.insert(String::from(scope.as_ref()));
3512 self
3513 }
3514 /// Identifies the authorization scope(s) for the method you are building.
3515 ///
3516 /// See [`Self::add_scope()`] for details.
3517 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceAppProfileCreateCall<'a, S>
3518 where I: IntoIterator<Item = St>,
3519 St: AsRef<str> {
3520 self._scopes
3521 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3522 self
3523 }
3524
3525 /// Removes all scopes, and no default scope will be used either.
3526 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3527 /// for details).
3528 pub fn clear_scopes(mut self) -> ProjectInstanceAppProfileCreateCall<'a, S> {
3529 self._scopes.clear();
3530 self
3531 }
3532}
3533
3534
3535/// Deletes an app profile from an instance.
3536///
3537/// A builder for the *instances.appProfiles.delete* method supported by a *project* resource.
3538/// It is not used directly, but through a [`ProjectMethods`] instance.
3539///
3540/// # Example
3541///
3542/// Instantiate a resource method builder
3543///
3544/// ```test_harness,no_run
3545/// # extern crate hyper;
3546/// # extern crate hyper_rustls;
3547/// # extern crate google_bigtableadmin2 as bigtableadmin2;
3548/// # async fn dox() {
3549/// # use std::default::Default;
3550/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
3551///
3552/// # let secret: oauth2::ApplicationSecret = Default::default();
3553/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
3554/// # secret,
3555/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3556/// # ).build().await.unwrap();
3557/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
3558/// // You can configure optional parameters by calling the respective setters at will, and
3559/// // execute the final call using `doit()`.
3560/// // Values shown here are possibly random and not representative !
3561/// let result = hub.projects().instances_app_profiles_delete("name")
3562/// .ignore_warnings(true)
3563/// .doit().await;
3564/// # }
3565/// ```
3566pub struct ProjectInstanceAppProfileDeleteCall<'a, S>
3567 where S: 'a {
3568
3569 hub: &'a BigtableAdmin<S>,
3570 _name: String,
3571 _ignore_warnings: Option<bool>,
3572 _delegate: Option<&'a mut dyn client::Delegate>,
3573 _additional_params: HashMap<String, String>,
3574 _scopes: BTreeSet<String>
3575}
3576
3577impl<'a, S> client::CallBuilder for ProjectInstanceAppProfileDeleteCall<'a, S> {}
3578
3579impl<'a, S> ProjectInstanceAppProfileDeleteCall<'a, S>
3580where
3581 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
3582 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
3583 S::Future: Send + Unpin + 'static,
3584 S::Error: Into<Box<dyn StdError + Send + Sync>>,
3585{
3586
3587
3588 /// Perform the operation you have build so far.
3589 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
3590 use std::io::{Read, Seek};
3591 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
3592 use client::{ToParts, url::Params};
3593 use std::borrow::Cow;
3594
3595 let mut dd = client::DefaultDelegate;
3596 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
3597 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.appProfiles.delete",
3598 http_method: hyper::Method::DELETE });
3599
3600 for &field in ["alt", "name", "ignoreWarnings"].iter() {
3601 if self._additional_params.contains_key(field) {
3602 dlg.finished(false);
3603 return Err(client::Error::FieldClash(field));
3604 }
3605 }
3606
3607 let mut params = Params::with_capacity(4 + self._additional_params.len());
3608 params.push("name", self._name);
3609 if let Some(value) = self._ignore_warnings.as_ref() {
3610 params.push("ignoreWarnings", value.to_string());
3611 }
3612
3613 params.extend(self._additional_params.iter());
3614
3615 params.push("alt", "json");
3616 let mut url = self.hub._base_url.clone() + "v2/{+name}";
3617 if self._scopes.is_empty() {
3618 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
3619 }
3620
3621 for &(find_this, param_name) in [("{+name}", "name")].iter() {
3622 url = params.uri_replacement(url, param_name, find_this, true);
3623 }
3624 {
3625 let to_remove = ["name"];
3626 params.remove_params(&to_remove);
3627 }
3628
3629 let url = params.parse_with_url(&url);
3630
3631
3632
3633 loop {
3634 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
3635 Ok(token) => token,
3636 Err(e) => {
3637 match dlg.token(e) {
3638 Ok(token) => token,
3639 Err(e) => {
3640 dlg.finished(false);
3641 return Err(client::Error::MissingToken(e));
3642 }
3643 }
3644 }
3645 };
3646 let mut req_result = {
3647 let client = &self.hub.client;
3648 dlg.pre_request();
3649 let mut req_builder = hyper::Request::builder()
3650 .method(hyper::Method::DELETE)
3651 .uri(url.as_str())
3652 .header(USER_AGENT, self.hub._user_agent.clone());
3653
3654 if let Some(token) = token.as_ref() {
3655 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3656 }
3657
3658
3659 let request = req_builder
3660 .body(hyper::body::Body::empty());
3661
3662 client.request(request.unwrap()).await
3663
3664 };
3665
3666 match req_result {
3667 Err(err) => {
3668 if let client::Retry::After(d) = dlg.http_error(&err) {
3669 sleep(d).await;
3670 continue;
3671 }
3672 dlg.finished(false);
3673 return Err(client::Error::HttpError(err))
3674 }
3675 Ok(mut res) => {
3676 if !res.status().is_success() {
3677 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3678 let (parts, _) = res.into_parts();
3679 let body = hyper::Body::from(res_body_string.clone());
3680 let restored_response = hyper::Response::from_parts(parts, body);
3681
3682 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
3683
3684 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
3685 sleep(d).await;
3686 continue;
3687 }
3688
3689 dlg.finished(false);
3690
3691 return match server_response {
3692 Some(error_value) => Err(client::Error::BadRequest(error_value)),
3693 None => Err(client::Error::Failure(restored_response)),
3694 }
3695 }
3696 let result_value = {
3697 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3698
3699 match json::from_str(&res_body_string) {
3700 Ok(decoded) => (res, decoded),
3701 Err(err) => {
3702 dlg.response_json_decode_error(&res_body_string, &err);
3703 return Err(client::Error::JsonDecodeError(res_body_string, err));
3704 }
3705 }
3706 };
3707
3708 dlg.finished(true);
3709 return Ok(result_value)
3710 }
3711 }
3712 }
3713 }
3714
3715
3716 /// Required. The unique name of the app profile to be deleted. Values are of the form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
3717 ///
3718 /// Sets the *name* path property to the given value.
3719 ///
3720 /// Even though the property as already been set when instantiating this call,
3721 /// we provide this method for API completeness.
3722 pub fn name(mut self, new_value: &str) -> ProjectInstanceAppProfileDeleteCall<'a, S> {
3723 self._name = new_value.to_string();
3724 self
3725 }
3726 /// Required. If true, ignore safety checks when deleting the app profile.
3727 ///
3728 /// Sets the *ignore warnings* query property to the given value.
3729 pub fn ignore_warnings(mut self, new_value: bool) -> ProjectInstanceAppProfileDeleteCall<'a, S> {
3730 self._ignore_warnings = Some(new_value);
3731 self
3732 }
3733 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3734 /// while executing the actual API request.
3735 ///
3736 /// ````text
3737 /// It should be used to handle progress information, and to implement a certain level of resilience.
3738 /// ````
3739 ///
3740 /// Sets the *delegate* property to the given value.
3741 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceAppProfileDeleteCall<'a, S> {
3742 self._delegate = Some(new_value);
3743 self
3744 }
3745
3746 /// Set any additional parameter of the query string used in the request.
3747 /// It should be used to set parameters which are not yet available through their own
3748 /// setters.
3749 ///
3750 /// Please note that this method must not be used to set any of the known parameters
3751 /// which have their own setter method. If done anyway, the request will fail.
3752 ///
3753 /// # Additional Parameters
3754 ///
3755 /// * *$.xgafv* (query-string) - V1 error format.
3756 /// * *access_token* (query-string) - OAuth access token.
3757 /// * *alt* (query-string) - Data format for response.
3758 /// * *callback* (query-string) - JSONP
3759 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3760 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3761 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3762 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3763 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3764 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3765 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3766 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceAppProfileDeleteCall<'a, S>
3767 where T: AsRef<str> {
3768 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
3769 self
3770 }
3771
3772 /// Identifies the authorization scope for the method you are building.
3773 ///
3774 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3775 /// [`Scope::BigtableAdmin`].
3776 ///
3777 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3778 /// tokens for more than one scope.
3779 ///
3780 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3781 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3782 /// sufficient, a read-write scope will do as well.
3783 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceAppProfileDeleteCall<'a, S>
3784 where St: AsRef<str> {
3785 self._scopes.insert(String::from(scope.as_ref()));
3786 self
3787 }
3788 /// Identifies the authorization scope(s) for the method you are building.
3789 ///
3790 /// See [`Self::add_scope()`] for details.
3791 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceAppProfileDeleteCall<'a, S>
3792 where I: IntoIterator<Item = St>,
3793 St: AsRef<str> {
3794 self._scopes
3795 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3796 self
3797 }
3798
3799 /// Removes all scopes, and no default scope will be used either.
3800 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3801 /// for details).
3802 pub fn clear_scopes(mut self) -> ProjectInstanceAppProfileDeleteCall<'a, S> {
3803 self._scopes.clear();
3804 self
3805 }
3806}
3807
3808
3809/// Gets information about an app profile.
3810///
3811/// A builder for the *instances.appProfiles.get* method supported by a *project* resource.
3812/// It is not used directly, but through a [`ProjectMethods`] instance.
3813///
3814/// # Example
3815///
3816/// Instantiate a resource method builder
3817///
3818/// ```test_harness,no_run
3819/// # extern crate hyper;
3820/// # extern crate hyper_rustls;
3821/// # extern crate google_bigtableadmin2 as bigtableadmin2;
3822/// # async fn dox() {
3823/// # use std::default::Default;
3824/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
3825///
3826/// # let secret: oauth2::ApplicationSecret = Default::default();
3827/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
3828/// # secret,
3829/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3830/// # ).build().await.unwrap();
3831/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
3832/// // You can configure optional parameters by calling the respective setters at will, and
3833/// // execute the final call using `doit()`.
3834/// // Values shown here are possibly random and not representative !
3835/// let result = hub.projects().instances_app_profiles_get("name")
3836/// .doit().await;
3837/// # }
3838/// ```
3839pub struct ProjectInstanceAppProfileGetCall<'a, S>
3840 where S: 'a {
3841
3842 hub: &'a BigtableAdmin<S>,
3843 _name: String,
3844 _delegate: Option<&'a mut dyn client::Delegate>,
3845 _additional_params: HashMap<String, String>,
3846 _scopes: BTreeSet<String>
3847}
3848
3849impl<'a, S> client::CallBuilder for ProjectInstanceAppProfileGetCall<'a, S> {}
3850
3851impl<'a, S> ProjectInstanceAppProfileGetCall<'a, S>
3852where
3853 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
3854 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
3855 S::Future: Send + Unpin + 'static,
3856 S::Error: Into<Box<dyn StdError + Send + Sync>>,
3857{
3858
3859
3860 /// Perform the operation you have build so far.
3861 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, AppProfile)> {
3862 use std::io::{Read, Seek};
3863 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
3864 use client::{ToParts, url::Params};
3865 use std::borrow::Cow;
3866
3867 let mut dd = client::DefaultDelegate;
3868 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
3869 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.appProfiles.get",
3870 http_method: hyper::Method::GET });
3871
3872 for &field in ["alt", "name"].iter() {
3873 if self._additional_params.contains_key(field) {
3874 dlg.finished(false);
3875 return Err(client::Error::FieldClash(field));
3876 }
3877 }
3878
3879 let mut params = Params::with_capacity(3 + self._additional_params.len());
3880 params.push("name", self._name);
3881
3882 params.extend(self._additional_params.iter());
3883
3884 params.push("alt", "json");
3885 let mut url = self.hub._base_url.clone() + "v2/{+name}";
3886 if self._scopes.is_empty() {
3887 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
3888 }
3889
3890 for &(find_this, param_name) in [("{+name}", "name")].iter() {
3891 url = params.uri_replacement(url, param_name, find_this, true);
3892 }
3893 {
3894 let to_remove = ["name"];
3895 params.remove_params(&to_remove);
3896 }
3897
3898 let url = params.parse_with_url(&url);
3899
3900
3901
3902 loop {
3903 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
3904 Ok(token) => token,
3905 Err(e) => {
3906 match dlg.token(e) {
3907 Ok(token) => token,
3908 Err(e) => {
3909 dlg.finished(false);
3910 return Err(client::Error::MissingToken(e));
3911 }
3912 }
3913 }
3914 };
3915 let mut req_result = {
3916 let client = &self.hub.client;
3917 dlg.pre_request();
3918 let mut req_builder = hyper::Request::builder()
3919 .method(hyper::Method::GET)
3920 .uri(url.as_str())
3921 .header(USER_AGENT, self.hub._user_agent.clone());
3922
3923 if let Some(token) = token.as_ref() {
3924 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3925 }
3926
3927
3928 let request = req_builder
3929 .body(hyper::body::Body::empty());
3930
3931 client.request(request.unwrap()).await
3932
3933 };
3934
3935 match req_result {
3936 Err(err) => {
3937 if let client::Retry::After(d) = dlg.http_error(&err) {
3938 sleep(d).await;
3939 continue;
3940 }
3941 dlg.finished(false);
3942 return Err(client::Error::HttpError(err))
3943 }
3944 Ok(mut res) => {
3945 if !res.status().is_success() {
3946 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3947 let (parts, _) = res.into_parts();
3948 let body = hyper::Body::from(res_body_string.clone());
3949 let restored_response = hyper::Response::from_parts(parts, body);
3950
3951 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
3952
3953 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
3954 sleep(d).await;
3955 continue;
3956 }
3957
3958 dlg.finished(false);
3959
3960 return match server_response {
3961 Some(error_value) => Err(client::Error::BadRequest(error_value)),
3962 None => Err(client::Error::Failure(restored_response)),
3963 }
3964 }
3965 let result_value = {
3966 let res_body_string = client::get_body_as_string(res.body_mut()).await;
3967
3968 match json::from_str(&res_body_string) {
3969 Ok(decoded) => (res, decoded),
3970 Err(err) => {
3971 dlg.response_json_decode_error(&res_body_string, &err);
3972 return Err(client::Error::JsonDecodeError(res_body_string, err));
3973 }
3974 }
3975 };
3976
3977 dlg.finished(true);
3978 return Ok(result_value)
3979 }
3980 }
3981 }
3982 }
3983
3984
3985 /// Required. The unique name of the requested app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
3986 ///
3987 /// Sets the *name* path property to the given value.
3988 ///
3989 /// Even though the property as already been set when instantiating this call,
3990 /// we provide this method for API completeness.
3991 pub fn name(mut self, new_value: &str) -> ProjectInstanceAppProfileGetCall<'a, S> {
3992 self._name = new_value.to_string();
3993 self
3994 }
3995 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3996 /// while executing the actual API request.
3997 ///
3998 /// ````text
3999 /// It should be used to handle progress information, and to implement a certain level of resilience.
4000 /// ````
4001 ///
4002 /// Sets the *delegate* property to the given value.
4003 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceAppProfileGetCall<'a, S> {
4004 self._delegate = Some(new_value);
4005 self
4006 }
4007
4008 /// Set any additional parameter of the query string used in the request.
4009 /// It should be used to set parameters which are not yet available through their own
4010 /// setters.
4011 ///
4012 /// Please note that this method must not be used to set any of the known parameters
4013 /// which have their own setter method. If done anyway, the request will fail.
4014 ///
4015 /// # Additional Parameters
4016 ///
4017 /// * *$.xgafv* (query-string) - V1 error format.
4018 /// * *access_token* (query-string) - OAuth access token.
4019 /// * *alt* (query-string) - Data format for response.
4020 /// * *callback* (query-string) - JSONP
4021 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4022 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4023 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4024 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4025 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4026 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4027 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4028 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceAppProfileGetCall<'a, S>
4029 where T: AsRef<str> {
4030 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
4031 self
4032 }
4033
4034 /// Identifies the authorization scope for the method you are building.
4035 ///
4036 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4037 /// [`Scope::BigtableAdmin`].
4038 ///
4039 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4040 /// tokens for more than one scope.
4041 ///
4042 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4043 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4044 /// sufficient, a read-write scope will do as well.
4045 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceAppProfileGetCall<'a, S>
4046 where St: AsRef<str> {
4047 self._scopes.insert(String::from(scope.as_ref()));
4048 self
4049 }
4050 /// Identifies the authorization scope(s) for the method you are building.
4051 ///
4052 /// See [`Self::add_scope()`] for details.
4053 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceAppProfileGetCall<'a, S>
4054 where I: IntoIterator<Item = St>,
4055 St: AsRef<str> {
4056 self._scopes
4057 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4058 self
4059 }
4060
4061 /// Removes all scopes, and no default scope will be used either.
4062 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4063 /// for details).
4064 pub fn clear_scopes(mut self) -> ProjectInstanceAppProfileGetCall<'a, S> {
4065 self._scopes.clear();
4066 self
4067 }
4068}
4069
4070
4071/// Lists information about app profiles in an instance.
4072///
4073/// A builder for the *instances.appProfiles.list* method supported by a *project* resource.
4074/// It is not used directly, but through a [`ProjectMethods`] instance.
4075///
4076/// # Example
4077///
4078/// Instantiate a resource method builder
4079///
4080/// ```test_harness,no_run
4081/// # extern crate hyper;
4082/// # extern crate hyper_rustls;
4083/// # extern crate google_bigtableadmin2 as bigtableadmin2;
4084/// # async fn dox() {
4085/// # use std::default::Default;
4086/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
4087///
4088/// # let secret: oauth2::ApplicationSecret = Default::default();
4089/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
4090/// # secret,
4091/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4092/// # ).build().await.unwrap();
4093/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
4094/// // You can configure optional parameters by calling the respective setters at will, and
4095/// // execute the final call using `doit()`.
4096/// // Values shown here are possibly random and not representative !
4097/// let result = hub.projects().instances_app_profiles_list("parent")
4098/// .page_token("gubergren")
4099/// .page_size(-16)
4100/// .doit().await;
4101/// # }
4102/// ```
4103pub struct ProjectInstanceAppProfileListCall<'a, S>
4104 where S: 'a {
4105
4106 hub: &'a BigtableAdmin<S>,
4107 _parent: String,
4108 _page_token: Option<String>,
4109 _page_size: Option<i32>,
4110 _delegate: Option<&'a mut dyn client::Delegate>,
4111 _additional_params: HashMap<String, String>,
4112 _scopes: BTreeSet<String>
4113}
4114
4115impl<'a, S> client::CallBuilder for ProjectInstanceAppProfileListCall<'a, S> {}
4116
4117impl<'a, S> ProjectInstanceAppProfileListCall<'a, S>
4118where
4119 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
4120 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
4121 S::Future: Send + Unpin + 'static,
4122 S::Error: Into<Box<dyn StdError + Send + Sync>>,
4123{
4124
4125
4126 /// Perform the operation you have build so far.
4127 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListAppProfilesResponse)> {
4128 use std::io::{Read, Seek};
4129 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
4130 use client::{ToParts, url::Params};
4131 use std::borrow::Cow;
4132
4133 let mut dd = client::DefaultDelegate;
4134 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
4135 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.appProfiles.list",
4136 http_method: hyper::Method::GET });
4137
4138 for &field in ["alt", "parent", "pageToken", "pageSize"].iter() {
4139 if self._additional_params.contains_key(field) {
4140 dlg.finished(false);
4141 return Err(client::Error::FieldClash(field));
4142 }
4143 }
4144
4145 let mut params = Params::with_capacity(5 + self._additional_params.len());
4146 params.push("parent", self._parent);
4147 if let Some(value) = self._page_token.as_ref() {
4148 params.push("pageToken", value);
4149 }
4150 if let Some(value) = self._page_size.as_ref() {
4151 params.push("pageSize", value.to_string());
4152 }
4153
4154 params.extend(self._additional_params.iter());
4155
4156 params.push("alt", "json");
4157 let mut url = self.hub._base_url.clone() + "v2/{+parent}/appProfiles";
4158 if self._scopes.is_empty() {
4159 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
4160 }
4161
4162 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
4163 url = params.uri_replacement(url, param_name, find_this, true);
4164 }
4165 {
4166 let to_remove = ["parent"];
4167 params.remove_params(&to_remove);
4168 }
4169
4170 let url = params.parse_with_url(&url);
4171
4172
4173
4174 loop {
4175 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
4176 Ok(token) => token,
4177 Err(e) => {
4178 match dlg.token(e) {
4179 Ok(token) => token,
4180 Err(e) => {
4181 dlg.finished(false);
4182 return Err(client::Error::MissingToken(e));
4183 }
4184 }
4185 }
4186 };
4187 let mut req_result = {
4188 let client = &self.hub.client;
4189 dlg.pre_request();
4190 let mut req_builder = hyper::Request::builder()
4191 .method(hyper::Method::GET)
4192 .uri(url.as_str())
4193 .header(USER_AGENT, self.hub._user_agent.clone());
4194
4195 if let Some(token) = token.as_ref() {
4196 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4197 }
4198
4199
4200 let request = req_builder
4201 .body(hyper::body::Body::empty());
4202
4203 client.request(request.unwrap()).await
4204
4205 };
4206
4207 match req_result {
4208 Err(err) => {
4209 if let client::Retry::After(d) = dlg.http_error(&err) {
4210 sleep(d).await;
4211 continue;
4212 }
4213 dlg.finished(false);
4214 return Err(client::Error::HttpError(err))
4215 }
4216 Ok(mut res) => {
4217 if !res.status().is_success() {
4218 let res_body_string = client::get_body_as_string(res.body_mut()).await;
4219 let (parts, _) = res.into_parts();
4220 let body = hyper::Body::from(res_body_string.clone());
4221 let restored_response = hyper::Response::from_parts(parts, body);
4222
4223 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
4224
4225 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
4226 sleep(d).await;
4227 continue;
4228 }
4229
4230 dlg.finished(false);
4231
4232 return match server_response {
4233 Some(error_value) => Err(client::Error::BadRequest(error_value)),
4234 None => Err(client::Error::Failure(restored_response)),
4235 }
4236 }
4237 let result_value = {
4238 let res_body_string = client::get_body_as_string(res.body_mut()).await;
4239
4240 match json::from_str(&res_body_string) {
4241 Ok(decoded) => (res, decoded),
4242 Err(err) => {
4243 dlg.response_json_decode_error(&res_body_string, &err);
4244 return Err(client::Error::JsonDecodeError(res_body_string, err));
4245 }
4246 }
4247 };
4248
4249 dlg.finished(true);
4250 return Ok(result_value)
4251 }
4252 }
4253 }
4254 }
4255
4256
4257 /// Required. The unique name of the instance for which a list of app profiles is requested. Values are of the form `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list AppProfiles for all Instances in a project, e.g., `projects/myproject/instances/-`.
4258 ///
4259 /// Sets the *parent* path property to the given value.
4260 ///
4261 /// Even though the property as already been set when instantiating this call,
4262 /// we provide this method for API completeness.
4263 pub fn parent(mut self, new_value: &str) -> ProjectInstanceAppProfileListCall<'a, S> {
4264 self._parent = new_value.to_string();
4265 self
4266 }
4267 /// The value of `next_page_token` returned by a previous call.
4268 ///
4269 /// Sets the *page token* query property to the given value.
4270 pub fn page_token(mut self, new_value: &str) -> ProjectInstanceAppProfileListCall<'a, S> {
4271 self._page_token = Some(new_value.to_string());
4272 self
4273 }
4274 /// Maximum number of results per page. 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.
4275 ///
4276 /// Sets the *page size* query property to the given value.
4277 pub fn page_size(mut self, new_value: i32) -> ProjectInstanceAppProfileListCall<'a, S> {
4278 self._page_size = Some(new_value);
4279 self
4280 }
4281 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4282 /// while executing the actual API request.
4283 ///
4284 /// ````text
4285 /// It should be used to handle progress information, and to implement a certain level of resilience.
4286 /// ````
4287 ///
4288 /// Sets the *delegate* property to the given value.
4289 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceAppProfileListCall<'a, S> {
4290 self._delegate = Some(new_value);
4291 self
4292 }
4293
4294 /// Set any additional parameter of the query string used in the request.
4295 /// It should be used to set parameters which are not yet available through their own
4296 /// setters.
4297 ///
4298 /// Please note that this method must not be used to set any of the known parameters
4299 /// which have their own setter method. If done anyway, the request will fail.
4300 ///
4301 /// # Additional Parameters
4302 ///
4303 /// * *$.xgafv* (query-string) - V1 error format.
4304 /// * *access_token* (query-string) - OAuth access token.
4305 /// * *alt* (query-string) - Data format for response.
4306 /// * *callback* (query-string) - JSONP
4307 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4308 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4309 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4310 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4311 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4312 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4313 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4314 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceAppProfileListCall<'a, S>
4315 where T: AsRef<str> {
4316 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
4317 self
4318 }
4319
4320 /// Identifies the authorization scope for the method you are building.
4321 ///
4322 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4323 /// [`Scope::BigtableAdmin`].
4324 ///
4325 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4326 /// tokens for more than one scope.
4327 ///
4328 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4329 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4330 /// sufficient, a read-write scope will do as well.
4331 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceAppProfileListCall<'a, S>
4332 where St: AsRef<str> {
4333 self._scopes.insert(String::from(scope.as_ref()));
4334 self
4335 }
4336 /// Identifies the authorization scope(s) for the method you are building.
4337 ///
4338 /// See [`Self::add_scope()`] for details.
4339 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceAppProfileListCall<'a, S>
4340 where I: IntoIterator<Item = St>,
4341 St: AsRef<str> {
4342 self._scopes
4343 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4344 self
4345 }
4346
4347 /// Removes all scopes, and no default scope will be used either.
4348 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4349 /// for details).
4350 pub fn clear_scopes(mut self) -> ProjectInstanceAppProfileListCall<'a, S> {
4351 self._scopes.clear();
4352 self
4353 }
4354}
4355
4356
4357/// Updates an app profile within an instance.
4358///
4359/// A builder for the *instances.appProfiles.patch* method supported by a *project* resource.
4360/// It is not used directly, but through a [`ProjectMethods`] instance.
4361///
4362/// # Example
4363///
4364/// Instantiate a resource method builder
4365///
4366/// ```test_harness,no_run
4367/// # extern crate hyper;
4368/// # extern crate hyper_rustls;
4369/// # extern crate google_bigtableadmin2 as bigtableadmin2;
4370/// use bigtableadmin2::api::AppProfile;
4371/// # async fn dox() {
4372/// # use std::default::Default;
4373/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
4374///
4375/// # let secret: oauth2::ApplicationSecret = Default::default();
4376/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
4377/// # secret,
4378/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4379/// # ).build().await.unwrap();
4380/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
4381/// // As the method needs a request, you would usually fill it with the desired information
4382/// // into the respective structure. Some of the parts shown here might not be applicable !
4383/// // Values shown here are possibly random and not representative !
4384/// let mut req = AppProfile::default();
4385///
4386/// // You can configure optional parameters by calling the respective setters at will, and
4387/// // execute the final call using `doit()`.
4388/// // Values shown here are possibly random and not representative !
4389/// let result = hub.projects().instances_app_profiles_patch(req, "name")
4390/// .update_mask(&Default::default())
4391/// .ignore_warnings(true)
4392/// .doit().await;
4393/// # }
4394/// ```
4395pub struct ProjectInstanceAppProfilePatchCall<'a, S>
4396 where S: 'a {
4397
4398 hub: &'a BigtableAdmin<S>,
4399 _request: AppProfile,
4400 _name: String,
4401 _update_mask: Option<client::FieldMask>,
4402 _ignore_warnings: Option<bool>,
4403 _delegate: Option<&'a mut dyn client::Delegate>,
4404 _additional_params: HashMap<String, String>,
4405 _scopes: BTreeSet<String>
4406}
4407
4408impl<'a, S> client::CallBuilder for ProjectInstanceAppProfilePatchCall<'a, S> {}
4409
4410impl<'a, S> ProjectInstanceAppProfilePatchCall<'a, S>
4411where
4412 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
4413 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
4414 S::Future: Send + Unpin + 'static,
4415 S::Error: Into<Box<dyn StdError + Send + Sync>>,
4416{
4417
4418
4419 /// Perform the operation you have build so far.
4420 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
4421 use std::io::{Read, Seek};
4422 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
4423 use client::{ToParts, url::Params};
4424 use std::borrow::Cow;
4425
4426 let mut dd = client::DefaultDelegate;
4427 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
4428 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.appProfiles.patch",
4429 http_method: hyper::Method::PATCH });
4430
4431 for &field in ["alt", "name", "updateMask", "ignoreWarnings"].iter() {
4432 if self._additional_params.contains_key(field) {
4433 dlg.finished(false);
4434 return Err(client::Error::FieldClash(field));
4435 }
4436 }
4437
4438 let mut params = Params::with_capacity(6 + self._additional_params.len());
4439 params.push("name", self._name);
4440 if let Some(value) = self._update_mask.as_ref() {
4441 params.push("updateMask", value.to_string());
4442 }
4443 if let Some(value) = self._ignore_warnings.as_ref() {
4444 params.push("ignoreWarnings", value.to_string());
4445 }
4446
4447 params.extend(self._additional_params.iter());
4448
4449 params.push("alt", "json");
4450 let mut url = self.hub._base_url.clone() + "v2/{+name}";
4451 if self._scopes.is_empty() {
4452 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
4453 }
4454
4455 for &(find_this, param_name) in [("{+name}", "name")].iter() {
4456 url = params.uri_replacement(url, param_name, find_this, true);
4457 }
4458 {
4459 let to_remove = ["name"];
4460 params.remove_params(&to_remove);
4461 }
4462
4463 let url = params.parse_with_url(&url);
4464
4465 let mut json_mime_type = mime::APPLICATION_JSON;
4466 let mut request_value_reader =
4467 {
4468 let mut value = json::value::to_value(&self._request).expect("serde to work");
4469 client::remove_json_null_values(&mut value);
4470 let mut dst = io::Cursor::new(Vec::with_capacity(128));
4471 json::to_writer(&mut dst, &value).unwrap();
4472 dst
4473 };
4474 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
4475 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
4476
4477
4478 loop {
4479 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
4480 Ok(token) => token,
4481 Err(e) => {
4482 match dlg.token(e) {
4483 Ok(token) => token,
4484 Err(e) => {
4485 dlg.finished(false);
4486 return Err(client::Error::MissingToken(e));
4487 }
4488 }
4489 }
4490 };
4491 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
4492 let mut req_result = {
4493 let client = &self.hub.client;
4494 dlg.pre_request();
4495 let mut req_builder = hyper::Request::builder()
4496 .method(hyper::Method::PATCH)
4497 .uri(url.as_str())
4498 .header(USER_AGENT, self.hub._user_agent.clone());
4499
4500 if let Some(token) = token.as_ref() {
4501 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4502 }
4503
4504
4505 let request = req_builder
4506 .header(CONTENT_TYPE, json_mime_type.to_string())
4507 .header(CONTENT_LENGTH, request_size as u64)
4508 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
4509
4510 client.request(request.unwrap()).await
4511
4512 };
4513
4514 match req_result {
4515 Err(err) => {
4516 if let client::Retry::After(d) = dlg.http_error(&err) {
4517 sleep(d).await;
4518 continue;
4519 }
4520 dlg.finished(false);
4521 return Err(client::Error::HttpError(err))
4522 }
4523 Ok(mut res) => {
4524 if !res.status().is_success() {
4525 let res_body_string = client::get_body_as_string(res.body_mut()).await;
4526 let (parts, _) = res.into_parts();
4527 let body = hyper::Body::from(res_body_string.clone());
4528 let restored_response = hyper::Response::from_parts(parts, body);
4529
4530 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
4531
4532 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
4533 sleep(d).await;
4534 continue;
4535 }
4536
4537 dlg.finished(false);
4538
4539 return match server_response {
4540 Some(error_value) => Err(client::Error::BadRequest(error_value)),
4541 None => Err(client::Error::Failure(restored_response)),
4542 }
4543 }
4544 let result_value = {
4545 let res_body_string = client::get_body_as_string(res.body_mut()).await;
4546
4547 match json::from_str(&res_body_string) {
4548 Ok(decoded) => (res, decoded),
4549 Err(err) => {
4550 dlg.response_json_decode_error(&res_body_string, &err);
4551 return Err(client::Error::JsonDecodeError(res_body_string, err));
4552 }
4553 }
4554 };
4555
4556 dlg.finished(true);
4557 return Ok(result_value)
4558 }
4559 }
4560 }
4561 }
4562
4563
4564 ///
4565 /// Sets the *request* property to the given value.
4566 ///
4567 /// Even though the property as already been set when instantiating this call,
4568 /// we provide this method for API completeness.
4569 pub fn request(mut self, new_value: AppProfile) -> ProjectInstanceAppProfilePatchCall<'a, S> {
4570 self._request = new_value;
4571 self
4572 }
4573 /// The unique name of the app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/_a-zA-Z0-9*`.
4574 ///
4575 /// Sets the *name* path property to the given value.
4576 ///
4577 /// Even though the property as already been set when instantiating this call,
4578 /// we provide this method for API completeness.
4579 pub fn name(mut self, new_value: &str) -> ProjectInstanceAppProfilePatchCall<'a, S> {
4580 self._name = new_value.to_string();
4581 self
4582 }
4583 /// Required. The subset of app profile fields which should be replaced. If unset, all fields will be replaced.
4584 ///
4585 /// Sets the *update mask* query property to the given value.
4586 pub fn update_mask(mut self, new_value: client::FieldMask) -> ProjectInstanceAppProfilePatchCall<'a, S> {
4587 self._update_mask = Some(new_value);
4588 self
4589 }
4590 /// If true, ignore safety checks when updating the app profile.
4591 ///
4592 /// Sets the *ignore warnings* query property to the given value.
4593 pub fn ignore_warnings(mut self, new_value: bool) -> ProjectInstanceAppProfilePatchCall<'a, S> {
4594 self._ignore_warnings = Some(new_value);
4595 self
4596 }
4597 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4598 /// while executing the actual API request.
4599 ///
4600 /// ````text
4601 /// It should be used to handle progress information, and to implement a certain level of resilience.
4602 /// ````
4603 ///
4604 /// Sets the *delegate* property to the given value.
4605 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceAppProfilePatchCall<'a, S> {
4606 self._delegate = Some(new_value);
4607 self
4608 }
4609
4610 /// Set any additional parameter of the query string used in the request.
4611 /// It should be used to set parameters which are not yet available through their own
4612 /// setters.
4613 ///
4614 /// Please note that this method must not be used to set any of the known parameters
4615 /// which have their own setter method. If done anyway, the request will fail.
4616 ///
4617 /// # Additional Parameters
4618 ///
4619 /// * *$.xgafv* (query-string) - V1 error format.
4620 /// * *access_token* (query-string) - OAuth access token.
4621 /// * *alt* (query-string) - Data format for response.
4622 /// * *callback* (query-string) - JSONP
4623 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4624 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4625 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4626 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4627 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4628 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4629 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4630 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceAppProfilePatchCall<'a, S>
4631 where T: AsRef<str> {
4632 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
4633 self
4634 }
4635
4636 /// Identifies the authorization scope for the method you are building.
4637 ///
4638 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4639 /// [`Scope::BigtableAdmin`].
4640 ///
4641 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4642 /// tokens for more than one scope.
4643 ///
4644 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4645 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4646 /// sufficient, a read-write scope will do as well.
4647 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceAppProfilePatchCall<'a, S>
4648 where St: AsRef<str> {
4649 self._scopes.insert(String::from(scope.as_ref()));
4650 self
4651 }
4652 /// Identifies the authorization scope(s) for the method you are building.
4653 ///
4654 /// See [`Self::add_scope()`] for details.
4655 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceAppProfilePatchCall<'a, S>
4656 where I: IntoIterator<Item = St>,
4657 St: AsRef<str> {
4658 self._scopes
4659 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4660 self
4661 }
4662
4663 /// Removes all scopes, and no default scope will be used either.
4664 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4665 /// for details).
4666 pub fn clear_scopes(mut self) -> ProjectInstanceAppProfilePatchCall<'a, S> {
4667 self._scopes.clear();
4668 self
4669 }
4670}
4671
4672
4673/// Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the destination instance and project.
4674///
4675/// A builder for the *instances.clusters.backups.copy* method supported by a *project* resource.
4676/// It is not used directly, but through a [`ProjectMethods`] instance.
4677///
4678/// # Example
4679///
4680/// Instantiate a resource method builder
4681///
4682/// ```test_harness,no_run
4683/// # extern crate hyper;
4684/// # extern crate hyper_rustls;
4685/// # extern crate google_bigtableadmin2 as bigtableadmin2;
4686/// use bigtableadmin2::api::CopyBackupRequest;
4687/// # async fn dox() {
4688/// # use std::default::Default;
4689/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
4690///
4691/// # let secret: oauth2::ApplicationSecret = Default::default();
4692/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
4693/// # secret,
4694/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4695/// # ).build().await.unwrap();
4696/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
4697/// // As the method needs a request, you would usually fill it with the desired information
4698/// // into the respective structure. Some of the parts shown here might not be applicable !
4699/// // Values shown here are possibly random and not representative !
4700/// let mut req = CopyBackupRequest::default();
4701///
4702/// // You can configure optional parameters by calling the respective setters at will, and
4703/// // execute the final call using `doit()`.
4704/// // Values shown here are possibly random and not representative !
4705/// let result = hub.projects().instances_clusters_backups_copy(req, "parent")
4706/// .doit().await;
4707/// # }
4708/// ```
4709pub struct ProjectInstanceClusterBackupCopyCall<'a, S>
4710 where S: 'a {
4711
4712 hub: &'a BigtableAdmin<S>,
4713 _request: CopyBackupRequest,
4714 _parent: String,
4715 _delegate: Option<&'a mut dyn client::Delegate>,
4716 _additional_params: HashMap<String, String>,
4717 _scopes: BTreeSet<String>
4718}
4719
4720impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupCopyCall<'a, S> {}
4721
4722impl<'a, S> ProjectInstanceClusterBackupCopyCall<'a, S>
4723where
4724 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
4725 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
4726 S::Future: Send + Unpin + 'static,
4727 S::Error: Into<Box<dyn StdError + Send + Sync>>,
4728{
4729
4730
4731 /// Perform the operation you have build so far.
4732 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
4733 use std::io::{Read, Seek};
4734 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
4735 use client::{ToParts, url::Params};
4736 use std::borrow::Cow;
4737
4738 let mut dd = client::DefaultDelegate;
4739 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
4740 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.copy",
4741 http_method: hyper::Method::POST });
4742
4743 for &field in ["alt", "parent"].iter() {
4744 if self._additional_params.contains_key(field) {
4745 dlg.finished(false);
4746 return Err(client::Error::FieldClash(field));
4747 }
4748 }
4749
4750 let mut params = Params::with_capacity(4 + self._additional_params.len());
4751 params.push("parent", self._parent);
4752
4753 params.extend(self._additional_params.iter());
4754
4755 params.push("alt", "json");
4756 let mut url = self.hub._base_url.clone() + "v2/{+parent}/backups:copy";
4757 if self._scopes.is_empty() {
4758 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
4759 }
4760
4761 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
4762 url = params.uri_replacement(url, param_name, find_this, true);
4763 }
4764 {
4765 let to_remove = ["parent"];
4766 params.remove_params(&to_remove);
4767 }
4768
4769 let url = params.parse_with_url(&url);
4770
4771 let mut json_mime_type = mime::APPLICATION_JSON;
4772 let mut request_value_reader =
4773 {
4774 let mut value = json::value::to_value(&self._request).expect("serde to work");
4775 client::remove_json_null_values(&mut value);
4776 let mut dst = io::Cursor::new(Vec::with_capacity(128));
4777 json::to_writer(&mut dst, &value).unwrap();
4778 dst
4779 };
4780 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
4781 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
4782
4783
4784 loop {
4785 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
4786 Ok(token) => token,
4787 Err(e) => {
4788 match dlg.token(e) {
4789 Ok(token) => token,
4790 Err(e) => {
4791 dlg.finished(false);
4792 return Err(client::Error::MissingToken(e));
4793 }
4794 }
4795 }
4796 };
4797 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
4798 let mut req_result = {
4799 let client = &self.hub.client;
4800 dlg.pre_request();
4801 let mut req_builder = hyper::Request::builder()
4802 .method(hyper::Method::POST)
4803 .uri(url.as_str())
4804 .header(USER_AGENT, self.hub._user_agent.clone());
4805
4806 if let Some(token) = token.as_ref() {
4807 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4808 }
4809
4810
4811 let request = req_builder
4812 .header(CONTENT_TYPE, json_mime_type.to_string())
4813 .header(CONTENT_LENGTH, request_size as u64)
4814 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
4815
4816 client.request(request.unwrap()).await
4817
4818 };
4819
4820 match req_result {
4821 Err(err) => {
4822 if let client::Retry::After(d) = dlg.http_error(&err) {
4823 sleep(d).await;
4824 continue;
4825 }
4826 dlg.finished(false);
4827 return Err(client::Error::HttpError(err))
4828 }
4829 Ok(mut res) => {
4830 if !res.status().is_success() {
4831 let res_body_string = client::get_body_as_string(res.body_mut()).await;
4832 let (parts, _) = res.into_parts();
4833 let body = hyper::Body::from(res_body_string.clone());
4834 let restored_response = hyper::Response::from_parts(parts, body);
4835
4836 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
4837
4838 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
4839 sleep(d).await;
4840 continue;
4841 }
4842
4843 dlg.finished(false);
4844
4845 return match server_response {
4846 Some(error_value) => Err(client::Error::BadRequest(error_value)),
4847 None => Err(client::Error::Failure(restored_response)),
4848 }
4849 }
4850 let result_value = {
4851 let res_body_string = client::get_body_as_string(res.body_mut()).await;
4852
4853 match json::from_str(&res_body_string) {
4854 Ok(decoded) => (res, decoded),
4855 Err(err) => {
4856 dlg.response_json_decode_error(&res_body_string, &err);
4857 return Err(client::Error::JsonDecodeError(res_body_string, err));
4858 }
4859 }
4860 };
4861
4862 dlg.finished(true);
4863 return Ok(result_value)
4864 }
4865 }
4866 }
4867 }
4868
4869
4870 ///
4871 /// Sets the *request* property to the given value.
4872 ///
4873 /// Even though the property as already been set when instantiating this call,
4874 /// we provide this method for API completeness.
4875 pub fn request(mut self, new_value: CopyBackupRequest) -> ProjectInstanceClusterBackupCopyCall<'a, S> {
4876 self._request = new_value;
4877 self
4878 }
4879 /// Required. The name of the destination cluster that will contain the backup copy. The cluster must already exists. Values are of the form: `projects/{project}/instances/{instance}/clusters/{cluster}`.
4880 ///
4881 /// Sets the *parent* path property to the given value.
4882 ///
4883 /// Even though the property as already been set when instantiating this call,
4884 /// we provide this method for API completeness.
4885 pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterBackupCopyCall<'a, S> {
4886 self._parent = new_value.to_string();
4887 self
4888 }
4889 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4890 /// while executing the actual API request.
4891 ///
4892 /// ````text
4893 /// It should be used to handle progress information, and to implement a certain level of resilience.
4894 /// ````
4895 ///
4896 /// Sets the *delegate* property to the given value.
4897 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupCopyCall<'a, S> {
4898 self._delegate = Some(new_value);
4899 self
4900 }
4901
4902 /// Set any additional parameter of the query string used in the request.
4903 /// It should be used to set parameters which are not yet available through their own
4904 /// setters.
4905 ///
4906 /// Please note that this method must not be used to set any of the known parameters
4907 /// which have their own setter method. If done anyway, the request will fail.
4908 ///
4909 /// # Additional Parameters
4910 ///
4911 /// * *$.xgafv* (query-string) - V1 error format.
4912 /// * *access_token* (query-string) - OAuth access token.
4913 /// * *alt* (query-string) - Data format for response.
4914 /// * *callback* (query-string) - JSONP
4915 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4916 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4917 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4918 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4919 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4920 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4921 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4922 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupCopyCall<'a, S>
4923 where T: AsRef<str> {
4924 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
4925 self
4926 }
4927
4928 /// Identifies the authorization scope for the method you are building.
4929 ///
4930 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4931 /// [`Scope::BigtableAdmin`].
4932 ///
4933 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4934 /// tokens for more than one scope.
4935 ///
4936 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4937 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4938 /// sufficient, a read-write scope will do as well.
4939 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupCopyCall<'a, S>
4940 where St: AsRef<str> {
4941 self._scopes.insert(String::from(scope.as_ref()));
4942 self
4943 }
4944 /// Identifies the authorization scope(s) for the method you are building.
4945 ///
4946 /// See [`Self::add_scope()`] for details.
4947 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupCopyCall<'a, S>
4948 where I: IntoIterator<Item = St>,
4949 St: AsRef<str> {
4950 self._scopes
4951 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4952 self
4953 }
4954
4955 /// Removes all scopes, and no default scope will be used either.
4956 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4957 /// for details).
4958 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupCopyCall<'a, S> {
4959 self._scopes.clear();
4960 self
4961 }
4962}
4963
4964
4965/// Starts creating a new Cloud Bigtable Backup. The returned backup long-running operation 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.
4966///
4967/// A builder for the *instances.clusters.backups.create* method supported by a *project* resource.
4968/// It is not used directly, but through a [`ProjectMethods`] instance.
4969///
4970/// # Example
4971///
4972/// Instantiate a resource method builder
4973///
4974/// ```test_harness,no_run
4975/// # extern crate hyper;
4976/// # extern crate hyper_rustls;
4977/// # extern crate google_bigtableadmin2 as bigtableadmin2;
4978/// use bigtableadmin2::api::Backup;
4979/// # async fn dox() {
4980/// # use std::default::Default;
4981/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
4982///
4983/// # let secret: oauth2::ApplicationSecret = Default::default();
4984/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
4985/// # secret,
4986/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4987/// # ).build().await.unwrap();
4988/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
4989/// // As the method needs a request, you would usually fill it with the desired information
4990/// // into the respective structure. Some of the parts shown here might not be applicable !
4991/// // Values shown here are possibly random and not representative !
4992/// let mut req = Backup::default();
4993///
4994/// // You can configure optional parameters by calling the respective setters at will, and
4995/// // execute the final call using `doit()`.
4996/// // Values shown here are possibly random and not representative !
4997/// let result = hub.projects().instances_clusters_backups_create(req, "parent")
4998/// .backup_id("gubergren")
4999/// .doit().await;
5000/// # }
5001/// ```
5002pub struct ProjectInstanceClusterBackupCreateCall<'a, S>
5003 where S: 'a {
5004
5005 hub: &'a BigtableAdmin<S>,
5006 _request: Backup,
5007 _parent: String,
5008 _backup_id: Option<String>,
5009 _delegate: Option<&'a mut dyn client::Delegate>,
5010 _additional_params: HashMap<String, String>,
5011 _scopes: BTreeSet<String>
5012}
5013
5014impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupCreateCall<'a, S> {}
5015
5016impl<'a, S> ProjectInstanceClusterBackupCreateCall<'a, S>
5017where
5018 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
5019 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
5020 S::Future: Send + Unpin + 'static,
5021 S::Error: Into<Box<dyn StdError + Send + Sync>>,
5022{
5023
5024
5025 /// Perform the operation you have build so far.
5026 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
5027 use std::io::{Read, Seek};
5028 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
5029 use client::{ToParts, url::Params};
5030 use std::borrow::Cow;
5031
5032 let mut dd = client::DefaultDelegate;
5033 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
5034 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.create",
5035 http_method: hyper::Method::POST });
5036
5037 for &field in ["alt", "parent", "backupId"].iter() {
5038 if self._additional_params.contains_key(field) {
5039 dlg.finished(false);
5040 return Err(client::Error::FieldClash(field));
5041 }
5042 }
5043
5044 let mut params = Params::with_capacity(5 + self._additional_params.len());
5045 params.push("parent", self._parent);
5046 if let Some(value) = self._backup_id.as_ref() {
5047 params.push("backupId", value);
5048 }
5049
5050 params.extend(self._additional_params.iter());
5051
5052 params.push("alt", "json");
5053 let mut url = self.hub._base_url.clone() + "v2/{+parent}/backups";
5054 if self._scopes.is_empty() {
5055 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
5056 }
5057
5058 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
5059 url = params.uri_replacement(url, param_name, find_this, true);
5060 }
5061 {
5062 let to_remove = ["parent"];
5063 params.remove_params(&to_remove);
5064 }
5065
5066 let url = params.parse_with_url(&url);
5067
5068 let mut json_mime_type = mime::APPLICATION_JSON;
5069 let mut request_value_reader =
5070 {
5071 let mut value = json::value::to_value(&self._request).expect("serde to work");
5072 client::remove_json_null_values(&mut value);
5073 let mut dst = io::Cursor::new(Vec::with_capacity(128));
5074 json::to_writer(&mut dst, &value).unwrap();
5075 dst
5076 };
5077 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
5078 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
5079
5080
5081 loop {
5082 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
5083 Ok(token) => token,
5084 Err(e) => {
5085 match dlg.token(e) {
5086 Ok(token) => token,
5087 Err(e) => {
5088 dlg.finished(false);
5089 return Err(client::Error::MissingToken(e));
5090 }
5091 }
5092 }
5093 };
5094 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
5095 let mut req_result = {
5096 let client = &self.hub.client;
5097 dlg.pre_request();
5098 let mut req_builder = hyper::Request::builder()
5099 .method(hyper::Method::POST)
5100 .uri(url.as_str())
5101 .header(USER_AGENT, self.hub._user_agent.clone());
5102
5103 if let Some(token) = token.as_ref() {
5104 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5105 }
5106
5107
5108 let request = req_builder
5109 .header(CONTENT_TYPE, json_mime_type.to_string())
5110 .header(CONTENT_LENGTH, request_size as u64)
5111 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
5112
5113 client.request(request.unwrap()).await
5114
5115 };
5116
5117 match req_result {
5118 Err(err) => {
5119 if let client::Retry::After(d) = dlg.http_error(&err) {
5120 sleep(d).await;
5121 continue;
5122 }
5123 dlg.finished(false);
5124 return Err(client::Error::HttpError(err))
5125 }
5126 Ok(mut res) => {
5127 if !res.status().is_success() {
5128 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5129 let (parts, _) = res.into_parts();
5130 let body = hyper::Body::from(res_body_string.clone());
5131 let restored_response = hyper::Response::from_parts(parts, body);
5132
5133 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
5134
5135 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
5136 sleep(d).await;
5137 continue;
5138 }
5139
5140 dlg.finished(false);
5141
5142 return match server_response {
5143 Some(error_value) => Err(client::Error::BadRequest(error_value)),
5144 None => Err(client::Error::Failure(restored_response)),
5145 }
5146 }
5147 let result_value = {
5148 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5149
5150 match json::from_str(&res_body_string) {
5151 Ok(decoded) => (res, decoded),
5152 Err(err) => {
5153 dlg.response_json_decode_error(&res_body_string, &err);
5154 return Err(client::Error::JsonDecodeError(res_body_string, err));
5155 }
5156 }
5157 };
5158
5159 dlg.finished(true);
5160 return Ok(result_value)
5161 }
5162 }
5163 }
5164 }
5165
5166
5167 ///
5168 /// Sets the *request* property to the given value.
5169 ///
5170 /// Even though the property as already been set when instantiating this call,
5171 /// we provide this method for API completeness.
5172 pub fn request(mut self, new_value: Backup) -> ProjectInstanceClusterBackupCreateCall<'a, S> {
5173 self._request = new_value;
5174 self
5175 }
5176 /// Required. This must be one of the clusters in the instance in which this table is located. The backup will be stored in this cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
5177 ///
5178 /// Sets the *parent* path property to the given value.
5179 ///
5180 /// Even though the property as already been set when instantiating this call,
5181 /// we provide this method for API completeness.
5182 pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterBackupCreateCall<'a, S> {
5183 self._parent = new_value.to_string();
5184 self
5185 }
5186 /// Required. The id of the backup to be created. The `backup_id` along with the parent `parent` are combined as {parent}/backups/{backup_id} to create the full backup name, of the form: `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This string must be between 1 and 50 characters in length and match the regex _a-zA-Z0-9*.
5187 ///
5188 /// Sets the *backup id* query property to the given value.
5189 pub fn backup_id(mut self, new_value: &str) -> ProjectInstanceClusterBackupCreateCall<'a, S> {
5190 self._backup_id = Some(new_value.to_string());
5191 self
5192 }
5193 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5194 /// while executing the actual API request.
5195 ///
5196 /// ````text
5197 /// It should be used to handle progress information, and to implement a certain level of resilience.
5198 /// ````
5199 ///
5200 /// Sets the *delegate* property to the given value.
5201 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupCreateCall<'a, S> {
5202 self._delegate = Some(new_value);
5203 self
5204 }
5205
5206 /// Set any additional parameter of the query string used in the request.
5207 /// It should be used to set parameters which are not yet available through their own
5208 /// setters.
5209 ///
5210 /// Please note that this method must not be used to set any of the known parameters
5211 /// which have their own setter method. If done anyway, the request will fail.
5212 ///
5213 /// # Additional Parameters
5214 ///
5215 /// * *$.xgafv* (query-string) - V1 error format.
5216 /// * *access_token* (query-string) - OAuth access token.
5217 /// * *alt* (query-string) - Data format for response.
5218 /// * *callback* (query-string) - JSONP
5219 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5220 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5221 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5222 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5223 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5224 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5225 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5226 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupCreateCall<'a, S>
5227 where T: AsRef<str> {
5228 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
5229 self
5230 }
5231
5232 /// Identifies the authorization scope for the method you are building.
5233 ///
5234 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5235 /// [`Scope::BigtableAdmin`].
5236 ///
5237 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5238 /// tokens for more than one scope.
5239 ///
5240 /// Usually there is more than one suitable scope to authorize an operation, some of which may
5241 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5242 /// sufficient, a read-write scope will do as well.
5243 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupCreateCall<'a, S>
5244 where St: AsRef<str> {
5245 self._scopes.insert(String::from(scope.as_ref()));
5246 self
5247 }
5248 /// Identifies the authorization scope(s) for the method you are building.
5249 ///
5250 /// See [`Self::add_scope()`] for details.
5251 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupCreateCall<'a, S>
5252 where I: IntoIterator<Item = St>,
5253 St: AsRef<str> {
5254 self._scopes
5255 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5256 self
5257 }
5258
5259 /// Removes all scopes, and no default scope will be used either.
5260 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5261 /// for details).
5262 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupCreateCall<'a, S> {
5263 self._scopes.clear();
5264 self
5265 }
5266}
5267
5268
5269/// Deletes a pending or completed Cloud Bigtable backup.
5270///
5271/// A builder for the *instances.clusters.backups.delete* method supported by a *project* resource.
5272/// It is not used directly, but through a [`ProjectMethods`] instance.
5273///
5274/// # Example
5275///
5276/// Instantiate a resource method builder
5277///
5278/// ```test_harness,no_run
5279/// # extern crate hyper;
5280/// # extern crate hyper_rustls;
5281/// # extern crate google_bigtableadmin2 as bigtableadmin2;
5282/// # async fn dox() {
5283/// # use std::default::Default;
5284/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
5285///
5286/// # let secret: oauth2::ApplicationSecret = Default::default();
5287/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
5288/// # secret,
5289/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5290/// # ).build().await.unwrap();
5291/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
5292/// // You can configure optional parameters by calling the respective setters at will, and
5293/// // execute the final call using `doit()`.
5294/// // Values shown here are possibly random and not representative !
5295/// let result = hub.projects().instances_clusters_backups_delete("name")
5296/// .doit().await;
5297/// # }
5298/// ```
5299pub struct ProjectInstanceClusterBackupDeleteCall<'a, S>
5300 where S: 'a {
5301
5302 hub: &'a BigtableAdmin<S>,
5303 _name: String,
5304 _delegate: Option<&'a mut dyn client::Delegate>,
5305 _additional_params: HashMap<String, String>,
5306 _scopes: BTreeSet<String>
5307}
5308
5309impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupDeleteCall<'a, S> {}
5310
5311impl<'a, S> ProjectInstanceClusterBackupDeleteCall<'a, S>
5312where
5313 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
5314 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
5315 S::Future: Send + Unpin + 'static,
5316 S::Error: Into<Box<dyn StdError + Send + Sync>>,
5317{
5318
5319
5320 /// Perform the operation you have build so far.
5321 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
5322 use std::io::{Read, Seek};
5323 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
5324 use client::{ToParts, url::Params};
5325 use std::borrow::Cow;
5326
5327 let mut dd = client::DefaultDelegate;
5328 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
5329 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.delete",
5330 http_method: hyper::Method::DELETE });
5331
5332 for &field in ["alt", "name"].iter() {
5333 if self._additional_params.contains_key(field) {
5334 dlg.finished(false);
5335 return Err(client::Error::FieldClash(field));
5336 }
5337 }
5338
5339 let mut params = Params::with_capacity(3 + self._additional_params.len());
5340 params.push("name", self._name);
5341
5342 params.extend(self._additional_params.iter());
5343
5344 params.push("alt", "json");
5345 let mut url = self.hub._base_url.clone() + "v2/{+name}";
5346 if self._scopes.is_empty() {
5347 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
5348 }
5349
5350 for &(find_this, param_name) in [("{+name}", "name")].iter() {
5351 url = params.uri_replacement(url, param_name, find_this, true);
5352 }
5353 {
5354 let to_remove = ["name"];
5355 params.remove_params(&to_remove);
5356 }
5357
5358 let url = params.parse_with_url(&url);
5359
5360
5361
5362 loop {
5363 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
5364 Ok(token) => token,
5365 Err(e) => {
5366 match dlg.token(e) {
5367 Ok(token) => token,
5368 Err(e) => {
5369 dlg.finished(false);
5370 return Err(client::Error::MissingToken(e));
5371 }
5372 }
5373 }
5374 };
5375 let mut req_result = {
5376 let client = &self.hub.client;
5377 dlg.pre_request();
5378 let mut req_builder = hyper::Request::builder()
5379 .method(hyper::Method::DELETE)
5380 .uri(url.as_str())
5381 .header(USER_AGENT, self.hub._user_agent.clone());
5382
5383 if let Some(token) = token.as_ref() {
5384 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5385 }
5386
5387
5388 let request = req_builder
5389 .body(hyper::body::Body::empty());
5390
5391 client.request(request.unwrap()).await
5392
5393 };
5394
5395 match req_result {
5396 Err(err) => {
5397 if let client::Retry::After(d) = dlg.http_error(&err) {
5398 sleep(d).await;
5399 continue;
5400 }
5401 dlg.finished(false);
5402 return Err(client::Error::HttpError(err))
5403 }
5404 Ok(mut res) => {
5405 if !res.status().is_success() {
5406 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5407 let (parts, _) = res.into_parts();
5408 let body = hyper::Body::from(res_body_string.clone());
5409 let restored_response = hyper::Response::from_parts(parts, body);
5410
5411 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
5412
5413 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
5414 sleep(d).await;
5415 continue;
5416 }
5417
5418 dlg.finished(false);
5419
5420 return match server_response {
5421 Some(error_value) => Err(client::Error::BadRequest(error_value)),
5422 None => Err(client::Error::Failure(restored_response)),
5423 }
5424 }
5425 let result_value = {
5426 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5427
5428 match json::from_str(&res_body_string) {
5429 Ok(decoded) => (res, decoded),
5430 Err(err) => {
5431 dlg.response_json_decode_error(&res_body_string, &err);
5432 return Err(client::Error::JsonDecodeError(res_body_string, err));
5433 }
5434 }
5435 };
5436
5437 dlg.finished(true);
5438 return Ok(result_value)
5439 }
5440 }
5441 }
5442 }
5443
5444
5445 /// Required. Name of the backup to delete. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
5446 ///
5447 /// Sets the *name* path property to the given value.
5448 ///
5449 /// Even though the property as already been set when instantiating this call,
5450 /// we provide this method for API completeness.
5451 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterBackupDeleteCall<'a, S> {
5452 self._name = new_value.to_string();
5453 self
5454 }
5455 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5456 /// while executing the actual API request.
5457 ///
5458 /// ````text
5459 /// It should be used to handle progress information, and to implement a certain level of resilience.
5460 /// ````
5461 ///
5462 /// Sets the *delegate* property to the given value.
5463 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupDeleteCall<'a, S> {
5464 self._delegate = Some(new_value);
5465 self
5466 }
5467
5468 /// Set any additional parameter of the query string used in the request.
5469 /// It should be used to set parameters which are not yet available through their own
5470 /// setters.
5471 ///
5472 /// Please note that this method must not be used to set any of the known parameters
5473 /// which have their own setter method. If done anyway, the request will fail.
5474 ///
5475 /// # Additional Parameters
5476 ///
5477 /// * *$.xgafv* (query-string) - V1 error format.
5478 /// * *access_token* (query-string) - OAuth access token.
5479 /// * *alt* (query-string) - Data format for response.
5480 /// * *callback* (query-string) - JSONP
5481 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5482 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5483 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5484 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5485 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5486 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5487 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5488 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupDeleteCall<'a, S>
5489 where T: AsRef<str> {
5490 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
5491 self
5492 }
5493
5494 /// Identifies the authorization scope for the method you are building.
5495 ///
5496 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5497 /// [`Scope::BigtableAdmin`].
5498 ///
5499 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5500 /// tokens for more than one scope.
5501 ///
5502 /// Usually there is more than one suitable scope to authorize an operation, some of which may
5503 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5504 /// sufficient, a read-write scope will do as well.
5505 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupDeleteCall<'a, S>
5506 where St: AsRef<str> {
5507 self._scopes.insert(String::from(scope.as_ref()));
5508 self
5509 }
5510 /// Identifies the authorization scope(s) for the method you are building.
5511 ///
5512 /// See [`Self::add_scope()`] for details.
5513 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupDeleteCall<'a, S>
5514 where I: IntoIterator<Item = St>,
5515 St: AsRef<str> {
5516 self._scopes
5517 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5518 self
5519 }
5520
5521 /// Removes all scopes, and no default scope will be used either.
5522 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5523 /// for details).
5524 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupDeleteCall<'a, S> {
5525 self._scopes.clear();
5526 self
5527 }
5528}
5529
5530
5531/// Gets metadata on a pending or completed Cloud Bigtable Backup.
5532///
5533/// A builder for the *instances.clusters.backups.get* method supported by a *project* resource.
5534/// It is not used directly, but through a [`ProjectMethods`] instance.
5535///
5536/// # Example
5537///
5538/// Instantiate a resource method builder
5539///
5540/// ```test_harness,no_run
5541/// # extern crate hyper;
5542/// # extern crate hyper_rustls;
5543/// # extern crate google_bigtableadmin2 as bigtableadmin2;
5544/// # async fn dox() {
5545/// # use std::default::Default;
5546/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
5547///
5548/// # let secret: oauth2::ApplicationSecret = Default::default();
5549/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
5550/// # secret,
5551/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5552/// # ).build().await.unwrap();
5553/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
5554/// // You can configure optional parameters by calling the respective setters at will, and
5555/// // execute the final call using `doit()`.
5556/// // Values shown here are possibly random and not representative !
5557/// let result = hub.projects().instances_clusters_backups_get("name")
5558/// .doit().await;
5559/// # }
5560/// ```
5561pub struct ProjectInstanceClusterBackupGetCall<'a, S>
5562 where S: 'a {
5563
5564 hub: &'a BigtableAdmin<S>,
5565 _name: String,
5566 _delegate: Option<&'a mut dyn client::Delegate>,
5567 _additional_params: HashMap<String, String>,
5568 _scopes: BTreeSet<String>
5569}
5570
5571impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupGetCall<'a, S> {}
5572
5573impl<'a, S> ProjectInstanceClusterBackupGetCall<'a, S>
5574where
5575 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
5576 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
5577 S::Future: Send + Unpin + 'static,
5578 S::Error: Into<Box<dyn StdError + Send + Sync>>,
5579{
5580
5581
5582 /// Perform the operation you have build so far.
5583 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Backup)> {
5584 use std::io::{Read, Seek};
5585 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
5586 use client::{ToParts, url::Params};
5587 use std::borrow::Cow;
5588
5589 let mut dd = client::DefaultDelegate;
5590 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
5591 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.get",
5592 http_method: hyper::Method::GET });
5593
5594 for &field in ["alt", "name"].iter() {
5595 if self._additional_params.contains_key(field) {
5596 dlg.finished(false);
5597 return Err(client::Error::FieldClash(field));
5598 }
5599 }
5600
5601 let mut params = Params::with_capacity(3 + self._additional_params.len());
5602 params.push("name", self._name);
5603
5604 params.extend(self._additional_params.iter());
5605
5606 params.push("alt", "json");
5607 let mut url = self.hub._base_url.clone() + "v2/{+name}";
5608 if self._scopes.is_empty() {
5609 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
5610 }
5611
5612 for &(find_this, param_name) in [("{+name}", "name")].iter() {
5613 url = params.uri_replacement(url, param_name, find_this, true);
5614 }
5615 {
5616 let to_remove = ["name"];
5617 params.remove_params(&to_remove);
5618 }
5619
5620 let url = params.parse_with_url(&url);
5621
5622
5623
5624 loop {
5625 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
5626 Ok(token) => token,
5627 Err(e) => {
5628 match dlg.token(e) {
5629 Ok(token) => token,
5630 Err(e) => {
5631 dlg.finished(false);
5632 return Err(client::Error::MissingToken(e));
5633 }
5634 }
5635 }
5636 };
5637 let mut req_result = {
5638 let client = &self.hub.client;
5639 dlg.pre_request();
5640 let mut req_builder = hyper::Request::builder()
5641 .method(hyper::Method::GET)
5642 .uri(url.as_str())
5643 .header(USER_AGENT, self.hub._user_agent.clone());
5644
5645 if let Some(token) = token.as_ref() {
5646 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5647 }
5648
5649
5650 let request = req_builder
5651 .body(hyper::body::Body::empty());
5652
5653 client.request(request.unwrap()).await
5654
5655 };
5656
5657 match req_result {
5658 Err(err) => {
5659 if let client::Retry::After(d) = dlg.http_error(&err) {
5660 sleep(d).await;
5661 continue;
5662 }
5663 dlg.finished(false);
5664 return Err(client::Error::HttpError(err))
5665 }
5666 Ok(mut res) => {
5667 if !res.status().is_success() {
5668 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5669 let (parts, _) = res.into_parts();
5670 let body = hyper::Body::from(res_body_string.clone());
5671 let restored_response = hyper::Response::from_parts(parts, body);
5672
5673 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
5674
5675 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
5676 sleep(d).await;
5677 continue;
5678 }
5679
5680 dlg.finished(false);
5681
5682 return match server_response {
5683 Some(error_value) => Err(client::Error::BadRequest(error_value)),
5684 None => Err(client::Error::Failure(restored_response)),
5685 }
5686 }
5687 let result_value = {
5688 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5689
5690 match json::from_str(&res_body_string) {
5691 Ok(decoded) => (res, decoded),
5692 Err(err) => {
5693 dlg.response_json_decode_error(&res_body_string, &err);
5694 return Err(client::Error::JsonDecodeError(res_body_string, err));
5695 }
5696 }
5697 };
5698
5699 dlg.finished(true);
5700 return Ok(result_value)
5701 }
5702 }
5703 }
5704 }
5705
5706
5707 /// Required. Name of the backup. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
5708 ///
5709 /// Sets the *name* path property to the given value.
5710 ///
5711 /// Even though the property as already been set when instantiating this call,
5712 /// we provide this method for API completeness.
5713 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterBackupGetCall<'a, S> {
5714 self._name = new_value.to_string();
5715 self
5716 }
5717 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5718 /// while executing the actual API request.
5719 ///
5720 /// ````text
5721 /// It should be used to handle progress information, and to implement a certain level of resilience.
5722 /// ````
5723 ///
5724 /// Sets the *delegate* property to the given value.
5725 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupGetCall<'a, S> {
5726 self._delegate = Some(new_value);
5727 self
5728 }
5729
5730 /// Set any additional parameter of the query string used in the request.
5731 /// It should be used to set parameters which are not yet available through their own
5732 /// setters.
5733 ///
5734 /// Please note that this method must not be used to set any of the known parameters
5735 /// which have their own setter method. If done anyway, the request will fail.
5736 ///
5737 /// # Additional Parameters
5738 ///
5739 /// * *$.xgafv* (query-string) - V1 error format.
5740 /// * *access_token* (query-string) - OAuth access token.
5741 /// * *alt* (query-string) - Data format for response.
5742 /// * *callback* (query-string) - JSONP
5743 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5744 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5745 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5746 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5747 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5748 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5749 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5750 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupGetCall<'a, S>
5751 where T: AsRef<str> {
5752 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
5753 self
5754 }
5755
5756 /// Identifies the authorization scope for the method you are building.
5757 ///
5758 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5759 /// [`Scope::BigtableAdmin`].
5760 ///
5761 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5762 /// tokens for more than one scope.
5763 ///
5764 /// Usually there is more than one suitable scope to authorize an operation, some of which may
5765 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5766 /// sufficient, a read-write scope will do as well.
5767 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupGetCall<'a, S>
5768 where St: AsRef<str> {
5769 self._scopes.insert(String::from(scope.as_ref()));
5770 self
5771 }
5772 /// Identifies the authorization scope(s) for the method you are building.
5773 ///
5774 /// See [`Self::add_scope()`] for details.
5775 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupGetCall<'a, S>
5776 where I: IntoIterator<Item = St>,
5777 St: AsRef<str> {
5778 self._scopes
5779 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5780 self
5781 }
5782
5783 /// Removes all scopes, and no default scope will be used either.
5784 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5785 /// for details).
5786 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupGetCall<'a, S> {
5787 self._scopes.clear();
5788 self
5789 }
5790}
5791
5792
5793/// 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.
5794///
5795/// A builder for the *instances.clusters.backups.getIamPolicy* method supported by a *project* resource.
5796/// It is not used directly, but through a [`ProjectMethods`] instance.
5797///
5798/// # Example
5799///
5800/// Instantiate a resource method builder
5801///
5802/// ```test_harness,no_run
5803/// # extern crate hyper;
5804/// # extern crate hyper_rustls;
5805/// # extern crate google_bigtableadmin2 as bigtableadmin2;
5806/// use bigtableadmin2::api::GetIamPolicyRequest;
5807/// # async fn dox() {
5808/// # use std::default::Default;
5809/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
5810///
5811/// # let secret: oauth2::ApplicationSecret = Default::default();
5812/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
5813/// # secret,
5814/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5815/// # ).build().await.unwrap();
5816/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
5817/// // As the method needs a request, you would usually fill it with the desired information
5818/// // into the respective structure. Some of the parts shown here might not be applicable !
5819/// // Values shown here are possibly random and not representative !
5820/// let mut req = GetIamPolicyRequest::default();
5821///
5822/// // You can configure optional parameters by calling the respective setters at will, and
5823/// // execute the final call using `doit()`.
5824/// // Values shown here are possibly random and not representative !
5825/// let result = hub.projects().instances_clusters_backups_get_iam_policy(req, "resource")
5826/// .doit().await;
5827/// # }
5828/// ```
5829pub struct ProjectInstanceClusterBackupGetIamPolicyCall<'a, S>
5830 where S: 'a {
5831
5832 hub: &'a BigtableAdmin<S>,
5833 _request: GetIamPolicyRequest,
5834 _resource: String,
5835 _delegate: Option<&'a mut dyn client::Delegate>,
5836 _additional_params: HashMap<String, String>,
5837 _scopes: BTreeSet<String>
5838}
5839
5840impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupGetIamPolicyCall<'a, S> {}
5841
5842impl<'a, S> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S>
5843where
5844 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
5845 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
5846 S::Future: Send + Unpin + 'static,
5847 S::Error: Into<Box<dyn StdError + Send + Sync>>,
5848{
5849
5850
5851 /// Perform the operation you have build so far.
5852 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Policy)> {
5853 use std::io::{Read, Seek};
5854 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
5855 use client::{ToParts, url::Params};
5856 use std::borrow::Cow;
5857
5858 let mut dd = client::DefaultDelegate;
5859 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
5860 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.getIamPolicy",
5861 http_method: hyper::Method::POST });
5862
5863 for &field in ["alt", "resource"].iter() {
5864 if self._additional_params.contains_key(field) {
5865 dlg.finished(false);
5866 return Err(client::Error::FieldClash(field));
5867 }
5868 }
5869
5870 let mut params = Params::with_capacity(4 + self._additional_params.len());
5871 params.push("resource", self._resource);
5872
5873 params.extend(self._additional_params.iter());
5874
5875 params.push("alt", "json");
5876 let mut url = self.hub._base_url.clone() + "v2/{+resource}:getIamPolicy";
5877 if self._scopes.is_empty() {
5878 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
5879 }
5880
5881 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
5882 url = params.uri_replacement(url, param_name, find_this, true);
5883 }
5884 {
5885 let to_remove = ["resource"];
5886 params.remove_params(&to_remove);
5887 }
5888
5889 let url = params.parse_with_url(&url);
5890
5891 let mut json_mime_type = mime::APPLICATION_JSON;
5892 let mut request_value_reader =
5893 {
5894 let mut value = json::value::to_value(&self._request).expect("serde to work");
5895 client::remove_json_null_values(&mut value);
5896 let mut dst = io::Cursor::new(Vec::with_capacity(128));
5897 json::to_writer(&mut dst, &value).unwrap();
5898 dst
5899 };
5900 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
5901 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
5902
5903
5904 loop {
5905 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
5906 Ok(token) => token,
5907 Err(e) => {
5908 match dlg.token(e) {
5909 Ok(token) => token,
5910 Err(e) => {
5911 dlg.finished(false);
5912 return Err(client::Error::MissingToken(e));
5913 }
5914 }
5915 }
5916 };
5917 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
5918 let mut req_result = {
5919 let client = &self.hub.client;
5920 dlg.pre_request();
5921 let mut req_builder = hyper::Request::builder()
5922 .method(hyper::Method::POST)
5923 .uri(url.as_str())
5924 .header(USER_AGENT, self.hub._user_agent.clone());
5925
5926 if let Some(token) = token.as_ref() {
5927 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5928 }
5929
5930
5931 let request = req_builder
5932 .header(CONTENT_TYPE, json_mime_type.to_string())
5933 .header(CONTENT_LENGTH, request_size as u64)
5934 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
5935
5936 client.request(request.unwrap()).await
5937
5938 };
5939
5940 match req_result {
5941 Err(err) => {
5942 if let client::Retry::After(d) = dlg.http_error(&err) {
5943 sleep(d).await;
5944 continue;
5945 }
5946 dlg.finished(false);
5947 return Err(client::Error::HttpError(err))
5948 }
5949 Ok(mut res) => {
5950 if !res.status().is_success() {
5951 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5952 let (parts, _) = res.into_parts();
5953 let body = hyper::Body::from(res_body_string.clone());
5954 let restored_response = hyper::Response::from_parts(parts, body);
5955
5956 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
5957
5958 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
5959 sleep(d).await;
5960 continue;
5961 }
5962
5963 dlg.finished(false);
5964
5965 return match server_response {
5966 Some(error_value) => Err(client::Error::BadRequest(error_value)),
5967 None => Err(client::Error::Failure(restored_response)),
5968 }
5969 }
5970 let result_value = {
5971 let res_body_string = client::get_body_as_string(res.body_mut()).await;
5972
5973 match json::from_str(&res_body_string) {
5974 Ok(decoded) => (res, decoded),
5975 Err(err) => {
5976 dlg.response_json_decode_error(&res_body_string, &err);
5977 return Err(client::Error::JsonDecodeError(res_body_string, err));
5978 }
5979 }
5980 };
5981
5982 dlg.finished(true);
5983 return Ok(result_value)
5984 }
5985 }
5986 }
5987 }
5988
5989
5990 ///
5991 /// Sets the *request* property to the given value.
5992 ///
5993 /// Even though the property as already been set when instantiating this call,
5994 /// we provide this method for API completeness.
5995 pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S> {
5996 self._request = new_value;
5997 self
5998 }
5999 /// REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
6000 ///
6001 /// Sets the *resource* path property to the given value.
6002 ///
6003 /// Even though the property as already been set when instantiating this call,
6004 /// we provide this method for API completeness.
6005 pub fn resource(mut self, new_value: &str) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S> {
6006 self._resource = new_value.to_string();
6007 self
6008 }
6009 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6010 /// while executing the actual API request.
6011 ///
6012 /// ````text
6013 /// It should be used to handle progress information, and to implement a certain level of resilience.
6014 /// ````
6015 ///
6016 /// Sets the *delegate* property to the given value.
6017 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S> {
6018 self._delegate = Some(new_value);
6019 self
6020 }
6021
6022 /// Set any additional parameter of the query string used in the request.
6023 /// It should be used to set parameters which are not yet available through their own
6024 /// setters.
6025 ///
6026 /// Please note that this method must not be used to set any of the known parameters
6027 /// which have their own setter method. If done anyway, the request will fail.
6028 ///
6029 /// # Additional Parameters
6030 ///
6031 /// * *$.xgafv* (query-string) - V1 error format.
6032 /// * *access_token* (query-string) - OAuth access token.
6033 /// * *alt* (query-string) - Data format for response.
6034 /// * *callback* (query-string) - JSONP
6035 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6036 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6037 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6038 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6039 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6040 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6041 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6042 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S>
6043 where T: AsRef<str> {
6044 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
6045 self
6046 }
6047
6048 /// Identifies the authorization scope for the method you are building.
6049 ///
6050 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6051 /// [`Scope::BigtableAdmin`].
6052 ///
6053 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6054 /// tokens for more than one scope.
6055 ///
6056 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6057 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6058 /// sufficient, a read-write scope will do as well.
6059 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S>
6060 where St: AsRef<str> {
6061 self._scopes.insert(String::from(scope.as_ref()));
6062 self
6063 }
6064 /// Identifies the authorization scope(s) for the method you are building.
6065 ///
6066 /// See [`Self::add_scope()`] for details.
6067 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S>
6068 where I: IntoIterator<Item = St>,
6069 St: AsRef<str> {
6070 self._scopes
6071 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6072 self
6073 }
6074
6075 /// Removes all scopes, and no default scope will be used either.
6076 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6077 /// for details).
6078 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, S> {
6079 self._scopes.clear();
6080 self
6081 }
6082}
6083
6084
6085/// Lists Cloud Bigtable backups. Returns both completed and pending backups.
6086///
6087/// A builder for the *instances.clusters.backups.list* method supported by a *project* resource.
6088/// It is not used directly, but through a [`ProjectMethods`] instance.
6089///
6090/// # Example
6091///
6092/// Instantiate a resource method builder
6093///
6094/// ```test_harness,no_run
6095/// # extern crate hyper;
6096/// # extern crate hyper_rustls;
6097/// # extern crate google_bigtableadmin2 as bigtableadmin2;
6098/// # async fn dox() {
6099/// # use std::default::Default;
6100/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
6101///
6102/// # let secret: oauth2::ApplicationSecret = Default::default();
6103/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
6104/// # secret,
6105/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6106/// # ).build().await.unwrap();
6107/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
6108/// // You can configure optional parameters by calling the respective setters at will, and
6109/// // execute the final call using `doit()`.
6110/// // Values shown here are possibly random and not representative !
6111/// let result = hub.projects().instances_clusters_backups_list("parent")
6112/// .page_token("labore")
6113/// .page_size(-43)
6114/// .order_by("duo")
6115/// .filter("sed")
6116/// .doit().await;
6117/// # }
6118/// ```
6119pub struct ProjectInstanceClusterBackupListCall<'a, S>
6120 where S: 'a {
6121
6122 hub: &'a BigtableAdmin<S>,
6123 _parent: String,
6124 _page_token: Option<String>,
6125 _page_size: Option<i32>,
6126 _order_by: Option<String>,
6127 _filter: Option<String>,
6128 _delegate: Option<&'a mut dyn client::Delegate>,
6129 _additional_params: HashMap<String, String>,
6130 _scopes: BTreeSet<String>
6131}
6132
6133impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupListCall<'a, S> {}
6134
6135impl<'a, S> ProjectInstanceClusterBackupListCall<'a, S>
6136where
6137 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
6138 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
6139 S::Future: Send + Unpin + 'static,
6140 S::Error: Into<Box<dyn StdError + Send + Sync>>,
6141{
6142
6143
6144 /// Perform the operation you have build so far.
6145 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListBackupsResponse)> {
6146 use std::io::{Read, Seek};
6147 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
6148 use client::{ToParts, url::Params};
6149 use std::borrow::Cow;
6150
6151 let mut dd = client::DefaultDelegate;
6152 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
6153 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.list",
6154 http_method: hyper::Method::GET });
6155
6156 for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "filter"].iter() {
6157 if self._additional_params.contains_key(field) {
6158 dlg.finished(false);
6159 return Err(client::Error::FieldClash(field));
6160 }
6161 }
6162
6163 let mut params = Params::with_capacity(7 + self._additional_params.len());
6164 params.push("parent", self._parent);
6165 if let Some(value) = self._page_token.as_ref() {
6166 params.push("pageToken", value);
6167 }
6168 if let Some(value) = self._page_size.as_ref() {
6169 params.push("pageSize", value.to_string());
6170 }
6171 if let Some(value) = self._order_by.as_ref() {
6172 params.push("orderBy", value);
6173 }
6174 if let Some(value) = self._filter.as_ref() {
6175 params.push("filter", value);
6176 }
6177
6178 params.extend(self._additional_params.iter());
6179
6180 params.push("alt", "json");
6181 let mut url = self.hub._base_url.clone() + "v2/{+parent}/backups";
6182 if self._scopes.is_empty() {
6183 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
6184 }
6185
6186 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
6187 url = params.uri_replacement(url, param_name, find_this, true);
6188 }
6189 {
6190 let to_remove = ["parent"];
6191 params.remove_params(&to_remove);
6192 }
6193
6194 let url = params.parse_with_url(&url);
6195
6196
6197
6198 loop {
6199 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
6200 Ok(token) => token,
6201 Err(e) => {
6202 match dlg.token(e) {
6203 Ok(token) => token,
6204 Err(e) => {
6205 dlg.finished(false);
6206 return Err(client::Error::MissingToken(e));
6207 }
6208 }
6209 }
6210 };
6211 let mut req_result = {
6212 let client = &self.hub.client;
6213 dlg.pre_request();
6214 let mut req_builder = hyper::Request::builder()
6215 .method(hyper::Method::GET)
6216 .uri(url.as_str())
6217 .header(USER_AGENT, self.hub._user_agent.clone());
6218
6219 if let Some(token) = token.as_ref() {
6220 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6221 }
6222
6223
6224 let request = req_builder
6225 .body(hyper::body::Body::empty());
6226
6227 client.request(request.unwrap()).await
6228
6229 };
6230
6231 match req_result {
6232 Err(err) => {
6233 if let client::Retry::After(d) = dlg.http_error(&err) {
6234 sleep(d).await;
6235 continue;
6236 }
6237 dlg.finished(false);
6238 return Err(client::Error::HttpError(err))
6239 }
6240 Ok(mut res) => {
6241 if !res.status().is_success() {
6242 let res_body_string = client::get_body_as_string(res.body_mut()).await;
6243 let (parts, _) = res.into_parts();
6244 let body = hyper::Body::from(res_body_string.clone());
6245 let restored_response = hyper::Response::from_parts(parts, body);
6246
6247 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
6248
6249 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
6250 sleep(d).await;
6251 continue;
6252 }
6253
6254 dlg.finished(false);
6255
6256 return match server_response {
6257 Some(error_value) => Err(client::Error::BadRequest(error_value)),
6258 None => Err(client::Error::Failure(restored_response)),
6259 }
6260 }
6261 let result_value = {
6262 let res_body_string = client::get_body_as_string(res.body_mut()).await;
6263
6264 match json::from_str(&res_body_string) {
6265 Ok(decoded) => (res, decoded),
6266 Err(err) => {
6267 dlg.response_json_decode_error(&res_body_string, &err);
6268 return Err(client::Error::JsonDecodeError(res_body_string, err));
6269 }
6270 }
6271 };
6272
6273 dlg.finished(true);
6274 return Ok(result_value)
6275 }
6276 }
6277 }
6278 }
6279
6280
6281 /// Required. The cluster to list backups from. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. Use `{cluster} = '-'` to list backups for all clusters in an instance, e.g., `projects/{project}/instances/{instance}/clusters/-`.
6282 ///
6283 /// Sets the *parent* path property to the given value.
6284 ///
6285 /// Even though the property as already been set when instantiating this call,
6286 /// we provide this method for API completeness.
6287 pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterBackupListCall<'a, S> {
6288 self._parent = new_value.to_string();
6289 self
6290 }
6291 /// If non-empty, `page_token` should contain a next_page_token from a previous ListBackupsResponse to the same `parent` and with the same `filter`.
6292 ///
6293 /// Sets the *page token* query property to the given value.
6294 pub fn page_token(mut self, new_value: &str) -> ProjectInstanceClusterBackupListCall<'a, S> {
6295 self._page_token = Some(new_value.to_string());
6296 self
6297 }
6298 /// Number of backups to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size.
6299 ///
6300 /// Sets the *page size* query property to the given value.
6301 pub fn page_size(mut self, new_value: i32) -> ProjectInstanceClusterBackupListCall<'a, S> {
6302 self._page_size = Some(new_value);
6303 self
6304 }
6305 /// An expression for specifying the sort order of the results of the request. The string value should specify one or more fields in Backup. The full syntax is described at https://aip.dev/132#ordering. Fields supported are: * name * source_table * expire_time * start_time * end_time * size_bytes * state For example, "start_time". The default sorting order is ascending. To specify descending order for the field, a suffix " desc" should be appended to the field name. For example, "start_time desc". Redundant space characters in the syntax are insigificant. If order_by is empty, results will be sorted by `start_time` in descending order starting from the most recently created backup.
6306 ///
6307 /// Sets the *order by* query property to the given value.
6308 pub fn order_by(mut self, new_value: &str) -> ProjectInstanceClusterBackupListCall<'a, S> {
6309 self._order_by = Some(new_value.to_string());
6310 self
6311 }
6312 /// A filter expression that filters backups 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 <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is roughly synonymous with equality. Filter rules are case insensitive. The fields eligible for filtering are: * `name` * `source_table` * `state` * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `end_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` To filter on multiple expressions, provide each separate expression within parentheses. By default, each expression is an AND expression. However, you can include AND, OR, and NOT expressions explicitly. Some examples of using filters are: * `name:"exact"` --> The backup's name is the string "exact". * `name:howl` --> The backup's name contains the string "howl". * `source_table:prod` --> The source_table'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 (start_time < \"2018-03-28T14:50:00Z\")` --> The backup name contains the string "howl" and start_time of the backup is before 2018-03-28T14:50:00Z. * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
6313 ///
6314 /// Sets the *filter* query property to the given value.
6315 pub fn filter(mut self, new_value: &str) -> ProjectInstanceClusterBackupListCall<'a, S> {
6316 self._filter = Some(new_value.to_string());
6317 self
6318 }
6319 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6320 /// while executing the actual API request.
6321 ///
6322 /// ````text
6323 /// It should be used to handle progress information, and to implement a certain level of resilience.
6324 /// ````
6325 ///
6326 /// Sets the *delegate* property to the given value.
6327 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupListCall<'a, S> {
6328 self._delegate = Some(new_value);
6329 self
6330 }
6331
6332 /// Set any additional parameter of the query string used in the request.
6333 /// It should be used to set parameters which are not yet available through their own
6334 /// setters.
6335 ///
6336 /// Please note that this method must not be used to set any of the known parameters
6337 /// which have their own setter method. If done anyway, the request will fail.
6338 ///
6339 /// # Additional Parameters
6340 ///
6341 /// * *$.xgafv* (query-string) - V1 error format.
6342 /// * *access_token* (query-string) - OAuth access token.
6343 /// * *alt* (query-string) - Data format for response.
6344 /// * *callback* (query-string) - JSONP
6345 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6346 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6347 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6348 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6349 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6350 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6351 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6352 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupListCall<'a, S>
6353 where T: AsRef<str> {
6354 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
6355 self
6356 }
6357
6358 /// Identifies the authorization scope for the method you are building.
6359 ///
6360 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6361 /// [`Scope::BigtableAdmin`].
6362 ///
6363 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6364 /// tokens for more than one scope.
6365 ///
6366 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6367 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6368 /// sufficient, a read-write scope will do as well.
6369 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupListCall<'a, S>
6370 where St: AsRef<str> {
6371 self._scopes.insert(String::from(scope.as_ref()));
6372 self
6373 }
6374 /// Identifies the authorization scope(s) for the method you are building.
6375 ///
6376 /// See [`Self::add_scope()`] for details.
6377 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupListCall<'a, S>
6378 where I: IntoIterator<Item = St>,
6379 St: AsRef<str> {
6380 self._scopes
6381 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6382 self
6383 }
6384
6385 /// Removes all scopes, and no default scope will be used either.
6386 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6387 /// for details).
6388 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupListCall<'a, S> {
6389 self._scopes.clear();
6390 self
6391 }
6392}
6393
6394
6395/// Updates a pending or completed Cloud Bigtable Backup.
6396///
6397/// A builder for the *instances.clusters.backups.patch* method supported by a *project* resource.
6398/// It is not used directly, but through a [`ProjectMethods`] instance.
6399///
6400/// # Example
6401///
6402/// Instantiate a resource method builder
6403///
6404/// ```test_harness,no_run
6405/// # extern crate hyper;
6406/// # extern crate hyper_rustls;
6407/// # extern crate google_bigtableadmin2 as bigtableadmin2;
6408/// use bigtableadmin2::api::Backup;
6409/// # async fn dox() {
6410/// # use std::default::Default;
6411/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
6412///
6413/// # let secret: oauth2::ApplicationSecret = Default::default();
6414/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
6415/// # secret,
6416/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6417/// # ).build().await.unwrap();
6418/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
6419/// // As the method needs a request, you would usually fill it with the desired information
6420/// // into the respective structure. Some of the parts shown here might not be applicable !
6421/// // Values shown here are possibly random and not representative !
6422/// let mut req = Backup::default();
6423///
6424/// // You can configure optional parameters by calling the respective setters at will, and
6425/// // execute the final call using `doit()`.
6426/// // Values shown here are possibly random and not representative !
6427/// let result = hub.projects().instances_clusters_backups_patch(req, "name")
6428/// .update_mask(&Default::default())
6429/// .doit().await;
6430/// # }
6431/// ```
6432pub struct ProjectInstanceClusterBackupPatchCall<'a, S>
6433 where S: 'a {
6434
6435 hub: &'a BigtableAdmin<S>,
6436 _request: Backup,
6437 _name: String,
6438 _update_mask: Option<client::FieldMask>,
6439 _delegate: Option<&'a mut dyn client::Delegate>,
6440 _additional_params: HashMap<String, String>,
6441 _scopes: BTreeSet<String>
6442}
6443
6444impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupPatchCall<'a, S> {}
6445
6446impl<'a, S> ProjectInstanceClusterBackupPatchCall<'a, S>
6447where
6448 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
6449 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
6450 S::Future: Send + Unpin + 'static,
6451 S::Error: Into<Box<dyn StdError + Send + Sync>>,
6452{
6453
6454
6455 /// Perform the operation you have build so far.
6456 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Backup)> {
6457 use std::io::{Read, Seek};
6458 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
6459 use client::{ToParts, url::Params};
6460 use std::borrow::Cow;
6461
6462 let mut dd = client::DefaultDelegate;
6463 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
6464 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.patch",
6465 http_method: hyper::Method::PATCH });
6466
6467 for &field in ["alt", "name", "updateMask"].iter() {
6468 if self._additional_params.contains_key(field) {
6469 dlg.finished(false);
6470 return Err(client::Error::FieldClash(field));
6471 }
6472 }
6473
6474 let mut params = Params::with_capacity(5 + self._additional_params.len());
6475 params.push("name", self._name);
6476 if let Some(value) = self._update_mask.as_ref() {
6477 params.push("updateMask", value.to_string());
6478 }
6479
6480 params.extend(self._additional_params.iter());
6481
6482 params.push("alt", "json");
6483 let mut url = self.hub._base_url.clone() + "v2/{+name}";
6484 if self._scopes.is_empty() {
6485 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
6486 }
6487
6488 for &(find_this, param_name) in [("{+name}", "name")].iter() {
6489 url = params.uri_replacement(url, param_name, find_this, true);
6490 }
6491 {
6492 let to_remove = ["name"];
6493 params.remove_params(&to_remove);
6494 }
6495
6496 let url = params.parse_with_url(&url);
6497
6498 let mut json_mime_type = mime::APPLICATION_JSON;
6499 let mut request_value_reader =
6500 {
6501 let mut value = json::value::to_value(&self._request).expect("serde to work");
6502 client::remove_json_null_values(&mut value);
6503 let mut dst = io::Cursor::new(Vec::with_capacity(128));
6504 json::to_writer(&mut dst, &value).unwrap();
6505 dst
6506 };
6507 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
6508 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
6509
6510
6511 loop {
6512 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
6513 Ok(token) => token,
6514 Err(e) => {
6515 match dlg.token(e) {
6516 Ok(token) => token,
6517 Err(e) => {
6518 dlg.finished(false);
6519 return Err(client::Error::MissingToken(e));
6520 }
6521 }
6522 }
6523 };
6524 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
6525 let mut req_result = {
6526 let client = &self.hub.client;
6527 dlg.pre_request();
6528 let mut req_builder = hyper::Request::builder()
6529 .method(hyper::Method::PATCH)
6530 .uri(url.as_str())
6531 .header(USER_AGENT, self.hub._user_agent.clone());
6532
6533 if let Some(token) = token.as_ref() {
6534 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6535 }
6536
6537
6538 let request = req_builder
6539 .header(CONTENT_TYPE, json_mime_type.to_string())
6540 .header(CONTENT_LENGTH, request_size as u64)
6541 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
6542
6543 client.request(request.unwrap()).await
6544
6545 };
6546
6547 match req_result {
6548 Err(err) => {
6549 if let client::Retry::After(d) = dlg.http_error(&err) {
6550 sleep(d).await;
6551 continue;
6552 }
6553 dlg.finished(false);
6554 return Err(client::Error::HttpError(err))
6555 }
6556 Ok(mut res) => {
6557 if !res.status().is_success() {
6558 let res_body_string = client::get_body_as_string(res.body_mut()).await;
6559 let (parts, _) = res.into_parts();
6560 let body = hyper::Body::from(res_body_string.clone());
6561 let restored_response = hyper::Response::from_parts(parts, body);
6562
6563 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
6564
6565 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
6566 sleep(d).await;
6567 continue;
6568 }
6569
6570 dlg.finished(false);
6571
6572 return match server_response {
6573 Some(error_value) => Err(client::Error::BadRequest(error_value)),
6574 None => Err(client::Error::Failure(restored_response)),
6575 }
6576 }
6577 let result_value = {
6578 let res_body_string = client::get_body_as_string(res.body_mut()).await;
6579
6580 match json::from_str(&res_body_string) {
6581 Ok(decoded) => (res, decoded),
6582 Err(err) => {
6583 dlg.response_json_decode_error(&res_body_string, &err);
6584 return Err(client::Error::JsonDecodeError(res_body_string, err));
6585 }
6586 }
6587 };
6588
6589 dlg.finished(true);
6590 return Ok(result_value)
6591 }
6592 }
6593 }
6594 }
6595
6596
6597 ///
6598 /// Sets the *request* property to the given value.
6599 ///
6600 /// Even though the property as already been set when instantiating this call,
6601 /// we provide this method for API completeness.
6602 pub fn request(mut self, new_value: Backup) -> ProjectInstanceClusterBackupPatchCall<'a, S> {
6603 self._request = new_value;
6604 self
6605 }
6606 /// A globally unique identifier for the backup which cannot be changed. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-zA-Z0-9*` The final segment of the name must be between 1 and 50 characters in length. The backup is stored in the cluster identified by the prefix of the backup name of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
6607 ///
6608 /// Sets the *name* path property to the given value.
6609 ///
6610 /// Even though the property as already been set when instantiating this call,
6611 /// we provide this method for API completeness.
6612 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterBackupPatchCall<'a, S> {
6613 self._name = new_value.to_string();
6614 self
6615 }
6616 /// 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.
6617 ///
6618 /// Sets the *update mask* query property to the given value.
6619 pub fn update_mask(mut self, new_value: client::FieldMask) -> ProjectInstanceClusterBackupPatchCall<'a, S> {
6620 self._update_mask = Some(new_value);
6621 self
6622 }
6623 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6624 /// while executing the actual API request.
6625 ///
6626 /// ````text
6627 /// It should be used to handle progress information, and to implement a certain level of resilience.
6628 /// ````
6629 ///
6630 /// Sets the *delegate* property to the given value.
6631 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupPatchCall<'a, S> {
6632 self._delegate = Some(new_value);
6633 self
6634 }
6635
6636 /// Set any additional parameter of the query string used in the request.
6637 /// It should be used to set parameters which are not yet available through their own
6638 /// setters.
6639 ///
6640 /// Please note that this method must not be used to set any of the known parameters
6641 /// which have their own setter method. If done anyway, the request will fail.
6642 ///
6643 /// # Additional Parameters
6644 ///
6645 /// * *$.xgafv* (query-string) - V1 error format.
6646 /// * *access_token* (query-string) - OAuth access token.
6647 /// * *alt* (query-string) - Data format for response.
6648 /// * *callback* (query-string) - JSONP
6649 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6650 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6651 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6652 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6653 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6654 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6655 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6656 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupPatchCall<'a, S>
6657 where T: AsRef<str> {
6658 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
6659 self
6660 }
6661
6662 /// Identifies the authorization scope for the method you are building.
6663 ///
6664 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6665 /// [`Scope::BigtableAdmin`].
6666 ///
6667 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6668 /// tokens for more than one scope.
6669 ///
6670 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6671 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6672 /// sufficient, a read-write scope will do as well.
6673 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupPatchCall<'a, S>
6674 where St: AsRef<str> {
6675 self._scopes.insert(String::from(scope.as_ref()));
6676 self
6677 }
6678 /// Identifies the authorization scope(s) for the method you are building.
6679 ///
6680 /// See [`Self::add_scope()`] for details.
6681 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupPatchCall<'a, S>
6682 where I: IntoIterator<Item = St>,
6683 St: AsRef<str> {
6684 self._scopes
6685 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6686 self
6687 }
6688
6689 /// Removes all scopes, and no default scope will be used either.
6690 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6691 /// for details).
6692 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupPatchCall<'a, S> {
6693 self._scopes.clear();
6694 self
6695 }
6696}
6697
6698
6699/// Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
6700///
6701/// A builder for the *instances.clusters.backups.setIamPolicy* method supported by a *project* resource.
6702/// It is not used directly, but through a [`ProjectMethods`] instance.
6703///
6704/// # Example
6705///
6706/// Instantiate a resource method builder
6707///
6708/// ```test_harness,no_run
6709/// # extern crate hyper;
6710/// # extern crate hyper_rustls;
6711/// # extern crate google_bigtableadmin2 as bigtableadmin2;
6712/// use bigtableadmin2::api::SetIamPolicyRequest;
6713/// # async fn dox() {
6714/// # use std::default::Default;
6715/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
6716///
6717/// # let secret: oauth2::ApplicationSecret = Default::default();
6718/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
6719/// # secret,
6720/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6721/// # ).build().await.unwrap();
6722/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
6723/// // As the method needs a request, you would usually fill it with the desired information
6724/// // into the respective structure. Some of the parts shown here might not be applicable !
6725/// // Values shown here are possibly random and not representative !
6726/// let mut req = SetIamPolicyRequest::default();
6727///
6728/// // You can configure optional parameters by calling the respective setters at will, and
6729/// // execute the final call using `doit()`.
6730/// // Values shown here are possibly random and not representative !
6731/// let result = hub.projects().instances_clusters_backups_set_iam_policy(req, "resource")
6732/// .doit().await;
6733/// # }
6734/// ```
6735pub struct ProjectInstanceClusterBackupSetIamPolicyCall<'a, S>
6736 where S: 'a {
6737
6738 hub: &'a BigtableAdmin<S>,
6739 _request: SetIamPolicyRequest,
6740 _resource: String,
6741 _delegate: Option<&'a mut dyn client::Delegate>,
6742 _additional_params: HashMap<String, String>,
6743 _scopes: BTreeSet<String>
6744}
6745
6746impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupSetIamPolicyCall<'a, S> {}
6747
6748impl<'a, S> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S>
6749where
6750 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
6751 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
6752 S::Future: Send + Unpin + 'static,
6753 S::Error: Into<Box<dyn StdError + Send + Sync>>,
6754{
6755
6756
6757 /// Perform the operation you have build so far.
6758 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Policy)> {
6759 use std::io::{Read, Seek};
6760 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
6761 use client::{ToParts, url::Params};
6762 use std::borrow::Cow;
6763
6764 let mut dd = client::DefaultDelegate;
6765 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
6766 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.setIamPolicy",
6767 http_method: hyper::Method::POST });
6768
6769 for &field in ["alt", "resource"].iter() {
6770 if self._additional_params.contains_key(field) {
6771 dlg.finished(false);
6772 return Err(client::Error::FieldClash(field));
6773 }
6774 }
6775
6776 let mut params = Params::with_capacity(4 + self._additional_params.len());
6777 params.push("resource", self._resource);
6778
6779 params.extend(self._additional_params.iter());
6780
6781 params.push("alt", "json");
6782 let mut url = self.hub._base_url.clone() + "v2/{+resource}:setIamPolicy";
6783 if self._scopes.is_empty() {
6784 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
6785 }
6786
6787 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
6788 url = params.uri_replacement(url, param_name, find_this, true);
6789 }
6790 {
6791 let to_remove = ["resource"];
6792 params.remove_params(&to_remove);
6793 }
6794
6795 let url = params.parse_with_url(&url);
6796
6797 let mut json_mime_type = mime::APPLICATION_JSON;
6798 let mut request_value_reader =
6799 {
6800 let mut value = json::value::to_value(&self._request).expect("serde to work");
6801 client::remove_json_null_values(&mut value);
6802 let mut dst = io::Cursor::new(Vec::with_capacity(128));
6803 json::to_writer(&mut dst, &value).unwrap();
6804 dst
6805 };
6806 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
6807 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
6808
6809
6810 loop {
6811 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
6812 Ok(token) => token,
6813 Err(e) => {
6814 match dlg.token(e) {
6815 Ok(token) => token,
6816 Err(e) => {
6817 dlg.finished(false);
6818 return Err(client::Error::MissingToken(e));
6819 }
6820 }
6821 }
6822 };
6823 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
6824 let mut req_result = {
6825 let client = &self.hub.client;
6826 dlg.pre_request();
6827 let mut req_builder = hyper::Request::builder()
6828 .method(hyper::Method::POST)
6829 .uri(url.as_str())
6830 .header(USER_AGENT, self.hub._user_agent.clone());
6831
6832 if let Some(token) = token.as_ref() {
6833 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6834 }
6835
6836
6837 let request = req_builder
6838 .header(CONTENT_TYPE, json_mime_type.to_string())
6839 .header(CONTENT_LENGTH, request_size as u64)
6840 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
6841
6842 client.request(request.unwrap()).await
6843
6844 };
6845
6846 match req_result {
6847 Err(err) => {
6848 if let client::Retry::After(d) = dlg.http_error(&err) {
6849 sleep(d).await;
6850 continue;
6851 }
6852 dlg.finished(false);
6853 return Err(client::Error::HttpError(err))
6854 }
6855 Ok(mut res) => {
6856 if !res.status().is_success() {
6857 let res_body_string = client::get_body_as_string(res.body_mut()).await;
6858 let (parts, _) = res.into_parts();
6859 let body = hyper::Body::from(res_body_string.clone());
6860 let restored_response = hyper::Response::from_parts(parts, body);
6861
6862 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
6863
6864 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
6865 sleep(d).await;
6866 continue;
6867 }
6868
6869 dlg.finished(false);
6870
6871 return match server_response {
6872 Some(error_value) => Err(client::Error::BadRequest(error_value)),
6873 None => Err(client::Error::Failure(restored_response)),
6874 }
6875 }
6876 let result_value = {
6877 let res_body_string = client::get_body_as_string(res.body_mut()).await;
6878
6879 match json::from_str(&res_body_string) {
6880 Ok(decoded) => (res, decoded),
6881 Err(err) => {
6882 dlg.response_json_decode_error(&res_body_string, &err);
6883 return Err(client::Error::JsonDecodeError(res_body_string, err));
6884 }
6885 }
6886 };
6887
6888 dlg.finished(true);
6889 return Ok(result_value)
6890 }
6891 }
6892 }
6893 }
6894
6895
6896 ///
6897 /// Sets the *request* property to the given value.
6898 ///
6899 /// Even though the property as already been set when instantiating this call,
6900 /// we provide this method for API completeness.
6901 pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S> {
6902 self._request = new_value;
6903 self
6904 }
6905 /// REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
6906 ///
6907 /// Sets the *resource* path property to the given value.
6908 ///
6909 /// Even though the property as already been set when instantiating this call,
6910 /// we provide this method for API completeness.
6911 pub fn resource(mut self, new_value: &str) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S> {
6912 self._resource = new_value.to_string();
6913 self
6914 }
6915 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6916 /// while executing the actual API request.
6917 ///
6918 /// ````text
6919 /// It should be used to handle progress information, and to implement a certain level of resilience.
6920 /// ````
6921 ///
6922 /// Sets the *delegate* property to the given value.
6923 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S> {
6924 self._delegate = Some(new_value);
6925 self
6926 }
6927
6928 /// Set any additional parameter of the query string used in the request.
6929 /// It should be used to set parameters which are not yet available through their own
6930 /// setters.
6931 ///
6932 /// Please note that this method must not be used to set any of the known parameters
6933 /// which have their own setter method. If done anyway, the request will fail.
6934 ///
6935 /// # Additional Parameters
6936 ///
6937 /// * *$.xgafv* (query-string) - V1 error format.
6938 /// * *access_token* (query-string) - OAuth access token.
6939 /// * *alt* (query-string) - Data format for response.
6940 /// * *callback* (query-string) - JSONP
6941 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6942 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6943 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6944 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6945 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6946 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6947 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6948 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S>
6949 where T: AsRef<str> {
6950 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
6951 self
6952 }
6953
6954 /// Identifies the authorization scope for the method you are building.
6955 ///
6956 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6957 /// [`Scope::BigtableAdmin`].
6958 ///
6959 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6960 /// tokens for more than one scope.
6961 ///
6962 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6963 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6964 /// sufficient, a read-write scope will do as well.
6965 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S>
6966 where St: AsRef<str> {
6967 self._scopes.insert(String::from(scope.as_ref()));
6968 self
6969 }
6970 /// Identifies the authorization scope(s) for the method you are building.
6971 ///
6972 /// See [`Self::add_scope()`] for details.
6973 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S>
6974 where I: IntoIterator<Item = St>,
6975 St: AsRef<str> {
6976 self._scopes
6977 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6978 self
6979 }
6980
6981 /// Removes all scopes, and no default scope will be used either.
6982 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6983 /// for details).
6984 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, S> {
6985 self._scopes.clear();
6986 self
6987 }
6988}
6989
6990
6991/// Returns permissions that the caller has on the specified Table or Backup resource.
6992///
6993/// A builder for the *instances.clusters.backups.testIamPermissions* method supported by a *project* resource.
6994/// It is not used directly, but through a [`ProjectMethods`] instance.
6995///
6996/// # Example
6997///
6998/// Instantiate a resource method builder
6999///
7000/// ```test_harness,no_run
7001/// # extern crate hyper;
7002/// # extern crate hyper_rustls;
7003/// # extern crate google_bigtableadmin2 as bigtableadmin2;
7004/// use bigtableadmin2::api::TestIamPermissionsRequest;
7005/// # async fn dox() {
7006/// # use std::default::Default;
7007/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
7008///
7009/// # let secret: oauth2::ApplicationSecret = Default::default();
7010/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
7011/// # secret,
7012/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7013/// # ).build().await.unwrap();
7014/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
7015/// // As the method needs a request, you would usually fill it with the desired information
7016/// // into the respective structure. Some of the parts shown here might not be applicable !
7017/// // Values shown here are possibly random and not representative !
7018/// let mut req = TestIamPermissionsRequest::default();
7019///
7020/// // You can configure optional parameters by calling the respective setters at will, and
7021/// // execute the final call using `doit()`.
7022/// // Values shown here are possibly random and not representative !
7023/// let result = hub.projects().instances_clusters_backups_test_iam_permissions(req, "resource")
7024/// .doit().await;
7025/// # }
7026/// ```
7027pub struct ProjectInstanceClusterBackupTestIamPermissionCall<'a, S>
7028 where S: 'a {
7029
7030 hub: &'a BigtableAdmin<S>,
7031 _request: TestIamPermissionsRequest,
7032 _resource: String,
7033 _delegate: Option<&'a mut dyn client::Delegate>,
7034 _additional_params: HashMap<String, String>,
7035 _scopes: BTreeSet<String>
7036}
7037
7038impl<'a, S> client::CallBuilder for ProjectInstanceClusterBackupTestIamPermissionCall<'a, S> {}
7039
7040impl<'a, S> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S>
7041where
7042 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
7043 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
7044 S::Future: Send + Unpin + 'static,
7045 S::Error: Into<Box<dyn StdError + Send + Sync>>,
7046{
7047
7048
7049 /// Perform the operation you have build so far.
7050 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, TestIamPermissionsResponse)> {
7051 use std::io::{Read, Seek};
7052 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
7053 use client::{ToParts, url::Params};
7054 use std::borrow::Cow;
7055
7056 let mut dd = client::DefaultDelegate;
7057 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
7058 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.testIamPermissions",
7059 http_method: hyper::Method::POST });
7060
7061 for &field in ["alt", "resource"].iter() {
7062 if self._additional_params.contains_key(field) {
7063 dlg.finished(false);
7064 return Err(client::Error::FieldClash(field));
7065 }
7066 }
7067
7068 let mut params = Params::with_capacity(4 + self._additional_params.len());
7069 params.push("resource", self._resource);
7070
7071 params.extend(self._additional_params.iter());
7072
7073 params.push("alt", "json");
7074 let mut url = self.hub._base_url.clone() + "v2/{+resource}:testIamPermissions";
7075 if self._scopes.is_empty() {
7076 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
7077 }
7078
7079 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
7080 url = params.uri_replacement(url, param_name, find_this, true);
7081 }
7082 {
7083 let to_remove = ["resource"];
7084 params.remove_params(&to_remove);
7085 }
7086
7087 let url = params.parse_with_url(&url);
7088
7089 let mut json_mime_type = mime::APPLICATION_JSON;
7090 let mut request_value_reader =
7091 {
7092 let mut value = json::value::to_value(&self._request).expect("serde to work");
7093 client::remove_json_null_values(&mut value);
7094 let mut dst = io::Cursor::new(Vec::with_capacity(128));
7095 json::to_writer(&mut dst, &value).unwrap();
7096 dst
7097 };
7098 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
7099 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
7100
7101
7102 loop {
7103 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
7104 Ok(token) => token,
7105 Err(e) => {
7106 match dlg.token(e) {
7107 Ok(token) => token,
7108 Err(e) => {
7109 dlg.finished(false);
7110 return Err(client::Error::MissingToken(e));
7111 }
7112 }
7113 }
7114 };
7115 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
7116 let mut req_result = {
7117 let client = &self.hub.client;
7118 dlg.pre_request();
7119 let mut req_builder = hyper::Request::builder()
7120 .method(hyper::Method::POST)
7121 .uri(url.as_str())
7122 .header(USER_AGENT, self.hub._user_agent.clone());
7123
7124 if let Some(token) = token.as_ref() {
7125 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7126 }
7127
7128
7129 let request = req_builder
7130 .header(CONTENT_TYPE, json_mime_type.to_string())
7131 .header(CONTENT_LENGTH, request_size as u64)
7132 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
7133
7134 client.request(request.unwrap()).await
7135
7136 };
7137
7138 match req_result {
7139 Err(err) => {
7140 if let client::Retry::After(d) = dlg.http_error(&err) {
7141 sleep(d).await;
7142 continue;
7143 }
7144 dlg.finished(false);
7145 return Err(client::Error::HttpError(err))
7146 }
7147 Ok(mut res) => {
7148 if !res.status().is_success() {
7149 let res_body_string = client::get_body_as_string(res.body_mut()).await;
7150 let (parts, _) = res.into_parts();
7151 let body = hyper::Body::from(res_body_string.clone());
7152 let restored_response = hyper::Response::from_parts(parts, body);
7153
7154 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
7155
7156 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
7157 sleep(d).await;
7158 continue;
7159 }
7160
7161 dlg.finished(false);
7162
7163 return match server_response {
7164 Some(error_value) => Err(client::Error::BadRequest(error_value)),
7165 None => Err(client::Error::Failure(restored_response)),
7166 }
7167 }
7168 let result_value = {
7169 let res_body_string = client::get_body_as_string(res.body_mut()).await;
7170
7171 match json::from_str(&res_body_string) {
7172 Ok(decoded) => (res, decoded),
7173 Err(err) => {
7174 dlg.response_json_decode_error(&res_body_string, &err);
7175 return Err(client::Error::JsonDecodeError(res_body_string, err));
7176 }
7177 }
7178 };
7179
7180 dlg.finished(true);
7181 return Ok(result_value)
7182 }
7183 }
7184 }
7185 }
7186
7187
7188 ///
7189 /// Sets the *request* property to the given value.
7190 ///
7191 /// Even though the property as already been set when instantiating this call,
7192 /// we provide this method for API completeness.
7193 pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S> {
7194 self._request = new_value;
7195 self
7196 }
7197 /// REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
7198 ///
7199 /// Sets the *resource* path property to the given value.
7200 ///
7201 /// Even though the property as already been set when instantiating this call,
7202 /// we provide this method for API completeness.
7203 pub fn resource(mut self, new_value: &str) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S> {
7204 self._resource = new_value.to_string();
7205 self
7206 }
7207 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7208 /// while executing the actual API request.
7209 ///
7210 /// ````text
7211 /// It should be used to handle progress information, and to implement a certain level of resilience.
7212 /// ````
7213 ///
7214 /// Sets the *delegate* property to the given value.
7215 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S> {
7216 self._delegate = Some(new_value);
7217 self
7218 }
7219
7220 /// Set any additional parameter of the query string used in the request.
7221 /// It should be used to set parameters which are not yet available through their own
7222 /// setters.
7223 ///
7224 /// Please note that this method must not be used to set any of the known parameters
7225 /// which have their own setter method. If done anyway, the request will fail.
7226 ///
7227 /// # Additional Parameters
7228 ///
7229 /// * *$.xgafv* (query-string) - V1 error format.
7230 /// * *access_token* (query-string) - OAuth access token.
7231 /// * *alt* (query-string) - Data format for response.
7232 /// * *callback* (query-string) - JSONP
7233 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7234 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7235 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7236 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7237 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7238 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7239 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7240 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S>
7241 where T: AsRef<str> {
7242 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
7243 self
7244 }
7245
7246 /// Identifies the authorization scope for the method you are building.
7247 ///
7248 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7249 /// [`Scope::BigtableAdmin`].
7250 ///
7251 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7252 /// tokens for more than one scope.
7253 ///
7254 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7255 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7256 /// sufficient, a read-write scope will do as well.
7257 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S>
7258 where St: AsRef<str> {
7259 self._scopes.insert(String::from(scope.as_ref()));
7260 self
7261 }
7262 /// Identifies the authorization scope(s) for the method you are building.
7263 ///
7264 /// See [`Self::add_scope()`] for details.
7265 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S>
7266 where I: IntoIterator<Item = St>,
7267 St: AsRef<str> {
7268 self._scopes
7269 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7270 self
7271 }
7272
7273 /// Removes all scopes, and no default scope will be used either.
7274 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7275 /// for details).
7276 pub fn clear_scopes(mut self) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, S> {
7277 self._scopes.clear();
7278 self
7279 }
7280}
7281
7282
7283/// Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.
7284///
7285/// A builder for the *instances.clusters.hotTablets.list* method supported by a *project* resource.
7286/// It is not used directly, but through a [`ProjectMethods`] instance.
7287///
7288/// # Example
7289///
7290/// Instantiate a resource method builder
7291///
7292/// ```test_harness,no_run
7293/// # extern crate hyper;
7294/// # extern crate hyper_rustls;
7295/// # extern crate google_bigtableadmin2 as bigtableadmin2;
7296/// # async fn dox() {
7297/// # use std::default::Default;
7298/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
7299///
7300/// # let secret: oauth2::ApplicationSecret = Default::default();
7301/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
7302/// # secret,
7303/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7304/// # ).build().await.unwrap();
7305/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
7306/// // You can configure optional parameters by calling the respective setters at will, and
7307/// // execute the final call using `doit()`.
7308/// // Values shown here are possibly random and not representative !
7309/// let result = hub.projects().instances_clusters_hot_tablets_list("parent")
7310/// .start_time(chrono::Utc::now())
7311/// .page_token("sed")
7312/// .page_size(-24)
7313/// .end_time(chrono::Utc::now())
7314/// .doit().await;
7315/// # }
7316/// ```
7317pub struct ProjectInstanceClusterHotTabletListCall<'a, S>
7318 where S: 'a {
7319
7320 hub: &'a BigtableAdmin<S>,
7321 _parent: String,
7322 _start_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
7323 _page_token: Option<String>,
7324 _page_size: Option<i32>,
7325 _end_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
7326 _delegate: Option<&'a mut dyn client::Delegate>,
7327 _additional_params: HashMap<String, String>,
7328 _scopes: BTreeSet<String>
7329}
7330
7331impl<'a, S> client::CallBuilder for ProjectInstanceClusterHotTabletListCall<'a, S> {}
7332
7333impl<'a, S> ProjectInstanceClusterHotTabletListCall<'a, S>
7334where
7335 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
7336 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
7337 S::Future: Send + Unpin + 'static,
7338 S::Error: Into<Box<dyn StdError + Send + Sync>>,
7339{
7340
7341
7342 /// Perform the operation you have build so far.
7343 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListHotTabletsResponse)> {
7344 use std::io::{Read, Seek};
7345 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
7346 use client::{ToParts, url::Params};
7347 use std::borrow::Cow;
7348
7349 let mut dd = client::DefaultDelegate;
7350 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
7351 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.hotTablets.list",
7352 http_method: hyper::Method::GET });
7353
7354 for &field in ["alt", "parent", "startTime", "pageToken", "pageSize", "endTime"].iter() {
7355 if self._additional_params.contains_key(field) {
7356 dlg.finished(false);
7357 return Err(client::Error::FieldClash(field));
7358 }
7359 }
7360
7361 let mut params = Params::with_capacity(7 + self._additional_params.len());
7362 params.push("parent", self._parent);
7363 if let Some(value) = self._start_time.as_ref() {
7364 params.push("startTime", ::client::serde::datetime_to_string(&value));
7365 }
7366 if let Some(value) = self._page_token.as_ref() {
7367 params.push("pageToken", value);
7368 }
7369 if let Some(value) = self._page_size.as_ref() {
7370 params.push("pageSize", value.to_string());
7371 }
7372 if let Some(value) = self._end_time.as_ref() {
7373 params.push("endTime", ::client::serde::datetime_to_string(&value));
7374 }
7375
7376 params.extend(self._additional_params.iter());
7377
7378 params.push("alt", "json");
7379 let mut url = self.hub._base_url.clone() + "v2/{+parent}/hotTablets";
7380 if self._scopes.is_empty() {
7381 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
7382 }
7383
7384 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
7385 url = params.uri_replacement(url, param_name, find_this, true);
7386 }
7387 {
7388 let to_remove = ["parent"];
7389 params.remove_params(&to_remove);
7390 }
7391
7392 let url = params.parse_with_url(&url);
7393
7394
7395
7396 loop {
7397 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
7398 Ok(token) => token,
7399 Err(e) => {
7400 match dlg.token(e) {
7401 Ok(token) => token,
7402 Err(e) => {
7403 dlg.finished(false);
7404 return Err(client::Error::MissingToken(e));
7405 }
7406 }
7407 }
7408 };
7409 let mut req_result = {
7410 let client = &self.hub.client;
7411 dlg.pre_request();
7412 let mut req_builder = hyper::Request::builder()
7413 .method(hyper::Method::GET)
7414 .uri(url.as_str())
7415 .header(USER_AGENT, self.hub._user_agent.clone());
7416
7417 if let Some(token) = token.as_ref() {
7418 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7419 }
7420
7421
7422 let request = req_builder
7423 .body(hyper::body::Body::empty());
7424
7425 client.request(request.unwrap()).await
7426
7427 };
7428
7429 match req_result {
7430 Err(err) => {
7431 if let client::Retry::After(d) = dlg.http_error(&err) {
7432 sleep(d).await;
7433 continue;
7434 }
7435 dlg.finished(false);
7436 return Err(client::Error::HttpError(err))
7437 }
7438 Ok(mut res) => {
7439 if !res.status().is_success() {
7440 let res_body_string = client::get_body_as_string(res.body_mut()).await;
7441 let (parts, _) = res.into_parts();
7442 let body = hyper::Body::from(res_body_string.clone());
7443 let restored_response = hyper::Response::from_parts(parts, body);
7444
7445 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
7446
7447 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
7448 sleep(d).await;
7449 continue;
7450 }
7451
7452 dlg.finished(false);
7453
7454 return match server_response {
7455 Some(error_value) => Err(client::Error::BadRequest(error_value)),
7456 None => Err(client::Error::Failure(restored_response)),
7457 }
7458 }
7459 let result_value = {
7460 let res_body_string = client::get_body_as_string(res.body_mut()).await;
7461
7462 match json::from_str(&res_body_string) {
7463 Ok(decoded) => (res, decoded),
7464 Err(err) => {
7465 dlg.response_json_decode_error(&res_body_string, &err);
7466 return Err(client::Error::JsonDecodeError(res_body_string, err));
7467 }
7468 }
7469 };
7470
7471 dlg.finished(true);
7472 return Ok(result_value)
7473 }
7474 }
7475 }
7476 }
7477
7478
7479 /// Required. The cluster name to list hot tablets. Value is in the following form: `projects/{project}/instances/{instance}/clusters/{cluster}`.
7480 ///
7481 /// Sets the *parent* path property to the given value.
7482 ///
7483 /// Even though the property as already been set when instantiating this call,
7484 /// we provide this method for API completeness.
7485 pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7486 self._parent = new_value.to_string();
7487 self
7488 }
7489 /// The start time to list hot tablets. The hot tablets in the response will have start times between the requested start time and end time. Start time defaults to Now if it is unset, and end time defaults to Now - 24 hours if it is unset. The start time should be less than the end time, and the maximum allowed time range between start time and end time is 48 hours. Start time and end time should have values between Now and Now - 14 days.
7490 ///
7491 /// Sets the *start time* query property to the given value.
7492 pub fn start_time(mut self, new_value: client::chrono::DateTime<client::chrono::offset::Utc>) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7493 self._start_time = Some(new_value);
7494 self
7495 }
7496 /// The value of `next_page_token` returned by a previous call.
7497 ///
7498 /// Sets the *page token* query property to the given value.
7499 pub fn page_token(mut self, new_value: &str) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7500 self._page_token = Some(new_value.to_string());
7501 self
7502 }
7503 /// Maximum number of results per page. A page_size that is empty or 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 do not need a page_size field. If a page_size is set in subsequent calls, it must match the page_size given in the first request.
7504 ///
7505 /// Sets the *page size* query property to the given value.
7506 pub fn page_size(mut self, new_value: i32) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7507 self._page_size = Some(new_value);
7508 self
7509 }
7510 /// The end time to list hot tablets.
7511 ///
7512 /// Sets the *end time* query property to the given value.
7513 pub fn end_time(mut self, new_value: client::chrono::DateTime<client::chrono::offset::Utc>) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7514 self._end_time = Some(new_value);
7515 self
7516 }
7517 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7518 /// while executing the actual API request.
7519 ///
7520 /// ````text
7521 /// It should be used to handle progress information, and to implement a certain level of resilience.
7522 /// ````
7523 ///
7524 /// Sets the *delegate* property to the given value.
7525 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7526 self._delegate = Some(new_value);
7527 self
7528 }
7529
7530 /// Set any additional parameter of the query string used in the request.
7531 /// It should be used to set parameters which are not yet available through their own
7532 /// setters.
7533 ///
7534 /// Please note that this method must not be used to set any of the known parameters
7535 /// which have their own setter method. If done anyway, the request will fail.
7536 ///
7537 /// # Additional Parameters
7538 ///
7539 /// * *$.xgafv* (query-string) - V1 error format.
7540 /// * *access_token* (query-string) - OAuth access token.
7541 /// * *alt* (query-string) - Data format for response.
7542 /// * *callback* (query-string) - JSONP
7543 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7544 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7545 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7546 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7547 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7548 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7549 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7550 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterHotTabletListCall<'a, S>
7551 where T: AsRef<str> {
7552 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
7553 self
7554 }
7555
7556 /// Identifies the authorization scope for the method you are building.
7557 ///
7558 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7559 /// [`Scope::BigtableAdmin`].
7560 ///
7561 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7562 /// tokens for more than one scope.
7563 ///
7564 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7565 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7566 /// sufficient, a read-write scope will do as well.
7567 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterHotTabletListCall<'a, S>
7568 where St: AsRef<str> {
7569 self._scopes.insert(String::from(scope.as_ref()));
7570 self
7571 }
7572 /// Identifies the authorization scope(s) for the method you are building.
7573 ///
7574 /// See [`Self::add_scope()`] for details.
7575 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterHotTabletListCall<'a, S>
7576 where I: IntoIterator<Item = St>,
7577 St: AsRef<str> {
7578 self._scopes
7579 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7580 self
7581 }
7582
7583 /// Removes all scopes, and no default scope will be used either.
7584 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7585 /// for details).
7586 pub fn clear_scopes(mut self) -> ProjectInstanceClusterHotTabletListCall<'a, S> {
7587 self._scopes.clear();
7588 self
7589 }
7590}
7591
7592
7593/// Creates a cluster within an instance. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
7594///
7595/// A builder for the *instances.clusters.create* method supported by a *project* resource.
7596/// It is not used directly, but through a [`ProjectMethods`] instance.
7597///
7598/// # Example
7599///
7600/// Instantiate a resource method builder
7601///
7602/// ```test_harness,no_run
7603/// # extern crate hyper;
7604/// # extern crate hyper_rustls;
7605/// # extern crate google_bigtableadmin2 as bigtableadmin2;
7606/// use bigtableadmin2::api::Cluster;
7607/// # async fn dox() {
7608/// # use std::default::Default;
7609/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
7610///
7611/// # let secret: oauth2::ApplicationSecret = Default::default();
7612/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
7613/// # secret,
7614/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7615/// # ).build().await.unwrap();
7616/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
7617/// // As the method needs a request, you would usually fill it with the desired information
7618/// // into the respective structure. Some of the parts shown here might not be applicable !
7619/// // Values shown here are possibly random and not representative !
7620/// let mut req = Cluster::default();
7621///
7622/// // You can configure optional parameters by calling the respective setters at will, and
7623/// // execute the final call using `doit()`.
7624/// // Values shown here are possibly random and not representative !
7625/// let result = hub.projects().instances_clusters_create(req, "parent")
7626/// .cluster_id("vero")
7627/// .doit().await;
7628/// # }
7629/// ```
7630pub struct ProjectInstanceClusterCreateCall<'a, S>
7631 where S: 'a {
7632
7633 hub: &'a BigtableAdmin<S>,
7634 _request: Cluster,
7635 _parent: String,
7636 _cluster_id: Option<String>,
7637 _delegate: Option<&'a mut dyn client::Delegate>,
7638 _additional_params: HashMap<String, String>,
7639 _scopes: BTreeSet<String>
7640}
7641
7642impl<'a, S> client::CallBuilder for ProjectInstanceClusterCreateCall<'a, S> {}
7643
7644impl<'a, S> ProjectInstanceClusterCreateCall<'a, S>
7645where
7646 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
7647 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
7648 S::Future: Send + Unpin + 'static,
7649 S::Error: Into<Box<dyn StdError + Send + Sync>>,
7650{
7651
7652
7653 /// Perform the operation you have build so far.
7654 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
7655 use std::io::{Read, Seek};
7656 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
7657 use client::{ToParts, url::Params};
7658 use std::borrow::Cow;
7659
7660 let mut dd = client::DefaultDelegate;
7661 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
7662 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.create",
7663 http_method: hyper::Method::POST });
7664
7665 for &field in ["alt", "parent", "clusterId"].iter() {
7666 if self._additional_params.contains_key(field) {
7667 dlg.finished(false);
7668 return Err(client::Error::FieldClash(field));
7669 }
7670 }
7671
7672 let mut params = Params::with_capacity(5 + self._additional_params.len());
7673 params.push("parent", self._parent);
7674 if let Some(value) = self._cluster_id.as_ref() {
7675 params.push("clusterId", value);
7676 }
7677
7678 params.extend(self._additional_params.iter());
7679
7680 params.push("alt", "json");
7681 let mut url = self.hub._base_url.clone() + "v2/{+parent}/clusters";
7682 if self._scopes.is_empty() {
7683 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
7684 }
7685
7686 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
7687 url = params.uri_replacement(url, param_name, find_this, true);
7688 }
7689 {
7690 let to_remove = ["parent"];
7691 params.remove_params(&to_remove);
7692 }
7693
7694 let url = params.parse_with_url(&url);
7695
7696 let mut json_mime_type = mime::APPLICATION_JSON;
7697 let mut request_value_reader =
7698 {
7699 let mut value = json::value::to_value(&self._request).expect("serde to work");
7700 client::remove_json_null_values(&mut value);
7701 let mut dst = io::Cursor::new(Vec::with_capacity(128));
7702 json::to_writer(&mut dst, &value).unwrap();
7703 dst
7704 };
7705 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
7706 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
7707
7708
7709 loop {
7710 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
7711 Ok(token) => token,
7712 Err(e) => {
7713 match dlg.token(e) {
7714 Ok(token) => token,
7715 Err(e) => {
7716 dlg.finished(false);
7717 return Err(client::Error::MissingToken(e));
7718 }
7719 }
7720 }
7721 };
7722 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
7723 let mut req_result = {
7724 let client = &self.hub.client;
7725 dlg.pre_request();
7726 let mut req_builder = hyper::Request::builder()
7727 .method(hyper::Method::POST)
7728 .uri(url.as_str())
7729 .header(USER_AGENT, self.hub._user_agent.clone());
7730
7731 if let Some(token) = token.as_ref() {
7732 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7733 }
7734
7735
7736 let request = req_builder
7737 .header(CONTENT_TYPE, json_mime_type.to_string())
7738 .header(CONTENT_LENGTH, request_size as u64)
7739 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
7740
7741 client.request(request.unwrap()).await
7742
7743 };
7744
7745 match req_result {
7746 Err(err) => {
7747 if let client::Retry::After(d) = dlg.http_error(&err) {
7748 sleep(d).await;
7749 continue;
7750 }
7751 dlg.finished(false);
7752 return Err(client::Error::HttpError(err))
7753 }
7754 Ok(mut res) => {
7755 if !res.status().is_success() {
7756 let res_body_string = client::get_body_as_string(res.body_mut()).await;
7757 let (parts, _) = res.into_parts();
7758 let body = hyper::Body::from(res_body_string.clone());
7759 let restored_response = hyper::Response::from_parts(parts, body);
7760
7761 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
7762
7763 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
7764 sleep(d).await;
7765 continue;
7766 }
7767
7768 dlg.finished(false);
7769
7770 return match server_response {
7771 Some(error_value) => Err(client::Error::BadRequest(error_value)),
7772 None => Err(client::Error::Failure(restored_response)),
7773 }
7774 }
7775 let result_value = {
7776 let res_body_string = client::get_body_as_string(res.body_mut()).await;
7777
7778 match json::from_str(&res_body_string) {
7779 Ok(decoded) => (res, decoded),
7780 Err(err) => {
7781 dlg.response_json_decode_error(&res_body_string, &err);
7782 return Err(client::Error::JsonDecodeError(res_body_string, err));
7783 }
7784 }
7785 };
7786
7787 dlg.finished(true);
7788 return Ok(result_value)
7789 }
7790 }
7791 }
7792 }
7793
7794
7795 ///
7796 /// Sets the *request* property to the given value.
7797 ///
7798 /// Even though the property as already been set when instantiating this call,
7799 /// we provide this method for API completeness.
7800 pub fn request(mut self, new_value: Cluster) -> ProjectInstanceClusterCreateCall<'a, S> {
7801 self._request = new_value;
7802 self
7803 }
7804 /// Required. The unique name of the instance in which to create the new cluster. Values are of the form `projects/{project}/instances/{instance}`.
7805 ///
7806 /// Sets the *parent* path property to the given value.
7807 ///
7808 /// Even though the property as already been set when instantiating this call,
7809 /// we provide this method for API completeness.
7810 pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterCreateCall<'a, S> {
7811 self._parent = new_value.to_string();
7812 self
7813 }
7814 /// Required. The ID to be used when referring to the new cluster within its instance, e.g., just `mycluster` rather than `projects/myproject/instances/myinstance/clusters/mycluster`.
7815 ///
7816 /// Sets the *cluster id* query property to the given value.
7817 pub fn cluster_id(mut self, new_value: &str) -> ProjectInstanceClusterCreateCall<'a, S> {
7818 self._cluster_id = Some(new_value.to_string());
7819 self
7820 }
7821 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7822 /// while executing the actual API request.
7823 ///
7824 /// ````text
7825 /// It should be used to handle progress information, and to implement a certain level of resilience.
7826 /// ````
7827 ///
7828 /// Sets the *delegate* property to the given value.
7829 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterCreateCall<'a, S> {
7830 self._delegate = Some(new_value);
7831 self
7832 }
7833
7834 /// Set any additional parameter of the query string used in the request.
7835 /// It should be used to set parameters which are not yet available through their own
7836 /// setters.
7837 ///
7838 /// Please note that this method must not be used to set any of the known parameters
7839 /// which have their own setter method. If done anyway, the request will fail.
7840 ///
7841 /// # Additional Parameters
7842 ///
7843 /// * *$.xgafv* (query-string) - V1 error format.
7844 /// * *access_token* (query-string) - OAuth access token.
7845 /// * *alt* (query-string) - Data format for response.
7846 /// * *callback* (query-string) - JSONP
7847 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7848 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7849 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7850 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7851 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7852 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7853 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7854 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterCreateCall<'a, S>
7855 where T: AsRef<str> {
7856 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
7857 self
7858 }
7859
7860 /// Identifies the authorization scope for the method you are building.
7861 ///
7862 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7863 /// [`Scope::BigtableAdmin`].
7864 ///
7865 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7866 /// tokens for more than one scope.
7867 ///
7868 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7869 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7870 /// sufficient, a read-write scope will do as well.
7871 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterCreateCall<'a, S>
7872 where St: AsRef<str> {
7873 self._scopes.insert(String::from(scope.as_ref()));
7874 self
7875 }
7876 /// Identifies the authorization scope(s) for the method you are building.
7877 ///
7878 /// See [`Self::add_scope()`] for details.
7879 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterCreateCall<'a, S>
7880 where I: IntoIterator<Item = St>,
7881 St: AsRef<str> {
7882 self._scopes
7883 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7884 self
7885 }
7886
7887 /// Removes all scopes, and no default scope will be used either.
7888 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7889 /// for details).
7890 pub fn clear_scopes(mut self) -> ProjectInstanceClusterCreateCall<'a, S> {
7891 self._scopes.clear();
7892 self
7893 }
7894}
7895
7896
7897/// Deletes a cluster from an instance.
7898///
7899/// A builder for the *instances.clusters.delete* method supported by a *project* resource.
7900/// It is not used directly, but through a [`ProjectMethods`] instance.
7901///
7902/// # Example
7903///
7904/// Instantiate a resource method builder
7905///
7906/// ```test_harness,no_run
7907/// # extern crate hyper;
7908/// # extern crate hyper_rustls;
7909/// # extern crate google_bigtableadmin2 as bigtableadmin2;
7910/// # async fn dox() {
7911/// # use std::default::Default;
7912/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
7913///
7914/// # let secret: oauth2::ApplicationSecret = Default::default();
7915/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
7916/// # secret,
7917/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7918/// # ).build().await.unwrap();
7919/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
7920/// // You can configure optional parameters by calling the respective setters at will, and
7921/// // execute the final call using `doit()`.
7922/// // Values shown here are possibly random and not representative !
7923/// let result = hub.projects().instances_clusters_delete("name")
7924/// .doit().await;
7925/// # }
7926/// ```
7927pub struct ProjectInstanceClusterDeleteCall<'a, S>
7928 where S: 'a {
7929
7930 hub: &'a BigtableAdmin<S>,
7931 _name: String,
7932 _delegate: Option<&'a mut dyn client::Delegate>,
7933 _additional_params: HashMap<String, String>,
7934 _scopes: BTreeSet<String>
7935}
7936
7937impl<'a, S> client::CallBuilder for ProjectInstanceClusterDeleteCall<'a, S> {}
7938
7939impl<'a, S> ProjectInstanceClusterDeleteCall<'a, S>
7940where
7941 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
7942 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
7943 S::Future: Send + Unpin + 'static,
7944 S::Error: Into<Box<dyn StdError + Send + Sync>>,
7945{
7946
7947
7948 /// Perform the operation you have build so far.
7949 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
7950 use std::io::{Read, Seek};
7951 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
7952 use client::{ToParts, url::Params};
7953 use std::borrow::Cow;
7954
7955 let mut dd = client::DefaultDelegate;
7956 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
7957 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.delete",
7958 http_method: hyper::Method::DELETE });
7959
7960 for &field in ["alt", "name"].iter() {
7961 if self._additional_params.contains_key(field) {
7962 dlg.finished(false);
7963 return Err(client::Error::FieldClash(field));
7964 }
7965 }
7966
7967 let mut params = Params::with_capacity(3 + self._additional_params.len());
7968 params.push("name", self._name);
7969
7970 params.extend(self._additional_params.iter());
7971
7972 params.push("alt", "json");
7973 let mut url = self.hub._base_url.clone() + "v2/{+name}";
7974 if self._scopes.is_empty() {
7975 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
7976 }
7977
7978 for &(find_this, param_name) in [("{+name}", "name")].iter() {
7979 url = params.uri_replacement(url, param_name, find_this, true);
7980 }
7981 {
7982 let to_remove = ["name"];
7983 params.remove_params(&to_remove);
7984 }
7985
7986 let url = params.parse_with_url(&url);
7987
7988
7989
7990 loop {
7991 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
7992 Ok(token) => token,
7993 Err(e) => {
7994 match dlg.token(e) {
7995 Ok(token) => token,
7996 Err(e) => {
7997 dlg.finished(false);
7998 return Err(client::Error::MissingToken(e));
7999 }
8000 }
8001 }
8002 };
8003 let mut req_result = {
8004 let client = &self.hub.client;
8005 dlg.pre_request();
8006 let mut req_builder = hyper::Request::builder()
8007 .method(hyper::Method::DELETE)
8008 .uri(url.as_str())
8009 .header(USER_AGENT, self.hub._user_agent.clone());
8010
8011 if let Some(token) = token.as_ref() {
8012 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8013 }
8014
8015
8016 let request = req_builder
8017 .body(hyper::body::Body::empty());
8018
8019 client.request(request.unwrap()).await
8020
8021 };
8022
8023 match req_result {
8024 Err(err) => {
8025 if let client::Retry::After(d) = dlg.http_error(&err) {
8026 sleep(d).await;
8027 continue;
8028 }
8029 dlg.finished(false);
8030 return Err(client::Error::HttpError(err))
8031 }
8032 Ok(mut res) => {
8033 if !res.status().is_success() {
8034 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8035 let (parts, _) = res.into_parts();
8036 let body = hyper::Body::from(res_body_string.clone());
8037 let restored_response = hyper::Response::from_parts(parts, body);
8038
8039 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
8040
8041 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
8042 sleep(d).await;
8043 continue;
8044 }
8045
8046 dlg.finished(false);
8047
8048 return match server_response {
8049 Some(error_value) => Err(client::Error::BadRequest(error_value)),
8050 None => Err(client::Error::Failure(restored_response)),
8051 }
8052 }
8053 let result_value = {
8054 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8055
8056 match json::from_str(&res_body_string) {
8057 Ok(decoded) => (res, decoded),
8058 Err(err) => {
8059 dlg.response_json_decode_error(&res_body_string, &err);
8060 return Err(client::Error::JsonDecodeError(res_body_string, err));
8061 }
8062 }
8063 };
8064
8065 dlg.finished(true);
8066 return Ok(result_value)
8067 }
8068 }
8069 }
8070 }
8071
8072
8073 /// Required. The unique name of the cluster to be deleted. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
8074 ///
8075 /// Sets the *name* path property to the given value.
8076 ///
8077 /// Even though the property as already been set when instantiating this call,
8078 /// we provide this method for API completeness.
8079 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterDeleteCall<'a, S> {
8080 self._name = new_value.to_string();
8081 self
8082 }
8083 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8084 /// while executing the actual API request.
8085 ///
8086 /// ````text
8087 /// It should be used to handle progress information, and to implement a certain level of resilience.
8088 /// ````
8089 ///
8090 /// Sets the *delegate* property to the given value.
8091 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterDeleteCall<'a, S> {
8092 self._delegate = Some(new_value);
8093 self
8094 }
8095
8096 /// Set any additional parameter of the query string used in the request.
8097 /// It should be used to set parameters which are not yet available through their own
8098 /// setters.
8099 ///
8100 /// Please note that this method must not be used to set any of the known parameters
8101 /// which have their own setter method. If done anyway, the request will fail.
8102 ///
8103 /// # Additional Parameters
8104 ///
8105 /// * *$.xgafv* (query-string) - V1 error format.
8106 /// * *access_token* (query-string) - OAuth access token.
8107 /// * *alt* (query-string) - Data format for response.
8108 /// * *callback* (query-string) - JSONP
8109 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8110 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8111 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8112 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8113 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8114 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8115 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8116 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterDeleteCall<'a, S>
8117 where T: AsRef<str> {
8118 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
8119 self
8120 }
8121
8122 /// Identifies the authorization scope for the method you are building.
8123 ///
8124 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8125 /// [`Scope::BigtableAdmin`].
8126 ///
8127 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8128 /// tokens for more than one scope.
8129 ///
8130 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8131 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8132 /// sufficient, a read-write scope will do as well.
8133 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterDeleteCall<'a, S>
8134 where St: AsRef<str> {
8135 self._scopes.insert(String::from(scope.as_ref()));
8136 self
8137 }
8138 /// Identifies the authorization scope(s) for the method you are building.
8139 ///
8140 /// See [`Self::add_scope()`] for details.
8141 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterDeleteCall<'a, S>
8142 where I: IntoIterator<Item = St>,
8143 St: AsRef<str> {
8144 self._scopes
8145 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8146 self
8147 }
8148
8149 /// Removes all scopes, and no default scope will be used either.
8150 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8151 /// for details).
8152 pub fn clear_scopes(mut self) -> ProjectInstanceClusterDeleteCall<'a, S> {
8153 self._scopes.clear();
8154 self
8155 }
8156}
8157
8158
8159/// Gets information about a cluster.
8160///
8161/// A builder for the *instances.clusters.get* method supported by a *project* resource.
8162/// It is not used directly, but through a [`ProjectMethods`] instance.
8163///
8164/// # Example
8165///
8166/// Instantiate a resource method builder
8167///
8168/// ```test_harness,no_run
8169/// # extern crate hyper;
8170/// # extern crate hyper_rustls;
8171/// # extern crate google_bigtableadmin2 as bigtableadmin2;
8172/// # async fn dox() {
8173/// # use std::default::Default;
8174/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
8175///
8176/// # let secret: oauth2::ApplicationSecret = Default::default();
8177/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
8178/// # secret,
8179/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8180/// # ).build().await.unwrap();
8181/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
8182/// // You can configure optional parameters by calling the respective setters at will, and
8183/// // execute the final call using `doit()`.
8184/// // Values shown here are possibly random and not representative !
8185/// let result = hub.projects().instances_clusters_get("name")
8186/// .doit().await;
8187/// # }
8188/// ```
8189pub struct ProjectInstanceClusterGetCall<'a, S>
8190 where S: 'a {
8191
8192 hub: &'a BigtableAdmin<S>,
8193 _name: String,
8194 _delegate: Option<&'a mut dyn client::Delegate>,
8195 _additional_params: HashMap<String, String>,
8196 _scopes: BTreeSet<String>
8197}
8198
8199impl<'a, S> client::CallBuilder for ProjectInstanceClusterGetCall<'a, S> {}
8200
8201impl<'a, S> ProjectInstanceClusterGetCall<'a, S>
8202where
8203 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
8204 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
8205 S::Future: Send + Unpin + 'static,
8206 S::Error: Into<Box<dyn StdError + Send + Sync>>,
8207{
8208
8209
8210 /// Perform the operation you have build so far.
8211 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Cluster)> {
8212 use std::io::{Read, Seek};
8213 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
8214 use client::{ToParts, url::Params};
8215 use std::borrow::Cow;
8216
8217 let mut dd = client::DefaultDelegate;
8218 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
8219 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.get",
8220 http_method: hyper::Method::GET });
8221
8222 for &field in ["alt", "name"].iter() {
8223 if self._additional_params.contains_key(field) {
8224 dlg.finished(false);
8225 return Err(client::Error::FieldClash(field));
8226 }
8227 }
8228
8229 let mut params = Params::with_capacity(3 + self._additional_params.len());
8230 params.push("name", self._name);
8231
8232 params.extend(self._additional_params.iter());
8233
8234 params.push("alt", "json");
8235 let mut url = self.hub._base_url.clone() + "v2/{+name}";
8236 if self._scopes.is_empty() {
8237 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
8238 }
8239
8240 for &(find_this, param_name) in [("{+name}", "name")].iter() {
8241 url = params.uri_replacement(url, param_name, find_this, true);
8242 }
8243 {
8244 let to_remove = ["name"];
8245 params.remove_params(&to_remove);
8246 }
8247
8248 let url = params.parse_with_url(&url);
8249
8250
8251
8252 loop {
8253 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
8254 Ok(token) => token,
8255 Err(e) => {
8256 match dlg.token(e) {
8257 Ok(token) => token,
8258 Err(e) => {
8259 dlg.finished(false);
8260 return Err(client::Error::MissingToken(e));
8261 }
8262 }
8263 }
8264 };
8265 let mut req_result = {
8266 let client = &self.hub.client;
8267 dlg.pre_request();
8268 let mut req_builder = hyper::Request::builder()
8269 .method(hyper::Method::GET)
8270 .uri(url.as_str())
8271 .header(USER_AGENT, self.hub._user_agent.clone());
8272
8273 if let Some(token) = token.as_ref() {
8274 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8275 }
8276
8277
8278 let request = req_builder
8279 .body(hyper::body::Body::empty());
8280
8281 client.request(request.unwrap()).await
8282
8283 };
8284
8285 match req_result {
8286 Err(err) => {
8287 if let client::Retry::After(d) = dlg.http_error(&err) {
8288 sleep(d).await;
8289 continue;
8290 }
8291 dlg.finished(false);
8292 return Err(client::Error::HttpError(err))
8293 }
8294 Ok(mut res) => {
8295 if !res.status().is_success() {
8296 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8297 let (parts, _) = res.into_parts();
8298 let body = hyper::Body::from(res_body_string.clone());
8299 let restored_response = hyper::Response::from_parts(parts, body);
8300
8301 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
8302
8303 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
8304 sleep(d).await;
8305 continue;
8306 }
8307
8308 dlg.finished(false);
8309
8310 return match server_response {
8311 Some(error_value) => Err(client::Error::BadRequest(error_value)),
8312 None => Err(client::Error::Failure(restored_response)),
8313 }
8314 }
8315 let result_value = {
8316 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8317
8318 match json::from_str(&res_body_string) {
8319 Ok(decoded) => (res, decoded),
8320 Err(err) => {
8321 dlg.response_json_decode_error(&res_body_string, &err);
8322 return Err(client::Error::JsonDecodeError(res_body_string, err));
8323 }
8324 }
8325 };
8326
8327 dlg.finished(true);
8328 return Ok(result_value)
8329 }
8330 }
8331 }
8332 }
8333
8334
8335 /// Required. The unique name of the requested cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
8336 ///
8337 /// Sets the *name* path property to the given value.
8338 ///
8339 /// Even though the property as already been set when instantiating this call,
8340 /// we provide this method for API completeness.
8341 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterGetCall<'a, S> {
8342 self._name = new_value.to_string();
8343 self
8344 }
8345 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8346 /// while executing the actual API request.
8347 ///
8348 /// ````text
8349 /// It should be used to handle progress information, and to implement a certain level of resilience.
8350 /// ````
8351 ///
8352 /// Sets the *delegate* property to the given value.
8353 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterGetCall<'a, S> {
8354 self._delegate = Some(new_value);
8355 self
8356 }
8357
8358 /// Set any additional parameter of the query string used in the request.
8359 /// It should be used to set parameters which are not yet available through their own
8360 /// setters.
8361 ///
8362 /// Please note that this method must not be used to set any of the known parameters
8363 /// which have their own setter method. If done anyway, the request will fail.
8364 ///
8365 /// # Additional Parameters
8366 ///
8367 /// * *$.xgafv* (query-string) - V1 error format.
8368 /// * *access_token* (query-string) - OAuth access token.
8369 /// * *alt* (query-string) - Data format for response.
8370 /// * *callback* (query-string) - JSONP
8371 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8372 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8373 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8374 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8375 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8376 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8377 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8378 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterGetCall<'a, S>
8379 where T: AsRef<str> {
8380 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
8381 self
8382 }
8383
8384 /// Identifies the authorization scope for the method you are building.
8385 ///
8386 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8387 /// [`Scope::BigtableAdmin`].
8388 ///
8389 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8390 /// tokens for more than one scope.
8391 ///
8392 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8393 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8394 /// sufficient, a read-write scope will do as well.
8395 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterGetCall<'a, S>
8396 where St: AsRef<str> {
8397 self._scopes.insert(String::from(scope.as_ref()));
8398 self
8399 }
8400 /// Identifies the authorization scope(s) for the method you are building.
8401 ///
8402 /// See [`Self::add_scope()`] for details.
8403 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterGetCall<'a, S>
8404 where I: IntoIterator<Item = St>,
8405 St: AsRef<str> {
8406 self._scopes
8407 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8408 self
8409 }
8410
8411 /// Removes all scopes, and no default scope will be used either.
8412 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8413 /// for details).
8414 pub fn clear_scopes(mut self) -> ProjectInstanceClusterGetCall<'a, S> {
8415 self._scopes.clear();
8416 self
8417 }
8418}
8419
8420
8421/// Lists information about clusters in an instance.
8422///
8423/// A builder for the *instances.clusters.list* method supported by a *project* resource.
8424/// It is not used directly, but through a [`ProjectMethods`] instance.
8425///
8426/// # Example
8427///
8428/// Instantiate a resource method builder
8429///
8430/// ```test_harness,no_run
8431/// # extern crate hyper;
8432/// # extern crate hyper_rustls;
8433/// # extern crate google_bigtableadmin2 as bigtableadmin2;
8434/// # async fn dox() {
8435/// # use std::default::Default;
8436/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
8437///
8438/// # let secret: oauth2::ApplicationSecret = Default::default();
8439/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
8440/// # secret,
8441/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8442/// # ).build().await.unwrap();
8443/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
8444/// // You can configure optional parameters by calling the respective setters at will, and
8445/// // execute the final call using `doit()`.
8446/// // Values shown here are possibly random and not representative !
8447/// let result = hub.projects().instances_clusters_list("parent")
8448/// .page_token("dolore")
8449/// .doit().await;
8450/// # }
8451/// ```
8452pub struct ProjectInstanceClusterListCall<'a, S>
8453 where S: 'a {
8454
8455 hub: &'a BigtableAdmin<S>,
8456 _parent: String,
8457 _page_token: Option<String>,
8458 _delegate: Option<&'a mut dyn client::Delegate>,
8459 _additional_params: HashMap<String, String>,
8460 _scopes: BTreeSet<String>
8461}
8462
8463impl<'a, S> client::CallBuilder for ProjectInstanceClusterListCall<'a, S> {}
8464
8465impl<'a, S> ProjectInstanceClusterListCall<'a, S>
8466where
8467 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
8468 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
8469 S::Future: Send + Unpin + 'static,
8470 S::Error: Into<Box<dyn StdError + Send + Sync>>,
8471{
8472
8473
8474 /// Perform the operation you have build so far.
8475 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListClustersResponse)> {
8476 use std::io::{Read, Seek};
8477 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
8478 use client::{ToParts, url::Params};
8479 use std::borrow::Cow;
8480
8481 let mut dd = client::DefaultDelegate;
8482 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
8483 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.list",
8484 http_method: hyper::Method::GET });
8485
8486 for &field in ["alt", "parent", "pageToken"].iter() {
8487 if self._additional_params.contains_key(field) {
8488 dlg.finished(false);
8489 return Err(client::Error::FieldClash(field));
8490 }
8491 }
8492
8493 let mut params = Params::with_capacity(4 + self._additional_params.len());
8494 params.push("parent", self._parent);
8495 if let Some(value) = self._page_token.as_ref() {
8496 params.push("pageToken", value);
8497 }
8498
8499 params.extend(self._additional_params.iter());
8500
8501 params.push("alt", "json");
8502 let mut url = self.hub._base_url.clone() + "v2/{+parent}/clusters";
8503 if self._scopes.is_empty() {
8504 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
8505 }
8506
8507 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
8508 url = params.uri_replacement(url, param_name, find_this, true);
8509 }
8510 {
8511 let to_remove = ["parent"];
8512 params.remove_params(&to_remove);
8513 }
8514
8515 let url = params.parse_with_url(&url);
8516
8517
8518
8519 loop {
8520 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
8521 Ok(token) => token,
8522 Err(e) => {
8523 match dlg.token(e) {
8524 Ok(token) => token,
8525 Err(e) => {
8526 dlg.finished(false);
8527 return Err(client::Error::MissingToken(e));
8528 }
8529 }
8530 }
8531 };
8532 let mut req_result = {
8533 let client = &self.hub.client;
8534 dlg.pre_request();
8535 let mut req_builder = hyper::Request::builder()
8536 .method(hyper::Method::GET)
8537 .uri(url.as_str())
8538 .header(USER_AGENT, self.hub._user_agent.clone());
8539
8540 if let Some(token) = token.as_ref() {
8541 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8542 }
8543
8544
8545 let request = req_builder
8546 .body(hyper::body::Body::empty());
8547
8548 client.request(request.unwrap()).await
8549
8550 };
8551
8552 match req_result {
8553 Err(err) => {
8554 if let client::Retry::After(d) = dlg.http_error(&err) {
8555 sleep(d).await;
8556 continue;
8557 }
8558 dlg.finished(false);
8559 return Err(client::Error::HttpError(err))
8560 }
8561 Ok(mut res) => {
8562 if !res.status().is_success() {
8563 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8564 let (parts, _) = res.into_parts();
8565 let body = hyper::Body::from(res_body_string.clone());
8566 let restored_response = hyper::Response::from_parts(parts, body);
8567
8568 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
8569
8570 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
8571 sleep(d).await;
8572 continue;
8573 }
8574
8575 dlg.finished(false);
8576
8577 return match server_response {
8578 Some(error_value) => Err(client::Error::BadRequest(error_value)),
8579 None => Err(client::Error::Failure(restored_response)),
8580 }
8581 }
8582 let result_value = {
8583 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8584
8585 match json::from_str(&res_body_string) {
8586 Ok(decoded) => (res, decoded),
8587 Err(err) => {
8588 dlg.response_json_decode_error(&res_body_string, &err);
8589 return Err(client::Error::JsonDecodeError(res_body_string, err));
8590 }
8591 }
8592 };
8593
8594 dlg.finished(true);
8595 return Ok(result_value)
8596 }
8597 }
8598 }
8599 }
8600
8601
8602 /// 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/-`.
8603 ///
8604 /// Sets the *parent* path property to the given value.
8605 ///
8606 /// Even though the property as already been set when instantiating this call,
8607 /// we provide this method for API completeness.
8608 pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterListCall<'a, S> {
8609 self._parent = new_value.to_string();
8610 self
8611 }
8612 /// DEPRECATED: This field is unused and ignored.
8613 ///
8614 /// Sets the *page token* query property to the given value.
8615 pub fn page_token(mut self, new_value: &str) -> ProjectInstanceClusterListCall<'a, S> {
8616 self._page_token = Some(new_value.to_string());
8617 self
8618 }
8619 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8620 /// while executing the actual API request.
8621 ///
8622 /// ````text
8623 /// It should be used to handle progress information, and to implement a certain level of resilience.
8624 /// ````
8625 ///
8626 /// Sets the *delegate* property to the given value.
8627 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterListCall<'a, S> {
8628 self._delegate = Some(new_value);
8629 self
8630 }
8631
8632 /// Set any additional parameter of the query string used in the request.
8633 /// It should be used to set parameters which are not yet available through their own
8634 /// setters.
8635 ///
8636 /// Please note that this method must not be used to set any of the known parameters
8637 /// which have their own setter method. If done anyway, the request will fail.
8638 ///
8639 /// # Additional Parameters
8640 ///
8641 /// * *$.xgafv* (query-string) - V1 error format.
8642 /// * *access_token* (query-string) - OAuth access token.
8643 /// * *alt* (query-string) - Data format for response.
8644 /// * *callback* (query-string) - JSONP
8645 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8646 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8647 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8648 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8649 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8650 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8651 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8652 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterListCall<'a, S>
8653 where T: AsRef<str> {
8654 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
8655 self
8656 }
8657
8658 /// Identifies the authorization scope for the method you are building.
8659 ///
8660 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8661 /// [`Scope::BigtableAdmin`].
8662 ///
8663 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8664 /// tokens for more than one scope.
8665 ///
8666 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8667 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8668 /// sufficient, a read-write scope will do as well.
8669 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterListCall<'a, S>
8670 where St: AsRef<str> {
8671 self._scopes.insert(String::from(scope.as_ref()));
8672 self
8673 }
8674 /// Identifies the authorization scope(s) for the method you are building.
8675 ///
8676 /// See [`Self::add_scope()`] for details.
8677 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterListCall<'a, S>
8678 where I: IntoIterator<Item = St>,
8679 St: AsRef<str> {
8680 self._scopes
8681 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8682 self
8683 }
8684
8685 /// Removes all scopes, and no default scope will be used either.
8686 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8687 /// for details).
8688 pub fn clear_scopes(mut self) -> ProjectInstanceClusterListCall<'a, S> {
8689 self._scopes.clear();
8690 self
8691 }
8692}
8693
8694
8695/// Partially updates a cluster within a project. This method is the preferred way to update a Cluster. To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask. To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.
8696///
8697/// A builder for the *instances.clusters.partialUpdateCluster* method supported by a *project* resource.
8698/// It is not used directly, but through a [`ProjectMethods`] instance.
8699///
8700/// # Example
8701///
8702/// Instantiate a resource method builder
8703///
8704/// ```test_harness,no_run
8705/// # extern crate hyper;
8706/// # extern crate hyper_rustls;
8707/// # extern crate google_bigtableadmin2 as bigtableadmin2;
8708/// use bigtableadmin2::api::Cluster;
8709/// # async fn dox() {
8710/// # use std::default::Default;
8711/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
8712///
8713/// # let secret: oauth2::ApplicationSecret = Default::default();
8714/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
8715/// # secret,
8716/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8717/// # ).build().await.unwrap();
8718/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
8719/// // As the method needs a request, you would usually fill it with the desired information
8720/// // into the respective structure. Some of the parts shown here might not be applicable !
8721/// // Values shown here are possibly random and not representative !
8722/// let mut req = Cluster::default();
8723///
8724/// // You can configure optional parameters by calling the respective setters at will, and
8725/// // execute the final call using `doit()`.
8726/// // Values shown here are possibly random and not representative !
8727/// let result = hub.projects().instances_clusters_partial_update_cluster(req, "name")
8728/// .update_mask(&Default::default())
8729/// .doit().await;
8730/// # }
8731/// ```
8732pub struct ProjectInstanceClusterPartialUpdateClusterCall<'a, S>
8733 where S: 'a {
8734
8735 hub: &'a BigtableAdmin<S>,
8736 _request: Cluster,
8737 _name: String,
8738 _update_mask: Option<client::FieldMask>,
8739 _delegate: Option<&'a mut dyn client::Delegate>,
8740 _additional_params: HashMap<String, String>,
8741 _scopes: BTreeSet<String>
8742}
8743
8744impl<'a, S> client::CallBuilder for ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {}
8745
8746impl<'a, S> ProjectInstanceClusterPartialUpdateClusterCall<'a, S>
8747where
8748 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
8749 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
8750 S::Future: Send + Unpin + 'static,
8751 S::Error: Into<Box<dyn StdError + Send + Sync>>,
8752{
8753
8754
8755 /// Perform the operation you have build so far.
8756 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
8757 use std::io::{Read, Seek};
8758 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
8759 use client::{ToParts, url::Params};
8760 use std::borrow::Cow;
8761
8762 let mut dd = client::DefaultDelegate;
8763 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
8764 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.partialUpdateCluster",
8765 http_method: hyper::Method::PATCH });
8766
8767 for &field in ["alt", "name", "updateMask"].iter() {
8768 if self._additional_params.contains_key(field) {
8769 dlg.finished(false);
8770 return Err(client::Error::FieldClash(field));
8771 }
8772 }
8773
8774 let mut params = Params::with_capacity(5 + self._additional_params.len());
8775 params.push("name", self._name);
8776 if let Some(value) = self._update_mask.as_ref() {
8777 params.push("updateMask", value.to_string());
8778 }
8779
8780 params.extend(self._additional_params.iter());
8781
8782 params.push("alt", "json");
8783 let mut url = self.hub._base_url.clone() + "v2/{+name}";
8784 if self._scopes.is_empty() {
8785 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
8786 }
8787
8788 for &(find_this, param_name) in [("{+name}", "name")].iter() {
8789 url = params.uri_replacement(url, param_name, find_this, true);
8790 }
8791 {
8792 let to_remove = ["name"];
8793 params.remove_params(&to_remove);
8794 }
8795
8796 let url = params.parse_with_url(&url);
8797
8798 let mut json_mime_type = mime::APPLICATION_JSON;
8799 let mut request_value_reader =
8800 {
8801 let mut value = json::value::to_value(&self._request).expect("serde to work");
8802 client::remove_json_null_values(&mut value);
8803 let mut dst = io::Cursor::new(Vec::with_capacity(128));
8804 json::to_writer(&mut dst, &value).unwrap();
8805 dst
8806 };
8807 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
8808 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
8809
8810
8811 loop {
8812 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
8813 Ok(token) => token,
8814 Err(e) => {
8815 match dlg.token(e) {
8816 Ok(token) => token,
8817 Err(e) => {
8818 dlg.finished(false);
8819 return Err(client::Error::MissingToken(e));
8820 }
8821 }
8822 }
8823 };
8824 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
8825 let mut req_result = {
8826 let client = &self.hub.client;
8827 dlg.pre_request();
8828 let mut req_builder = hyper::Request::builder()
8829 .method(hyper::Method::PATCH)
8830 .uri(url.as_str())
8831 .header(USER_AGENT, self.hub._user_agent.clone());
8832
8833 if let Some(token) = token.as_ref() {
8834 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8835 }
8836
8837
8838 let request = req_builder
8839 .header(CONTENT_TYPE, json_mime_type.to_string())
8840 .header(CONTENT_LENGTH, request_size as u64)
8841 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
8842
8843 client.request(request.unwrap()).await
8844
8845 };
8846
8847 match req_result {
8848 Err(err) => {
8849 if let client::Retry::After(d) = dlg.http_error(&err) {
8850 sleep(d).await;
8851 continue;
8852 }
8853 dlg.finished(false);
8854 return Err(client::Error::HttpError(err))
8855 }
8856 Ok(mut res) => {
8857 if !res.status().is_success() {
8858 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8859 let (parts, _) = res.into_parts();
8860 let body = hyper::Body::from(res_body_string.clone());
8861 let restored_response = hyper::Response::from_parts(parts, body);
8862
8863 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
8864
8865 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
8866 sleep(d).await;
8867 continue;
8868 }
8869
8870 dlg.finished(false);
8871
8872 return match server_response {
8873 Some(error_value) => Err(client::Error::BadRequest(error_value)),
8874 None => Err(client::Error::Failure(restored_response)),
8875 }
8876 }
8877 let result_value = {
8878 let res_body_string = client::get_body_as_string(res.body_mut()).await;
8879
8880 match json::from_str(&res_body_string) {
8881 Ok(decoded) => (res, decoded),
8882 Err(err) => {
8883 dlg.response_json_decode_error(&res_body_string, &err);
8884 return Err(client::Error::JsonDecodeError(res_body_string, err));
8885 }
8886 }
8887 };
8888
8889 dlg.finished(true);
8890 return Ok(result_value)
8891 }
8892 }
8893 }
8894 }
8895
8896
8897 ///
8898 /// Sets the *request* property to the given value.
8899 ///
8900 /// Even though the property as already been set when instantiating this call,
8901 /// we provide this method for API completeness.
8902 pub fn request(mut self, new_value: Cluster) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {
8903 self._request = new_value;
8904 self
8905 }
8906 /// The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
8907 ///
8908 /// Sets the *name* path property to the given value.
8909 ///
8910 /// Even though the property as already been set when instantiating this call,
8911 /// we provide this method for API completeness.
8912 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {
8913 self._name = new_value.to_string();
8914 self
8915 }
8916 /// Required. The subset of Cluster fields which should be replaced.
8917 ///
8918 /// Sets the *update mask* query property to the given value.
8919 pub fn update_mask(mut self, new_value: client::FieldMask) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {
8920 self._update_mask = Some(new_value);
8921 self
8922 }
8923 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8924 /// while executing the actual API request.
8925 ///
8926 /// ````text
8927 /// It should be used to handle progress information, and to implement a certain level of resilience.
8928 /// ````
8929 ///
8930 /// Sets the *delegate* property to the given value.
8931 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {
8932 self._delegate = Some(new_value);
8933 self
8934 }
8935
8936 /// Set any additional parameter of the query string used in the request.
8937 /// It should be used to set parameters which are not yet available through their own
8938 /// setters.
8939 ///
8940 /// Please note that this method must not be used to set any of the known parameters
8941 /// which have their own setter method. If done anyway, the request will fail.
8942 ///
8943 /// # Additional Parameters
8944 ///
8945 /// * *$.xgafv* (query-string) - V1 error format.
8946 /// * *access_token* (query-string) - OAuth access token.
8947 /// * *alt* (query-string) - Data format for response.
8948 /// * *callback* (query-string) - JSONP
8949 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8950 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8951 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8952 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8953 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8954 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8955 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8956 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S>
8957 where T: AsRef<str> {
8958 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
8959 self
8960 }
8961
8962 /// Identifies the authorization scope for the method you are building.
8963 ///
8964 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8965 /// [`Scope::BigtableAdmin`].
8966 ///
8967 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8968 /// tokens for more than one scope.
8969 ///
8970 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8971 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8972 /// sufficient, a read-write scope will do as well.
8973 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S>
8974 where St: AsRef<str> {
8975 self._scopes.insert(String::from(scope.as_ref()));
8976 self
8977 }
8978 /// Identifies the authorization scope(s) for the method you are building.
8979 ///
8980 /// See [`Self::add_scope()`] for details.
8981 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S>
8982 where I: IntoIterator<Item = St>,
8983 St: AsRef<str> {
8984 self._scopes
8985 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8986 self
8987 }
8988
8989 /// Removes all scopes, and no default scope will be used either.
8990 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8991 /// for details).
8992 pub fn clear_scopes(mut self) -> ProjectInstanceClusterPartialUpdateClusterCall<'a, S> {
8993 self._scopes.clear();
8994 self
8995 }
8996}
8997
8998
8999/// Updates a cluster within an instance. Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.
9000///
9001/// A builder for the *instances.clusters.update* method supported by a *project* resource.
9002/// It is not used directly, but through a [`ProjectMethods`] instance.
9003///
9004/// # Example
9005///
9006/// Instantiate a resource method builder
9007///
9008/// ```test_harness,no_run
9009/// # extern crate hyper;
9010/// # extern crate hyper_rustls;
9011/// # extern crate google_bigtableadmin2 as bigtableadmin2;
9012/// use bigtableadmin2::api::Cluster;
9013/// # async fn dox() {
9014/// # use std::default::Default;
9015/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
9016///
9017/// # let secret: oauth2::ApplicationSecret = Default::default();
9018/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
9019/// # secret,
9020/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9021/// # ).build().await.unwrap();
9022/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
9023/// // As the method needs a request, you would usually fill it with the desired information
9024/// // into the respective structure. Some of the parts shown here might not be applicable !
9025/// // Values shown here are possibly random and not representative !
9026/// let mut req = Cluster::default();
9027///
9028/// // You can configure optional parameters by calling the respective setters at will, and
9029/// // execute the final call using `doit()`.
9030/// // Values shown here are possibly random and not representative !
9031/// let result = hub.projects().instances_clusters_update(req, "name")
9032/// .doit().await;
9033/// # }
9034/// ```
9035pub struct ProjectInstanceClusterUpdateCall<'a, S>
9036 where S: 'a {
9037
9038 hub: &'a BigtableAdmin<S>,
9039 _request: Cluster,
9040 _name: String,
9041 _delegate: Option<&'a mut dyn client::Delegate>,
9042 _additional_params: HashMap<String, String>,
9043 _scopes: BTreeSet<String>
9044}
9045
9046impl<'a, S> client::CallBuilder for ProjectInstanceClusterUpdateCall<'a, S> {}
9047
9048impl<'a, S> ProjectInstanceClusterUpdateCall<'a, S>
9049where
9050 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
9051 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
9052 S::Future: Send + Unpin + 'static,
9053 S::Error: Into<Box<dyn StdError + Send + Sync>>,
9054{
9055
9056
9057 /// Perform the operation you have build so far.
9058 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
9059 use std::io::{Read, Seek};
9060 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
9061 use client::{ToParts, url::Params};
9062 use std::borrow::Cow;
9063
9064 let mut dd = client::DefaultDelegate;
9065 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
9066 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.clusters.update",
9067 http_method: hyper::Method::PUT });
9068
9069 for &field in ["alt", "name"].iter() {
9070 if self._additional_params.contains_key(field) {
9071 dlg.finished(false);
9072 return Err(client::Error::FieldClash(field));
9073 }
9074 }
9075
9076 let mut params = Params::with_capacity(4 + self._additional_params.len());
9077 params.push("name", self._name);
9078
9079 params.extend(self._additional_params.iter());
9080
9081 params.push("alt", "json");
9082 let mut url = self.hub._base_url.clone() + "v2/{+name}";
9083 if self._scopes.is_empty() {
9084 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
9085 }
9086
9087 for &(find_this, param_name) in [("{+name}", "name")].iter() {
9088 url = params.uri_replacement(url, param_name, find_this, true);
9089 }
9090 {
9091 let to_remove = ["name"];
9092 params.remove_params(&to_remove);
9093 }
9094
9095 let url = params.parse_with_url(&url);
9096
9097 let mut json_mime_type = mime::APPLICATION_JSON;
9098 let mut request_value_reader =
9099 {
9100 let mut value = json::value::to_value(&self._request).expect("serde to work");
9101 client::remove_json_null_values(&mut value);
9102 let mut dst = io::Cursor::new(Vec::with_capacity(128));
9103 json::to_writer(&mut dst, &value).unwrap();
9104 dst
9105 };
9106 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
9107 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
9108
9109
9110 loop {
9111 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
9112 Ok(token) => token,
9113 Err(e) => {
9114 match dlg.token(e) {
9115 Ok(token) => token,
9116 Err(e) => {
9117 dlg.finished(false);
9118 return Err(client::Error::MissingToken(e));
9119 }
9120 }
9121 }
9122 };
9123 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
9124 let mut req_result = {
9125 let client = &self.hub.client;
9126 dlg.pre_request();
9127 let mut req_builder = hyper::Request::builder()
9128 .method(hyper::Method::PUT)
9129 .uri(url.as_str())
9130 .header(USER_AGENT, self.hub._user_agent.clone());
9131
9132 if let Some(token) = token.as_ref() {
9133 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9134 }
9135
9136
9137 let request = req_builder
9138 .header(CONTENT_TYPE, json_mime_type.to_string())
9139 .header(CONTENT_LENGTH, request_size as u64)
9140 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
9141
9142 client.request(request.unwrap()).await
9143
9144 };
9145
9146 match req_result {
9147 Err(err) => {
9148 if let client::Retry::After(d) = dlg.http_error(&err) {
9149 sleep(d).await;
9150 continue;
9151 }
9152 dlg.finished(false);
9153 return Err(client::Error::HttpError(err))
9154 }
9155 Ok(mut res) => {
9156 if !res.status().is_success() {
9157 let res_body_string = client::get_body_as_string(res.body_mut()).await;
9158 let (parts, _) = res.into_parts();
9159 let body = hyper::Body::from(res_body_string.clone());
9160 let restored_response = hyper::Response::from_parts(parts, body);
9161
9162 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
9163
9164 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
9165 sleep(d).await;
9166 continue;
9167 }
9168
9169 dlg.finished(false);
9170
9171 return match server_response {
9172 Some(error_value) => Err(client::Error::BadRequest(error_value)),
9173 None => Err(client::Error::Failure(restored_response)),
9174 }
9175 }
9176 let result_value = {
9177 let res_body_string = client::get_body_as_string(res.body_mut()).await;
9178
9179 match json::from_str(&res_body_string) {
9180 Ok(decoded) => (res, decoded),
9181 Err(err) => {
9182 dlg.response_json_decode_error(&res_body_string, &err);
9183 return Err(client::Error::JsonDecodeError(res_body_string, err));
9184 }
9185 }
9186 };
9187
9188 dlg.finished(true);
9189 return Ok(result_value)
9190 }
9191 }
9192 }
9193 }
9194
9195
9196 ///
9197 /// Sets the *request* property to the given value.
9198 ///
9199 /// Even though the property as already been set when instantiating this call,
9200 /// we provide this method for API completeness.
9201 pub fn request(mut self, new_value: Cluster) -> ProjectInstanceClusterUpdateCall<'a, S> {
9202 self._request = new_value;
9203 self
9204 }
9205 /// The unique name of the cluster. Values are of the form `projects/{project}/instances/{instance}/clusters/a-z*`.
9206 ///
9207 /// Sets the *name* path property to the given value.
9208 ///
9209 /// Even though the property as already been set when instantiating this call,
9210 /// we provide this method for API completeness.
9211 pub fn name(mut self, new_value: &str) -> ProjectInstanceClusterUpdateCall<'a, S> {
9212 self._name = new_value.to_string();
9213 self
9214 }
9215 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9216 /// while executing the actual API request.
9217 ///
9218 /// ````text
9219 /// It should be used to handle progress information, and to implement a certain level of resilience.
9220 /// ````
9221 ///
9222 /// Sets the *delegate* property to the given value.
9223 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceClusterUpdateCall<'a, S> {
9224 self._delegate = Some(new_value);
9225 self
9226 }
9227
9228 /// Set any additional parameter of the query string used in the request.
9229 /// It should be used to set parameters which are not yet available through their own
9230 /// setters.
9231 ///
9232 /// Please note that this method must not be used to set any of the known parameters
9233 /// which have their own setter method. If done anyway, the request will fail.
9234 ///
9235 /// # Additional Parameters
9236 ///
9237 /// * *$.xgafv* (query-string) - V1 error format.
9238 /// * *access_token* (query-string) - OAuth access token.
9239 /// * *alt* (query-string) - Data format for response.
9240 /// * *callback* (query-string) - JSONP
9241 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9242 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9243 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9244 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9245 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9246 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9247 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9248 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceClusterUpdateCall<'a, S>
9249 where T: AsRef<str> {
9250 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
9251 self
9252 }
9253
9254 /// Identifies the authorization scope for the method you are building.
9255 ///
9256 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9257 /// [`Scope::BigtableAdmin`].
9258 ///
9259 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9260 /// tokens for more than one scope.
9261 ///
9262 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9263 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9264 /// sufficient, a read-write scope will do as well.
9265 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceClusterUpdateCall<'a, S>
9266 where St: AsRef<str> {
9267 self._scopes.insert(String::from(scope.as_ref()));
9268 self
9269 }
9270 /// Identifies the authorization scope(s) for the method you are building.
9271 ///
9272 /// See [`Self::add_scope()`] for details.
9273 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceClusterUpdateCall<'a, S>
9274 where I: IntoIterator<Item = St>,
9275 St: AsRef<str> {
9276 self._scopes
9277 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9278 self
9279 }
9280
9281 /// Removes all scopes, and no default scope will be used either.
9282 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9283 /// for details).
9284 pub fn clear_scopes(mut self) -> ProjectInstanceClusterUpdateCall<'a, S> {
9285 self._scopes.clear();
9286 self
9287 }
9288}
9289
9290
9291/// Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.
9292///
9293/// A builder for the *instances.tables.checkConsistency* method supported by a *project* resource.
9294/// It is not used directly, but through a [`ProjectMethods`] instance.
9295///
9296/// # Example
9297///
9298/// Instantiate a resource method builder
9299///
9300/// ```test_harness,no_run
9301/// # extern crate hyper;
9302/// # extern crate hyper_rustls;
9303/// # extern crate google_bigtableadmin2 as bigtableadmin2;
9304/// use bigtableadmin2::api::CheckConsistencyRequest;
9305/// # async fn dox() {
9306/// # use std::default::Default;
9307/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
9308///
9309/// # let secret: oauth2::ApplicationSecret = Default::default();
9310/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
9311/// # secret,
9312/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9313/// # ).build().await.unwrap();
9314/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
9315/// // As the method needs a request, you would usually fill it with the desired information
9316/// // into the respective structure. Some of the parts shown here might not be applicable !
9317/// // Values shown here are possibly random and not representative !
9318/// let mut req = CheckConsistencyRequest::default();
9319///
9320/// // You can configure optional parameters by calling the respective setters at will, and
9321/// // execute the final call using `doit()`.
9322/// // Values shown here are possibly random and not representative !
9323/// let result = hub.projects().instances_tables_check_consistency(req, "name")
9324/// .doit().await;
9325/// # }
9326/// ```
9327pub struct ProjectInstanceTableCheckConsistencyCall<'a, S>
9328 where S: 'a {
9329
9330 hub: &'a BigtableAdmin<S>,
9331 _request: CheckConsistencyRequest,
9332 _name: String,
9333 _delegate: Option<&'a mut dyn client::Delegate>,
9334 _additional_params: HashMap<String, String>,
9335 _scopes: BTreeSet<String>
9336}
9337
9338impl<'a, S> client::CallBuilder for ProjectInstanceTableCheckConsistencyCall<'a, S> {}
9339
9340impl<'a, S> ProjectInstanceTableCheckConsistencyCall<'a, S>
9341where
9342 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
9343 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
9344 S::Future: Send + Unpin + 'static,
9345 S::Error: Into<Box<dyn StdError + Send + Sync>>,
9346{
9347
9348
9349 /// Perform the operation you have build so far.
9350 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, CheckConsistencyResponse)> {
9351 use std::io::{Read, Seek};
9352 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
9353 use client::{ToParts, url::Params};
9354 use std::borrow::Cow;
9355
9356 let mut dd = client::DefaultDelegate;
9357 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
9358 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.checkConsistency",
9359 http_method: hyper::Method::POST });
9360
9361 for &field in ["alt", "name"].iter() {
9362 if self._additional_params.contains_key(field) {
9363 dlg.finished(false);
9364 return Err(client::Error::FieldClash(field));
9365 }
9366 }
9367
9368 let mut params = Params::with_capacity(4 + self._additional_params.len());
9369 params.push("name", self._name);
9370
9371 params.extend(self._additional_params.iter());
9372
9373 params.push("alt", "json");
9374 let mut url = self.hub._base_url.clone() + "v2/{+name}:checkConsistency";
9375 if self._scopes.is_empty() {
9376 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
9377 }
9378
9379 for &(find_this, param_name) in [("{+name}", "name")].iter() {
9380 url = params.uri_replacement(url, param_name, find_this, true);
9381 }
9382 {
9383 let to_remove = ["name"];
9384 params.remove_params(&to_remove);
9385 }
9386
9387 let url = params.parse_with_url(&url);
9388
9389 let mut json_mime_type = mime::APPLICATION_JSON;
9390 let mut request_value_reader =
9391 {
9392 let mut value = json::value::to_value(&self._request).expect("serde to work");
9393 client::remove_json_null_values(&mut value);
9394 let mut dst = io::Cursor::new(Vec::with_capacity(128));
9395 json::to_writer(&mut dst, &value).unwrap();
9396 dst
9397 };
9398 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
9399 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
9400
9401
9402 loop {
9403 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
9404 Ok(token) => token,
9405 Err(e) => {
9406 match dlg.token(e) {
9407 Ok(token) => token,
9408 Err(e) => {
9409 dlg.finished(false);
9410 return Err(client::Error::MissingToken(e));
9411 }
9412 }
9413 }
9414 };
9415 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
9416 let mut req_result = {
9417 let client = &self.hub.client;
9418 dlg.pre_request();
9419 let mut req_builder = hyper::Request::builder()
9420 .method(hyper::Method::POST)
9421 .uri(url.as_str())
9422 .header(USER_AGENT, self.hub._user_agent.clone());
9423
9424 if let Some(token) = token.as_ref() {
9425 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9426 }
9427
9428
9429 let request = req_builder
9430 .header(CONTENT_TYPE, json_mime_type.to_string())
9431 .header(CONTENT_LENGTH, request_size as u64)
9432 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
9433
9434 client.request(request.unwrap()).await
9435
9436 };
9437
9438 match req_result {
9439 Err(err) => {
9440 if let client::Retry::After(d) = dlg.http_error(&err) {
9441 sleep(d).await;
9442 continue;
9443 }
9444 dlg.finished(false);
9445 return Err(client::Error::HttpError(err))
9446 }
9447 Ok(mut res) => {
9448 if !res.status().is_success() {
9449 let res_body_string = client::get_body_as_string(res.body_mut()).await;
9450 let (parts, _) = res.into_parts();
9451 let body = hyper::Body::from(res_body_string.clone());
9452 let restored_response = hyper::Response::from_parts(parts, body);
9453
9454 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
9455
9456 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
9457 sleep(d).await;
9458 continue;
9459 }
9460
9461 dlg.finished(false);
9462
9463 return match server_response {
9464 Some(error_value) => Err(client::Error::BadRequest(error_value)),
9465 None => Err(client::Error::Failure(restored_response)),
9466 }
9467 }
9468 let result_value = {
9469 let res_body_string = client::get_body_as_string(res.body_mut()).await;
9470
9471 match json::from_str(&res_body_string) {
9472 Ok(decoded) => (res, decoded),
9473 Err(err) => {
9474 dlg.response_json_decode_error(&res_body_string, &err);
9475 return Err(client::Error::JsonDecodeError(res_body_string, err));
9476 }
9477 }
9478 };
9479
9480 dlg.finished(true);
9481 return Ok(result_value)
9482 }
9483 }
9484 }
9485 }
9486
9487
9488 ///
9489 /// Sets the *request* property to the given value.
9490 ///
9491 /// Even though the property as already been set when instantiating this call,
9492 /// we provide this method for API completeness.
9493 pub fn request(mut self, new_value: CheckConsistencyRequest) -> ProjectInstanceTableCheckConsistencyCall<'a, S> {
9494 self._request = new_value;
9495 self
9496 }
9497 /// Required. The unique name of the Table for which to check replication consistency. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
9498 ///
9499 /// Sets the *name* path property to the given value.
9500 ///
9501 /// Even though the property as already been set when instantiating this call,
9502 /// we provide this method for API completeness.
9503 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableCheckConsistencyCall<'a, S> {
9504 self._name = new_value.to_string();
9505 self
9506 }
9507 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9508 /// while executing the actual API request.
9509 ///
9510 /// ````text
9511 /// It should be used to handle progress information, and to implement a certain level of resilience.
9512 /// ````
9513 ///
9514 /// Sets the *delegate* property to the given value.
9515 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableCheckConsistencyCall<'a, S> {
9516 self._delegate = Some(new_value);
9517 self
9518 }
9519
9520 /// Set any additional parameter of the query string used in the request.
9521 /// It should be used to set parameters which are not yet available through their own
9522 /// setters.
9523 ///
9524 /// Please note that this method must not be used to set any of the known parameters
9525 /// which have their own setter method. If done anyway, the request will fail.
9526 ///
9527 /// # Additional Parameters
9528 ///
9529 /// * *$.xgafv* (query-string) - V1 error format.
9530 /// * *access_token* (query-string) - OAuth access token.
9531 /// * *alt* (query-string) - Data format for response.
9532 /// * *callback* (query-string) - JSONP
9533 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9534 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9535 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9536 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9537 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9538 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9539 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9540 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableCheckConsistencyCall<'a, S>
9541 where T: AsRef<str> {
9542 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
9543 self
9544 }
9545
9546 /// Identifies the authorization scope for the method you are building.
9547 ///
9548 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9549 /// [`Scope::BigtableAdmin`].
9550 ///
9551 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9552 /// tokens for more than one scope.
9553 ///
9554 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9555 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9556 /// sufficient, a read-write scope will do as well.
9557 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableCheckConsistencyCall<'a, S>
9558 where St: AsRef<str> {
9559 self._scopes.insert(String::from(scope.as_ref()));
9560 self
9561 }
9562 /// Identifies the authorization scope(s) for the method you are building.
9563 ///
9564 /// See [`Self::add_scope()`] for details.
9565 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableCheckConsistencyCall<'a, S>
9566 where I: IntoIterator<Item = St>,
9567 St: AsRef<str> {
9568 self._scopes
9569 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9570 self
9571 }
9572
9573 /// Removes all scopes, and no default scope will be used either.
9574 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9575 /// for details).
9576 pub fn clear_scopes(mut self) -> ProjectInstanceTableCheckConsistencyCall<'a, S> {
9577 self._scopes.clear();
9578 self
9579 }
9580}
9581
9582
9583/// Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.
9584///
9585/// A builder for the *instances.tables.create* method supported by a *project* resource.
9586/// It is not used directly, but through a [`ProjectMethods`] instance.
9587///
9588/// # Example
9589///
9590/// Instantiate a resource method builder
9591///
9592/// ```test_harness,no_run
9593/// # extern crate hyper;
9594/// # extern crate hyper_rustls;
9595/// # extern crate google_bigtableadmin2 as bigtableadmin2;
9596/// use bigtableadmin2::api::CreateTableRequest;
9597/// # async fn dox() {
9598/// # use std::default::Default;
9599/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
9600///
9601/// # let secret: oauth2::ApplicationSecret = Default::default();
9602/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
9603/// # secret,
9604/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9605/// # ).build().await.unwrap();
9606/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
9607/// // As the method needs a request, you would usually fill it with the desired information
9608/// // into the respective structure. Some of the parts shown here might not be applicable !
9609/// // Values shown here are possibly random and not representative !
9610/// let mut req = CreateTableRequest::default();
9611///
9612/// // You can configure optional parameters by calling the respective setters at will, and
9613/// // execute the final call using `doit()`.
9614/// // Values shown here are possibly random and not representative !
9615/// let result = hub.projects().instances_tables_create(req, "parent")
9616/// .doit().await;
9617/// # }
9618/// ```
9619pub struct ProjectInstanceTableCreateCall<'a, S>
9620 where S: 'a {
9621
9622 hub: &'a BigtableAdmin<S>,
9623 _request: CreateTableRequest,
9624 _parent: String,
9625 _delegate: Option<&'a mut dyn client::Delegate>,
9626 _additional_params: HashMap<String, String>,
9627 _scopes: BTreeSet<String>
9628}
9629
9630impl<'a, S> client::CallBuilder for ProjectInstanceTableCreateCall<'a, S> {}
9631
9632impl<'a, S> ProjectInstanceTableCreateCall<'a, S>
9633where
9634 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
9635 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
9636 S::Future: Send + Unpin + 'static,
9637 S::Error: Into<Box<dyn StdError + Send + Sync>>,
9638{
9639
9640
9641 /// Perform the operation you have build so far.
9642 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Table)> {
9643 use std::io::{Read, Seek};
9644 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
9645 use client::{ToParts, url::Params};
9646 use std::borrow::Cow;
9647
9648 let mut dd = client::DefaultDelegate;
9649 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
9650 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.create",
9651 http_method: hyper::Method::POST });
9652
9653 for &field in ["alt", "parent"].iter() {
9654 if self._additional_params.contains_key(field) {
9655 dlg.finished(false);
9656 return Err(client::Error::FieldClash(field));
9657 }
9658 }
9659
9660 let mut params = Params::with_capacity(4 + self._additional_params.len());
9661 params.push("parent", self._parent);
9662
9663 params.extend(self._additional_params.iter());
9664
9665 params.push("alt", "json");
9666 let mut url = self.hub._base_url.clone() + "v2/{+parent}/tables";
9667 if self._scopes.is_empty() {
9668 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
9669 }
9670
9671 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
9672 url = params.uri_replacement(url, param_name, find_this, true);
9673 }
9674 {
9675 let to_remove = ["parent"];
9676 params.remove_params(&to_remove);
9677 }
9678
9679 let url = params.parse_with_url(&url);
9680
9681 let mut json_mime_type = mime::APPLICATION_JSON;
9682 let mut request_value_reader =
9683 {
9684 let mut value = json::value::to_value(&self._request).expect("serde to work");
9685 client::remove_json_null_values(&mut value);
9686 let mut dst = io::Cursor::new(Vec::with_capacity(128));
9687 json::to_writer(&mut dst, &value).unwrap();
9688 dst
9689 };
9690 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
9691 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
9692
9693
9694 loop {
9695 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
9696 Ok(token) => token,
9697 Err(e) => {
9698 match dlg.token(e) {
9699 Ok(token) => token,
9700 Err(e) => {
9701 dlg.finished(false);
9702 return Err(client::Error::MissingToken(e));
9703 }
9704 }
9705 }
9706 };
9707 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
9708 let mut req_result = {
9709 let client = &self.hub.client;
9710 dlg.pre_request();
9711 let mut req_builder = hyper::Request::builder()
9712 .method(hyper::Method::POST)
9713 .uri(url.as_str())
9714 .header(USER_AGENT, self.hub._user_agent.clone());
9715
9716 if let Some(token) = token.as_ref() {
9717 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9718 }
9719
9720
9721 let request = req_builder
9722 .header(CONTENT_TYPE, json_mime_type.to_string())
9723 .header(CONTENT_LENGTH, request_size as u64)
9724 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
9725
9726 client.request(request.unwrap()).await
9727
9728 };
9729
9730 match req_result {
9731 Err(err) => {
9732 if let client::Retry::After(d) = dlg.http_error(&err) {
9733 sleep(d).await;
9734 continue;
9735 }
9736 dlg.finished(false);
9737 return Err(client::Error::HttpError(err))
9738 }
9739 Ok(mut res) => {
9740 if !res.status().is_success() {
9741 let res_body_string = client::get_body_as_string(res.body_mut()).await;
9742 let (parts, _) = res.into_parts();
9743 let body = hyper::Body::from(res_body_string.clone());
9744 let restored_response = hyper::Response::from_parts(parts, body);
9745
9746 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
9747
9748 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
9749 sleep(d).await;
9750 continue;
9751 }
9752
9753 dlg.finished(false);
9754
9755 return match server_response {
9756 Some(error_value) => Err(client::Error::BadRequest(error_value)),
9757 None => Err(client::Error::Failure(restored_response)),
9758 }
9759 }
9760 let result_value = {
9761 let res_body_string = client::get_body_as_string(res.body_mut()).await;
9762
9763 match json::from_str(&res_body_string) {
9764 Ok(decoded) => (res, decoded),
9765 Err(err) => {
9766 dlg.response_json_decode_error(&res_body_string, &err);
9767 return Err(client::Error::JsonDecodeError(res_body_string, err));
9768 }
9769 }
9770 };
9771
9772 dlg.finished(true);
9773 return Ok(result_value)
9774 }
9775 }
9776 }
9777 }
9778
9779
9780 ///
9781 /// Sets the *request* property to the given value.
9782 ///
9783 /// Even though the property as already been set when instantiating this call,
9784 /// we provide this method for API completeness.
9785 pub fn request(mut self, new_value: CreateTableRequest) -> ProjectInstanceTableCreateCall<'a, S> {
9786 self._request = new_value;
9787 self
9788 }
9789 /// Required. The unique name of the instance in which to create the table. Values are of the form `projects/{project}/instances/{instance}`.
9790 ///
9791 /// Sets the *parent* path property to the given value.
9792 ///
9793 /// Even though the property as already been set when instantiating this call,
9794 /// we provide this method for API completeness.
9795 pub fn parent(mut self, new_value: &str) -> ProjectInstanceTableCreateCall<'a, S> {
9796 self._parent = new_value.to_string();
9797 self
9798 }
9799 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9800 /// while executing the actual API request.
9801 ///
9802 /// ````text
9803 /// It should be used to handle progress information, and to implement a certain level of resilience.
9804 /// ````
9805 ///
9806 /// Sets the *delegate* property to the given value.
9807 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableCreateCall<'a, S> {
9808 self._delegate = Some(new_value);
9809 self
9810 }
9811
9812 /// Set any additional parameter of the query string used in the request.
9813 /// It should be used to set parameters which are not yet available through their own
9814 /// setters.
9815 ///
9816 /// Please note that this method must not be used to set any of the known parameters
9817 /// which have their own setter method. If done anyway, the request will fail.
9818 ///
9819 /// # Additional Parameters
9820 ///
9821 /// * *$.xgafv* (query-string) - V1 error format.
9822 /// * *access_token* (query-string) - OAuth access token.
9823 /// * *alt* (query-string) - Data format for response.
9824 /// * *callback* (query-string) - JSONP
9825 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9826 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9827 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9828 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9829 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9830 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9831 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9832 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableCreateCall<'a, S>
9833 where T: AsRef<str> {
9834 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
9835 self
9836 }
9837
9838 /// Identifies the authorization scope for the method you are building.
9839 ///
9840 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9841 /// [`Scope::BigtableAdmin`].
9842 ///
9843 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9844 /// tokens for more than one scope.
9845 ///
9846 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9847 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9848 /// sufficient, a read-write scope will do as well.
9849 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableCreateCall<'a, S>
9850 where St: AsRef<str> {
9851 self._scopes.insert(String::from(scope.as_ref()));
9852 self
9853 }
9854 /// Identifies the authorization scope(s) for the method you are building.
9855 ///
9856 /// See [`Self::add_scope()`] for details.
9857 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableCreateCall<'a, S>
9858 where I: IntoIterator<Item = St>,
9859 St: AsRef<str> {
9860 self._scopes
9861 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9862 self
9863 }
9864
9865 /// Removes all scopes, and no default scope will be used either.
9866 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9867 /// for details).
9868 pub fn clear_scopes(mut self) -> ProjectInstanceTableCreateCall<'a, S> {
9869 self._scopes.clear();
9870 self
9871 }
9872}
9873
9874
9875/// Permanently deletes a specified table and all of its data.
9876///
9877/// A builder for the *instances.tables.delete* method supported by a *project* resource.
9878/// It is not used directly, but through a [`ProjectMethods`] instance.
9879///
9880/// # Example
9881///
9882/// Instantiate a resource method builder
9883///
9884/// ```test_harness,no_run
9885/// # extern crate hyper;
9886/// # extern crate hyper_rustls;
9887/// # extern crate google_bigtableadmin2 as bigtableadmin2;
9888/// # async fn dox() {
9889/// # use std::default::Default;
9890/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
9891///
9892/// # let secret: oauth2::ApplicationSecret = Default::default();
9893/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
9894/// # secret,
9895/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9896/// # ).build().await.unwrap();
9897/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
9898/// // You can configure optional parameters by calling the respective setters at will, and
9899/// // execute the final call using `doit()`.
9900/// // Values shown here are possibly random and not representative !
9901/// let result = hub.projects().instances_tables_delete("name")
9902/// .doit().await;
9903/// # }
9904/// ```
9905pub struct ProjectInstanceTableDeleteCall<'a, S>
9906 where S: 'a {
9907
9908 hub: &'a BigtableAdmin<S>,
9909 _name: String,
9910 _delegate: Option<&'a mut dyn client::Delegate>,
9911 _additional_params: HashMap<String, String>,
9912 _scopes: BTreeSet<String>
9913}
9914
9915impl<'a, S> client::CallBuilder for ProjectInstanceTableDeleteCall<'a, S> {}
9916
9917impl<'a, S> ProjectInstanceTableDeleteCall<'a, S>
9918where
9919 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
9920 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
9921 S::Future: Send + Unpin + 'static,
9922 S::Error: Into<Box<dyn StdError + Send + Sync>>,
9923{
9924
9925
9926 /// Perform the operation you have build so far.
9927 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
9928 use std::io::{Read, Seek};
9929 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
9930 use client::{ToParts, url::Params};
9931 use std::borrow::Cow;
9932
9933 let mut dd = client::DefaultDelegate;
9934 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
9935 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.delete",
9936 http_method: hyper::Method::DELETE });
9937
9938 for &field in ["alt", "name"].iter() {
9939 if self._additional_params.contains_key(field) {
9940 dlg.finished(false);
9941 return Err(client::Error::FieldClash(field));
9942 }
9943 }
9944
9945 let mut params = Params::with_capacity(3 + self._additional_params.len());
9946 params.push("name", self._name);
9947
9948 params.extend(self._additional_params.iter());
9949
9950 params.push("alt", "json");
9951 let mut url = self.hub._base_url.clone() + "v2/{+name}";
9952 if self._scopes.is_empty() {
9953 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
9954 }
9955
9956 for &(find_this, param_name) in [("{+name}", "name")].iter() {
9957 url = params.uri_replacement(url, param_name, find_this, true);
9958 }
9959 {
9960 let to_remove = ["name"];
9961 params.remove_params(&to_remove);
9962 }
9963
9964 let url = params.parse_with_url(&url);
9965
9966
9967
9968 loop {
9969 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
9970 Ok(token) => token,
9971 Err(e) => {
9972 match dlg.token(e) {
9973 Ok(token) => token,
9974 Err(e) => {
9975 dlg.finished(false);
9976 return Err(client::Error::MissingToken(e));
9977 }
9978 }
9979 }
9980 };
9981 let mut req_result = {
9982 let client = &self.hub.client;
9983 dlg.pre_request();
9984 let mut req_builder = hyper::Request::builder()
9985 .method(hyper::Method::DELETE)
9986 .uri(url.as_str())
9987 .header(USER_AGENT, self.hub._user_agent.clone());
9988
9989 if let Some(token) = token.as_ref() {
9990 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9991 }
9992
9993
9994 let request = req_builder
9995 .body(hyper::body::Body::empty());
9996
9997 client.request(request.unwrap()).await
9998
9999 };
10000
10001 match req_result {
10002 Err(err) => {
10003 if let client::Retry::After(d) = dlg.http_error(&err) {
10004 sleep(d).await;
10005 continue;
10006 }
10007 dlg.finished(false);
10008 return Err(client::Error::HttpError(err))
10009 }
10010 Ok(mut res) => {
10011 if !res.status().is_success() {
10012 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10013 let (parts, _) = res.into_parts();
10014 let body = hyper::Body::from(res_body_string.clone());
10015 let restored_response = hyper::Response::from_parts(parts, body);
10016
10017 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
10018
10019 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
10020 sleep(d).await;
10021 continue;
10022 }
10023
10024 dlg.finished(false);
10025
10026 return match server_response {
10027 Some(error_value) => Err(client::Error::BadRequest(error_value)),
10028 None => Err(client::Error::Failure(restored_response)),
10029 }
10030 }
10031 let result_value = {
10032 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10033
10034 match json::from_str(&res_body_string) {
10035 Ok(decoded) => (res, decoded),
10036 Err(err) => {
10037 dlg.response_json_decode_error(&res_body_string, &err);
10038 return Err(client::Error::JsonDecodeError(res_body_string, err));
10039 }
10040 }
10041 };
10042
10043 dlg.finished(true);
10044 return Ok(result_value)
10045 }
10046 }
10047 }
10048 }
10049
10050
10051 /// Required. The unique name of the table to be deleted. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
10052 ///
10053 /// Sets the *name* path property to the given value.
10054 ///
10055 /// Even though the property as already been set when instantiating this call,
10056 /// we provide this method for API completeness.
10057 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableDeleteCall<'a, S> {
10058 self._name = new_value.to_string();
10059 self
10060 }
10061 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10062 /// while executing the actual API request.
10063 ///
10064 /// ````text
10065 /// It should be used to handle progress information, and to implement a certain level of resilience.
10066 /// ````
10067 ///
10068 /// Sets the *delegate* property to the given value.
10069 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableDeleteCall<'a, S> {
10070 self._delegate = Some(new_value);
10071 self
10072 }
10073
10074 /// Set any additional parameter of the query string used in the request.
10075 /// It should be used to set parameters which are not yet available through their own
10076 /// setters.
10077 ///
10078 /// Please note that this method must not be used to set any of the known parameters
10079 /// which have their own setter method. If done anyway, the request will fail.
10080 ///
10081 /// # Additional Parameters
10082 ///
10083 /// * *$.xgafv* (query-string) - V1 error format.
10084 /// * *access_token* (query-string) - OAuth access token.
10085 /// * *alt* (query-string) - Data format for response.
10086 /// * *callback* (query-string) - JSONP
10087 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10088 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10089 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10090 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10091 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10092 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10093 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10094 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableDeleteCall<'a, S>
10095 where T: AsRef<str> {
10096 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
10097 self
10098 }
10099
10100 /// Identifies the authorization scope for the method you are building.
10101 ///
10102 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10103 /// [`Scope::BigtableAdmin`].
10104 ///
10105 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10106 /// tokens for more than one scope.
10107 ///
10108 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10109 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10110 /// sufficient, a read-write scope will do as well.
10111 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableDeleteCall<'a, S>
10112 where St: AsRef<str> {
10113 self._scopes.insert(String::from(scope.as_ref()));
10114 self
10115 }
10116 /// Identifies the authorization scope(s) for the method you are building.
10117 ///
10118 /// See [`Self::add_scope()`] for details.
10119 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableDeleteCall<'a, S>
10120 where I: IntoIterator<Item = St>,
10121 St: AsRef<str> {
10122 self._scopes
10123 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10124 self
10125 }
10126
10127 /// Removes all scopes, and no default scope will be used either.
10128 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10129 /// for details).
10130 pub fn clear_scopes(mut self) -> ProjectInstanceTableDeleteCall<'a, S> {
10131 self._scopes.clear();
10132 self
10133 }
10134}
10135
10136
10137/// 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. Note that row key prefixes used here are treated as service data. For more information about how service data is handled, see the [Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-notice).
10138///
10139/// A builder for the *instances.tables.dropRowRange* method supported by a *project* resource.
10140/// It is not used directly, but through a [`ProjectMethods`] instance.
10141///
10142/// # Example
10143///
10144/// Instantiate a resource method builder
10145///
10146/// ```test_harness,no_run
10147/// # extern crate hyper;
10148/// # extern crate hyper_rustls;
10149/// # extern crate google_bigtableadmin2 as bigtableadmin2;
10150/// use bigtableadmin2::api::DropRowRangeRequest;
10151/// # async fn dox() {
10152/// # use std::default::Default;
10153/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
10154///
10155/// # let secret: oauth2::ApplicationSecret = Default::default();
10156/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
10157/// # secret,
10158/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10159/// # ).build().await.unwrap();
10160/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
10161/// // As the method needs a request, you would usually fill it with the desired information
10162/// // into the respective structure. Some of the parts shown here might not be applicable !
10163/// // Values shown here are possibly random and not representative !
10164/// let mut req = DropRowRangeRequest::default();
10165///
10166/// // You can configure optional parameters by calling the respective setters at will, and
10167/// // execute the final call using `doit()`.
10168/// // Values shown here are possibly random and not representative !
10169/// let result = hub.projects().instances_tables_drop_row_range(req, "name")
10170/// .doit().await;
10171/// # }
10172/// ```
10173pub struct ProjectInstanceTableDropRowRangeCall<'a, S>
10174 where S: 'a {
10175
10176 hub: &'a BigtableAdmin<S>,
10177 _request: DropRowRangeRequest,
10178 _name: String,
10179 _delegate: Option<&'a mut dyn client::Delegate>,
10180 _additional_params: HashMap<String, String>,
10181 _scopes: BTreeSet<String>
10182}
10183
10184impl<'a, S> client::CallBuilder for ProjectInstanceTableDropRowRangeCall<'a, S> {}
10185
10186impl<'a, S> ProjectInstanceTableDropRowRangeCall<'a, S>
10187where
10188 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
10189 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
10190 S::Future: Send + Unpin + 'static,
10191 S::Error: Into<Box<dyn StdError + Send + Sync>>,
10192{
10193
10194
10195 /// Perform the operation you have build so far.
10196 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
10197 use std::io::{Read, Seek};
10198 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
10199 use client::{ToParts, url::Params};
10200 use std::borrow::Cow;
10201
10202 let mut dd = client::DefaultDelegate;
10203 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
10204 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.dropRowRange",
10205 http_method: hyper::Method::POST });
10206
10207 for &field in ["alt", "name"].iter() {
10208 if self._additional_params.contains_key(field) {
10209 dlg.finished(false);
10210 return Err(client::Error::FieldClash(field));
10211 }
10212 }
10213
10214 let mut params = Params::with_capacity(4 + self._additional_params.len());
10215 params.push("name", self._name);
10216
10217 params.extend(self._additional_params.iter());
10218
10219 params.push("alt", "json");
10220 let mut url = self.hub._base_url.clone() + "v2/{+name}:dropRowRange";
10221 if self._scopes.is_empty() {
10222 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
10223 }
10224
10225 for &(find_this, param_name) in [("{+name}", "name")].iter() {
10226 url = params.uri_replacement(url, param_name, find_this, true);
10227 }
10228 {
10229 let to_remove = ["name"];
10230 params.remove_params(&to_remove);
10231 }
10232
10233 let url = params.parse_with_url(&url);
10234
10235 let mut json_mime_type = mime::APPLICATION_JSON;
10236 let mut request_value_reader =
10237 {
10238 let mut value = json::value::to_value(&self._request).expect("serde to work");
10239 client::remove_json_null_values(&mut value);
10240 let mut dst = io::Cursor::new(Vec::with_capacity(128));
10241 json::to_writer(&mut dst, &value).unwrap();
10242 dst
10243 };
10244 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
10245 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
10246
10247
10248 loop {
10249 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
10250 Ok(token) => token,
10251 Err(e) => {
10252 match dlg.token(e) {
10253 Ok(token) => token,
10254 Err(e) => {
10255 dlg.finished(false);
10256 return Err(client::Error::MissingToken(e));
10257 }
10258 }
10259 }
10260 };
10261 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
10262 let mut req_result = {
10263 let client = &self.hub.client;
10264 dlg.pre_request();
10265 let mut req_builder = hyper::Request::builder()
10266 .method(hyper::Method::POST)
10267 .uri(url.as_str())
10268 .header(USER_AGENT, self.hub._user_agent.clone());
10269
10270 if let Some(token) = token.as_ref() {
10271 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10272 }
10273
10274
10275 let request = req_builder
10276 .header(CONTENT_TYPE, json_mime_type.to_string())
10277 .header(CONTENT_LENGTH, request_size as u64)
10278 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
10279
10280 client.request(request.unwrap()).await
10281
10282 };
10283
10284 match req_result {
10285 Err(err) => {
10286 if let client::Retry::After(d) = dlg.http_error(&err) {
10287 sleep(d).await;
10288 continue;
10289 }
10290 dlg.finished(false);
10291 return Err(client::Error::HttpError(err))
10292 }
10293 Ok(mut res) => {
10294 if !res.status().is_success() {
10295 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10296 let (parts, _) = res.into_parts();
10297 let body = hyper::Body::from(res_body_string.clone());
10298 let restored_response = hyper::Response::from_parts(parts, body);
10299
10300 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
10301
10302 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
10303 sleep(d).await;
10304 continue;
10305 }
10306
10307 dlg.finished(false);
10308
10309 return match server_response {
10310 Some(error_value) => Err(client::Error::BadRequest(error_value)),
10311 None => Err(client::Error::Failure(restored_response)),
10312 }
10313 }
10314 let result_value = {
10315 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10316
10317 match json::from_str(&res_body_string) {
10318 Ok(decoded) => (res, decoded),
10319 Err(err) => {
10320 dlg.response_json_decode_error(&res_body_string, &err);
10321 return Err(client::Error::JsonDecodeError(res_body_string, err));
10322 }
10323 }
10324 };
10325
10326 dlg.finished(true);
10327 return Ok(result_value)
10328 }
10329 }
10330 }
10331 }
10332
10333
10334 ///
10335 /// Sets the *request* property to the given value.
10336 ///
10337 /// Even though the property as already been set when instantiating this call,
10338 /// we provide this method for API completeness.
10339 pub fn request(mut self, new_value: DropRowRangeRequest) -> ProjectInstanceTableDropRowRangeCall<'a, S> {
10340 self._request = new_value;
10341 self
10342 }
10343 /// Required. The unique name of the table on which to drop a range of rows. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
10344 ///
10345 /// Sets the *name* path property to the given value.
10346 ///
10347 /// Even though the property as already been set when instantiating this call,
10348 /// we provide this method for API completeness.
10349 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableDropRowRangeCall<'a, S> {
10350 self._name = new_value.to_string();
10351 self
10352 }
10353 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10354 /// while executing the actual API request.
10355 ///
10356 /// ````text
10357 /// It should be used to handle progress information, and to implement a certain level of resilience.
10358 /// ````
10359 ///
10360 /// Sets the *delegate* property to the given value.
10361 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableDropRowRangeCall<'a, S> {
10362 self._delegate = Some(new_value);
10363 self
10364 }
10365
10366 /// Set any additional parameter of the query string used in the request.
10367 /// It should be used to set parameters which are not yet available through their own
10368 /// setters.
10369 ///
10370 /// Please note that this method must not be used to set any of the known parameters
10371 /// which have their own setter method. If done anyway, the request will fail.
10372 ///
10373 /// # Additional Parameters
10374 ///
10375 /// * *$.xgafv* (query-string) - V1 error format.
10376 /// * *access_token* (query-string) - OAuth access token.
10377 /// * *alt* (query-string) - Data format for response.
10378 /// * *callback* (query-string) - JSONP
10379 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10380 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10381 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10382 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10383 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10384 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10385 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10386 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableDropRowRangeCall<'a, S>
10387 where T: AsRef<str> {
10388 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
10389 self
10390 }
10391
10392 /// Identifies the authorization scope for the method you are building.
10393 ///
10394 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10395 /// [`Scope::BigtableAdmin`].
10396 ///
10397 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10398 /// tokens for more than one scope.
10399 ///
10400 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10401 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10402 /// sufficient, a read-write scope will do as well.
10403 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableDropRowRangeCall<'a, S>
10404 where St: AsRef<str> {
10405 self._scopes.insert(String::from(scope.as_ref()));
10406 self
10407 }
10408 /// Identifies the authorization scope(s) for the method you are building.
10409 ///
10410 /// See [`Self::add_scope()`] for details.
10411 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableDropRowRangeCall<'a, S>
10412 where I: IntoIterator<Item = St>,
10413 St: AsRef<str> {
10414 self._scopes
10415 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10416 self
10417 }
10418
10419 /// Removes all scopes, and no default scope will be used either.
10420 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10421 /// for details).
10422 pub fn clear_scopes(mut self) -> ProjectInstanceTableDropRowRangeCall<'a, S> {
10423 self._scopes.clear();
10424 self
10425 }
10426}
10427
10428
10429/// Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.
10430///
10431/// A builder for the *instances.tables.generateConsistencyToken* method supported by a *project* resource.
10432/// It is not used directly, but through a [`ProjectMethods`] instance.
10433///
10434/// # Example
10435///
10436/// Instantiate a resource method builder
10437///
10438/// ```test_harness,no_run
10439/// # extern crate hyper;
10440/// # extern crate hyper_rustls;
10441/// # extern crate google_bigtableadmin2 as bigtableadmin2;
10442/// use bigtableadmin2::api::GenerateConsistencyTokenRequest;
10443/// # async fn dox() {
10444/// # use std::default::Default;
10445/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
10446///
10447/// # let secret: oauth2::ApplicationSecret = Default::default();
10448/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
10449/// # secret,
10450/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10451/// # ).build().await.unwrap();
10452/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
10453/// // As the method needs a request, you would usually fill it with the desired information
10454/// // into the respective structure. Some of the parts shown here might not be applicable !
10455/// // Values shown here are possibly random and not representative !
10456/// let mut req = GenerateConsistencyTokenRequest::default();
10457///
10458/// // You can configure optional parameters by calling the respective setters at will, and
10459/// // execute the final call using `doit()`.
10460/// // Values shown here are possibly random and not representative !
10461/// let result = hub.projects().instances_tables_generate_consistency_token(req, "name")
10462/// .doit().await;
10463/// # }
10464/// ```
10465pub struct ProjectInstanceTableGenerateConsistencyTokenCall<'a, S>
10466 where S: 'a {
10467
10468 hub: &'a BigtableAdmin<S>,
10469 _request: GenerateConsistencyTokenRequest,
10470 _name: String,
10471 _delegate: Option<&'a mut dyn client::Delegate>,
10472 _additional_params: HashMap<String, String>,
10473 _scopes: BTreeSet<String>
10474}
10475
10476impl<'a, S> client::CallBuilder for ProjectInstanceTableGenerateConsistencyTokenCall<'a, S> {}
10477
10478impl<'a, S> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S>
10479where
10480 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
10481 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
10482 S::Future: Send + Unpin + 'static,
10483 S::Error: Into<Box<dyn StdError + Send + Sync>>,
10484{
10485
10486
10487 /// Perform the operation you have build so far.
10488 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, GenerateConsistencyTokenResponse)> {
10489 use std::io::{Read, Seek};
10490 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
10491 use client::{ToParts, url::Params};
10492 use std::borrow::Cow;
10493
10494 let mut dd = client::DefaultDelegate;
10495 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
10496 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.generateConsistencyToken",
10497 http_method: hyper::Method::POST });
10498
10499 for &field in ["alt", "name"].iter() {
10500 if self._additional_params.contains_key(field) {
10501 dlg.finished(false);
10502 return Err(client::Error::FieldClash(field));
10503 }
10504 }
10505
10506 let mut params = Params::with_capacity(4 + self._additional_params.len());
10507 params.push("name", self._name);
10508
10509 params.extend(self._additional_params.iter());
10510
10511 params.push("alt", "json");
10512 let mut url = self.hub._base_url.clone() + "v2/{+name}:generateConsistencyToken";
10513 if self._scopes.is_empty() {
10514 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
10515 }
10516
10517 for &(find_this, param_name) in [("{+name}", "name")].iter() {
10518 url = params.uri_replacement(url, param_name, find_this, true);
10519 }
10520 {
10521 let to_remove = ["name"];
10522 params.remove_params(&to_remove);
10523 }
10524
10525 let url = params.parse_with_url(&url);
10526
10527 let mut json_mime_type = mime::APPLICATION_JSON;
10528 let mut request_value_reader =
10529 {
10530 let mut value = json::value::to_value(&self._request).expect("serde to work");
10531 client::remove_json_null_values(&mut value);
10532 let mut dst = io::Cursor::new(Vec::with_capacity(128));
10533 json::to_writer(&mut dst, &value).unwrap();
10534 dst
10535 };
10536 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
10537 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
10538
10539
10540 loop {
10541 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
10542 Ok(token) => token,
10543 Err(e) => {
10544 match dlg.token(e) {
10545 Ok(token) => token,
10546 Err(e) => {
10547 dlg.finished(false);
10548 return Err(client::Error::MissingToken(e));
10549 }
10550 }
10551 }
10552 };
10553 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
10554 let mut req_result = {
10555 let client = &self.hub.client;
10556 dlg.pre_request();
10557 let mut req_builder = hyper::Request::builder()
10558 .method(hyper::Method::POST)
10559 .uri(url.as_str())
10560 .header(USER_AGENT, self.hub._user_agent.clone());
10561
10562 if let Some(token) = token.as_ref() {
10563 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10564 }
10565
10566
10567 let request = req_builder
10568 .header(CONTENT_TYPE, json_mime_type.to_string())
10569 .header(CONTENT_LENGTH, request_size as u64)
10570 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
10571
10572 client.request(request.unwrap()).await
10573
10574 };
10575
10576 match req_result {
10577 Err(err) => {
10578 if let client::Retry::After(d) = dlg.http_error(&err) {
10579 sleep(d).await;
10580 continue;
10581 }
10582 dlg.finished(false);
10583 return Err(client::Error::HttpError(err))
10584 }
10585 Ok(mut res) => {
10586 if !res.status().is_success() {
10587 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10588 let (parts, _) = res.into_parts();
10589 let body = hyper::Body::from(res_body_string.clone());
10590 let restored_response = hyper::Response::from_parts(parts, body);
10591
10592 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
10593
10594 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
10595 sleep(d).await;
10596 continue;
10597 }
10598
10599 dlg.finished(false);
10600
10601 return match server_response {
10602 Some(error_value) => Err(client::Error::BadRequest(error_value)),
10603 None => Err(client::Error::Failure(restored_response)),
10604 }
10605 }
10606 let result_value = {
10607 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10608
10609 match json::from_str(&res_body_string) {
10610 Ok(decoded) => (res, decoded),
10611 Err(err) => {
10612 dlg.response_json_decode_error(&res_body_string, &err);
10613 return Err(client::Error::JsonDecodeError(res_body_string, err));
10614 }
10615 }
10616 };
10617
10618 dlg.finished(true);
10619 return Ok(result_value)
10620 }
10621 }
10622 }
10623 }
10624
10625
10626 ///
10627 /// Sets the *request* property to the given value.
10628 ///
10629 /// Even though the property as already been set when instantiating this call,
10630 /// we provide this method for API completeness.
10631 pub fn request(mut self, new_value: GenerateConsistencyTokenRequest) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S> {
10632 self._request = new_value;
10633 self
10634 }
10635 /// Required. The unique name of the Table for which to create a consistency token. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
10636 ///
10637 /// Sets the *name* path property to the given value.
10638 ///
10639 /// Even though the property as already been set when instantiating this call,
10640 /// we provide this method for API completeness.
10641 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S> {
10642 self._name = new_value.to_string();
10643 self
10644 }
10645 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10646 /// while executing the actual API request.
10647 ///
10648 /// ````text
10649 /// It should be used to handle progress information, and to implement a certain level of resilience.
10650 /// ````
10651 ///
10652 /// Sets the *delegate* property to the given value.
10653 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S> {
10654 self._delegate = Some(new_value);
10655 self
10656 }
10657
10658 /// Set any additional parameter of the query string used in the request.
10659 /// It should be used to set parameters which are not yet available through their own
10660 /// setters.
10661 ///
10662 /// Please note that this method must not be used to set any of the known parameters
10663 /// which have their own setter method. If done anyway, the request will fail.
10664 ///
10665 /// # Additional Parameters
10666 ///
10667 /// * *$.xgafv* (query-string) - V1 error format.
10668 /// * *access_token* (query-string) - OAuth access token.
10669 /// * *alt* (query-string) - Data format for response.
10670 /// * *callback* (query-string) - JSONP
10671 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10672 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10673 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10674 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10675 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10676 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10677 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10678 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S>
10679 where T: AsRef<str> {
10680 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
10681 self
10682 }
10683
10684 /// Identifies the authorization scope for the method you are building.
10685 ///
10686 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10687 /// [`Scope::BigtableAdmin`].
10688 ///
10689 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10690 /// tokens for more than one scope.
10691 ///
10692 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10693 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10694 /// sufficient, a read-write scope will do as well.
10695 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S>
10696 where St: AsRef<str> {
10697 self._scopes.insert(String::from(scope.as_ref()));
10698 self
10699 }
10700 /// Identifies the authorization scope(s) for the method you are building.
10701 ///
10702 /// See [`Self::add_scope()`] for details.
10703 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S>
10704 where I: IntoIterator<Item = St>,
10705 St: AsRef<str> {
10706 self._scopes
10707 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10708 self
10709 }
10710
10711 /// Removes all scopes, and no default scope will be used either.
10712 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10713 /// for details).
10714 pub fn clear_scopes(mut self) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, S> {
10715 self._scopes.clear();
10716 self
10717 }
10718}
10719
10720
10721/// Gets metadata information about the specified table.
10722///
10723/// A builder for the *instances.tables.get* method supported by a *project* resource.
10724/// It is not used directly, but through a [`ProjectMethods`] instance.
10725///
10726/// # Example
10727///
10728/// Instantiate a resource method builder
10729///
10730/// ```test_harness,no_run
10731/// # extern crate hyper;
10732/// # extern crate hyper_rustls;
10733/// # extern crate google_bigtableadmin2 as bigtableadmin2;
10734/// # async fn dox() {
10735/// # use std::default::Default;
10736/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
10737///
10738/// # let secret: oauth2::ApplicationSecret = Default::default();
10739/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
10740/// # secret,
10741/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10742/// # ).build().await.unwrap();
10743/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
10744/// // You can configure optional parameters by calling the respective setters at will, and
10745/// // execute the final call using `doit()`.
10746/// // Values shown here are possibly random and not representative !
10747/// let result = hub.projects().instances_tables_get("name")
10748/// .view("sadipscing")
10749/// .doit().await;
10750/// # }
10751/// ```
10752pub struct ProjectInstanceTableGetCall<'a, S>
10753 where S: 'a {
10754
10755 hub: &'a BigtableAdmin<S>,
10756 _name: String,
10757 _view: Option<String>,
10758 _delegate: Option<&'a mut dyn client::Delegate>,
10759 _additional_params: HashMap<String, String>,
10760 _scopes: BTreeSet<String>
10761}
10762
10763impl<'a, S> client::CallBuilder for ProjectInstanceTableGetCall<'a, S> {}
10764
10765impl<'a, S> ProjectInstanceTableGetCall<'a, S>
10766where
10767 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
10768 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
10769 S::Future: Send + Unpin + 'static,
10770 S::Error: Into<Box<dyn StdError + Send + Sync>>,
10771{
10772
10773
10774 /// Perform the operation you have build so far.
10775 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Table)> {
10776 use std::io::{Read, Seek};
10777 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
10778 use client::{ToParts, url::Params};
10779 use std::borrow::Cow;
10780
10781 let mut dd = client::DefaultDelegate;
10782 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
10783 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.get",
10784 http_method: hyper::Method::GET });
10785
10786 for &field in ["alt", "name", "view"].iter() {
10787 if self._additional_params.contains_key(field) {
10788 dlg.finished(false);
10789 return Err(client::Error::FieldClash(field));
10790 }
10791 }
10792
10793 let mut params = Params::with_capacity(4 + self._additional_params.len());
10794 params.push("name", self._name);
10795 if let Some(value) = self._view.as_ref() {
10796 params.push("view", value);
10797 }
10798
10799 params.extend(self._additional_params.iter());
10800
10801 params.push("alt", "json");
10802 let mut url = self.hub._base_url.clone() + "v2/{+name}";
10803 if self._scopes.is_empty() {
10804 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
10805 }
10806
10807 for &(find_this, param_name) in [("{+name}", "name")].iter() {
10808 url = params.uri_replacement(url, param_name, find_this, true);
10809 }
10810 {
10811 let to_remove = ["name"];
10812 params.remove_params(&to_remove);
10813 }
10814
10815 let url = params.parse_with_url(&url);
10816
10817
10818
10819 loop {
10820 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
10821 Ok(token) => token,
10822 Err(e) => {
10823 match dlg.token(e) {
10824 Ok(token) => token,
10825 Err(e) => {
10826 dlg.finished(false);
10827 return Err(client::Error::MissingToken(e));
10828 }
10829 }
10830 }
10831 };
10832 let mut req_result = {
10833 let client = &self.hub.client;
10834 dlg.pre_request();
10835 let mut req_builder = hyper::Request::builder()
10836 .method(hyper::Method::GET)
10837 .uri(url.as_str())
10838 .header(USER_AGENT, self.hub._user_agent.clone());
10839
10840 if let Some(token) = token.as_ref() {
10841 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10842 }
10843
10844
10845 let request = req_builder
10846 .body(hyper::body::Body::empty());
10847
10848 client.request(request.unwrap()).await
10849
10850 };
10851
10852 match req_result {
10853 Err(err) => {
10854 if let client::Retry::After(d) = dlg.http_error(&err) {
10855 sleep(d).await;
10856 continue;
10857 }
10858 dlg.finished(false);
10859 return Err(client::Error::HttpError(err))
10860 }
10861 Ok(mut res) => {
10862 if !res.status().is_success() {
10863 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10864 let (parts, _) = res.into_parts();
10865 let body = hyper::Body::from(res_body_string.clone());
10866 let restored_response = hyper::Response::from_parts(parts, body);
10867
10868 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
10869
10870 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
10871 sleep(d).await;
10872 continue;
10873 }
10874
10875 dlg.finished(false);
10876
10877 return match server_response {
10878 Some(error_value) => Err(client::Error::BadRequest(error_value)),
10879 None => Err(client::Error::Failure(restored_response)),
10880 }
10881 }
10882 let result_value = {
10883 let res_body_string = client::get_body_as_string(res.body_mut()).await;
10884
10885 match json::from_str(&res_body_string) {
10886 Ok(decoded) => (res, decoded),
10887 Err(err) => {
10888 dlg.response_json_decode_error(&res_body_string, &err);
10889 return Err(client::Error::JsonDecodeError(res_body_string, err));
10890 }
10891 }
10892 };
10893
10894 dlg.finished(true);
10895 return Ok(result_value)
10896 }
10897 }
10898 }
10899 }
10900
10901
10902 /// Required. The unique name of the requested table. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
10903 ///
10904 /// Sets the *name* path property to the given value.
10905 ///
10906 /// Even though the property as already been set when instantiating this call,
10907 /// we provide this method for API completeness.
10908 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableGetCall<'a, S> {
10909 self._name = new_value.to_string();
10910 self
10911 }
10912 /// The view to be applied to the returned table's fields. Defaults to `SCHEMA_VIEW` if unspecified.
10913 ///
10914 /// Sets the *view* query property to the given value.
10915 pub fn view(mut self, new_value: &str) -> ProjectInstanceTableGetCall<'a, S> {
10916 self._view = Some(new_value.to_string());
10917 self
10918 }
10919 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10920 /// while executing the actual API request.
10921 ///
10922 /// ````text
10923 /// It should be used to handle progress information, and to implement a certain level of resilience.
10924 /// ````
10925 ///
10926 /// Sets the *delegate* property to the given value.
10927 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableGetCall<'a, S> {
10928 self._delegate = Some(new_value);
10929 self
10930 }
10931
10932 /// Set any additional parameter of the query string used in the request.
10933 /// It should be used to set parameters which are not yet available through their own
10934 /// setters.
10935 ///
10936 /// Please note that this method must not be used to set any of the known parameters
10937 /// which have their own setter method. If done anyway, the request will fail.
10938 ///
10939 /// # Additional Parameters
10940 ///
10941 /// * *$.xgafv* (query-string) - V1 error format.
10942 /// * *access_token* (query-string) - OAuth access token.
10943 /// * *alt* (query-string) - Data format for response.
10944 /// * *callback* (query-string) - JSONP
10945 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10946 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10947 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10948 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10949 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10950 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10951 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10952 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableGetCall<'a, S>
10953 where T: AsRef<str> {
10954 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
10955 self
10956 }
10957
10958 /// Identifies the authorization scope for the method you are building.
10959 ///
10960 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10961 /// [`Scope::BigtableAdmin`].
10962 ///
10963 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10964 /// tokens for more than one scope.
10965 ///
10966 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10967 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10968 /// sufficient, a read-write scope will do as well.
10969 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableGetCall<'a, S>
10970 where St: AsRef<str> {
10971 self._scopes.insert(String::from(scope.as_ref()));
10972 self
10973 }
10974 /// Identifies the authorization scope(s) for the method you are building.
10975 ///
10976 /// See [`Self::add_scope()`] for details.
10977 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableGetCall<'a, S>
10978 where I: IntoIterator<Item = St>,
10979 St: AsRef<str> {
10980 self._scopes
10981 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10982 self
10983 }
10984
10985 /// Removes all scopes, and no default scope will be used either.
10986 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10987 /// for details).
10988 pub fn clear_scopes(mut self) -> ProjectInstanceTableGetCall<'a, S> {
10989 self._scopes.clear();
10990 self
10991 }
10992}
10993
10994
10995/// 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.
10996///
10997/// A builder for the *instances.tables.getIamPolicy* method supported by a *project* resource.
10998/// It is not used directly, but through a [`ProjectMethods`] instance.
10999///
11000/// # Example
11001///
11002/// Instantiate a resource method builder
11003///
11004/// ```test_harness,no_run
11005/// # extern crate hyper;
11006/// # extern crate hyper_rustls;
11007/// # extern crate google_bigtableadmin2 as bigtableadmin2;
11008/// use bigtableadmin2::api::GetIamPolicyRequest;
11009/// # async fn dox() {
11010/// # use std::default::Default;
11011/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
11012///
11013/// # let secret: oauth2::ApplicationSecret = Default::default();
11014/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
11015/// # secret,
11016/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11017/// # ).build().await.unwrap();
11018/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
11019/// // As the method needs a request, you would usually fill it with the desired information
11020/// // into the respective structure. Some of the parts shown here might not be applicable !
11021/// // Values shown here are possibly random and not representative !
11022/// let mut req = GetIamPolicyRequest::default();
11023///
11024/// // You can configure optional parameters by calling the respective setters at will, and
11025/// // execute the final call using `doit()`.
11026/// // Values shown here are possibly random and not representative !
11027/// let result = hub.projects().instances_tables_get_iam_policy(req, "resource")
11028/// .doit().await;
11029/// # }
11030/// ```
11031pub struct ProjectInstanceTableGetIamPolicyCall<'a, S>
11032 where S: 'a {
11033
11034 hub: &'a BigtableAdmin<S>,
11035 _request: GetIamPolicyRequest,
11036 _resource: String,
11037 _delegate: Option<&'a mut dyn client::Delegate>,
11038 _additional_params: HashMap<String, String>,
11039 _scopes: BTreeSet<String>
11040}
11041
11042impl<'a, S> client::CallBuilder for ProjectInstanceTableGetIamPolicyCall<'a, S> {}
11043
11044impl<'a, S> ProjectInstanceTableGetIamPolicyCall<'a, S>
11045where
11046 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
11047 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
11048 S::Future: Send + Unpin + 'static,
11049 S::Error: Into<Box<dyn StdError + Send + Sync>>,
11050{
11051
11052
11053 /// Perform the operation you have build so far.
11054 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Policy)> {
11055 use std::io::{Read, Seek};
11056 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
11057 use client::{ToParts, url::Params};
11058 use std::borrow::Cow;
11059
11060 let mut dd = client::DefaultDelegate;
11061 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
11062 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.getIamPolicy",
11063 http_method: hyper::Method::POST });
11064
11065 for &field in ["alt", "resource"].iter() {
11066 if self._additional_params.contains_key(field) {
11067 dlg.finished(false);
11068 return Err(client::Error::FieldClash(field));
11069 }
11070 }
11071
11072 let mut params = Params::with_capacity(4 + self._additional_params.len());
11073 params.push("resource", self._resource);
11074
11075 params.extend(self._additional_params.iter());
11076
11077 params.push("alt", "json");
11078 let mut url = self.hub._base_url.clone() + "v2/{+resource}:getIamPolicy";
11079 if self._scopes.is_empty() {
11080 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
11081 }
11082
11083 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
11084 url = params.uri_replacement(url, param_name, find_this, true);
11085 }
11086 {
11087 let to_remove = ["resource"];
11088 params.remove_params(&to_remove);
11089 }
11090
11091 let url = params.parse_with_url(&url);
11092
11093 let mut json_mime_type = mime::APPLICATION_JSON;
11094 let mut request_value_reader =
11095 {
11096 let mut value = json::value::to_value(&self._request).expect("serde to work");
11097 client::remove_json_null_values(&mut value);
11098 let mut dst = io::Cursor::new(Vec::with_capacity(128));
11099 json::to_writer(&mut dst, &value).unwrap();
11100 dst
11101 };
11102 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
11103 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
11104
11105
11106 loop {
11107 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
11108 Ok(token) => token,
11109 Err(e) => {
11110 match dlg.token(e) {
11111 Ok(token) => token,
11112 Err(e) => {
11113 dlg.finished(false);
11114 return Err(client::Error::MissingToken(e));
11115 }
11116 }
11117 }
11118 };
11119 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
11120 let mut req_result = {
11121 let client = &self.hub.client;
11122 dlg.pre_request();
11123 let mut req_builder = hyper::Request::builder()
11124 .method(hyper::Method::POST)
11125 .uri(url.as_str())
11126 .header(USER_AGENT, self.hub._user_agent.clone());
11127
11128 if let Some(token) = token.as_ref() {
11129 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11130 }
11131
11132
11133 let request = req_builder
11134 .header(CONTENT_TYPE, json_mime_type.to_string())
11135 .header(CONTENT_LENGTH, request_size as u64)
11136 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
11137
11138 client.request(request.unwrap()).await
11139
11140 };
11141
11142 match req_result {
11143 Err(err) => {
11144 if let client::Retry::After(d) = dlg.http_error(&err) {
11145 sleep(d).await;
11146 continue;
11147 }
11148 dlg.finished(false);
11149 return Err(client::Error::HttpError(err))
11150 }
11151 Ok(mut res) => {
11152 if !res.status().is_success() {
11153 let res_body_string = client::get_body_as_string(res.body_mut()).await;
11154 let (parts, _) = res.into_parts();
11155 let body = hyper::Body::from(res_body_string.clone());
11156 let restored_response = hyper::Response::from_parts(parts, body);
11157
11158 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
11159
11160 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
11161 sleep(d).await;
11162 continue;
11163 }
11164
11165 dlg.finished(false);
11166
11167 return match server_response {
11168 Some(error_value) => Err(client::Error::BadRequest(error_value)),
11169 None => Err(client::Error::Failure(restored_response)),
11170 }
11171 }
11172 let result_value = {
11173 let res_body_string = client::get_body_as_string(res.body_mut()).await;
11174
11175 match json::from_str(&res_body_string) {
11176 Ok(decoded) => (res, decoded),
11177 Err(err) => {
11178 dlg.response_json_decode_error(&res_body_string, &err);
11179 return Err(client::Error::JsonDecodeError(res_body_string, err));
11180 }
11181 }
11182 };
11183
11184 dlg.finished(true);
11185 return Ok(result_value)
11186 }
11187 }
11188 }
11189 }
11190
11191
11192 ///
11193 /// Sets the *request* property to the given value.
11194 ///
11195 /// Even though the property as already been set when instantiating this call,
11196 /// we provide this method for API completeness.
11197 pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceTableGetIamPolicyCall<'a, S> {
11198 self._request = new_value;
11199 self
11200 }
11201 /// REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
11202 ///
11203 /// Sets the *resource* path property to the given value.
11204 ///
11205 /// Even though the property as already been set when instantiating this call,
11206 /// we provide this method for API completeness.
11207 pub fn resource(mut self, new_value: &str) -> ProjectInstanceTableGetIamPolicyCall<'a, S> {
11208 self._resource = new_value.to_string();
11209 self
11210 }
11211 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11212 /// while executing the actual API request.
11213 ///
11214 /// ````text
11215 /// It should be used to handle progress information, and to implement a certain level of resilience.
11216 /// ````
11217 ///
11218 /// Sets the *delegate* property to the given value.
11219 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableGetIamPolicyCall<'a, S> {
11220 self._delegate = Some(new_value);
11221 self
11222 }
11223
11224 /// Set any additional parameter of the query string used in the request.
11225 /// It should be used to set parameters which are not yet available through their own
11226 /// setters.
11227 ///
11228 /// Please note that this method must not be used to set any of the known parameters
11229 /// which have their own setter method. If done anyway, the request will fail.
11230 ///
11231 /// # Additional Parameters
11232 ///
11233 /// * *$.xgafv* (query-string) - V1 error format.
11234 /// * *access_token* (query-string) - OAuth access token.
11235 /// * *alt* (query-string) - Data format for response.
11236 /// * *callback* (query-string) - JSONP
11237 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11238 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11239 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11240 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11241 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11242 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11243 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11244 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableGetIamPolicyCall<'a, S>
11245 where T: AsRef<str> {
11246 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
11247 self
11248 }
11249
11250 /// Identifies the authorization scope for the method you are building.
11251 ///
11252 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11253 /// [`Scope::BigtableAdmin`].
11254 ///
11255 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11256 /// tokens for more than one scope.
11257 ///
11258 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11259 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11260 /// sufficient, a read-write scope will do as well.
11261 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableGetIamPolicyCall<'a, S>
11262 where St: AsRef<str> {
11263 self._scopes.insert(String::from(scope.as_ref()));
11264 self
11265 }
11266 /// Identifies the authorization scope(s) for the method you are building.
11267 ///
11268 /// See [`Self::add_scope()`] for details.
11269 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableGetIamPolicyCall<'a, S>
11270 where I: IntoIterator<Item = St>,
11271 St: AsRef<str> {
11272 self._scopes
11273 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11274 self
11275 }
11276
11277 /// Removes all scopes, and no default scope will be used either.
11278 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11279 /// for details).
11280 pub fn clear_scopes(mut self) -> ProjectInstanceTableGetIamPolicyCall<'a, S> {
11281 self._scopes.clear();
11282 self
11283 }
11284}
11285
11286
11287/// Lists all tables served from a specified instance.
11288///
11289/// A builder for the *instances.tables.list* method supported by a *project* resource.
11290/// It is not used directly, but through a [`ProjectMethods`] instance.
11291///
11292/// # Example
11293///
11294/// Instantiate a resource method builder
11295///
11296/// ```test_harness,no_run
11297/// # extern crate hyper;
11298/// # extern crate hyper_rustls;
11299/// # extern crate google_bigtableadmin2 as bigtableadmin2;
11300/// # async fn dox() {
11301/// # use std::default::Default;
11302/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
11303///
11304/// # let secret: oauth2::ApplicationSecret = Default::default();
11305/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
11306/// # secret,
11307/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11308/// # ).build().await.unwrap();
11309/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
11310/// // You can configure optional parameters by calling the respective setters at will, and
11311/// // execute the final call using `doit()`.
11312/// // Values shown here are possibly random and not representative !
11313/// let result = hub.projects().instances_tables_list("parent")
11314/// .view("duo")
11315/// .page_token("vero")
11316/// .page_size(-76)
11317/// .doit().await;
11318/// # }
11319/// ```
11320pub struct ProjectInstanceTableListCall<'a, S>
11321 where S: 'a {
11322
11323 hub: &'a BigtableAdmin<S>,
11324 _parent: String,
11325 _view: Option<String>,
11326 _page_token: Option<String>,
11327 _page_size: Option<i32>,
11328 _delegate: Option<&'a mut dyn client::Delegate>,
11329 _additional_params: HashMap<String, String>,
11330 _scopes: BTreeSet<String>
11331}
11332
11333impl<'a, S> client::CallBuilder for ProjectInstanceTableListCall<'a, S> {}
11334
11335impl<'a, S> ProjectInstanceTableListCall<'a, S>
11336where
11337 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
11338 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
11339 S::Future: Send + Unpin + 'static,
11340 S::Error: Into<Box<dyn StdError + Send + Sync>>,
11341{
11342
11343
11344 /// Perform the operation you have build so far.
11345 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListTablesResponse)> {
11346 use std::io::{Read, Seek};
11347 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
11348 use client::{ToParts, url::Params};
11349 use std::borrow::Cow;
11350
11351 let mut dd = client::DefaultDelegate;
11352 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
11353 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.list",
11354 http_method: hyper::Method::GET });
11355
11356 for &field in ["alt", "parent", "view", "pageToken", "pageSize"].iter() {
11357 if self._additional_params.contains_key(field) {
11358 dlg.finished(false);
11359 return Err(client::Error::FieldClash(field));
11360 }
11361 }
11362
11363 let mut params = Params::with_capacity(6 + self._additional_params.len());
11364 params.push("parent", self._parent);
11365 if let Some(value) = self._view.as_ref() {
11366 params.push("view", value);
11367 }
11368 if let Some(value) = self._page_token.as_ref() {
11369 params.push("pageToken", value);
11370 }
11371 if let Some(value) = self._page_size.as_ref() {
11372 params.push("pageSize", value.to_string());
11373 }
11374
11375 params.extend(self._additional_params.iter());
11376
11377 params.push("alt", "json");
11378 let mut url = self.hub._base_url.clone() + "v2/{+parent}/tables";
11379 if self._scopes.is_empty() {
11380 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
11381 }
11382
11383 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
11384 url = params.uri_replacement(url, param_name, find_this, true);
11385 }
11386 {
11387 let to_remove = ["parent"];
11388 params.remove_params(&to_remove);
11389 }
11390
11391 let url = params.parse_with_url(&url);
11392
11393
11394
11395 loop {
11396 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
11397 Ok(token) => token,
11398 Err(e) => {
11399 match dlg.token(e) {
11400 Ok(token) => token,
11401 Err(e) => {
11402 dlg.finished(false);
11403 return Err(client::Error::MissingToken(e));
11404 }
11405 }
11406 }
11407 };
11408 let mut req_result = {
11409 let client = &self.hub.client;
11410 dlg.pre_request();
11411 let mut req_builder = hyper::Request::builder()
11412 .method(hyper::Method::GET)
11413 .uri(url.as_str())
11414 .header(USER_AGENT, self.hub._user_agent.clone());
11415
11416 if let Some(token) = token.as_ref() {
11417 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11418 }
11419
11420
11421 let request = req_builder
11422 .body(hyper::body::Body::empty());
11423
11424 client.request(request.unwrap()).await
11425
11426 };
11427
11428 match req_result {
11429 Err(err) => {
11430 if let client::Retry::After(d) = dlg.http_error(&err) {
11431 sleep(d).await;
11432 continue;
11433 }
11434 dlg.finished(false);
11435 return Err(client::Error::HttpError(err))
11436 }
11437 Ok(mut res) => {
11438 if !res.status().is_success() {
11439 let res_body_string = client::get_body_as_string(res.body_mut()).await;
11440 let (parts, _) = res.into_parts();
11441 let body = hyper::Body::from(res_body_string.clone());
11442 let restored_response = hyper::Response::from_parts(parts, body);
11443
11444 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
11445
11446 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
11447 sleep(d).await;
11448 continue;
11449 }
11450
11451 dlg.finished(false);
11452
11453 return match server_response {
11454 Some(error_value) => Err(client::Error::BadRequest(error_value)),
11455 None => Err(client::Error::Failure(restored_response)),
11456 }
11457 }
11458 let result_value = {
11459 let res_body_string = client::get_body_as_string(res.body_mut()).await;
11460
11461 match json::from_str(&res_body_string) {
11462 Ok(decoded) => (res, decoded),
11463 Err(err) => {
11464 dlg.response_json_decode_error(&res_body_string, &err);
11465 return Err(client::Error::JsonDecodeError(res_body_string, err));
11466 }
11467 }
11468 };
11469
11470 dlg.finished(true);
11471 return Ok(result_value)
11472 }
11473 }
11474 }
11475 }
11476
11477
11478 /// Required. The unique name of the instance for which tables should be listed. Values are of the form `projects/{project}/instances/{instance}`.
11479 ///
11480 /// Sets the *parent* path property to the given value.
11481 ///
11482 /// Even though the property as already been set when instantiating this call,
11483 /// we provide this method for API completeness.
11484 pub fn parent(mut self, new_value: &str) -> ProjectInstanceTableListCall<'a, S> {
11485 self._parent = new_value.to_string();
11486 self
11487 }
11488 /// The view to be applied to the returned tables' fields. Only NAME_ONLY view (default), REPLICATION_VIEW and ENCRYPTION_VIEW are supported.
11489 ///
11490 /// Sets the *view* query property to the given value.
11491 pub fn view(mut self, new_value: &str) -> ProjectInstanceTableListCall<'a, S> {
11492 self._view = Some(new_value.to_string());
11493 self
11494 }
11495 /// The value of `next_page_token` returned by a previous call.
11496 ///
11497 /// Sets the *page token* query property to the given value.
11498 pub fn page_token(mut self, new_value: &str) -> ProjectInstanceTableListCall<'a, S> {
11499 self._page_token = Some(new_value.to_string());
11500 self
11501 }
11502 /// Maximum number of results per page. 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.
11503 ///
11504 /// Sets the *page size* query property to the given value.
11505 pub fn page_size(mut self, new_value: i32) -> ProjectInstanceTableListCall<'a, S> {
11506 self._page_size = Some(new_value);
11507 self
11508 }
11509 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11510 /// while executing the actual API request.
11511 ///
11512 /// ````text
11513 /// It should be used to handle progress information, and to implement a certain level of resilience.
11514 /// ````
11515 ///
11516 /// Sets the *delegate* property to the given value.
11517 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableListCall<'a, S> {
11518 self._delegate = Some(new_value);
11519 self
11520 }
11521
11522 /// Set any additional parameter of the query string used in the request.
11523 /// It should be used to set parameters which are not yet available through their own
11524 /// setters.
11525 ///
11526 /// Please note that this method must not be used to set any of the known parameters
11527 /// which have their own setter method. If done anyway, the request will fail.
11528 ///
11529 /// # Additional Parameters
11530 ///
11531 /// * *$.xgafv* (query-string) - V1 error format.
11532 /// * *access_token* (query-string) - OAuth access token.
11533 /// * *alt* (query-string) - Data format for response.
11534 /// * *callback* (query-string) - JSONP
11535 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11536 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11537 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11538 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11539 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11540 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11541 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11542 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableListCall<'a, S>
11543 where T: AsRef<str> {
11544 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
11545 self
11546 }
11547
11548 /// Identifies the authorization scope for the method you are building.
11549 ///
11550 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11551 /// [`Scope::BigtableAdmin`].
11552 ///
11553 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11554 /// tokens for more than one scope.
11555 ///
11556 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11557 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11558 /// sufficient, a read-write scope will do as well.
11559 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableListCall<'a, S>
11560 where St: AsRef<str> {
11561 self._scopes.insert(String::from(scope.as_ref()));
11562 self
11563 }
11564 /// Identifies the authorization scope(s) for the method you are building.
11565 ///
11566 /// See [`Self::add_scope()`] for details.
11567 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableListCall<'a, S>
11568 where I: IntoIterator<Item = St>,
11569 St: AsRef<str> {
11570 self._scopes
11571 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11572 self
11573 }
11574
11575 /// Removes all scopes, and no default scope will be used either.
11576 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11577 /// for details).
11578 pub fn clear_scopes(mut self) -> ProjectInstanceTableListCall<'a, S> {
11579 self._scopes.clear();
11580 self
11581 }
11582}
11583
11584
11585/// Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.
11586///
11587/// A builder for the *instances.tables.modifyColumnFamilies* method supported by a *project* resource.
11588/// It is not used directly, but through a [`ProjectMethods`] instance.
11589///
11590/// # Example
11591///
11592/// Instantiate a resource method builder
11593///
11594/// ```test_harness,no_run
11595/// # extern crate hyper;
11596/// # extern crate hyper_rustls;
11597/// # extern crate google_bigtableadmin2 as bigtableadmin2;
11598/// use bigtableadmin2::api::ModifyColumnFamiliesRequest;
11599/// # async fn dox() {
11600/// # use std::default::Default;
11601/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
11602///
11603/// # let secret: oauth2::ApplicationSecret = Default::default();
11604/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
11605/// # secret,
11606/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11607/// # ).build().await.unwrap();
11608/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
11609/// // As the method needs a request, you would usually fill it with the desired information
11610/// // into the respective structure. Some of the parts shown here might not be applicable !
11611/// // Values shown here are possibly random and not representative !
11612/// let mut req = ModifyColumnFamiliesRequest::default();
11613///
11614/// // You can configure optional parameters by calling the respective setters at will, and
11615/// // execute the final call using `doit()`.
11616/// // Values shown here are possibly random and not representative !
11617/// let result = hub.projects().instances_tables_modify_column_families(req, "name")
11618/// .doit().await;
11619/// # }
11620/// ```
11621pub struct ProjectInstanceTableModifyColumnFamilyCall<'a, S>
11622 where S: 'a {
11623
11624 hub: &'a BigtableAdmin<S>,
11625 _request: ModifyColumnFamiliesRequest,
11626 _name: String,
11627 _delegate: Option<&'a mut dyn client::Delegate>,
11628 _additional_params: HashMap<String, String>,
11629 _scopes: BTreeSet<String>
11630}
11631
11632impl<'a, S> client::CallBuilder for ProjectInstanceTableModifyColumnFamilyCall<'a, S> {}
11633
11634impl<'a, S> ProjectInstanceTableModifyColumnFamilyCall<'a, S>
11635where
11636 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
11637 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
11638 S::Future: Send + Unpin + 'static,
11639 S::Error: Into<Box<dyn StdError + Send + Sync>>,
11640{
11641
11642
11643 /// Perform the operation you have build so far.
11644 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Table)> {
11645 use std::io::{Read, Seek};
11646 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
11647 use client::{ToParts, url::Params};
11648 use std::borrow::Cow;
11649
11650 let mut dd = client::DefaultDelegate;
11651 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
11652 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.modifyColumnFamilies",
11653 http_method: hyper::Method::POST });
11654
11655 for &field in ["alt", "name"].iter() {
11656 if self._additional_params.contains_key(field) {
11657 dlg.finished(false);
11658 return Err(client::Error::FieldClash(field));
11659 }
11660 }
11661
11662 let mut params = Params::with_capacity(4 + self._additional_params.len());
11663 params.push("name", self._name);
11664
11665 params.extend(self._additional_params.iter());
11666
11667 params.push("alt", "json");
11668 let mut url = self.hub._base_url.clone() + "v2/{+name}:modifyColumnFamilies";
11669 if self._scopes.is_empty() {
11670 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
11671 }
11672
11673 for &(find_this, param_name) in [("{+name}", "name")].iter() {
11674 url = params.uri_replacement(url, param_name, find_this, true);
11675 }
11676 {
11677 let to_remove = ["name"];
11678 params.remove_params(&to_remove);
11679 }
11680
11681 let url = params.parse_with_url(&url);
11682
11683 let mut json_mime_type = mime::APPLICATION_JSON;
11684 let mut request_value_reader =
11685 {
11686 let mut value = json::value::to_value(&self._request).expect("serde to work");
11687 client::remove_json_null_values(&mut value);
11688 let mut dst = io::Cursor::new(Vec::with_capacity(128));
11689 json::to_writer(&mut dst, &value).unwrap();
11690 dst
11691 };
11692 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
11693 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
11694
11695
11696 loop {
11697 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
11698 Ok(token) => token,
11699 Err(e) => {
11700 match dlg.token(e) {
11701 Ok(token) => token,
11702 Err(e) => {
11703 dlg.finished(false);
11704 return Err(client::Error::MissingToken(e));
11705 }
11706 }
11707 }
11708 };
11709 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
11710 let mut req_result = {
11711 let client = &self.hub.client;
11712 dlg.pre_request();
11713 let mut req_builder = hyper::Request::builder()
11714 .method(hyper::Method::POST)
11715 .uri(url.as_str())
11716 .header(USER_AGENT, self.hub._user_agent.clone());
11717
11718 if let Some(token) = token.as_ref() {
11719 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11720 }
11721
11722
11723 let request = req_builder
11724 .header(CONTENT_TYPE, json_mime_type.to_string())
11725 .header(CONTENT_LENGTH, request_size as u64)
11726 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
11727
11728 client.request(request.unwrap()).await
11729
11730 };
11731
11732 match req_result {
11733 Err(err) => {
11734 if let client::Retry::After(d) = dlg.http_error(&err) {
11735 sleep(d).await;
11736 continue;
11737 }
11738 dlg.finished(false);
11739 return Err(client::Error::HttpError(err))
11740 }
11741 Ok(mut res) => {
11742 if !res.status().is_success() {
11743 let res_body_string = client::get_body_as_string(res.body_mut()).await;
11744 let (parts, _) = res.into_parts();
11745 let body = hyper::Body::from(res_body_string.clone());
11746 let restored_response = hyper::Response::from_parts(parts, body);
11747
11748 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
11749
11750 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
11751 sleep(d).await;
11752 continue;
11753 }
11754
11755 dlg.finished(false);
11756
11757 return match server_response {
11758 Some(error_value) => Err(client::Error::BadRequest(error_value)),
11759 None => Err(client::Error::Failure(restored_response)),
11760 }
11761 }
11762 let result_value = {
11763 let res_body_string = client::get_body_as_string(res.body_mut()).await;
11764
11765 match json::from_str(&res_body_string) {
11766 Ok(decoded) => (res, decoded),
11767 Err(err) => {
11768 dlg.response_json_decode_error(&res_body_string, &err);
11769 return Err(client::Error::JsonDecodeError(res_body_string, err));
11770 }
11771 }
11772 };
11773
11774 dlg.finished(true);
11775 return Ok(result_value)
11776 }
11777 }
11778 }
11779 }
11780
11781
11782 ///
11783 /// Sets the *request* property to the given value.
11784 ///
11785 /// Even though the property as already been set when instantiating this call,
11786 /// we provide this method for API completeness.
11787 pub fn request(mut self, new_value: ModifyColumnFamiliesRequest) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S> {
11788 self._request = new_value;
11789 self
11790 }
11791 /// Required. The unique name of the table whose families should be modified. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
11792 ///
11793 /// Sets the *name* path property to the given value.
11794 ///
11795 /// Even though the property as already been set when instantiating this call,
11796 /// we provide this method for API completeness.
11797 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S> {
11798 self._name = new_value.to_string();
11799 self
11800 }
11801 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11802 /// while executing the actual API request.
11803 ///
11804 /// ````text
11805 /// It should be used to handle progress information, and to implement a certain level of resilience.
11806 /// ````
11807 ///
11808 /// Sets the *delegate* property to the given value.
11809 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S> {
11810 self._delegate = Some(new_value);
11811 self
11812 }
11813
11814 /// Set any additional parameter of the query string used in the request.
11815 /// It should be used to set parameters which are not yet available through their own
11816 /// setters.
11817 ///
11818 /// Please note that this method must not be used to set any of the known parameters
11819 /// which have their own setter method. If done anyway, the request will fail.
11820 ///
11821 /// # Additional Parameters
11822 ///
11823 /// * *$.xgafv* (query-string) - V1 error format.
11824 /// * *access_token* (query-string) - OAuth access token.
11825 /// * *alt* (query-string) - Data format for response.
11826 /// * *callback* (query-string) - JSONP
11827 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11828 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11829 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11830 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11831 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11832 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11833 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11834 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S>
11835 where T: AsRef<str> {
11836 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
11837 self
11838 }
11839
11840 /// Identifies the authorization scope for the method you are building.
11841 ///
11842 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11843 /// [`Scope::BigtableAdmin`].
11844 ///
11845 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11846 /// tokens for more than one scope.
11847 ///
11848 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11849 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11850 /// sufficient, a read-write scope will do as well.
11851 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S>
11852 where St: AsRef<str> {
11853 self._scopes.insert(String::from(scope.as_ref()));
11854 self
11855 }
11856 /// Identifies the authorization scope(s) for the method you are building.
11857 ///
11858 /// See [`Self::add_scope()`] for details.
11859 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S>
11860 where I: IntoIterator<Item = St>,
11861 St: AsRef<str> {
11862 self._scopes
11863 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11864 self
11865 }
11866
11867 /// Removes all scopes, and no default scope will be used either.
11868 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11869 /// for details).
11870 pub fn clear_scopes(mut self) -> ProjectInstanceTableModifyColumnFamilyCall<'a, S> {
11871 self._scopes.clear();
11872 self
11873 }
11874}
11875
11876
11877/// Updates a specified table.
11878///
11879/// A builder for the *instances.tables.patch* method supported by a *project* resource.
11880/// It is not used directly, but through a [`ProjectMethods`] instance.
11881///
11882/// # Example
11883///
11884/// Instantiate a resource method builder
11885///
11886/// ```test_harness,no_run
11887/// # extern crate hyper;
11888/// # extern crate hyper_rustls;
11889/// # extern crate google_bigtableadmin2 as bigtableadmin2;
11890/// use bigtableadmin2::api::Table;
11891/// # async fn dox() {
11892/// # use std::default::Default;
11893/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
11894///
11895/// # let secret: oauth2::ApplicationSecret = Default::default();
11896/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
11897/// # secret,
11898/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11899/// # ).build().await.unwrap();
11900/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
11901/// // As the method needs a request, you would usually fill it with the desired information
11902/// // into the respective structure. Some of the parts shown here might not be applicable !
11903/// // Values shown here are possibly random and not representative !
11904/// let mut req = Table::default();
11905///
11906/// // You can configure optional parameters by calling the respective setters at will, and
11907/// // execute the final call using `doit()`.
11908/// // Values shown here are possibly random and not representative !
11909/// let result = hub.projects().instances_tables_patch(req, "name")
11910/// .update_mask(&Default::default())
11911/// .doit().await;
11912/// # }
11913/// ```
11914pub struct ProjectInstanceTablePatchCall<'a, S>
11915 where S: 'a {
11916
11917 hub: &'a BigtableAdmin<S>,
11918 _request: Table,
11919 _name: String,
11920 _update_mask: Option<client::FieldMask>,
11921 _delegate: Option<&'a mut dyn client::Delegate>,
11922 _additional_params: HashMap<String, String>,
11923 _scopes: BTreeSet<String>
11924}
11925
11926impl<'a, S> client::CallBuilder for ProjectInstanceTablePatchCall<'a, S> {}
11927
11928impl<'a, S> ProjectInstanceTablePatchCall<'a, S>
11929where
11930 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
11931 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
11932 S::Future: Send + Unpin + 'static,
11933 S::Error: Into<Box<dyn StdError + Send + Sync>>,
11934{
11935
11936
11937 /// Perform the operation you have build so far.
11938 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
11939 use std::io::{Read, Seek};
11940 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
11941 use client::{ToParts, url::Params};
11942 use std::borrow::Cow;
11943
11944 let mut dd = client::DefaultDelegate;
11945 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
11946 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.patch",
11947 http_method: hyper::Method::PATCH });
11948
11949 for &field in ["alt", "name", "updateMask"].iter() {
11950 if self._additional_params.contains_key(field) {
11951 dlg.finished(false);
11952 return Err(client::Error::FieldClash(field));
11953 }
11954 }
11955
11956 let mut params = Params::with_capacity(5 + self._additional_params.len());
11957 params.push("name", self._name);
11958 if let Some(value) = self._update_mask.as_ref() {
11959 params.push("updateMask", value.to_string());
11960 }
11961
11962 params.extend(self._additional_params.iter());
11963
11964 params.push("alt", "json");
11965 let mut url = self.hub._base_url.clone() + "v2/{+name}";
11966 if self._scopes.is_empty() {
11967 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
11968 }
11969
11970 for &(find_this, param_name) in [("{+name}", "name")].iter() {
11971 url = params.uri_replacement(url, param_name, find_this, true);
11972 }
11973 {
11974 let to_remove = ["name"];
11975 params.remove_params(&to_remove);
11976 }
11977
11978 let url = params.parse_with_url(&url);
11979
11980 let mut json_mime_type = mime::APPLICATION_JSON;
11981 let mut request_value_reader =
11982 {
11983 let mut value = json::value::to_value(&self._request).expect("serde to work");
11984 client::remove_json_null_values(&mut value);
11985 let mut dst = io::Cursor::new(Vec::with_capacity(128));
11986 json::to_writer(&mut dst, &value).unwrap();
11987 dst
11988 };
11989 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
11990 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
11991
11992
11993 loop {
11994 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
11995 Ok(token) => token,
11996 Err(e) => {
11997 match dlg.token(e) {
11998 Ok(token) => token,
11999 Err(e) => {
12000 dlg.finished(false);
12001 return Err(client::Error::MissingToken(e));
12002 }
12003 }
12004 }
12005 };
12006 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12007 let mut req_result = {
12008 let client = &self.hub.client;
12009 dlg.pre_request();
12010 let mut req_builder = hyper::Request::builder()
12011 .method(hyper::Method::PATCH)
12012 .uri(url.as_str())
12013 .header(USER_AGENT, self.hub._user_agent.clone());
12014
12015 if let Some(token) = token.as_ref() {
12016 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12017 }
12018
12019
12020 let request = req_builder
12021 .header(CONTENT_TYPE, json_mime_type.to_string())
12022 .header(CONTENT_LENGTH, request_size as u64)
12023 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
12024
12025 client.request(request.unwrap()).await
12026
12027 };
12028
12029 match req_result {
12030 Err(err) => {
12031 if let client::Retry::After(d) = dlg.http_error(&err) {
12032 sleep(d).await;
12033 continue;
12034 }
12035 dlg.finished(false);
12036 return Err(client::Error::HttpError(err))
12037 }
12038 Ok(mut res) => {
12039 if !res.status().is_success() {
12040 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12041 let (parts, _) = res.into_parts();
12042 let body = hyper::Body::from(res_body_string.clone());
12043 let restored_response = hyper::Response::from_parts(parts, body);
12044
12045 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
12046
12047 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
12048 sleep(d).await;
12049 continue;
12050 }
12051
12052 dlg.finished(false);
12053
12054 return match server_response {
12055 Some(error_value) => Err(client::Error::BadRequest(error_value)),
12056 None => Err(client::Error::Failure(restored_response)),
12057 }
12058 }
12059 let result_value = {
12060 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12061
12062 match json::from_str(&res_body_string) {
12063 Ok(decoded) => (res, decoded),
12064 Err(err) => {
12065 dlg.response_json_decode_error(&res_body_string, &err);
12066 return Err(client::Error::JsonDecodeError(res_body_string, err));
12067 }
12068 }
12069 };
12070
12071 dlg.finished(true);
12072 return Ok(result_value)
12073 }
12074 }
12075 }
12076 }
12077
12078
12079 ///
12080 /// Sets the *request* property to the given value.
12081 ///
12082 /// Even though the property as already been set when instantiating this call,
12083 /// we provide this method for API completeness.
12084 pub fn request(mut self, new_value: Table) -> ProjectInstanceTablePatchCall<'a, S> {
12085 self._request = new_value;
12086 self
12087 }
12088 /// The unique name of the table. Values are of the form `projects/{project}/instances/{instance}/tables/_a-zA-Z0-9*`. Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `STATS_VIEW`, `FULL`
12089 ///
12090 /// Sets the *name* path property to the given value.
12091 ///
12092 /// Even though the property as already been set when instantiating this call,
12093 /// we provide this method for API completeness.
12094 pub fn name(mut self, new_value: &str) -> ProjectInstanceTablePatchCall<'a, S> {
12095 self._name = new_value.to_string();
12096 self
12097 }
12098 /// Required. The list of fields to update. A mask specifying which fields (e.g. `change_stream_config`) in the `table` field should be updated. This mask is relative to the `table` field, not to the request message. The wildcard (*) path is currently not supported. Currently UpdateTable is only supported for the following fields: * `change_stream_config` * `change_stream_config.retention_period` * `deletion_protection` If `column_families` is set in `update_mask`, it will return an UNIMPLEMENTED error.
12099 ///
12100 /// Sets the *update mask* query property to the given value.
12101 pub fn update_mask(mut self, new_value: client::FieldMask) -> ProjectInstanceTablePatchCall<'a, S> {
12102 self._update_mask = Some(new_value);
12103 self
12104 }
12105 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12106 /// while executing the actual API request.
12107 ///
12108 /// ````text
12109 /// It should be used to handle progress information, and to implement a certain level of resilience.
12110 /// ````
12111 ///
12112 /// Sets the *delegate* property to the given value.
12113 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTablePatchCall<'a, S> {
12114 self._delegate = Some(new_value);
12115 self
12116 }
12117
12118 /// Set any additional parameter of the query string used in the request.
12119 /// It should be used to set parameters which are not yet available through their own
12120 /// setters.
12121 ///
12122 /// Please note that this method must not be used to set any of the known parameters
12123 /// which have their own setter method. If done anyway, the request will fail.
12124 ///
12125 /// # Additional Parameters
12126 ///
12127 /// * *$.xgafv* (query-string) - V1 error format.
12128 /// * *access_token* (query-string) - OAuth access token.
12129 /// * *alt* (query-string) - Data format for response.
12130 /// * *callback* (query-string) - JSONP
12131 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12132 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12133 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12134 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12135 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12136 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12137 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12138 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTablePatchCall<'a, S>
12139 where T: AsRef<str> {
12140 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
12141 self
12142 }
12143
12144 /// Identifies the authorization scope for the method you are building.
12145 ///
12146 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12147 /// [`Scope::BigtableAdmin`].
12148 ///
12149 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12150 /// tokens for more than one scope.
12151 ///
12152 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12153 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12154 /// sufficient, a read-write scope will do as well.
12155 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTablePatchCall<'a, S>
12156 where St: AsRef<str> {
12157 self._scopes.insert(String::from(scope.as_ref()));
12158 self
12159 }
12160 /// Identifies the authorization scope(s) for the method you are building.
12161 ///
12162 /// See [`Self::add_scope()`] for details.
12163 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTablePatchCall<'a, S>
12164 where I: IntoIterator<Item = St>,
12165 St: AsRef<str> {
12166 self._scopes
12167 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12168 self
12169 }
12170
12171 /// Removes all scopes, and no default scope will be used either.
12172 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12173 /// for details).
12174 pub fn clear_scopes(mut self) -> ProjectInstanceTablePatchCall<'a, S> {
12175 self._scopes.clear();
12176 self
12177 }
12178}
12179
12180
12181/// Create a new table by restoring from a completed backup. The returned table long-running operation can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreTableMetadata. The response type is Table, if successful.
12182///
12183/// A builder for the *instances.tables.restore* method supported by a *project* resource.
12184/// It is not used directly, but through a [`ProjectMethods`] instance.
12185///
12186/// # Example
12187///
12188/// Instantiate a resource method builder
12189///
12190/// ```test_harness,no_run
12191/// # extern crate hyper;
12192/// # extern crate hyper_rustls;
12193/// # extern crate google_bigtableadmin2 as bigtableadmin2;
12194/// use bigtableadmin2::api::RestoreTableRequest;
12195/// # async fn dox() {
12196/// # use std::default::Default;
12197/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
12198///
12199/// # let secret: oauth2::ApplicationSecret = Default::default();
12200/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
12201/// # secret,
12202/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12203/// # ).build().await.unwrap();
12204/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
12205/// // As the method needs a request, you would usually fill it with the desired information
12206/// // into the respective structure. Some of the parts shown here might not be applicable !
12207/// // Values shown here are possibly random and not representative !
12208/// let mut req = RestoreTableRequest::default();
12209///
12210/// // You can configure optional parameters by calling the respective setters at will, and
12211/// // execute the final call using `doit()`.
12212/// // Values shown here are possibly random and not representative !
12213/// let result = hub.projects().instances_tables_restore(req, "parent")
12214/// .doit().await;
12215/// # }
12216/// ```
12217pub struct ProjectInstanceTableRestoreCall<'a, S>
12218 where S: 'a {
12219
12220 hub: &'a BigtableAdmin<S>,
12221 _request: RestoreTableRequest,
12222 _parent: String,
12223 _delegate: Option<&'a mut dyn client::Delegate>,
12224 _additional_params: HashMap<String, String>,
12225 _scopes: BTreeSet<String>
12226}
12227
12228impl<'a, S> client::CallBuilder for ProjectInstanceTableRestoreCall<'a, S> {}
12229
12230impl<'a, S> ProjectInstanceTableRestoreCall<'a, S>
12231where
12232 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
12233 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
12234 S::Future: Send + Unpin + 'static,
12235 S::Error: Into<Box<dyn StdError + Send + Sync>>,
12236{
12237
12238
12239 /// Perform the operation you have build so far.
12240 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
12241 use std::io::{Read, Seek};
12242 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
12243 use client::{ToParts, url::Params};
12244 use std::borrow::Cow;
12245
12246 let mut dd = client::DefaultDelegate;
12247 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
12248 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.restore",
12249 http_method: hyper::Method::POST });
12250
12251 for &field in ["alt", "parent"].iter() {
12252 if self._additional_params.contains_key(field) {
12253 dlg.finished(false);
12254 return Err(client::Error::FieldClash(field));
12255 }
12256 }
12257
12258 let mut params = Params::with_capacity(4 + self._additional_params.len());
12259 params.push("parent", self._parent);
12260
12261 params.extend(self._additional_params.iter());
12262
12263 params.push("alt", "json");
12264 let mut url = self.hub._base_url.clone() + "v2/{+parent}/tables:restore";
12265 if self._scopes.is_empty() {
12266 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
12267 }
12268
12269 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
12270 url = params.uri_replacement(url, param_name, find_this, true);
12271 }
12272 {
12273 let to_remove = ["parent"];
12274 params.remove_params(&to_remove);
12275 }
12276
12277 let url = params.parse_with_url(&url);
12278
12279 let mut json_mime_type = mime::APPLICATION_JSON;
12280 let mut request_value_reader =
12281 {
12282 let mut value = json::value::to_value(&self._request).expect("serde to work");
12283 client::remove_json_null_values(&mut value);
12284 let mut dst = io::Cursor::new(Vec::with_capacity(128));
12285 json::to_writer(&mut dst, &value).unwrap();
12286 dst
12287 };
12288 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
12289 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12290
12291
12292 loop {
12293 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
12294 Ok(token) => token,
12295 Err(e) => {
12296 match dlg.token(e) {
12297 Ok(token) => token,
12298 Err(e) => {
12299 dlg.finished(false);
12300 return Err(client::Error::MissingToken(e));
12301 }
12302 }
12303 }
12304 };
12305 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12306 let mut req_result = {
12307 let client = &self.hub.client;
12308 dlg.pre_request();
12309 let mut req_builder = hyper::Request::builder()
12310 .method(hyper::Method::POST)
12311 .uri(url.as_str())
12312 .header(USER_AGENT, self.hub._user_agent.clone());
12313
12314 if let Some(token) = token.as_ref() {
12315 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12316 }
12317
12318
12319 let request = req_builder
12320 .header(CONTENT_TYPE, json_mime_type.to_string())
12321 .header(CONTENT_LENGTH, request_size as u64)
12322 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
12323
12324 client.request(request.unwrap()).await
12325
12326 };
12327
12328 match req_result {
12329 Err(err) => {
12330 if let client::Retry::After(d) = dlg.http_error(&err) {
12331 sleep(d).await;
12332 continue;
12333 }
12334 dlg.finished(false);
12335 return Err(client::Error::HttpError(err))
12336 }
12337 Ok(mut res) => {
12338 if !res.status().is_success() {
12339 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12340 let (parts, _) = res.into_parts();
12341 let body = hyper::Body::from(res_body_string.clone());
12342 let restored_response = hyper::Response::from_parts(parts, body);
12343
12344 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
12345
12346 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
12347 sleep(d).await;
12348 continue;
12349 }
12350
12351 dlg.finished(false);
12352
12353 return match server_response {
12354 Some(error_value) => Err(client::Error::BadRequest(error_value)),
12355 None => Err(client::Error::Failure(restored_response)),
12356 }
12357 }
12358 let result_value = {
12359 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12360
12361 match json::from_str(&res_body_string) {
12362 Ok(decoded) => (res, decoded),
12363 Err(err) => {
12364 dlg.response_json_decode_error(&res_body_string, &err);
12365 return Err(client::Error::JsonDecodeError(res_body_string, err));
12366 }
12367 }
12368 };
12369
12370 dlg.finished(true);
12371 return Ok(result_value)
12372 }
12373 }
12374 }
12375 }
12376
12377
12378 ///
12379 /// Sets the *request* property to the given value.
12380 ///
12381 /// Even though the property as already been set when instantiating this call,
12382 /// we provide this method for API completeness.
12383 pub fn request(mut self, new_value: RestoreTableRequest) -> ProjectInstanceTableRestoreCall<'a, S> {
12384 self._request = new_value;
12385 self
12386 }
12387 /// Required. The name of the instance in which to create the restored table. Values are of the form `projects//instances/`.
12388 ///
12389 /// Sets the *parent* path property to the given value.
12390 ///
12391 /// Even though the property as already been set when instantiating this call,
12392 /// we provide this method for API completeness.
12393 pub fn parent(mut self, new_value: &str) -> ProjectInstanceTableRestoreCall<'a, S> {
12394 self._parent = new_value.to_string();
12395 self
12396 }
12397 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12398 /// while executing the actual API request.
12399 ///
12400 /// ````text
12401 /// It should be used to handle progress information, and to implement a certain level of resilience.
12402 /// ````
12403 ///
12404 /// Sets the *delegate* property to the given value.
12405 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableRestoreCall<'a, S> {
12406 self._delegate = Some(new_value);
12407 self
12408 }
12409
12410 /// Set any additional parameter of the query string used in the request.
12411 /// It should be used to set parameters which are not yet available through their own
12412 /// setters.
12413 ///
12414 /// Please note that this method must not be used to set any of the known parameters
12415 /// which have their own setter method. If done anyway, the request will fail.
12416 ///
12417 /// # Additional Parameters
12418 ///
12419 /// * *$.xgafv* (query-string) - V1 error format.
12420 /// * *access_token* (query-string) - OAuth access token.
12421 /// * *alt* (query-string) - Data format for response.
12422 /// * *callback* (query-string) - JSONP
12423 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12424 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12425 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12426 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12427 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12428 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12429 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12430 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableRestoreCall<'a, S>
12431 where T: AsRef<str> {
12432 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
12433 self
12434 }
12435
12436 /// Identifies the authorization scope for the method you are building.
12437 ///
12438 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12439 /// [`Scope::BigtableAdmin`].
12440 ///
12441 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12442 /// tokens for more than one scope.
12443 ///
12444 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12445 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12446 /// sufficient, a read-write scope will do as well.
12447 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableRestoreCall<'a, S>
12448 where St: AsRef<str> {
12449 self._scopes.insert(String::from(scope.as_ref()));
12450 self
12451 }
12452 /// Identifies the authorization scope(s) for the method you are building.
12453 ///
12454 /// See [`Self::add_scope()`] for details.
12455 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableRestoreCall<'a, S>
12456 where I: IntoIterator<Item = St>,
12457 St: AsRef<str> {
12458 self._scopes
12459 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12460 self
12461 }
12462
12463 /// Removes all scopes, and no default scope will be used either.
12464 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12465 /// for details).
12466 pub fn clear_scopes(mut self) -> ProjectInstanceTableRestoreCall<'a, S> {
12467 self._scopes.clear();
12468 self
12469 }
12470}
12471
12472
12473/// Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
12474///
12475/// A builder for the *instances.tables.setIamPolicy* method supported by a *project* resource.
12476/// It is not used directly, but through a [`ProjectMethods`] instance.
12477///
12478/// # Example
12479///
12480/// Instantiate a resource method builder
12481///
12482/// ```test_harness,no_run
12483/// # extern crate hyper;
12484/// # extern crate hyper_rustls;
12485/// # extern crate google_bigtableadmin2 as bigtableadmin2;
12486/// use bigtableadmin2::api::SetIamPolicyRequest;
12487/// # async fn dox() {
12488/// # use std::default::Default;
12489/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
12490///
12491/// # let secret: oauth2::ApplicationSecret = Default::default();
12492/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
12493/// # secret,
12494/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12495/// # ).build().await.unwrap();
12496/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
12497/// // As the method needs a request, you would usually fill it with the desired information
12498/// // into the respective structure. Some of the parts shown here might not be applicable !
12499/// // Values shown here are possibly random and not representative !
12500/// let mut req = SetIamPolicyRequest::default();
12501///
12502/// // You can configure optional parameters by calling the respective setters at will, and
12503/// // execute the final call using `doit()`.
12504/// // Values shown here are possibly random and not representative !
12505/// let result = hub.projects().instances_tables_set_iam_policy(req, "resource")
12506/// .doit().await;
12507/// # }
12508/// ```
12509pub struct ProjectInstanceTableSetIamPolicyCall<'a, S>
12510 where S: 'a {
12511
12512 hub: &'a BigtableAdmin<S>,
12513 _request: SetIamPolicyRequest,
12514 _resource: String,
12515 _delegate: Option<&'a mut dyn client::Delegate>,
12516 _additional_params: HashMap<String, String>,
12517 _scopes: BTreeSet<String>
12518}
12519
12520impl<'a, S> client::CallBuilder for ProjectInstanceTableSetIamPolicyCall<'a, S> {}
12521
12522impl<'a, S> ProjectInstanceTableSetIamPolicyCall<'a, S>
12523where
12524 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
12525 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
12526 S::Future: Send + Unpin + 'static,
12527 S::Error: Into<Box<dyn StdError + Send + Sync>>,
12528{
12529
12530
12531 /// Perform the operation you have build so far.
12532 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Policy)> {
12533 use std::io::{Read, Seek};
12534 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
12535 use client::{ToParts, url::Params};
12536 use std::borrow::Cow;
12537
12538 let mut dd = client::DefaultDelegate;
12539 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
12540 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.setIamPolicy",
12541 http_method: hyper::Method::POST });
12542
12543 for &field in ["alt", "resource"].iter() {
12544 if self._additional_params.contains_key(field) {
12545 dlg.finished(false);
12546 return Err(client::Error::FieldClash(field));
12547 }
12548 }
12549
12550 let mut params = Params::with_capacity(4 + self._additional_params.len());
12551 params.push("resource", self._resource);
12552
12553 params.extend(self._additional_params.iter());
12554
12555 params.push("alt", "json");
12556 let mut url = self.hub._base_url.clone() + "v2/{+resource}:setIamPolicy";
12557 if self._scopes.is_empty() {
12558 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
12559 }
12560
12561 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
12562 url = params.uri_replacement(url, param_name, find_this, true);
12563 }
12564 {
12565 let to_remove = ["resource"];
12566 params.remove_params(&to_remove);
12567 }
12568
12569 let url = params.parse_with_url(&url);
12570
12571 let mut json_mime_type = mime::APPLICATION_JSON;
12572 let mut request_value_reader =
12573 {
12574 let mut value = json::value::to_value(&self._request).expect("serde to work");
12575 client::remove_json_null_values(&mut value);
12576 let mut dst = io::Cursor::new(Vec::with_capacity(128));
12577 json::to_writer(&mut dst, &value).unwrap();
12578 dst
12579 };
12580 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
12581 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12582
12583
12584 loop {
12585 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
12586 Ok(token) => token,
12587 Err(e) => {
12588 match dlg.token(e) {
12589 Ok(token) => token,
12590 Err(e) => {
12591 dlg.finished(false);
12592 return Err(client::Error::MissingToken(e));
12593 }
12594 }
12595 }
12596 };
12597 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12598 let mut req_result = {
12599 let client = &self.hub.client;
12600 dlg.pre_request();
12601 let mut req_builder = hyper::Request::builder()
12602 .method(hyper::Method::POST)
12603 .uri(url.as_str())
12604 .header(USER_AGENT, self.hub._user_agent.clone());
12605
12606 if let Some(token) = token.as_ref() {
12607 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12608 }
12609
12610
12611 let request = req_builder
12612 .header(CONTENT_TYPE, json_mime_type.to_string())
12613 .header(CONTENT_LENGTH, request_size as u64)
12614 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
12615
12616 client.request(request.unwrap()).await
12617
12618 };
12619
12620 match req_result {
12621 Err(err) => {
12622 if let client::Retry::After(d) = dlg.http_error(&err) {
12623 sleep(d).await;
12624 continue;
12625 }
12626 dlg.finished(false);
12627 return Err(client::Error::HttpError(err))
12628 }
12629 Ok(mut res) => {
12630 if !res.status().is_success() {
12631 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12632 let (parts, _) = res.into_parts();
12633 let body = hyper::Body::from(res_body_string.clone());
12634 let restored_response = hyper::Response::from_parts(parts, body);
12635
12636 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
12637
12638 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
12639 sleep(d).await;
12640 continue;
12641 }
12642
12643 dlg.finished(false);
12644
12645 return match server_response {
12646 Some(error_value) => Err(client::Error::BadRequest(error_value)),
12647 None => Err(client::Error::Failure(restored_response)),
12648 }
12649 }
12650 let result_value = {
12651 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12652
12653 match json::from_str(&res_body_string) {
12654 Ok(decoded) => (res, decoded),
12655 Err(err) => {
12656 dlg.response_json_decode_error(&res_body_string, &err);
12657 return Err(client::Error::JsonDecodeError(res_body_string, err));
12658 }
12659 }
12660 };
12661
12662 dlg.finished(true);
12663 return Ok(result_value)
12664 }
12665 }
12666 }
12667 }
12668
12669
12670 ///
12671 /// Sets the *request* property to the given value.
12672 ///
12673 /// Even though the property as already been set when instantiating this call,
12674 /// we provide this method for API completeness.
12675 pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectInstanceTableSetIamPolicyCall<'a, S> {
12676 self._request = new_value;
12677 self
12678 }
12679 /// REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
12680 ///
12681 /// Sets the *resource* path property to the given value.
12682 ///
12683 /// Even though the property as already been set when instantiating this call,
12684 /// we provide this method for API completeness.
12685 pub fn resource(mut self, new_value: &str) -> ProjectInstanceTableSetIamPolicyCall<'a, S> {
12686 self._resource = new_value.to_string();
12687 self
12688 }
12689 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12690 /// while executing the actual API request.
12691 ///
12692 /// ````text
12693 /// It should be used to handle progress information, and to implement a certain level of resilience.
12694 /// ````
12695 ///
12696 /// Sets the *delegate* property to the given value.
12697 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableSetIamPolicyCall<'a, S> {
12698 self._delegate = Some(new_value);
12699 self
12700 }
12701
12702 /// Set any additional parameter of the query string used in the request.
12703 /// It should be used to set parameters which are not yet available through their own
12704 /// setters.
12705 ///
12706 /// Please note that this method must not be used to set any of the known parameters
12707 /// which have their own setter method. If done anyway, the request will fail.
12708 ///
12709 /// # Additional Parameters
12710 ///
12711 /// * *$.xgafv* (query-string) - V1 error format.
12712 /// * *access_token* (query-string) - OAuth access token.
12713 /// * *alt* (query-string) - Data format for response.
12714 /// * *callback* (query-string) - JSONP
12715 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12716 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12717 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12718 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12719 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12720 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12721 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12722 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableSetIamPolicyCall<'a, S>
12723 where T: AsRef<str> {
12724 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
12725 self
12726 }
12727
12728 /// Identifies the authorization scope for the method you are building.
12729 ///
12730 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12731 /// [`Scope::BigtableAdmin`].
12732 ///
12733 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12734 /// tokens for more than one scope.
12735 ///
12736 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12737 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12738 /// sufficient, a read-write scope will do as well.
12739 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableSetIamPolicyCall<'a, S>
12740 where St: AsRef<str> {
12741 self._scopes.insert(String::from(scope.as_ref()));
12742 self
12743 }
12744 /// Identifies the authorization scope(s) for the method you are building.
12745 ///
12746 /// See [`Self::add_scope()`] for details.
12747 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableSetIamPolicyCall<'a, S>
12748 where I: IntoIterator<Item = St>,
12749 St: AsRef<str> {
12750 self._scopes
12751 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12752 self
12753 }
12754
12755 /// Removes all scopes, and no default scope will be used either.
12756 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12757 /// for details).
12758 pub fn clear_scopes(mut self) -> ProjectInstanceTableSetIamPolicyCall<'a, S> {
12759 self._scopes.clear();
12760 self
12761 }
12762}
12763
12764
12765/// Returns permissions that the caller has on the specified Table or Backup resource.
12766///
12767/// A builder for the *instances.tables.testIamPermissions* method supported by a *project* resource.
12768/// It is not used directly, but through a [`ProjectMethods`] instance.
12769///
12770/// # Example
12771///
12772/// Instantiate a resource method builder
12773///
12774/// ```test_harness,no_run
12775/// # extern crate hyper;
12776/// # extern crate hyper_rustls;
12777/// # extern crate google_bigtableadmin2 as bigtableadmin2;
12778/// use bigtableadmin2::api::TestIamPermissionsRequest;
12779/// # async fn dox() {
12780/// # use std::default::Default;
12781/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
12782///
12783/// # let secret: oauth2::ApplicationSecret = Default::default();
12784/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
12785/// # secret,
12786/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12787/// # ).build().await.unwrap();
12788/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
12789/// // As the method needs a request, you would usually fill it with the desired information
12790/// // into the respective structure. Some of the parts shown here might not be applicable !
12791/// // Values shown here are possibly random and not representative !
12792/// let mut req = TestIamPermissionsRequest::default();
12793///
12794/// // You can configure optional parameters by calling the respective setters at will, and
12795/// // execute the final call using `doit()`.
12796/// // Values shown here are possibly random and not representative !
12797/// let result = hub.projects().instances_tables_test_iam_permissions(req, "resource")
12798/// .doit().await;
12799/// # }
12800/// ```
12801pub struct ProjectInstanceTableTestIamPermissionCall<'a, S>
12802 where S: 'a {
12803
12804 hub: &'a BigtableAdmin<S>,
12805 _request: TestIamPermissionsRequest,
12806 _resource: String,
12807 _delegate: Option<&'a mut dyn client::Delegate>,
12808 _additional_params: HashMap<String, String>,
12809 _scopes: BTreeSet<String>
12810}
12811
12812impl<'a, S> client::CallBuilder for ProjectInstanceTableTestIamPermissionCall<'a, S> {}
12813
12814impl<'a, S> ProjectInstanceTableTestIamPermissionCall<'a, S>
12815where
12816 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
12817 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
12818 S::Future: Send + Unpin + 'static,
12819 S::Error: Into<Box<dyn StdError + Send + Sync>>,
12820{
12821
12822
12823 /// Perform the operation you have build so far.
12824 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, TestIamPermissionsResponse)> {
12825 use std::io::{Read, Seek};
12826 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
12827 use client::{ToParts, url::Params};
12828 use std::borrow::Cow;
12829
12830 let mut dd = client::DefaultDelegate;
12831 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
12832 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.testIamPermissions",
12833 http_method: hyper::Method::POST });
12834
12835 for &field in ["alt", "resource"].iter() {
12836 if self._additional_params.contains_key(field) {
12837 dlg.finished(false);
12838 return Err(client::Error::FieldClash(field));
12839 }
12840 }
12841
12842 let mut params = Params::with_capacity(4 + self._additional_params.len());
12843 params.push("resource", self._resource);
12844
12845 params.extend(self._additional_params.iter());
12846
12847 params.push("alt", "json");
12848 let mut url = self.hub._base_url.clone() + "v2/{+resource}:testIamPermissions";
12849 if self._scopes.is_empty() {
12850 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
12851 }
12852
12853 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
12854 url = params.uri_replacement(url, param_name, find_this, true);
12855 }
12856 {
12857 let to_remove = ["resource"];
12858 params.remove_params(&to_remove);
12859 }
12860
12861 let url = params.parse_with_url(&url);
12862
12863 let mut json_mime_type = mime::APPLICATION_JSON;
12864 let mut request_value_reader =
12865 {
12866 let mut value = json::value::to_value(&self._request).expect("serde to work");
12867 client::remove_json_null_values(&mut value);
12868 let mut dst = io::Cursor::new(Vec::with_capacity(128));
12869 json::to_writer(&mut dst, &value).unwrap();
12870 dst
12871 };
12872 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
12873 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12874
12875
12876 loop {
12877 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
12878 Ok(token) => token,
12879 Err(e) => {
12880 match dlg.token(e) {
12881 Ok(token) => token,
12882 Err(e) => {
12883 dlg.finished(false);
12884 return Err(client::Error::MissingToken(e));
12885 }
12886 }
12887 }
12888 };
12889 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
12890 let mut req_result = {
12891 let client = &self.hub.client;
12892 dlg.pre_request();
12893 let mut req_builder = hyper::Request::builder()
12894 .method(hyper::Method::POST)
12895 .uri(url.as_str())
12896 .header(USER_AGENT, self.hub._user_agent.clone());
12897
12898 if let Some(token) = token.as_ref() {
12899 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12900 }
12901
12902
12903 let request = req_builder
12904 .header(CONTENT_TYPE, json_mime_type.to_string())
12905 .header(CONTENT_LENGTH, request_size as u64)
12906 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
12907
12908 client.request(request.unwrap()).await
12909
12910 };
12911
12912 match req_result {
12913 Err(err) => {
12914 if let client::Retry::After(d) = dlg.http_error(&err) {
12915 sleep(d).await;
12916 continue;
12917 }
12918 dlg.finished(false);
12919 return Err(client::Error::HttpError(err))
12920 }
12921 Ok(mut res) => {
12922 if !res.status().is_success() {
12923 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12924 let (parts, _) = res.into_parts();
12925 let body = hyper::Body::from(res_body_string.clone());
12926 let restored_response = hyper::Response::from_parts(parts, body);
12927
12928 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
12929
12930 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
12931 sleep(d).await;
12932 continue;
12933 }
12934
12935 dlg.finished(false);
12936
12937 return match server_response {
12938 Some(error_value) => Err(client::Error::BadRequest(error_value)),
12939 None => Err(client::Error::Failure(restored_response)),
12940 }
12941 }
12942 let result_value = {
12943 let res_body_string = client::get_body_as_string(res.body_mut()).await;
12944
12945 match json::from_str(&res_body_string) {
12946 Ok(decoded) => (res, decoded),
12947 Err(err) => {
12948 dlg.response_json_decode_error(&res_body_string, &err);
12949 return Err(client::Error::JsonDecodeError(res_body_string, err));
12950 }
12951 }
12952 };
12953
12954 dlg.finished(true);
12955 return Ok(result_value)
12956 }
12957 }
12958 }
12959 }
12960
12961
12962 ///
12963 /// Sets the *request* property to the given value.
12964 ///
12965 /// Even though the property as already been set when instantiating this call,
12966 /// we provide this method for API completeness.
12967 pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceTableTestIamPermissionCall<'a, S> {
12968 self._request = new_value;
12969 self
12970 }
12971 /// REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
12972 ///
12973 /// Sets the *resource* path property to the given value.
12974 ///
12975 /// Even though the property as already been set when instantiating this call,
12976 /// we provide this method for API completeness.
12977 pub fn resource(mut self, new_value: &str) -> ProjectInstanceTableTestIamPermissionCall<'a, S> {
12978 self._resource = new_value.to_string();
12979 self
12980 }
12981 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12982 /// while executing the actual API request.
12983 ///
12984 /// ````text
12985 /// It should be used to handle progress information, and to implement a certain level of resilience.
12986 /// ````
12987 ///
12988 /// Sets the *delegate* property to the given value.
12989 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableTestIamPermissionCall<'a, S> {
12990 self._delegate = Some(new_value);
12991 self
12992 }
12993
12994 /// Set any additional parameter of the query string used in the request.
12995 /// It should be used to set parameters which are not yet available through their own
12996 /// setters.
12997 ///
12998 /// Please note that this method must not be used to set any of the known parameters
12999 /// which have their own setter method. If done anyway, the request will fail.
13000 ///
13001 /// # Additional Parameters
13002 ///
13003 /// * *$.xgafv* (query-string) - V1 error format.
13004 /// * *access_token* (query-string) - OAuth access token.
13005 /// * *alt* (query-string) - Data format for response.
13006 /// * *callback* (query-string) - JSONP
13007 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13008 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13009 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13010 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13011 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13012 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13013 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13014 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableTestIamPermissionCall<'a, S>
13015 where T: AsRef<str> {
13016 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
13017 self
13018 }
13019
13020 /// Identifies the authorization scope for the method you are building.
13021 ///
13022 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13023 /// [`Scope::BigtableAdmin`].
13024 ///
13025 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13026 /// tokens for more than one scope.
13027 ///
13028 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13029 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13030 /// sufficient, a read-write scope will do as well.
13031 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableTestIamPermissionCall<'a, S>
13032 where St: AsRef<str> {
13033 self._scopes.insert(String::from(scope.as_ref()));
13034 self
13035 }
13036 /// Identifies the authorization scope(s) for the method you are building.
13037 ///
13038 /// See [`Self::add_scope()`] for details.
13039 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableTestIamPermissionCall<'a, S>
13040 where I: IntoIterator<Item = St>,
13041 St: AsRef<str> {
13042 self._scopes
13043 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13044 self
13045 }
13046
13047 /// Removes all scopes, and no default scope will be used either.
13048 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13049 /// for details).
13050 pub fn clear_scopes(mut self) -> ProjectInstanceTableTestIamPermissionCall<'a, S> {
13051 self._scopes.clear();
13052 self
13053 }
13054}
13055
13056
13057/// Restores a specified table which was accidentally deleted.
13058///
13059/// A builder for the *instances.tables.undelete* method supported by a *project* resource.
13060/// It is not used directly, but through a [`ProjectMethods`] instance.
13061///
13062/// # Example
13063///
13064/// Instantiate a resource method builder
13065///
13066/// ```test_harness,no_run
13067/// # extern crate hyper;
13068/// # extern crate hyper_rustls;
13069/// # extern crate google_bigtableadmin2 as bigtableadmin2;
13070/// use bigtableadmin2::api::UndeleteTableRequest;
13071/// # async fn dox() {
13072/// # use std::default::Default;
13073/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
13074///
13075/// # let secret: oauth2::ApplicationSecret = Default::default();
13076/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
13077/// # secret,
13078/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13079/// # ).build().await.unwrap();
13080/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
13081/// // As the method needs a request, you would usually fill it with the desired information
13082/// // into the respective structure. Some of the parts shown here might not be applicable !
13083/// // Values shown here are possibly random and not representative !
13084/// let mut req = UndeleteTableRequest::default();
13085///
13086/// // You can configure optional parameters by calling the respective setters at will, and
13087/// // execute the final call using `doit()`.
13088/// // Values shown here are possibly random and not representative !
13089/// let result = hub.projects().instances_tables_undelete(req, "name")
13090/// .doit().await;
13091/// # }
13092/// ```
13093pub struct ProjectInstanceTableUndeleteCall<'a, S>
13094 where S: 'a {
13095
13096 hub: &'a BigtableAdmin<S>,
13097 _request: UndeleteTableRequest,
13098 _name: String,
13099 _delegate: Option<&'a mut dyn client::Delegate>,
13100 _additional_params: HashMap<String, String>,
13101 _scopes: BTreeSet<String>
13102}
13103
13104impl<'a, S> client::CallBuilder for ProjectInstanceTableUndeleteCall<'a, S> {}
13105
13106impl<'a, S> ProjectInstanceTableUndeleteCall<'a, S>
13107where
13108 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
13109 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
13110 S::Future: Send + Unpin + 'static,
13111 S::Error: Into<Box<dyn StdError + Send + Sync>>,
13112{
13113
13114
13115 /// Perform the operation you have build so far.
13116 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
13117 use std::io::{Read, Seek};
13118 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
13119 use client::{ToParts, url::Params};
13120 use std::borrow::Cow;
13121
13122 let mut dd = client::DefaultDelegate;
13123 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
13124 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.tables.undelete",
13125 http_method: hyper::Method::POST });
13126
13127 for &field in ["alt", "name"].iter() {
13128 if self._additional_params.contains_key(field) {
13129 dlg.finished(false);
13130 return Err(client::Error::FieldClash(field));
13131 }
13132 }
13133
13134 let mut params = Params::with_capacity(4 + self._additional_params.len());
13135 params.push("name", self._name);
13136
13137 params.extend(self._additional_params.iter());
13138
13139 params.push("alt", "json");
13140 let mut url = self.hub._base_url.clone() + "v2/{+name}:undelete";
13141 if self._scopes.is_empty() {
13142 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
13143 }
13144
13145 for &(find_this, param_name) in [("{+name}", "name")].iter() {
13146 url = params.uri_replacement(url, param_name, find_this, true);
13147 }
13148 {
13149 let to_remove = ["name"];
13150 params.remove_params(&to_remove);
13151 }
13152
13153 let url = params.parse_with_url(&url);
13154
13155 let mut json_mime_type = mime::APPLICATION_JSON;
13156 let mut request_value_reader =
13157 {
13158 let mut value = json::value::to_value(&self._request).expect("serde to work");
13159 client::remove_json_null_values(&mut value);
13160 let mut dst = io::Cursor::new(Vec::with_capacity(128));
13161 json::to_writer(&mut dst, &value).unwrap();
13162 dst
13163 };
13164 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
13165 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
13166
13167
13168 loop {
13169 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
13170 Ok(token) => token,
13171 Err(e) => {
13172 match dlg.token(e) {
13173 Ok(token) => token,
13174 Err(e) => {
13175 dlg.finished(false);
13176 return Err(client::Error::MissingToken(e));
13177 }
13178 }
13179 }
13180 };
13181 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
13182 let mut req_result = {
13183 let client = &self.hub.client;
13184 dlg.pre_request();
13185 let mut req_builder = hyper::Request::builder()
13186 .method(hyper::Method::POST)
13187 .uri(url.as_str())
13188 .header(USER_AGENT, self.hub._user_agent.clone());
13189
13190 if let Some(token) = token.as_ref() {
13191 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13192 }
13193
13194
13195 let request = req_builder
13196 .header(CONTENT_TYPE, json_mime_type.to_string())
13197 .header(CONTENT_LENGTH, request_size as u64)
13198 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
13199
13200 client.request(request.unwrap()).await
13201
13202 };
13203
13204 match req_result {
13205 Err(err) => {
13206 if let client::Retry::After(d) = dlg.http_error(&err) {
13207 sleep(d).await;
13208 continue;
13209 }
13210 dlg.finished(false);
13211 return Err(client::Error::HttpError(err))
13212 }
13213 Ok(mut res) => {
13214 if !res.status().is_success() {
13215 let res_body_string = client::get_body_as_string(res.body_mut()).await;
13216 let (parts, _) = res.into_parts();
13217 let body = hyper::Body::from(res_body_string.clone());
13218 let restored_response = hyper::Response::from_parts(parts, body);
13219
13220 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
13221
13222 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
13223 sleep(d).await;
13224 continue;
13225 }
13226
13227 dlg.finished(false);
13228
13229 return match server_response {
13230 Some(error_value) => Err(client::Error::BadRequest(error_value)),
13231 None => Err(client::Error::Failure(restored_response)),
13232 }
13233 }
13234 let result_value = {
13235 let res_body_string = client::get_body_as_string(res.body_mut()).await;
13236
13237 match json::from_str(&res_body_string) {
13238 Ok(decoded) => (res, decoded),
13239 Err(err) => {
13240 dlg.response_json_decode_error(&res_body_string, &err);
13241 return Err(client::Error::JsonDecodeError(res_body_string, err));
13242 }
13243 }
13244 };
13245
13246 dlg.finished(true);
13247 return Ok(result_value)
13248 }
13249 }
13250 }
13251 }
13252
13253
13254 ///
13255 /// Sets the *request* property to the given value.
13256 ///
13257 /// Even though the property as already been set when instantiating this call,
13258 /// we provide this method for API completeness.
13259 pub fn request(mut self, new_value: UndeleteTableRequest) -> ProjectInstanceTableUndeleteCall<'a, S> {
13260 self._request = new_value;
13261 self
13262 }
13263 /// Required. The unique name of the table to be restored. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`.
13264 ///
13265 /// Sets the *name* path property to the given value.
13266 ///
13267 /// Even though the property as already been set when instantiating this call,
13268 /// we provide this method for API completeness.
13269 pub fn name(mut self, new_value: &str) -> ProjectInstanceTableUndeleteCall<'a, S> {
13270 self._name = new_value.to_string();
13271 self
13272 }
13273 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13274 /// while executing the actual API request.
13275 ///
13276 /// ````text
13277 /// It should be used to handle progress information, and to implement a certain level of resilience.
13278 /// ````
13279 ///
13280 /// Sets the *delegate* property to the given value.
13281 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTableUndeleteCall<'a, S> {
13282 self._delegate = Some(new_value);
13283 self
13284 }
13285
13286 /// Set any additional parameter of the query string used in the request.
13287 /// It should be used to set parameters which are not yet available through their own
13288 /// setters.
13289 ///
13290 /// Please note that this method must not be used to set any of the known parameters
13291 /// which have their own setter method. If done anyway, the request will fail.
13292 ///
13293 /// # Additional Parameters
13294 ///
13295 /// * *$.xgafv* (query-string) - V1 error format.
13296 /// * *access_token* (query-string) - OAuth access token.
13297 /// * *alt* (query-string) - Data format for response.
13298 /// * *callback* (query-string) - JSONP
13299 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13300 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13301 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13302 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13303 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13304 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13305 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13306 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTableUndeleteCall<'a, S>
13307 where T: AsRef<str> {
13308 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
13309 self
13310 }
13311
13312 /// Identifies the authorization scope for the method you are building.
13313 ///
13314 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13315 /// [`Scope::BigtableAdmin`].
13316 ///
13317 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13318 /// tokens for more than one scope.
13319 ///
13320 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13321 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13322 /// sufficient, a read-write scope will do as well.
13323 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTableUndeleteCall<'a, S>
13324 where St: AsRef<str> {
13325 self._scopes.insert(String::from(scope.as_ref()));
13326 self
13327 }
13328 /// Identifies the authorization scope(s) for the method you are building.
13329 ///
13330 /// See [`Self::add_scope()`] for details.
13331 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTableUndeleteCall<'a, S>
13332 where I: IntoIterator<Item = St>,
13333 St: AsRef<str> {
13334 self._scopes
13335 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13336 self
13337 }
13338
13339 /// Removes all scopes, and no default scope will be used either.
13340 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13341 /// for details).
13342 pub fn clear_scopes(mut self) -> ProjectInstanceTableUndeleteCall<'a, S> {
13343 self._scopes.clear();
13344 self
13345 }
13346}
13347
13348
13349/// Create an instance within a project. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
13350///
13351/// A builder for the *instances.create* method supported by a *project* resource.
13352/// It is not used directly, but through a [`ProjectMethods`] instance.
13353///
13354/// # Example
13355///
13356/// Instantiate a resource method builder
13357///
13358/// ```test_harness,no_run
13359/// # extern crate hyper;
13360/// # extern crate hyper_rustls;
13361/// # extern crate google_bigtableadmin2 as bigtableadmin2;
13362/// use bigtableadmin2::api::CreateInstanceRequest;
13363/// # async fn dox() {
13364/// # use std::default::Default;
13365/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
13366///
13367/// # let secret: oauth2::ApplicationSecret = Default::default();
13368/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
13369/// # secret,
13370/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13371/// # ).build().await.unwrap();
13372/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
13373/// // As the method needs a request, you would usually fill it with the desired information
13374/// // into the respective structure. Some of the parts shown here might not be applicable !
13375/// // Values shown here are possibly random and not representative !
13376/// let mut req = CreateInstanceRequest::default();
13377///
13378/// // You can configure optional parameters by calling the respective setters at will, and
13379/// // execute the final call using `doit()`.
13380/// // Values shown here are possibly random and not representative !
13381/// let result = hub.projects().instances_create(req, "parent")
13382/// .doit().await;
13383/// # }
13384/// ```
13385pub struct ProjectInstanceCreateCall<'a, S>
13386 where S: 'a {
13387
13388 hub: &'a BigtableAdmin<S>,
13389 _request: CreateInstanceRequest,
13390 _parent: String,
13391 _delegate: Option<&'a mut dyn client::Delegate>,
13392 _additional_params: HashMap<String, String>,
13393 _scopes: BTreeSet<String>
13394}
13395
13396impl<'a, S> client::CallBuilder for ProjectInstanceCreateCall<'a, S> {}
13397
13398impl<'a, S> ProjectInstanceCreateCall<'a, S>
13399where
13400 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
13401 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
13402 S::Future: Send + Unpin + 'static,
13403 S::Error: Into<Box<dyn StdError + Send + Sync>>,
13404{
13405
13406
13407 /// Perform the operation you have build so far.
13408 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
13409 use std::io::{Read, Seek};
13410 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
13411 use client::{ToParts, url::Params};
13412 use std::borrow::Cow;
13413
13414 let mut dd = client::DefaultDelegate;
13415 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
13416 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.create",
13417 http_method: hyper::Method::POST });
13418
13419 for &field in ["alt", "parent"].iter() {
13420 if self._additional_params.contains_key(field) {
13421 dlg.finished(false);
13422 return Err(client::Error::FieldClash(field));
13423 }
13424 }
13425
13426 let mut params = Params::with_capacity(4 + self._additional_params.len());
13427 params.push("parent", self._parent);
13428
13429 params.extend(self._additional_params.iter());
13430
13431 params.push("alt", "json");
13432 let mut url = self.hub._base_url.clone() + "v2/{+parent}/instances";
13433 if self._scopes.is_empty() {
13434 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
13435 }
13436
13437 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
13438 url = params.uri_replacement(url, param_name, find_this, true);
13439 }
13440 {
13441 let to_remove = ["parent"];
13442 params.remove_params(&to_remove);
13443 }
13444
13445 let url = params.parse_with_url(&url);
13446
13447 let mut json_mime_type = mime::APPLICATION_JSON;
13448 let mut request_value_reader =
13449 {
13450 let mut value = json::value::to_value(&self._request).expect("serde to work");
13451 client::remove_json_null_values(&mut value);
13452 let mut dst = io::Cursor::new(Vec::with_capacity(128));
13453 json::to_writer(&mut dst, &value).unwrap();
13454 dst
13455 };
13456 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
13457 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
13458
13459
13460 loop {
13461 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
13462 Ok(token) => token,
13463 Err(e) => {
13464 match dlg.token(e) {
13465 Ok(token) => token,
13466 Err(e) => {
13467 dlg.finished(false);
13468 return Err(client::Error::MissingToken(e));
13469 }
13470 }
13471 }
13472 };
13473 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
13474 let mut req_result = {
13475 let client = &self.hub.client;
13476 dlg.pre_request();
13477 let mut req_builder = hyper::Request::builder()
13478 .method(hyper::Method::POST)
13479 .uri(url.as_str())
13480 .header(USER_AGENT, self.hub._user_agent.clone());
13481
13482 if let Some(token) = token.as_ref() {
13483 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13484 }
13485
13486
13487 let request = req_builder
13488 .header(CONTENT_TYPE, json_mime_type.to_string())
13489 .header(CONTENT_LENGTH, request_size as u64)
13490 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
13491
13492 client.request(request.unwrap()).await
13493
13494 };
13495
13496 match req_result {
13497 Err(err) => {
13498 if let client::Retry::After(d) = dlg.http_error(&err) {
13499 sleep(d).await;
13500 continue;
13501 }
13502 dlg.finished(false);
13503 return Err(client::Error::HttpError(err))
13504 }
13505 Ok(mut res) => {
13506 if !res.status().is_success() {
13507 let res_body_string = client::get_body_as_string(res.body_mut()).await;
13508 let (parts, _) = res.into_parts();
13509 let body = hyper::Body::from(res_body_string.clone());
13510 let restored_response = hyper::Response::from_parts(parts, body);
13511
13512 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
13513
13514 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
13515 sleep(d).await;
13516 continue;
13517 }
13518
13519 dlg.finished(false);
13520
13521 return match server_response {
13522 Some(error_value) => Err(client::Error::BadRequest(error_value)),
13523 None => Err(client::Error::Failure(restored_response)),
13524 }
13525 }
13526 let result_value = {
13527 let res_body_string = client::get_body_as_string(res.body_mut()).await;
13528
13529 match json::from_str(&res_body_string) {
13530 Ok(decoded) => (res, decoded),
13531 Err(err) => {
13532 dlg.response_json_decode_error(&res_body_string, &err);
13533 return Err(client::Error::JsonDecodeError(res_body_string, err));
13534 }
13535 }
13536 };
13537
13538 dlg.finished(true);
13539 return Ok(result_value)
13540 }
13541 }
13542 }
13543 }
13544
13545
13546 ///
13547 /// Sets the *request* property to the given value.
13548 ///
13549 /// Even though the property as already been set when instantiating this call,
13550 /// we provide this method for API completeness.
13551 pub fn request(mut self, new_value: CreateInstanceRequest) -> ProjectInstanceCreateCall<'a, S> {
13552 self._request = new_value;
13553 self
13554 }
13555 /// Required. The unique name of the project in which to create the new instance. Values are of the form `projects/{project}`.
13556 ///
13557 /// Sets the *parent* path property to the given value.
13558 ///
13559 /// Even though the property as already been set when instantiating this call,
13560 /// we provide this method for API completeness.
13561 pub fn parent(mut self, new_value: &str) -> ProjectInstanceCreateCall<'a, S> {
13562 self._parent = new_value.to_string();
13563 self
13564 }
13565 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13566 /// while executing the actual API request.
13567 ///
13568 /// ````text
13569 /// It should be used to handle progress information, and to implement a certain level of resilience.
13570 /// ````
13571 ///
13572 /// Sets the *delegate* property to the given value.
13573 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceCreateCall<'a, S> {
13574 self._delegate = Some(new_value);
13575 self
13576 }
13577
13578 /// Set any additional parameter of the query string used in the request.
13579 /// It should be used to set parameters which are not yet available through their own
13580 /// setters.
13581 ///
13582 /// Please note that this method must not be used to set any of the known parameters
13583 /// which have their own setter method. If done anyway, the request will fail.
13584 ///
13585 /// # Additional Parameters
13586 ///
13587 /// * *$.xgafv* (query-string) - V1 error format.
13588 /// * *access_token* (query-string) - OAuth access token.
13589 /// * *alt* (query-string) - Data format for response.
13590 /// * *callback* (query-string) - JSONP
13591 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13592 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13593 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13594 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13595 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13596 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13597 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13598 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceCreateCall<'a, S>
13599 where T: AsRef<str> {
13600 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
13601 self
13602 }
13603
13604 /// Identifies the authorization scope for the method you are building.
13605 ///
13606 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13607 /// [`Scope::BigtableAdmin`].
13608 ///
13609 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13610 /// tokens for more than one scope.
13611 ///
13612 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13613 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13614 /// sufficient, a read-write scope will do as well.
13615 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceCreateCall<'a, S>
13616 where St: AsRef<str> {
13617 self._scopes.insert(String::from(scope.as_ref()));
13618 self
13619 }
13620 /// Identifies the authorization scope(s) for the method you are building.
13621 ///
13622 /// See [`Self::add_scope()`] for details.
13623 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceCreateCall<'a, S>
13624 where I: IntoIterator<Item = St>,
13625 St: AsRef<str> {
13626 self._scopes
13627 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13628 self
13629 }
13630
13631 /// Removes all scopes, and no default scope will be used either.
13632 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13633 /// for details).
13634 pub fn clear_scopes(mut self) -> ProjectInstanceCreateCall<'a, S> {
13635 self._scopes.clear();
13636 self
13637 }
13638}
13639
13640
13641/// Delete an instance from a project.
13642///
13643/// A builder for the *instances.delete* method supported by a *project* resource.
13644/// It is not used directly, but through a [`ProjectMethods`] instance.
13645///
13646/// # Example
13647///
13648/// Instantiate a resource method builder
13649///
13650/// ```test_harness,no_run
13651/// # extern crate hyper;
13652/// # extern crate hyper_rustls;
13653/// # extern crate google_bigtableadmin2 as bigtableadmin2;
13654/// # async fn dox() {
13655/// # use std::default::Default;
13656/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
13657///
13658/// # let secret: oauth2::ApplicationSecret = Default::default();
13659/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
13660/// # secret,
13661/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13662/// # ).build().await.unwrap();
13663/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
13664/// // You can configure optional parameters by calling the respective setters at will, and
13665/// // execute the final call using `doit()`.
13666/// // Values shown here are possibly random and not representative !
13667/// let result = hub.projects().instances_delete("name")
13668/// .doit().await;
13669/// # }
13670/// ```
13671pub struct ProjectInstanceDeleteCall<'a, S>
13672 where S: 'a {
13673
13674 hub: &'a BigtableAdmin<S>,
13675 _name: String,
13676 _delegate: Option<&'a mut dyn client::Delegate>,
13677 _additional_params: HashMap<String, String>,
13678 _scopes: BTreeSet<String>
13679}
13680
13681impl<'a, S> client::CallBuilder for ProjectInstanceDeleteCall<'a, S> {}
13682
13683impl<'a, S> ProjectInstanceDeleteCall<'a, S>
13684where
13685 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
13686 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
13687 S::Future: Send + Unpin + 'static,
13688 S::Error: Into<Box<dyn StdError + Send + Sync>>,
13689{
13690
13691
13692 /// Perform the operation you have build so far.
13693 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
13694 use std::io::{Read, Seek};
13695 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
13696 use client::{ToParts, url::Params};
13697 use std::borrow::Cow;
13698
13699 let mut dd = client::DefaultDelegate;
13700 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
13701 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.delete",
13702 http_method: hyper::Method::DELETE });
13703
13704 for &field in ["alt", "name"].iter() {
13705 if self._additional_params.contains_key(field) {
13706 dlg.finished(false);
13707 return Err(client::Error::FieldClash(field));
13708 }
13709 }
13710
13711 let mut params = Params::with_capacity(3 + self._additional_params.len());
13712 params.push("name", self._name);
13713
13714 params.extend(self._additional_params.iter());
13715
13716 params.push("alt", "json");
13717 let mut url = self.hub._base_url.clone() + "v2/{+name}";
13718 if self._scopes.is_empty() {
13719 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
13720 }
13721
13722 for &(find_this, param_name) in [("{+name}", "name")].iter() {
13723 url = params.uri_replacement(url, param_name, find_this, true);
13724 }
13725 {
13726 let to_remove = ["name"];
13727 params.remove_params(&to_remove);
13728 }
13729
13730 let url = params.parse_with_url(&url);
13731
13732
13733
13734 loop {
13735 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
13736 Ok(token) => token,
13737 Err(e) => {
13738 match dlg.token(e) {
13739 Ok(token) => token,
13740 Err(e) => {
13741 dlg.finished(false);
13742 return Err(client::Error::MissingToken(e));
13743 }
13744 }
13745 }
13746 };
13747 let mut req_result = {
13748 let client = &self.hub.client;
13749 dlg.pre_request();
13750 let mut req_builder = hyper::Request::builder()
13751 .method(hyper::Method::DELETE)
13752 .uri(url.as_str())
13753 .header(USER_AGENT, self.hub._user_agent.clone());
13754
13755 if let Some(token) = token.as_ref() {
13756 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13757 }
13758
13759
13760 let request = req_builder
13761 .body(hyper::body::Body::empty());
13762
13763 client.request(request.unwrap()).await
13764
13765 };
13766
13767 match req_result {
13768 Err(err) => {
13769 if let client::Retry::After(d) = dlg.http_error(&err) {
13770 sleep(d).await;
13771 continue;
13772 }
13773 dlg.finished(false);
13774 return Err(client::Error::HttpError(err))
13775 }
13776 Ok(mut res) => {
13777 if !res.status().is_success() {
13778 let res_body_string = client::get_body_as_string(res.body_mut()).await;
13779 let (parts, _) = res.into_parts();
13780 let body = hyper::Body::from(res_body_string.clone());
13781 let restored_response = hyper::Response::from_parts(parts, body);
13782
13783 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
13784
13785 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
13786 sleep(d).await;
13787 continue;
13788 }
13789
13790 dlg.finished(false);
13791
13792 return match server_response {
13793 Some(error_value) => Err(client::Error::BadRequest(error_value)),
13794 None => Err(client::Error::Failure(restored_response)),
13795 }
13796 }
13797 let result_value = {
13798 let res_body_string = client::get_body_as_string(res.body_mut()).await;
13799
13800 match json::from_str(&res_body_string) {
13801 Ok(decoded) => (res, decoded),
13802 Err(err) => {
13803 dlg.response_json_decode_error(&res_body_string, &err);
13804 return Err(client::Error::JsonDecodeError(res_body_string, err));
13805 }
13806 }
13807 };
13808
13809 dlg.finished(true);
13810 return Ok(result_value)
13811 }
13812 }
13813 }
13814 }
13815
13816
13817 /// Required. The unique name of the instance to be deleted. Values are of the form `projects/{project}/instances/{instance}`.
13818 ///
13819 /// Sets the *name* path property to the given value.
13820 ///
13821 /// Even though the property as already been set when instantiating this call,
13822 /// we provide this method for API completeness.
13823 pub fn name(mut self, new_value: &str) -> ProjectInstanceDeleteCall<'a, S> {
13824 self._name = new_value.to_string();
13825 self
13826 }
13827 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13828 /// while executing the actual API request.
13829 ///
13830 /// ````text
13831 /// It should be used to handle progress information, and to implement a certain level of resilience.
13832 /// ````
13833 ///
13834 /// Sets the *delegate* property to the given value.
13835 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceDeleteCall<'a, S> {
13836 self._delegate = Some(new_value);
13837 self
13838 }
13839
13840 /// Set any additional parameter of the query string used in the request.
13841 /// It should be used to set parameters which are not yet available through their own
13842 /// setters.
13843 ///
13844 /// Please note that this method must not be used to set any of the known parameters
13845 /// which have their own setter method. If done anyway, the request will fail.
13846 ///
13847 /// # Additional Parameters
13848 ///
13849 /// * *$.xgafv* (query-string) - V1 error format.
13850 /// * *access_token* (query-string) - OAuth access token.
13851 /// * *alt* (query-string) - Data format for response.
13852 /// * *callback* (query-string) - JSONP
13853 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13854 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13855 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13856 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13857 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13858 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13859 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13860 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceDeleteCall<'a, S>
13861 where T: AsRef<str> {
13862 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
13863 self
13864 }
13865
13866 /// Identifies the authorization scope for the method you are building.
13867 ///
13868 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13869 /// [`Scope::BigtableAdmin`].
13870 ///
13871 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13872 /// tokens for more than one scope.
13873 ///
13874 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13875 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13876 /// sufficient, a read-write scope will do as well.
13877 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceDeleteCall<'a, S>
13878 where St: AsRef<str> {
13879 self._scopes.insert(String::from(scope.as_ref()));
13880 self
13881 }
13882 /// Identifies the authorization scope(s) for the method you are building.
13883 ///
13884 /// See [`Self::add_scope()`] for details.
13885 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceDeleteCall<'a, S>
13886 where I: IntoIterator<Item = St>,
13887 St: AsRef<str> {
13888 self._scopes
13889 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13890 self
13891 }
13892
13893 /// Removes all scopes, and no default scope will be used either.
13894 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13895 /// for details).
13896 pub fn clear_scopes(mut self) -> ProjectInstanceDeleteCall<'a, S> {
13897 self._scopes.clear();
13898 self
13899 }
13900}
13901
13902
13903/// Gets information about an instance.
13904///
13905/// A builder for the *instances.get* method supported by a *project* resource.
13906/// It is not used directly, but through a [`ProjectMethods`] instance.
13907///
13908/// # Example
13909///
13910/// Instantiate a resource method builder
13911///
13912/// ```test_harness,no_run
13913/// # extern crate hyper;
13914/// # extern crate hyper_rustls;
13915/// # extern crate google_bigtableadmin2 as bigtableadmin2;
13916/// # async fn dox() {
13917/// # use std::default::Default;
13918/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
13919///
13920/// # let secret: oauth2::ApplicationSecret = Default::default();
13921/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
13922/// # secret,
13923/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13924/// # ).build().await.unwrap();
13925/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
13926/// // You can configure optional parameters by calling the respective setters at will, and
13927/// // execute the final call using `doit()`.
13928/// // Values shown here are possibly random and not representative !
13929/// let result = hub.projects().instances_get("name")
13930/// .doit().await;
13931/// # }
13932/// ```
13933pub struct ProjectInstanceGetCall<'a, S>
13934 where S: 'a {
13935
13936 hub: &'a BigtableAdmin<S>,
13937 _name: String,
13938 _delegate: Option<&'a mut dyn client::Delegate>,
13939 _additional_params: HashMap<String, String>,
13940 _scopes: BTreeSet<String>
13941}
13942
13943impl<'a, S> client::CallBuilder for ProjectInstanceGetCall<'a, S> {}
13944
13945impl<'a, S> ProjectInstanceGetCall<'a, S>
13946where
13947 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
13948 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
13949 S::Future: Send + Unpin + 'static,
13950 S::Error: Into<Box<dyn StdError + Send + Sync>>,
13951{
13952
13953
13954 /// Perform the operation you have build so far.
13955 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Instance)> {
13956 use std::io::{Read, Seek};
13957 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
13958 use client::{ToParts, url::Params};
13959 use std::borrow::Cow;
13960
13961 let mut dd = client::DefaultDelegate;
13962 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
13963 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.get",
13964 http_method: hyper::Method::GET });
13965
13966 for &field in ["alt", "name"].iter() {
13967 if self._additional_params.contains_key(field) {
13968 dlg.finished(false);
13969 return Err(client::Error::FieldClash(field));
13970 }
13971 }
13972
13973 let mut params = Params::with_capacity(3 + self._additional_params.len());
13974 params.push("name", self._name);
13975
13976 params.extend(self._additional_params.iter());
13977
13978 params.push("alt", "json");
13979 let mut url = self.hub._base_url.clone() + "v2/{+name}";
13980 if self._scopes.is_empty() {
13981 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
13982 }
13983
13984 for &(find_this, param_name) in [("{+name}", "name")].iter() {
13985 url = params.uri_replacement(url, param_name, find_this, true);
13986 }
13987 {
13988 let to_remove = ["name"];
13989 params.remove_params(&to_remove);
13990 }
13991
13992 let url = params.parse_with_url(&url);
13993
13994
13995
13996 loop {
13997 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
13998 Ok(token) => token,
13999 Err(e) => {
14000 match dlg.token(e) {
14001 Ok(token) => token,
14002 Err(e) => {
14003 dlg.finished(false);
14004 return Err(client::Error::MissingToken(e));
14005 }
14006 }
14007 }
14008 };
14009 let mut req_result = {
14010 let client = &self.hub.client;
14011 dlg.pre_request();
14012 let mut req_builder = hyper::Request::builder()
14013 .method(hyper::Method::GET)
14014 .uri(url.as_str())
14015 .header(USER_AGENT, self.hub._user_agent.clone());
14016
14017 if let Some(token) = token.as_ref() {
14018 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14019 }
14020
14021
14022 let request = req_builder
14023 .body(hyper::body::Body::empty());
14024
14025 client.request(request.unwrap()).await
14026
14027 };
14028
14029 match req_result {
14030 Err(err) => {
14031 if let client::Retry::After(d) = dlg.http_error(&err) {
14032 sleep(d).await;
14033 continue;
14034 }
14035 dlg.finished(false);
14036 return Err(client::Error::HttpError(err))
14037 }
14038 Ok(mut res) => {
14039 if !res.status().is_success() {
14040 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14041 let (parts, _) = res.into_parts();
14042 let body = hyper::Body::from(res_body_string.clone());
14043 let restored_response = hyper::Response::from_parts(parts, body);
14044
14045 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
14046
14047 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
14048 sleep(d).await;
14049 continue;
14050 }
14051
14052 dlg.finished(false);
14053
14054 return match server_response {
14055 Some(error_value) => Err(client::Error::BadRequest(error_value)),
14056 None => Err(client::Error::Failure(restored_response)),
14057 }
14058 }
14059 let result_value = {
14060 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14061
14062 match json::from_str(&res_body_string) {
14063 Ok(decoded) => (res, decoded),
14064 Err(err) => {
14065 dlg.response_json_decode_error(&res_body_string, &err);
14066 return Err(client::Error::JsonDecodeError(res_body_string, err));
14067 }
14068 }
14069 };
14070
14071 dlg.finished(true);
14072 return Ok(result_value)
14073 }
14074 }
14075 }
14076 }
14077
14078
14079 /// Required. The unique name of the requested instance. Values are of the form `projects/{project}/instances/{instance}`.
14080 ///
14081 /// Sets the *name* path property to the given value.
14082 ///
14083 /// Even though the property as already been set when instantiating this call,
14084 /// we provide this method for API completeness.
14085 pub fn name(mut self, new_value: &str) -> ProjectInstanceGetCall<'a, S> {
14086 self._name = new_value.to_string();
14087 self
14088 }
14089 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
14090 /// while executing the actual API request.
14091 ///
14092 /// ````text
14093 /// It should be used to handle progress information, and to implement a certain level of resilience.
14094 /// ````
14095 ///
14096 /// Sets the *delegate* property to the given value.
14097 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceGetCall<'a, S> {
14098 self._delegate = Some(new_value);
14099 self
14100 }
14101
14102 /// Set any additional parameter of the query string used in the request.
14103 /// It should be used to set parameters which are not yet available through their own
14104 /// setters.
14105 ///
14106 /// Please note that this method must not be used to set any of the known parameters
14107 /// which have their own setter method. If done anyway, the request will fail.
14108 ///
14109 /// # Additional Parameters
14110 ///
14111 /// * *$.xgafv* (query-string) - V1 error format.
14112 /// * *access_token* (query-string) - OAuth access token.
14113 /// * *alt* (query-string) - Data format for response.
14114 /// * *callback* (query-string) - JSONP
14115 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
14116 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
14117 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
14118 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
14119 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
14120 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
14121 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
14122 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceGetCall<'a, S>
14123 where T: AsRef<str> {
14124 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
14125 self
14126 }
14127
14128 /// Identifies the authorization scope for the method you are building.
14129 ///
14130 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
14131 /// [`Scope::BigtableAdmin`].
14132 ///
14133 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
14134 /// tokens for more than one scope.
14135 ///
14136 /// Usually there is more than one suitable scope to authorize an operation, some of which may
14137 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
14138 /// sufficient, a read-write scope will do as well.
14139 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceGetCall<'a, S>
14140 where St: AsRef<str> {
14141 self._scopes.insert(String::from(scope.as_ref()));
14142 self
14143 }
14144 /// Identifies the authorization scope(s) for the method you are building.
14145 ///
14146 /// See [`Self::add_scope()`] for details.
14147 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceGetCall<'a, S>
14148 where I: IntoIterator<Item = St>,
14149 St: AsRef<str> {
14150 self._scopes
14151 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
14152 self
14153 }
14154
14155 /// Removes all scopes, and no default scope will be used either.
14156 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
14157 /// for details).
14158 pub fn clear_scopes(mut self) -> ProjectInstanceGetCall<'a, S> {
14159 self._scopes.clear();
14160 self
14161 }
14162}
14163
14164
14165/// Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.
14166///
14167/// A builder for the *instances.getIamPolicy* method supported by a *project* resource.
14168/// It is not used directly, but through a [`ProjectMethods`] instance.
14169///
14170/// # Example
14171///
14172/// Instantiate a resource method builder
14173///
14174/// ```test_harness,no_run
14175/// # extern crate hyper;
14176/// # extern crate hyper_rustls;
14177/// # extern crate google_bigtableadmin2 as bigtableadmin2;
14178/// use bigtableadmin2::api::GetIamPolicyRequest;
14179/// # async fn dox() {
14180/// # use std::default::Default;
14181/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
14182///
14183/// # let secret: oauth2::ApplicationSecret = Default::default();
14184/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
14185/// # secret,
14186/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
14187/// # ).build().await.unwrap();
14188/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
14189/// // As the method needs a request, you would usually fill it with the desired information
14190/// // into the respective structure. Some of the parts shown here might not be applicable !
14191/// // Values shown here are possibly random and not representative !
14192/// let mut req = GetIamPolicyRequest::default();
14193///
14194/// // You can configure optional parameters by calling the respective setters at will, and
14195/// // execute the final call using `doit()`.
14196/// // Values shown here are possibly random and not representative !
14197/// let result = hub.projects().instances_get_iam_policy(req, "resource")
14198/// .doit().await;
14199/// # }
14200/// ```
14201pub struct ProjectInstanceGetIamPolicyCall<'a, S>
14202 where S: 'a {
14203
14204 hub: &'a BigtableAdmin<S>,
14205 _request: GetIamPolicyRequest,
14206 _resource: String,
14207 _delegate: Option<&'a mut dyn client::Delegate>,
14208 _additional_params: HashMap<String, String>,
14209 _scopes: BTreeSet<String>
14210}
14211
14212impl<'a, S> client::CallBuilder for ProjectInstanceGetIamPolicyCall<'a, S> {}
14213
14214impl<'a, S> ProjectInstanceGetIamPolicyCall<'a, S>
14215where
14216 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
14217 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
14218 S::Future: Send + Unpin + 'static,
14219 S::Error: Into<Box<dyn StdError + Send + Sync>>,
14220{
14221
14222
14223 /// Perform the operation you have build so far.
14224 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Policy)> {
14225 use std::io::{Read, Seek};
14226 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
14227 use client::{ToParts, url::Params};
14228 use std::borrow::Cow;
14229
14230 let mut dd = client::DefaultDelegate;
14231 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
14232 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.getIamPolicy",
14233 http_method: hyper::Method::POST });
14234
14235 for &field in ["alt", "resource"].iter() {
14236 if self._additional_params.contains_key(field) {
14237 dlg.finished(false);
14238 return Err(client::Error::FieldClash(field));
14239 }
14240 }
14241
14242 let mut params = Params::with_capacity(4 + self._additional_params.len());
14243 params.push("resource", self._resource);
14244
14245 params.extend(self._additional_params.iter());
14246
14247 params.push("alt", "json");
14248 let mut url = self.hub._base_url.clone() + "v2/{+resource}:getIamPolicy";
14249 if self._scopes.is_empty() {
14250 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
14251 }
14252
14253 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
14254 url = params.uri_replacement(url, param_name, find_this, true);
14255 }
14256 {
14257 let to_remove = ["resource"];
14258 params.remove_params(&to_remove);
14259 }
14260
14261 let url = params.parse_with_url(&url);
14262
14263 let mut json_mime_type = mime::APPLICATION_JSON;
14264 let mut request_value_reader =
14265 {
14266 let mut value = json::value::to_value(&self._request).expect("serde to work");
14267 client::remove_json_null_values(&mut value);
14268 let mut dst = io::Cursor::new(Vec::with_capacity(128));
14269 json::to_writer(&mut dst, &value).unwrap();
14270 dst
14271 };
14272 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
14273 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
14274
14275
14276 loop {
14277 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
14278 Ok(token) => token,
14279 Err(e) => {
14280 match dlg.token(e) {
14281 Ok(token) => token,
14282 Err(e) => {
14283 dlg.finished(false);
14284 return Err(client::Error::MissingToken(e));
14285 }
14286 }
14287 }
14288 };
14289 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
14290 let mut req_result = {
14291 let client = &self.hub.client;
14292 dlg.pre_request();
14293 let mut req_builder = hyper::Request::builder()
14294 .method(hyper::Method::POST)
14295 .uri(url.as_str())
14296 .header(USER_AGENT, self.hub._user_agent.clone());
14297
14298 if let Some(token) = token.as_ref() {
14299 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14300 }
14301
14302
14303 let request = req_builder
14304 .header(CONTENT_TYPE, json_mime_type.to_string())
14305 .header(CONTENT_LENGTH, request_size as u64)
14306 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
14307
14308 client.request(request.unwrap()).await
14309
14310 };
14311
14312 match req_result {
14313 Err(err) => {
14314 if let client::Retry::After(d) = dlg.http_error(&err) {
14315 sleep(d).await;
14316 continue;
14317 }
14318 dlg.finished(false);
14319 return Err(client::Error::HttpError(err))
14320 }
14321 Ok(mut res) => {
14322 if !res.status().is_success() {
14323 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14324 let (parts, _) = res.into_parts();
14325 let body = hyper::Body::from(res_body_string.clone());
14326 let restored_response = hyper::Response::from_parts(parts, body);
14327
14328 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
14329
14330 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
14331 sleep(d).await;
14332 continue;
14333 }
14334
14335 dlg.finished(false);
14336
14337 return match server_response {
14338 Some(error_value) => Err(client::Error::BadRequest(error_value)),
14339 None => Err(client::Error::Failure(restored_response)),
14340 }
14341 }
14342 let result_value = {
14343 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14344
14345 match json::from_str(&res_body_string) {
14346 Ok(decoded) => (res, decoded),
14347 Err(err) => {
14348 dlg.response_json_decode_error(&res_body_string, &err);
14349 return Err(client::Error::JsonDecodeError(res_body_string, err));
14350 }
14351 }
14352 };
14353
14354 dlg.finished(true);
14355 return Ok(result_value)
14356 }
14357 }
14358 }
14359 }
14360
14361
14362 ///
14363 /// Sets the *request* property to the given value.
14364 ///
14365 /// Even though the property as already been set when instantiating this call,
14366 /// we provide this method for API completeness.
14367 pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceGetIamPolicyCall<'a, S> {
14368 self._request = new_value;
14369 self
14370 }
14371 /// REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
14372 ///
14373 /// Sets the *resource* path property to the given value.
14374 ///
14375 /// Even though the property as already been set when instantiating this call,
14376 /// we provide this method for API completeness.
14377 pub fn resource(mut self, new_value: &str) -> ProjectInstanceGetIamPolicyCall<'a, S> {
14378 self._resource = new_value.to_string();
14379 self
14380 }
14381 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
14382 /// while executing the actual API request.
14383 ///
14384 /// ````text
14385 /// It should be used to handle progress information, and to implement a certain level of resilience.
14386 /// ````
14387 ///
14388 /// Sets the *delegate* property to the given value.
14389 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceGetIamPolicyCall<'a, S> {
14390 self._delegate = Some(new_value);
14391 self
14392 }
14393
14394 /// Set any additional parameter of the query string used in the request.
14395 /// It should be used to set parameters which are not yet available through their own
14396 /// setters.
14397 ///
14398 /// Please note that this method must not be used to set any of the known parameters
14399 /// which have their own setter method. If done anyway, the request will fail.
14400 ///
14401 /// # Additional Parameters
14402 ///
14403 /// * *$.xgafv* (query-string) - V1 error format.
14404 /// * *access_token* (query-string) - OAuth access token.
14405 /// * *alt* (query-string) - Data format for response.
14406 /// * *callback* (query-string) - JSONP
14407 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
14408 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
14409 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
14410 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
14411 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
14412 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
14413 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
14414 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceGetIamPolicyCall<'a, S>
14415 where T: AsRef<str> {
14416 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
14417 self
14418 }
14419
14420 /// Identifies the authorization scope for the method you are building.
14421 ///
14422 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
14423 /// [`Scope::BigtableAdmin`].
14424 ///
14425 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
14426 /// tokens for more than one scope.
14427 ///
14428 /// Usually there is more than one suitable scope to authorize an operation, some of which may
14429 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
14430 /// sufficient, a read-write scope will do as well.
14431 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceGetIamPolicyCall<'a, S>
14432 where St: AsRef<str> {
14433 self._scopes.insert(String::from(scope.as_ref()));
14434 self
14435 }
14436 /// Identifies the authorization scope(s) for the method you are building.
14437 ///
14438 /// See [`Self::add_scope()`] for details.
14439 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceGetIamPolicyCall<'a, S>
14440 where I: IntoIterator<Item = St>,
14441 St: AsRef<str> {
14442 self._scopes
14443 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
14444 self
14445 }
14446
14447 /// Removes all scopes, and no default scope will be used either.
14448 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
14449 /// for details).
14450 pub fn clear_scopes(mut self) -> ProjectInstanceGetIamPolicyCall<'a, S> {
14451 self._scopes.clear();
14452 self
14453 }
14454}
14455
14456
14457/// Lists information about instances in a project.
14458///
14459/// A builder for the *instances.list* method supported by a *project* resource.
14460/// It is not used directly, but through a [`ProjectMethods`] instance.
14461///
14462/// # Example
14463///
14464/// Instantiate a resource method builder
14465///
14466/// ```test_harness,no_run
14467/// # extern crate hyper;
14468/// # extern crate hyper_rustls;
14469/// # extern crate google_bigtableadmin2 as bigtableadmin2;
14470/// # async fn dox() {
14471/// # use std::default::Default;
14472/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
14473///
14474/// # let secret: oauth2::ApplicationSecret = Default::default();
14475/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
14476/// # secret,
14477/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
14478/// # ).build().await.unwrap();
14479/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
14480/// // You can configure optional parameters by calling the respective setters at will, and
14481/// // execute the final call using `doit()`.
14482/// // Values shown here are possibly random and not representative !
14483/// let result = hub.projects().instances_list("parent")
14484/// .page_token("voluptua.")
14485/// .doit().await;
14486/// # }
14487/// ```
14488pub struct ProjectInstanceListCall<'a, S>
14489 where S: 'a {
14490
14491 hub: &'a BigtableAdmin<S>,
14492 _parent: String,
14493 _page_token: Option<String>,
14494 _delegate: Option<&'a mut dyn client::Delegate>,
14495 _additional_params: HashMap<String, String>,
14496 _scopes: BTreeSet<String>
14497}
14498
14499impl<'a, S> client::CallBuilder for ProjectInstanceListCall<'a, S> {}
14500
14501impl<'a, S> ProjectInstanceListCall<'a, S>
14502where
14503 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
14504 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
14505 S::Future: Send + Unpin + 'static,
14506 S::Error: Into<Box<dyn StdError + Send + Sync>>,
14507{
14508
14509
14510 /// Perform the operation you have build so far.
14511 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListInstancesResponse)> {
14512 use std::io::{Read, Seek};
14513 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
14514 use client::{ToParts, url::Params};
14515 use std::borrow::Cow;
14516
14517 let mut dd = client::DefaultDelegate;
14518 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
14519 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.list",
14520 http_method: hyper::Method::GET });
14521
14522 for &field in ["alt", "parent", "pageToken"].iter() {
14523 if self._additional_params.contains_key(field) {
14524 dlg.finished(false);
14525 return Err(client::Error::FieldClash(field));
14526 }
14527 }
14528
14529 let mut params = Params::with_capacity(4 + self._additional_params.len());
14530 params.push("parent", self._parent);
14531 if let Some(value) = self._page_token.as_ref() {
14532 params.push("pageToken", value);
14533 }
14534
14535 params.extend(self._additional_params.iter());
14536
14537 params.push("alt", "json");
14538 let mut url = self.hub._base_url.clone() + "v2/{+parent}/instances";
14539 if self._scopes.is_empty() {
14540 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
14541 }
14542
14543 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
14544 url = params.uri_replacement(url, param_name, find_this, true);
14545 }
14546 {
14547 let to_remove = ["parent"];
14548 params.remove_params(&to_remove);
14549 }
14550
14551 let url = params.parse_with_url(&url);
14552
14553
14554
14555 loop {
14556 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
14557 Ok(token) => token,
14558 Err(e) => {
14559 match dlg.token(e) {
14560 Ok(token) => token,
14561 Err(e) => {
14562 dlg.finished(false);
14563 return Err(client::Error::MissingToken(e));
14564 }
14565 }
14566 }
14567 };
14568 let mut req_result = {
14569 let client = &self.hub.client;
14570 dlg.pre_request();
14571 let mut req_builder = hyper::Request::builder()
14572 .method(hyper::Method::GET)
14573 .uri(url.as_str())
14574 .header(USER_AGENT, self.hub._user_agent.clone());
14575
14576 if let Some(token) = token.as_ref() {
14577 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14578 }
14579
14580
14581 let request = req_builder
14582 .body(hyper::body::Body::empty());
14583
14584 client.request(request.unwrap()).await
14585
14586 };
14587
14588 match req_result {
14589 Err(err) => {
14590 if let client::Retry::After(d) = dlg.http_error(&err) {
14591 sleep(d).await;
14592 continue;
14593 }
14594 dlg.finished(false);
14595 return Err(client::Error::HttpError(err))
14596 }
14597 Ok(mut res) => {
14598 if !res.status().is_success() {
14599 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14600 let (parts, _) = res.into_parts();
14601 let body = hyper::Body::from(res_body_string.clone());
14602 let restored_response = hyper::Response::from_parts(parts, body);
14603
14604 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
14605
14606 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
14607 sleep(d).await;
14608 continue;
14609 }
14610
14611 dlg.finished(false);
14612
14613 return match server_response {
14614 Some(error_value) => Err(client::Error::BadRequest(error_value)),
14615 None => Err(client::Error::Failure(restored_response)),
14616 }
14617 }
14618 let result_value = {
14619 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14620
14621 match json::from_str(&res_body_string) {
14622 Ok(decoded) => (res, decoded),
14623 Err(err) => {
14624 dlg.response_json_decode_error(&res_body_string, &err);
14625 return Err(client::Error::JsonDecodeError(res_body_string, err));
14626 }
14627 }
14628 };
14629
14630 dlg.finished(true);
14631 return Ok(result_value)
14632 }
14633 }
14634 }
14635 }
14636
14637
14638 /// Required. The unique name of the project for which a list of instances is requested. Values are of the form `projects/{project}`.
14639 ///
14640 /// Sets the *parent* path property to the given value.
14641 ///
14642 /// Even though the property as already been set when instantiating this call,
14643 /// we provide this method for API completeness.
14644 pub fn parent(mut self, new_value: &str) -> ProjectInstanceListCall<'a, S> {
14645 self._parent = new_value.to_string();
14646 self
14647 }
14648 /// DEPRECATED: This field is unused and ignored.
14649 ///
14650 /// Sets the *page token* query property to the given value.
14651 pub fn page_token(mut self, new_value: &str) -> ProjectInstanceListCall<'a, S> {
14652 self._page_token = Some(new_value.to_string());
14653 self
14654 }
14655 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
14656 /// while executing the actual API request.
14657 ///
14658 /// ````text
14659 /// It should be used to handle progress information, and to implement a certain level of resilience.
14660 /// ````
14661 ///
14662 /// Sets the *delegate* property to the given value.
14663 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceListCall<'a, S> {
14664 self._delegate = Some(new_value);
14665 self
14666 }
14667
14668 /// Set any additional parameter of the query string used in the request.
14669 /// It should be used to set parameters which are not yet available through their own
14670 /// setters.
14671 ///
14672 /// Please note that this method must not be used to set any of the known parameters
14673 /// which have their own setter method. If done anyway, the request will fail.
14674 ///
14675 /// # Additional Parameters
14676 ///
14677 /// * *$.xgafv* (query-string) - V1 error format.
14678 /// * *access_token* (query-string) - OAuth access token.
14679 /// * *alt* (query-string) - Data format for response.
14680 /// * *callback* (query-string) - JSONP
14681 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
14682 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
14683 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
14684 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
14685 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
14686 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
14687 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
14688 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceListCall<'a, S>
14689 where T: AsRef<str> {
14690 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
14691 self
14692 }
14693
14694 /// Identifies the authorization scope for the method you are building.
14695 ///
14696 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
14697 /// [`Scope::BigtableAdmin`].
14698 ///
14699 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
14700 /// tokens for more than one scope.
14701 ///
14702 /// Usually there is more than one suitable scope to authorize an operation, some of which may
14703 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
14704 /// sufficient, a read-write scope will do as well.
14705 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceListCall<'a, S>
14706 where St: AsRef<str> {
14707 self._scopes.insert(String::from(scope.as_ref()));
14708 self
14709 }
14710 /// Identifies the authorization scope(s) for the method you are building.
14711 ///
14712 /// See [`Self::add_scope()`] for details.
14713 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceListCall<'a, S>
14714 where I: IntoIterator<Item = St>,
14715 St: AsRef<str> {
14716 self._scopes
14717 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
14718 self
14719 }
14720
14721 /// Removes all scopes, and no default scope will be used either.
14722 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
14723 /// for details).
14724 pub fn clear_scopes(mut self) -> ProjectInstanceListCall<'a, S> {
14725 self._scopes.clear();
14726 self
14727 }
14728}
14729
14730
14731/// Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.
14732///
14733/// A builder for the *instances.partialUpdateInstance* method supported by a *project* resource.
14734/// It is not used directly, but through a [`ProjectMethods`] instance.
14735///
14736/// # Example
14737///
14738/// Instantiate a resource method builder
14739///
14740/// ```test_harness,no_run
14741/// # extern crate hyper;
14742/// # extern crate hyper_rustls;
14743/// # extern crate google_bigtableadmin2 as bigtableadmin2;
14744/// use bigtableadmin2::api::Instance;
14745/// # async fn dox() {
14746/// # use std::default::Default;
14747/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
14748///
14749/// # let secret: oauth2::ApplicationSecret = Default::default();
14750/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
14751/// # secret,
14752/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
14753/// # ).build().await.unwrap();
14754/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
14755/// // As the method needs a request, you would usually fill it with the desired information
14756/// // into the respective structure. Some of the parts shown here might not be applicable !
14757/// // Values shown here are possibly random and not representative !
14758/// let mut req = Instance::default();
14759///
14760/// // You can configure optional parameters by calling the respective setters at will, and
14761/// // execute the final call using `doit()`.
14762/// // Values shown here are possibly random and not representative !
14763/// let result = hub.projects().instances_partial_update_instance(req, "name")
14764/// .update_mask(&Default::default())
14765/// .doit().await;
14766/// # }
14767/// ```
14768pub struct ProjectInstancePartialUpdateInstanceCall<'a, S>
14769 where S: 'a {
14770
14771 hub: &'a BigtableAdmin<S>,
14772 _request: Instance,
14773 _name: String,
14774 _update_mask: Option<client::FieldMask>,
14775 _delegate: Option<&'a mut dyn client::Delegate>,
14776 _additional_params: HashMap<String, String>,
14777 _scopes: BTreeSet<String>
14778}
14779
14780impl<'a, S> client::CallBuilder for ProjectInstancePartialUpdateInstanceCall<'a, S> {}
14781
14782impl<'a, S> ProjectInstancePartialUpdateInstanceCall<'a, S>
14783where
14784 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
14785 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
14786 S::Future: Send + Unpin + 'static,
14787 S::Error: Into<Box<dyn StdError + Send + Sync>>,
14788{
14789
14790
14791 /// Perform the operation you have build so far.
14792 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Operation)> {
14793 use std::io::{Read, Seek};
14794 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
14795 use client::{ToParts, url::Params};
14796 use std::borrow::Cow;
14797
14798 let mut dd = client::DefaultDelegate;
14799 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
14800 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.partialUpdateInstance",
14801 http_method: hyper::Method::PATCH });
14802
14803 for &field in ["alt", "name", "updateMask"].iter() {
14804 if self._additional_params.contains_key(field) {
14805 dlg.finished(false);
14806 return Err(client::Error::FieldClash(field));
14807 }
14808 }
14809
14810 let mut params = Params::with_capacity(5 + self._additional_params.len());
14811 params.push("name", self._name);
14812 if let Some(value) = self._update_mask.as_ref() {
14813 params.push("updateMask", value.to_string());
14814 }
14815
14816 params.extend(self._additional_params.iter());
14817
14818 params.push("alt", "json");
14819 let mut url = self.hub._base_url.clone() + "v2/{+name}";
14820 if self._scopes.is_empty() {
14821 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
14822 }
14823
14824 for &(find_this, param_name) in [("{+name}", "name")].iter() {
14825 url = params.uri_replacement(url, param_name, find_this, true);
14826 }
14827 {
14828 let to_remove = ["name"];
14829 params.remove_params(&to_remove);
14830 }
14831
14832 let url = params.parse_with_url(&url);
14833
14834 let mut json_mime_type = mime::APPLICATION_JSON;
14835 let mut request_value_reader =
14836 {
14837 let mut value = json::value::to_value(&self._request).expect("serde to work");
14838 client::remove_json_null_values(&mut value);
14839 let mut dst = io::Cursor::new(Vec::with_capacity(128));
14840 json::to_writer(&mut dst, &value).unwrap();
14841 dst
14842 };
14843 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
14844 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
14845
14846
14847 loop {
14848 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
14849 Ok(token) => token,
14850 Err(e) => {
14851 match dlg.token(e) {
14852 Ok(token) => token,
14853 Err(e) => {
14854 dlg.finished(false);
14855 return Err(client::Error::MissingToken(e));
14856 }
14857 }
14858 }
14859 };
14860 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
14861 let mut req_result = {
14862 let client = &self.hub.client;
14863 dlg.pre_request();
14864 let mut req_builder = hyper::Request::builder()
14865 .method(hyper::Method::PATCH)
14866 .uri(url.as_str())
14867 .header(USER_AGENT, self.hub._user_agent.clone());
14868
14869 if let Some(token) = token.as_ref() {
14870 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14871 }
14872
14873
14874 let request = req_builder
14875 .header(CONTENT_TYPE, json_mime_type.to_string())
14876 .header(CONTENT_LENGTH, request_size as u64)
14877 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
14878
14879 client.request(request.unwrap()).await
14880
14881 };
14882
14883 match req_result {
14884 Err(err) => {
14885 if let client::Retry::After(d) = dlg.http_error(&err) {
14886 sleep(d).await;
14887 continue;
14888 }
14889 dlg.finished(false);
14890 return Err(client::Error::HttpError(err))
14891 }
14892 Ok(mut res) => {
14893 if !res.status().is_success() {
14894 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14895 let (parts, _) = res.into_parts();
14896 let body = hyper::Body::from(res_body_string.clone());
14897 let restored_response = hyper::Response::from_parts(parts, body);
14898
14899 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
14900
14901 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
14902 sleep(d).await;
14903 continue;
14904 }
14905
14906 dlg.finished(false);
14907
14908 return match server_response {
14909 Some(error_value) => Err(client::Error::BadRequest(error_value)),
14910 None => Err(client::Error::Failure(restored_response)),
14911 }
14912 }
14913 let result_value = {
14914 let res_body_string = client::get_body_as_string(res.body_mut()).await;
14915
14916 match json::from_str(&res_body_string) {
14917 Ok(decoded) => (res, decoded),
14918 Err(err) => {
14919 dlg.response_json_decode_error(&res_body_string, &err);
14920 return Err(client::Error::JsonDecodeError(res_body_string, err));
14921 }
14922 }
14923 };
14924
14925 dlg.finished(true);
14926 return Ok(result_value)
14927 }
14928 }
14929 }
14930 }
14931
14932
14933 ///
14934 /// Sets the *request* property to the given value.
14935 ///
14936 /// Even though the property as already been set when instantiating this call,
14937 /// we provide this method for API completeness.
14938 pub fn request(mut self, new_value: Instance) -> ProjectInstancePartialUpdateInstanceCall<'a, S> {
14939 self._request = new_value;
14940 self
14941 }
14942 /// The unique name of the instance. Values are of the form `projects/{project}/instances/a-z+[a-z0-9]`.
14943 ///
14944 /// Sets the *name* path property to the given value.
14945 ///
14946 /// Even though the property as already been set when instantiating this call,
14947 /// we provide this method for API completeness.
14948 pub fn name(mut self, new_value: &str) -> ProjectInstancePartialUpdateInstanceCall<'a, S> {
14949 self._name = new_value.to_string();
14950 self
14951 }
14952 /// Required. The subset of Instance fields which should be replaced. Must be explicitly set.
14953 ///
14954 /// Sets the *update mask* query property to the given value.
14955 pub fn update_mask(mut self, new_value: client::FieldMask) -> ProjectInstancePartialUpdateInstanceCall<'a, S> {
14956 self._update_mask = Some(new_value);
14957 self
14958 }
14959 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
14960 /// while executing the actual API request.
14961 ///
14962 /// ````text
14963 /// It should be used to handle progress information, and to implement a certain level of resilience.
14964 /// ````
14965 ///
14966 /// Sets the *delegate* property to the given value.
14967 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstancePartialUpdateInstanceCall<'a, S> {
14968 self._delegate = Some(new_value);
14969 self
14970 }
14971
14972 /// Set any additional parameter of the query string used in the request.
14973 /// It should be used to set parameters which are not yet available through their own
14974 /// setters.
14975 ///
14976 /// Please note that this method must not be used to set any of the known parameters
14977 /// which have their own setter method. If done anyway, the request will fail.
14978 ///
14979 /// # Additional Parameters
14980 ///
14981 /// * *$.xgafv* (query-string) - V1 error format.
14982 /// * *access_token* (query-string) - OAuth access token.
14983 /// * *alt* (query-string) - Data format for response.
14984 /// * *callback* (query-string) - JSONP
14985 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
14986 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
14987 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
14988 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
14989 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
14990 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
14991 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
14992 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstancePartialUpdateInstanceCall<'a, S>
14993 where T: AsRef<str> {
14994 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
14995 self
14996 }
14997
14998 /// Identifies the authorization scope for the method you are building.
14999 ///
15000 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15001 /// [`Scope::BigtableAdmin`].
15002 ///
15003 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15004 /// tokens for more than one scope.
15005 ///
15006 /// Usually there is more than one suitable scope to authorize an operation, some of which may
15007 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15008 /// sufficient, a read-write scope will do as well.
15009 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstancePartialUpdateInstanceCall<'a, S>
15010 where St: AsRef<str> {
15011 self._scopes.insert(String::from(scope.as_ref()));
15012 self
15013 }
15014 /// Identifies the authorization scope(s) for the method you are building.
15015 ///
15016 /// See [`Self::add_scope()`] for details.
15017 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstancePartialUpdateInstanceCall<'a, S>
15018 where I: IntoIterator<Item = St>,
15019 St: AsRef<str> {
15020 self._scopes
15021 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15022 self
15023 }
15024
15025 /// Removes all scopes, and no default scope will be used either.
15026 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15027 /// for details).
15028 pub fn clear_scopes(mut self) -> ProjectInstancePartialUpdateInstanceCall<'a, S> {
15029 self._scopes.clear();
15030 self
15031 }
15032}
15033
15034
15035/// Sets the access control policy on an instance resource. Replaces any existing policy.
15036///
15037/// A builder for the *instances.setIamPolicy* method supported by a *project* resource.
15038/// It is not used directly, but through a [`ProjectMethods`] instance.
15039///
15040/// # Example
15041///
15042/// Instantiate a resource method builder
15043///
15044/// ```test_harness,no_run
15045/// # extern crate hyper;
15046/// # extern crate hyper_rustls;
15047/// # extern crate google_bigtableadmin2 as bigtableadmin2;
15048/// use bigtableadmin2::api::SetIamPolicyRequest;
15049/// # async fn dox() {
15050/// # use std::default::Default;
15051/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
15052///
15053/// # let secret: oauth2::ApplicationSecret = Default::default();
15054/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
15055/// # secret,
15056/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15057/// # ).build().await.unwrap();
15058/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
15059/// // As the method needs a request, you would usually fill it with the desired information
15060/// // into the respective structure. Some of the parts shown here might not be applicable !
15061/// // Values shown here are possibly random and not representative !
15062/// let mut req = SetIamPolicyRequest::default();
15063///
15064/// // You can configure optional parameters by calling the respective setters at will, and
15065/// // execute the final call using `doit()`.
15066/// // Values shown here are possibly random and not representative !
15067/// let result = hub.projects().instances_set_iam_policy(req, "resource")
15068/// .doit().await;
15069/// # }
15070/// ```
15071pub struct ProjectInstanceSetIamPolicyCall<'a, S>
15072 where S: 'a {
15073
15074 hub: &'a BigtableAdmin<S>,
15075 _request: SetIamPolicyRequest,
15076 _resource: String,
15077 _delegate: Option<&'a mut dyn client::Delegate>,
15078 _additional_params: HashMap<String, String>,
15079 _scopes: BTreeSet<String>
15080}
15081
15082impl<'a, S> client::CallBuilder for ProjectInstanceSetIamPolicyCall<'a, S> {}
15083
15084impl<'a, S> ProjectInstanceSetIamPolicyCall<'a, S>
15085where
15086 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
15087 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
15088 S::Future: Send + Unpin + 'static,
15089 S::Error: Into<Box<dyn StdError + Send + Sync>>,
15090{
15091
15092
15093 /// Perform the operation you have build so far.
15094 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Policy)> {
15095 use std::io::{Read, Seek};
15096 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
15097 use client::{ToParts, url::Params};
15098 use std::borrow::Cow;
15099
15100 let mut dd = client::DefaultDelegate;
15101 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
15102 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.setIamPolicy",
15103 http_method: hyper::Method::POST });
15104
15105 for &field in ["alt", "resource"].iter() {
15106 if self._additional_params.contains_key(field) {
15107 dlg.finished(false);
15108 return Err(client::Error::FieldClash(field));
15109 }
15110 }
15111
15112 let mut params = Params::with_capacity(4 + self._additional_params.len());
15113 params.push("resource", self._resource);
15114
15115 params.extend(self._additional_params.iter());
15116
15117 params.push("alt", "json");
15118 let mut url = self.hub._base_url.clone() + "v2/{+resource}:setIamPolicy";
15119 if self._scopes.is_empty() {
15120 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
15121 }
15122
15123 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
15124 url = params.uri_replacement(url, param_name, find_this, true);
15125 }
15126 {
15127 let to_remove = ["resource"];
15128 params.remove_params(&to_remove);
15129 }
15130
15131 let url = params.parse_with_url(&url);
15132
15133 let mut json_mime_type = mime::APPLICATION_JSON;
15134 let mut request_value_reader =
15135 {
15136 let mut value = json::value::to_value(&self._request).expect("serde to work");
15137 client::remove_json_null_values(&mut value);
15138 let mut dst = io::Cursor::new(Vec::with_capacity(128));
15139 json::to_writer(&mut dst, &value).unwrap();
15140 dst
15141 };
15142 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
15143 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
15144
15145
15146 loop {
15147 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
15148 Ok(token) => token,
15149 Err(e) => {
15150 match dlg.token(e) {
15151 Ok(token) => token,
15152 Err(e) => {
15153 dlg.finished(false);
15154 return Err(client::Error::MissingToken(e));
15155 }
15156 }
15157 }
15158 };
15159 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
15160 let mut req_result = {
15161 let client = &self.hub.client;
15162 dlg.pre_request();
15163 let mut req_builder = hyper::Request::builder()
15164 .method(hyper::Method::POST)
15165 .uri(url.as_str())
15166 .header(USER_AGENT, self.hub._user_agent.clone());
15167
15168 if let Some(token) = token.as_ref() {
15169 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
15170 }
15171
15172
15173 let request = req_builder
15174 .header(CONTENT_TYPE, json_mime_type.to_string())
15175 .header(CONTENT_LENGTH, request_size as u64)
15176 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
15177
15178 client.request(request.unwrap()).await
15179
15180 };
15181
15182 match req_result {
15183 Err(err) => {
15184 if let client::Retry::After(d) = dlg.http_error(&err) {
15185 sleep(d).await;
15186 continue;
15187 }
15188 dlg.finished(false);
15189 return Err(client::Error::HttpError(err))
15190 }
15191 Ok(mut res) => {
15192 if !res.status().is_success() {
15193 let res_body_string = client::get_body_as_string(res.body_mut()).await;
15194 let (parts, _) = res.into_parts();
15195 let body = hyper::Body::from(res_body_string.clone());
15196 let restored_response = hyper::Response::from_parts(parts, body);
15197
15198 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
15199
15200 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
15201 sleep(d).await;
15202 continue;
15203 }
15204
15205 dlg.finished(false);
15206
15207 return match server_response {
15208 Some(error_value) => Err(client::Error::BadRequest(error_value)),
15209 None => Err(client::Error::Failure(restored_response)),
15210 }
15211 }
15212 let result_value = {
15213 let res_body_string = client::get_body_as_string(res.body_mut()).await;
15214
15215 match json::from_str(&res_body_string) {
15216 Ok(decoded) => (res, decoded),
15217 Err(err) => {
15218 dlg.response_json_decode_error(&res_body_string, &err);
15219 return Err(client::Error::JsonDecodeError(res_body_string, err));
15220 }
15221 }
15222 };
15223
15224 dlg.finished(true);
15225 return Ok(result_value)
15226 }
15227 }
15228 }
15229 }
15230
15231
15232 ///
15233 /// Sets the *request* property to the given value.
15234 ///
15235 /// Even though the property as already been set when instantiating this call,
15236 /// we provide this method for API completeness.
15237 pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectInstanceSetIamPolicyCall<'a, S> {
15238 self._request = new_value;
15239 self
15240 }
15241 /// REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
15242 ///
15243 /// Sets the *resource* path property to the given value.
15244 ///
15245 /// Even though the property as already been set when instantiating this call,
15246 /// we provide this method for API completeness.
15247 pub fn resource(mut self, new_value: &str) -> ProjectInstanceSetIamPolicyCall<'a, S> {
15248 self._resource = new_value.to_string();
15249 self
15250 }
15251 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
15252 /// while executing the actual API request.
15253 ///
15254 /// ````text
15255 /// It should be used to handle progress information, and to implement a certain level of resilience.
15256 /// ````
15257 ///
15258 /// Sets the *delegate* property to the given value.
15259 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceSetIamPolicyCall<'a, S> {
15260 self._delegate = Some(new_value);
15261 self
15262 }
15263
15264 /// Set any additional parameter of the query string used in the request.
15265 /// It should be used to set parameters which are not yet available through their own
15266 /// setters.
15267 ///
15268 /// Please note that this method must not be used to set any of the known parameters
15269 /// which have their own setter method. If done anyway, the request will fail.
15270 ///
15271 /// # Additional Parameters
15272 ///
15273 /// * *$.xgafv* (query-string) - V1 error format.
15274 /// * *access_token* (query-string) - OAuth access token.
15275 /// * *alt* (query-string) - Data format for response.
15276 /// * *callback* (query-string) - JSONP
15277 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
15278 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
15279 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
15280 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
15281 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
15282 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
15283 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
15284 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceSetIamPolicyCall<'a, S>
15285 where T: AsRef<str> {
15286 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
15287 self
15288 }
15289
15290 /// Identifies the authorization scope for the method you are building.
15291 ///
15292 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15293 /// [`Scope::BigtableAdmin`].
15294 ///
15295 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15296 /// tokens for more than one scope.
15297 ///
15298 /// Usually there is more than one suitable scope to authorize an operation, some of which may
15299 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15300 /// sufficient, a read-write scope will do as well.
15301 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceSetIamPolicyCall<'a, S>
15302 where St: AsRef<str> {
15303 self._scopes.insert(String::from(scope.as_ref()));
15304 self
15305 }
15306 /// Identifies the authorization scope(s) for the method you are building.
15307 ///
15308 /// See [`Self::add_scope()`] for details.
15309 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceSetIamPolicyCall<'a, S>
15310 where I: IntoIterator<Item = St>,
15311 St: AsRef<str> {
15312 self._scopes
15313 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15314 self
15315 }
15316
15317 /// Removes all scopes, and no default scope will be used either.
15318 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15319 /// for details).
15320 pub fn clear_scopes(mut self) -> ProjectInstanceSetIamPolicyCall<'a, S> {
15321 self._scopes.clear();
15322 self
15323 }
15324}
15325
15326
15327/// Returns permissions that the caller has on the specified instance resource.
15328///
15329/// A builder for the *instances.testIamPermissions* method supported by a *project* resource.
15330/// It is not used directly, but through a [`ProjectMethods`] instance.
15331///
15332/// # Example
15333///
15334/// Instantiate a resource method builder
15335///
15336/// ```test_harness,no_run
15337/// # extern crate hyper;
15338/// # extern crate hyper_rustls;
15339/// # extern crate google_bigtableadmin2 as bigtableadmin2;
15340/// use bigtableadmin2::api::TestIamPermissionsRequest;
15341/// # async fn dox() {
15342/// # use std::default::Default;
15343/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
15344///
15345/// # let secret: oauth2::ApplicationSecret = Default::default();
15346/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
15347/// # secret,
15348/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15349/// # ).build().await.unwrap();
15350/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
15351/// // As the method needs a request, you would usually fill it with the desired information
15352/// // into the respective structure. Some of the parts shown here might not be applicable !
15353/// // Values shown here are possibly random and not representative !
15354/// let mut req = TestIamPermissionsRequest::default();
15355///
15356/// // You can configure optional parameters by calling the respective setters at will, and
15357/// // execute the final call using `doit()`.
15358/// // Values shown here are possibly random and not representative !
15359/// let result = hub.projects().instances_test_iam_permissions(req, "resource")
15360/// .doit().await;
15361/// # }
15362/// ```
15363pub struct ProjectInstanceTestIamPermissionCall<'a, S>
15364 where S: 'a {
15365
15366 hub: &'a BigtableAdmin<S>,
15367 _request: TestIamPermissionsRequest,
15368 _resource: String,
15369 _delegate: Option<&'a mut dyn client::Delegate>,
15370 _additional_params: HashMap<String, String>,
15371 _scopes: BTreeSet<String>
15372}
15373
15374impl<'a, S> client::CallBuilder for ProjectInstanceTestIamPermissionCall<'a, S> {}
15375
15376impl<'a, S> ProjectInstanceTestIamPermissionCall<'a, S>
15377where
15378 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
15379 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
15380 S::Future: Send + Unpin + 'static,
15381 S::Error: Into<Box<dyn StdError + Send + Sync>>,
15382{
15383
15384
15385 /// Perform the operation you have build so far.
15386 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, TestIamPermissionsResponse)> {
15387 use std::io::{Read, Seek};
15388 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
15389 use client::{ToParts, url::Params};
15390 use std::borrow::Cow;
15391
15392 let mut dd = client::DefaultDelegate;
15393 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
15394 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.testIamPermissions",
15395 http_method: hyper::Method::POST });
15396
15397 for &field in ["alt", "resource"].iter() {
15398 if self._additional_params.contains_key(field) {
15399 dlg.finished(false);
15400 return Err(client::Error::FieldClash(field));
15401 }
15402 }
15403
15404 let mut params = Params::with_capacity(4 + self._additional_params.len());
15405 params.push("resource", self._resource);
15406
15407 params.extend(self._additional_params.iter());
15408
15409 params.push("alt", "json");
15410 let mut url = self.hub._base_url.clone() + "v2/{+resource}:testIamPermissions";
15411 if self._scopes.is_empty() {
15412 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
15413 }
15414
15415 for &(find_this, param_name) in [("{+resource}", "resource")].iter() {
15416 url = params.uri_replacement(url, param_name, find_this, true);
15417 }
15418 {
15419 let to_remove = ["resource"];
15420 params.remove_params(&to_remove);
15421 }
15422
15423 let url = params.parse_with_url(&url);
15424
15425 let mut json_mime_type = mime::APPLICATION_JSON;
15426 let mut request_value_reader =
15427 {
15428 let mut value = json::value::to_value(&self._request).expect("serde to work");
15429 client::remove_json_null_values(&mut value);
15430 let mut dst = io::Cursor::new(Vec::with_capacity(128));
15431 json::to_writer(&mut dst, &value).unwrap();
15432 dst
15433 };
15434 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
15435 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
15436
15437
15438 loop {
15439 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
15440 Ok(token) => token,
15441 Err(e) => {
15442 match dlg.token(e) {
15443 Ok(token) => token,
15444 Err(e) => {
15445 dlg.finished(false);
15446 return Err(client::Error::MissingToken(e));
15447 }
15448 }
15449 }
15450 };
15451 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
15452 let mut req_result = {
15453 let client = &self.hub.client;
15454 dlg.pre_request();
15455 let mut req_builder = hyper::Request::builder()
15456 .method(hyper::Method::POST)
15457 .uri(url.as_str())
15458 .header(USER_AGENT, self.hub._user_agent.clone());
15459
15460 if let Some(token) = token.as_ref() {
15461 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
15462 }
15463
15464
15465 let request = req_builder
15466 .header(CONTENT_TYPE, json_mime_type.to_string())
15467 .header(CONTENT_LENGTH, request_size as u64)
15468 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
15469
15470 client.request(request.unwrap()).await
15471
15472 };
15473
15474 match req_result {
15475 Err(err) => {
15476 if let client::Retry::After(d) = dlg.http_error(&err) {
15477 sleep(d).await;
15478 continue;
15479 }
15480 dlg.finished(false);
15481 return Err(client::Error::HttpError(err))
15482 }
15483 Ok(mut res) => {
15484 if !res.status().is_success() {
15485 let res_body_string = client::get_body_as_string(res.body_mut()).await;
15486 let (parts, _) = res.into_parts();
15487 let body = hyper::Body::from(res_body_string.clone());
15488 let restored_response = hyper::Response::from_parts(parts, body);
15489
15490 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
15491
15492 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
15493 sleep(d).await;
15494 continue;
15495 }
15496
15497 dlg.finished(false);
15498
15499 return match server_response {
15500 Some(error_value) => Err(client::Error::BadRequest(error_value)),
15501 None => Err(client::Error::Failure(restored_response)),
15502 }
15503 }
15504 let result_value = {
15505 let res_body_string = client::get_body_as_string(res.body_mut()).await;
15506
15507 match json::from_str(&res_body_string) {
15508 Ok(decoded) => (res, decoded),
15509 Err(err) => {
15510 dlg.response_json_decode_error(&res_body_string, &err);
15511 return Err(client::Error::JsonDecodeError(res_body_string, err));
15512 }
15513 }
15514 };
15515
15516 dlg.finished(true);
15517 return Ok(result_value)
15518 }
15519 }
15520 }
15521 }
15522
15523
15524 ///
15525 /// Sets the *request* property to the given value.
15526 ///
15527 /// Even though the property as already been set when instantiating this call,
15528 /// we provide this method for API completeness.
15529 pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceTestIamPermissionCall<'a, S> {
15530 self._request = new_value;
15531 self
15532 }
15533 /// REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
15534 ///
15535 /// Sets the *resource* path property to the given value.
15536 ///
15537 /// Even though the property as already been set when instantiating this call,
15538 /// we provide this method for API completeness.
15539 pub fn resource(mut self, new_value: &str) -> ProjectInstanceTestIamPermissionCall<'a, S> {
15540 self._resource = new_value.to_string();
15541 self
15542 }
15543 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
15544 /// while executing the actual API request.
15545 ///
15546 /// ````text
15547 /// It should be used to handle progress information, and to implement a certain level of resilience.
15548 /// ````
15549 ///
15550 /// Sets the *delegate* property to the given value.
15551 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceTestIamPermissionCall<'a, S> {
15552 self._delegate = Some(new_value);
15553 self
15554 }
15555
15556 /// Set any additional parameter of the query string used in the request.
15557 /// It should be used to set parameters which are not yet available through their own
15558 /// setters.
15559 ///
15560 /// Please note that this method must not be used to set any of the known parameters
15561 /// which have their own setter method. If done anyway, the request will fail.
15562 ///
15563 /// # Additional Parameters
15564 ///
15565 /// * *$.xgafv* (query-string) - V1 error format.
15566 /// * *access_token* (query-string) - OAuth access token.
15567 /// * *alt* (query-string) - Data format for response.
15568 /// * *callback* (query-string) - JSONP
15569 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
15570 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
15571 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
15572 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
15573 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
15574 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
15575 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
15576 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceTestIamPermissionCall<'a, S>
15577 where T: AsRef<str> {
15578 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
15579 self
15580 }
15581
15582 /// Identifies the authorization scope for the method you are building.
15583 ///
15584 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15585 /// [`Scope::BigtableAdmin`].
15586 ///
15587 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15588 /// tokens for more than one scope.
15589 ///
15590 /// Usually there is more than one suitable scope to authorize an operation, some of which may
15591 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15592 /// sufficient, a read-write scope will do as well.
15593 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceTestIamPermissionCall<'a, S>
15594 where St: AsRef<str> {
15595 self._scopes.insert(String::from(scope.as_ref()));
15596 self
15597 }
15598 /// Identifies the authorization scope(s) for the method you are building.
15599 ///
15600 /// See [`Self::add_scope()`] for details.
15601 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceTestIamPermissionCall<'a, S>
15602 where I: IntoIterator<Item = St>,
15603 St: AsRef<str> {
15604 self._scopes
15605 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15606 self
15607 }
15608
15609 /// Removes all scopes, and no default scope will be used either.
15610 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15611 /// for details).
15612 pub fn clear_scopes(mut self) -> ProjectInstanceTestIamPermissionCall<'a, S> {
15613 self._scopes.clear();
15614 self
15615 }
15616}
15617
15618
15619/// Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.
15620///
15621/// A builder for the *instances.update* method supported by a *project* resource.
15622/// It is not used directly, but through a [`ProjectMethods`] instance.
15623///
15624/// # Example
15625///
15626/// Instantiate a resource method builder
15627///
15628/// ```test_harness,no_run
15629/// # extern crate hyper;
15630/// # extern crate hyper_rustls;
15631/// # extern crate google_bigtableadmin2 as bigtableadmin2;
15632/// use bigtableadmin2::api::Instance;
15633/// # async fn dox() {
15634/// # use std::default::Default;
15635/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
15636///
15637/// # let secret: oauth2::ApplicationSecret = Default::default();
15638/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
15639/// # secret,
15640/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15641/// # ).build().await.unwrap();
15642/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
15643/// // As the method needs a request, you would usually fill it with the desired information
15644/// // into the respective structure. Some of the parts shown here might not be applicable !
15645/// // Values shown here are possibly random and not representative !
15646/// let mut req = Instance::default();
15647///
15648/// // You can configure optional parameters by calling the respective setters at will, and
15649/// // execute the final call using `doit()`.
15650/// // Values shown here are possibly random and not representative !
15651/// let result = hub.projects().instances_update(req, "name")
15652/// .doit().await;
15653/// # }
15654/// ```
15655pub struct ProjectInstanceUpdateCall<'a, S>
15656 where S: 'a {
15657
15658 hub: &'a BigtableAdmin<S>,
15659 _request: Instance,
15660 _name: String,
15661 _delegate: Option<&'a mut dyn client::Delegate>,
15662 _additional_params: HashMap<String, String>,
15663 _scopes: BTreeSet<String>
15664}
15665
15666impl<'a, S> client::CallBuilder for ProjectInstanceUpdateCall<'a, S> {}
15667
15668impl<'a, S> ProjectInstanceUpdateCall<'a, S>
15669where
15670 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
15671 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
15672 S::Future: Send + Unpin + 'static,
15673 S::Error: Into<Box<dyn StdError + Send + Sync>>,
15674{
15675
15676
15677 /// Perform the operation you have build so far.
15678 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Instance)> {
15679 use std::io::{Read, Seek};
15680 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
15681 use client::{ToParts, url::Params};
15682 use std::borrow::Cow;
15683
15684 let mut dd = client::DefaultDelegate;
15685 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
15686 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.instances.update",
15687 http_method: hyper::Method::PUT });
15688
15689 for &field in ["alt", "name"].iter() {
15690 if self._additional_params.contains_key(field) {
15691 dlg.finished(false);
15692 return Err(client::Error::FieldClash(field));
15693 }
15694 }
15695
15696 let mut params = Params::with_capacity(4 + self._additional_params.len());
15697 params.push("name", self._name);
15698
15699 params.extend(self._additional_params.iter());
15700
15701 params.push("alt", "json");
15702 let mut url = self.hub._base_url.clone() + "v2/{+name}";
15703 if self._scopes.is_empty() {
15704 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
15705 }
15706
15707 for &(find_this, param_name) in [("{+name}", "name")].iter() {
15708 url = params.uri_replacement(url, param_name, find_this, true);
15709 }
15710 {
15711 let to_remove = ["name"];
15712 params.remove_params(&to_remove);
15713 }
15714
15715 let url = params.parse_with_url(&url);
15716
15717 let mut json_mime_type = mime::APPLICATION_JSON;
15718 let mut request_value_reader =
15719 {
15720 let mut value = json::value::to_value(&self._request).expect("serde to work");
15721 client::remove_json_null_values(&mut value);
15722 let mut dst = io::Cursor::new(Vec::with_capacity(128));
15723 json::to_writer(&mut dst, &value).unwrap();
15724 dst
15725 };
15726 let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap();
15727 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
15728
15729
15730 loop {
15731 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
15732 Ok(token) => token,
15733 Err(e) => {
15734 match dlg.token(e) {
15735 Ok(token) => token,
15736 Err(e) => {
15737 dlg.finished(false);
15738 return Err(client::Error::MissingToken(e));
15739 }
15740 }
15741 }
15742 };
15743 request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
15744 let mut req_result = {
15745 let client = &self.hub.client;
15746 dlg.pre_request();
15747 let mut req_builder = hyper::Request::builder()
15748 .method(hyper::Method::PUT)
15749 .uri(url.as_str())
15750 .header(USER_AGENT, self.hub._user_agent.clone());
15751
15752 if let Some(token) = token.as_ref() {
15753 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
15754 }
15755
15756
15757 let request = req_builder
15758 .header(CONTENT_TYPE, json_mime_type.to_string())
15759 .header(CONTENT_LENGTH, request_size as u64)
15760 .body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
15761
15762 client.request(request.unwrap()).await
15763
15764 };
15765
15766 match req_result {
15767 Err(err) => {
15768 if let client::Retry::After(d) = dlg.http_error(&err) {
15769 sleep(d).await;
15770 continue;
15771 }
15772 dlg.finished(false);
15773 return Err(client::Error::HttpError(err))
15774 }
15775 Ok(mut res) => {
15776 if !res.status().is_success() {
15777 let res_body_string = client::get_body_as_string(res.body_mut()).await;
15778 let (parts, _) = res.into_parts();
15779 let body = hyper::Body::from(res_body_string.clone());
15780 let restored_response = hyper::Response::from_parts(parts, body);
15781
15782 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
15783
15784 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
15785 sleep(d).await;
15786 continue;
15787 }
15788
15789 dlg.finished(false);
15790
15791 return match server_response {
15792 Some(error_value) => Err(client::Error::BadRequest(error_value)),
15793 None => Err(client::Error::Failure(restored_response)),
15794 }
15795 }
15796 let result_value = {
15797 let res_body_string = client::get_body_as_string(res.body_mut()).await;
15798
15799 match json::from_str(&res_body_string) {
15800 Ok(decoded) => (res, decoded),
15801 Err(err) => {
15802 dlg.response_json_decode_error(&res_body_string, &err);
15803 return Err(client::Error::JsonDecodeError(res_body_string, err));
15804 }
15805 }
15806 };
15807
15808 dlg.finished(true);
15809 return Ok(result_value)
15810 }
15811 }
15812 }
15813 }
15814
15815
15816 ///
15817 /// Sets the *request* property to the given value.
15818 ///
15819 /// Even though the property as already been set when instantiating this call,
15820 /// we provide this method for API completeness.
15821 pub fn request(mut self, new_value: Instance) -> ProjectInstanceUpdateCall<'a, S> {
15822 self._request = new_value;
15823 self
15824 }
15825 /// The unique name of the instance. Values are of the form `projects/{project}/instances/a-z+[a-z0-9]`.
15826 ///
15827 /// Sets the *name* path property to the given value.
15828 ///
15829 /// Even though the property as already been set when instantiating this call,
15830 /// we provide this method for API completeness.
15831 pub fn name(mut self, new_value: &str) -> ProjectInstanceUpdateCall<'a, S> {
15832 self._name = new_value.to_string();
15833 self
15834 }
15835 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
15836 /// while executing the actual API request.
15837 ///
15838 /// ````text
15839 /// It should be used to handle progress information, and to implement a certain level of resilience.
15840 /// ````
15841 ///
15842 /// Sets the *delegate* property to the given value.
15843 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectInstanceUpdateCall<'a, S> {
15844 self._delegate = Some(new_value);
15845 self
15846 }
15847
15848 /// Set any additional parameter of the query string used in the request.
15849 /// It should be used to set parameters which are not yet available through their own
15850 /// setters.
15851 ///
15852 /// Please note that this method must not be used to set any of the known parameters
15853 /// which have their own setter method. If done anyway, the request will fail.
15854 ///
15855 /// # Additional Parameters
15856 ///
15857 /// * *$.xgafv* (query-string) - V1 error format.
15858 /// * *access_token* (query-string) - OAuth access token.
15859 /// * *alt* (query-string) - Data format for response.
15860 /// * *callback* (query-string) - JSONP
15861 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
15862 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
15863 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
15864 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
15865 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
15866 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
15867 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
15868 pub fn param<T>(mut self, name: T, value: T) -> ProjectInstanceUpdateCall<'a, S>
15869 where T: AsRef<str> {
15870 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
15871 self
15872 }
15873
15874 /// Identifies the authorization scope for the method you are building.
15875 ///
15876 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15877 /// [`Scope::BigtableAdmin`].
15878 ///
15879 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15880 /// tokens for more than one scope.
15881 ///
15882 /// Usually there is more than one suitable scope to authorize an operation, some of which may
15883 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15884 /// sufficient, a read-write scope will do as well.
15885 pub fn add_scope<St>(mut self, scope: St) -> ProjectInstanceUpdateCall<'a, S>
15886 where St: AsRef<str> {
15887 self._scopes.insert(String::from(scope.as_ref()));
15888 self
15889 }
15890 /// Identifies the authorization scope(s) for the method you are building.
15891 ///
15892 /// See [`Self::add_scope()`] for details.
15893 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectInstanceUpdateCall<'a, S>
15894 where I: IntoIterator<Item = St>,
15895 St: AsRef<str> {
15896 self._scopes
15897 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15898 self
15899 }
15900
15901 /// Removes all scopes, and no default scope will be used either.
15902 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15903 /// for details).
15904 pub fn clear_scopes(mut self) -> ProjectInstanceUpdateCall<'a, S> {
15905 self._scopes.clear();
15906 self
15907 }
15908}
15909
15910
15911/// Lists information about the supported locations for this service.
15912///
15913/// A builder for the *locations.list* method supported by a *project* resource.
15914/// It is not used directly, but through a [`ProjectMethods`] instance.
15915///
15916/// # Example
15917///
15918/// Instantiate a resource method builder
15919///
15920/// ```test_harness,no_run
15921/// # extern crate hyper;
15922/// # extern crate hyper_rustls;
15923/// # extern crate google_bigtableadmin2 as bigtableadmin2;
15924/// # async fn dox() {
15925/// # use std::default::Default;
15926/// # use bigtableadmin2::{BigtableAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask};
15927///
15928/// # let secret: oauth2::ApplicationSecret = Default::default();
15929/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
15930/// # secret,
15931/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15932/// # ).build().await.unwrap();
15933/// # let mut hub = BigtableAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
15934/// // You can configure optional parameters by calling the respective setters at will, and
15935/// // execute the final call using `doit()`.
15936/// // Values shown here are possibly random and not representative !
15937/// let result = hub.projects().locations_list("name")
15938/// .page_token("takimata")
15939/// .page_size(-19)
15940/// .filter("gubergren")
15941/// .doit().await;
15942/// # }
15943/// ```
15944pub struct ProjectLocationListCall<'a, S>
15945 where S: 'a {
15946
15947 hub: &'a BigtableAdmin<S>,
15948 _name: String,
15949 _page_token: Option<String>,
15950 _page_size: Option<i32>,
15951 _filter: Option<String>,
15952 _delegate: Option<&'a mut dyn client::Delegate>,
15953 _additional_params: HashMap<String, String>,
15954 _scopes: BTreeSet<String>
15955}
15956
15957impl<'a, S> client::CallBuilder for ProjectLocationListCall<'a, S> {}
15958
15959impl<'a, S> ProjectLocationListCall<'a, S>
15960where
15961 S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
15962 S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
15963 S::Future: Send + Unpin + 'static,
15964 S::Error: Into<Box<dyn StdError + Send + Sync>>,
15965{
15966
15967
15968 /// Perform the operation you have build so far.
15969 pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListLocationsResponse)> {
15970 use std::io::{Read, Seek};
15971 use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
15972 use client::{ToParts, url::Params};
15973 use std::borrow::Cow;
15974
15975 let mut dd = client::DefaultDelegate;
15976 let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
15977 dlg.begin(client::MethodInfo { id: "bigtableadmin.projects.locations.list",
15978 http_method: hyper::Method::GET });
15979
15980 for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() {
15981 if self._additional_params.contains_key(field) {
15982 dlg.finished(false);
15983 return Err(client::Error::FieldClash(field));
15984 }
15985 }
15986
15987 let mut params = Params::with_capacity(6 + self._additional_params.len());
15988 params.push("name", self._name);
15989 if let Some(value) = self._page_token.as_ref() {
15990 params.push("pageToken", value);
15991 }
15992 if let Some(value) = self._page_size.as_ref() {
15993 params.push("pageSize", value.to_string());
15994 }
15995 if let Some(value) = self._filter.as_ref() {
15996 params.push("filter", value);
15997 }
15998
15999 params.extend(self._additional_params.iter());
16000
16001 params.push("alt", "json");
16002 let mut url = self.hub._base_url.clone() + "v2/{+name}/locations";
16003 if self._scopes.is_empty() {
16004 self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string());
16005 }
16006
16007 for &(find_this, param_name) in [("{+name}", "name")].iter() {
16008 url = params.uri_replacement(url, param_name, find_this, true);
16009 }
16010 {
16011 let to_remove = ["name"];
16012 params.remove_params(&to_remove);
16013 }
16014
16015 let url = params.parse_with_url(&url);
16016
16017
16018
16019 loop {
16020 let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
16021 Ok(token) => token,
16022 Err(e) => {
16023 match dlg.token(e) {
16024 Ok(token) => token,
16025 Err(e) => {
16026 dlg.finished(false);
16027 return Err(client::Error::MissingToken(e));
16028 }
16029 }
16030 }
16031 };
16032 let mut req_result = {
16033 let client = &self.hub.client;
16034 dlg.pre_request();
16035 let mut req_builder = hyper::Request::builder()
16036 .method(hyper::Method::GET)
16037 .uri(url.as_str())
16038 .header(USER_AGENT, self.hub._user_agent.clone());
16039
16040 if let Some(token) = token.as_ref() {
16041 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
16042 }
16043
16044
16045 let request = req_builder
16046 .body(hyper::body::Body::empty());
16047
16048 client.request(request.unwrap()).await
16049
16050 };
16051
16052 match req_result {
16053 Err(err) => {
16054 if let client::Retry::After(d) = dlg.http_error(&err) {
16055 sleep(d).await;
16056 continue;
16057 }
16058 dlg.finished(false);
16059 return Err(client::Error::HttpError(err))
16060 }
16061 Ok(mut res) => {
16062 if !res.status().is_success() {
16063 let res_body_string = client::get_body_as_string(res.body_mut()).await;
16064 let (parts, _) = res.into_parts();
16065 let body = hyper::Body::from(res_body_string.clone());
16066 let restored_response = hyper::Response::from_parts(parts, body);
16067
16068 let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
16069
16070 if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
16071 sleep(d).await;
16072 continue;
16073 }
16074
16075 dlg.finished(false);
16076
16077 return match server_response {
16078 Some(error_value) => Err(client::Error::BadRequest(error_value)),
16079 None => Err(client::Error::Failure(restored_response)),
16080 }
16081 }
16082 let result_value = {
16083 let res_body_string = client::get_body_as_string(res.body_mut()).await;
16084
16085 match json::from_str(&res_body_string) {
16086 Ok(decoded) => (res, decoded),
16087 Err(err) => {
16088 dlg.response_json_decode_error(&res_body_string, &err);
16089 return Err(client::Error::JsonDecodeError(res_body_string, err));
16090 }
16091 }
16092 };
16093
16094 dlg.finished(true);
16095 return Ok(result_value)
16096 }
16097 }
16098 }
16099 }
16100
16101
16102 /// The resource that owns the locations collection, if applicable.
16103 ///
16104 /// Sets the *name* path property to the given value.
16105 ///
16106 /// Even though the property as already been set when instantiating this call,
16107 /// we provide this method for API completeness.
16108 pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, S> {
16109 self._name = new_value.to_string();
16110 self
16111 }
16112 /// A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
16113 ///
16114 /// Sets the *page token* query property to the given value.
16115 pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, S> {
16116 self._page_token = Some(new_value.to_string());
16117 self
16118 }
16119 /// The maximum number of results to return. If not set, the service selects a default.
16120 ///
16121 /// Sets the *page size* query property to the given value.
16122 pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, S> {
16123 self._page_size = Some(new_value);
16124 self
16125 }
16126 /// A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
16127 ///
16128 /// Sets the *filter* query property to the given value.
16129 pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'a, S> {
16130 self._filter = Some(new_value.to_string());
16131 self
16132 }
16133 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
16134 /// while executing the actual API request.
16135 ///
16136 /// ````text
16137 /// It should be used to handle progress information, and to implement a certain level of resilience.
16138 /// ````
16139 ///
16140 /// Sets the *delegate* property to the given value.
16141 pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectLocationListCall<'a, S> {
16142 self._delegate = Some(new_value);
16143 self
16144 }
16145
16146 /// Set any additional parameter of the query string used in the request.
16147 /// It should be used to set parameters which are not yet available through their own
16148 /// setters.
16149 ///
16150 /// Please note that this method must not be used to set any of the known parameters
16151 /// which have their own setter method. If done anyway, the request will fail.
16152 ///
16153 /// # Additional Parameters
16154 ///
16155 /// * *$.xgafv* (query-string) - V1 error format.
16156 /// * *access_token* (query-string) - OAuth access token.
16157 /// * *alt* (query-string) - Data format for response.
16158 /// * *callback* (query-string) - JSONP
16159 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
16160 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
16161 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
16162 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
16163 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
16164 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
16165 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
16166 pub fn param<T>(mut self, name: T, value: T) -> ProjectLocationListCall<'a, S>
16167 where T: AsRef<str> {
16168 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
16169 self
16170 }
16171
16172 /// Identifies the authorization scope for the method you are building.
16173 ///
16174 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
16175 /// [`Scope::BigtableAdmin`].
16176 ///
16177 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
16178 /// tokens for more than one scope.
16179 ///
16180 /// Usually there is more than one suitable scope to authorize an operation, some of which may
16181 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
16182 /// sufficient, a read-write scope will do as well.
16183 pub fn add_scope<St>(mut self, scope: St) -> ProjectLocationListCall<'a, S>
16184 where St: AsRef<str> {
16185 self._scopes.insert(String::from(scope.as_ref()));
16186 self
16187 }
16188 /// Identifies the authorization scope(s) for the method you are building.
16189 ///
16190 /// See [`Self::add_scope()`] for details.
16191 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectLocationListCall<'a, S>
16192 where I: IntoIterator<Item = St>,
16193 St: AsRef<str> {
16194 self._scopes
16195 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
16196 self
16197 }
16198
16199 /// Removes all scopes, and no default scope will be used either.
16200 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
16201 /// for details).
16202 pub fn clear_scopes(mut self) -> ProjectLocationListCall<'a, S> {
16203 self._scopes.clear();
16204 self
16205 }
16206}
16207
16208