google_firebasehosting1/api.rs
1#![allow(clippy::ptr_arg)]
2
3use std::collections::{BTreeSet, HashMap};
4
5use tokio::time::sleep;
6
7// ##############
8// UTILITIES ###
9// ############
10
11/// Identifies the an OAuth2 authorization scope.
12/// A scope is needed when requesting an
13/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
14#[derive(PartialEq, Eq, Ord, PartialOrd, Hash, Debug, Clone, Copy)]
15pub enum Scope {
16 /// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
17 CloudPlatform,
18
19 /// View and administer all your Firebase data and settings
20 Firebase,
21}
22
23impl AsRef<str> for Scope {
24 fn as_ref(&self) -> &str {
25 match *self {
26 Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
27 Scope::Firebase => "https://www.googleapis.com/auth/firebase",
28 }
29 }
30}
31
32#[allow(clippy::derivable_impls)]
33impl Default for Scope {
34 fn default() -> Scope {
35 Scope::Firebase
36 }
37}
38
39// ########
40// HUB ###
41// ######
42
43/// Central instance to access all FirebaseHosting related resource activities
44///
45/// # Examples
46///
47/// Instantiate a new hub
48///
49/// ```test_harness,no_run
50/// extern crate hyper;
51/// extern crate hyper_rustls;
52/// extern crate google_firebasehosting1 as firebasehosting1;
53/// use firebasehosting1::api::CancelOperationRequest;
54/// use firebasehosting1::{Result, Error};
55/// # async fn dox() {
56/// use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
57///
58/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
59/// // `client_secret`, among other things.
60/// let secret: yup_oauth2::ApplicationSecret = Default::default();
61/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
62/// // unless you replace `None` with the desired Flow.
63/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
64/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
65/// // retrieve them from storage.
66/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
67/// .with_native_roots()
68/// .unwrap()
69/// .https_only()
70/// .enable_http2()
71/// .build();
72///
73/// let executor = hyper_util::rt::TokioExecutor::new();
74/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
75/// secret,
76/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
77/// yup_oauth2::client::CustomHyperClientBuilder::from(
78/// hyper_util::client::legacy::Client::builder(executor).build(connector),
79/// ),
80/// ).build().await.unwrap();
81///
82/// let client = hyper_util::client::legacy::Client::builder(
83/// hyper_util::rt::TokioExecutor::new()
84/// )
85/// .build(
86/// hyper_rustls::HttpsConnectorBuilder::new()
87/// .with_native_roots()
88/// .unwrap()
89/// .https_or_http()
90/// .enable_http2()
91/// .build()
92/// );
93/// let mut hub = FirebaseHosting::new(client, auth);
94/// // As the method needs a request, you would usually fill it with the desired information
95/// // into the respective structure. Some of the parts shown here might not be applicable !
96/// // Values shown here are possibly random and not representative !
97/// let mut req = CancelOperationRequest::default();
98///
99/// // You can configure optional parameters by calling the respective setters at will, and
100/// // execute the final call using `doit()`.
101/// // Values shown here are possibly random and not representative !
102/// let result = hub.operations().cancel(req, "name")
103/// .doit().await;
104///
105/// match result {
106/// Err(e) => match e {
107/// // The Error enum provides details about what exactly happened.
108/// // You can also just use its `Debug`, `Display` or `Error` traits
109/// Error::HttpError(_)
110/// |Error::Io(_)
111/// |Error::MissingAPIKey
112/// |Error::MissingToken(_)
113/// |Error::Cancelled
114/// |Error::UploadSizeLimitExceeded(_, _)
115/// |Error::Failure(_)
116/// |Error::BadRequest(_)
117/// |Error::FieldClash(_)
118/// |Error::JsonDecodeError(_, _) => println!("{}", e),
119/// },
120/// Ok(res) => println!("Success: {:?}", res),
121/// }
122/// # }
123/// ```
124#[derive(Clone)]
125pub struct FirebaseHosting<C> {
126 pub client: common::Client<C>,
127 pub auth: Box<dyn common::GetToken>,
128 _user_agent: String,
129 _base_url: String,
130 _root_url: String,
131}
132
133impl<C> common::Hub for FirebaseHosting<C> {}
134
135impl<'a, C> FirebaseHosting<C> {
136 pub fn new<A: 'static + common::GetToken>(
137 client: common::Client<C>,
138 auth: A,
139 ) -> FirebaseHosting<C> {
140 FirebaseHosting {
141 client,
142 auth: Box::new(auth),
143 _user_agent: "google-api-rust-client/7.0.0".to_string(),
144 _base_url: "https://firebasehosting.googleapis.com/".to_string(),
145 _root_url: "https://firebasehosting.googleapis.com/".to_string(),
146 }
147 }
148
149 pub fn operations(&'a self) -> OperationMethods<'a, C> {
150 OperationMethods { hub: self }
151 }
152 pub fn projects(&'a self) -> ProjectMethods<'a, C> {
153 ProjectMethods { hub: self }
154 }
155
156 /// Set the user-agent header field to use in all requests to the server.
157 /// It defaults to `google-api-rust-client/7.0.0`.
158 ///
159 /// Returns the previously set user-agent.
160 pub fn user_agent(&mut self, agent_name: String) -> String {
161 std::mem::replace(&mut self._user_agent, agent_name)
162 }
163
164 /// Set the base url to use in all requests to the server.
165 /// It defaults to `https://firebasehosting.googleapis.com/`.
166 ///
167 /// Returns the previously set base url.
168 pub fn base_url(&mut self, new_base_url: String) -> String {
169 std::mem::replace(&mut self._base_url, new_base_url)
170 }
171
172 /// Set the root url to use in all requests to the server.
173 /// It defaults to `https://firebasehosting.googleapis.com/`.
174 ///
175 /// Returns the previously set root url.
176 pub fn root_url(&mut self, new_root_url: String) -> String {
177 std::mem::replace(&mut self._root_url, new_root_url)
178 }
179}
180
181// ############
182// SCHEMAS ###
183// ##########
184/// The request message for Operations.CancelOperation.
185///
186/// # Activities
187///
188/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
189/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
190///
191/// * [cancel operations](OperationCancelCall) (request)
192/// * [sites custom domains operations cancel projects](ProjectSiteCustomDomainOperationCancelCall) (request)
193#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
194#[serde_with::serde_as]
195#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
196pub struct CancelOperationRequest {
197 _never_set: Option<bool>,
198}
199
200impl common::RequestValue for CancelOperationRequest {}
201
202/// 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); }
203///
204/// # Activities
205///
206/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
207/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
208///
209/// * [cancel operations](OperationCancelCall) (response)
210/// * [delete operations](OperationDeleteCall) (response)
211/// * [sites custom domains operations cancel projects](ProjectSiteCustomDomainOperationCancelCall) (response)
212/// * [sites custom domains operations delete projects](ProjectSiteCustomDomainOperationDeleteCall) (response)
213#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
214#[serde_with::serde_as]
215#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
216pub struct Empty {
217 _never_set: Option<bool>,
218}
219
220impl common::ResponseResult for Empty {}
221
222/// The response message for Operations.ListOperations.
223///
224/// # Activities
225///
226/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
227/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
228///
229/// * [list operations](OperationListCall) (response)
230#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
231#[serde_with::serde_as]
232#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
233pub struct ListOperationsResponse {
234 /// The standard List next-page token.
235 #[serde(rename = "nextPageToken")]
236 pub next_page_token: Option<String>,
237 /// A list of operations that matches the specified filter in the request.
238 pub operations: Option<Vec<Operation>>,
239 /// Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.
240 pub unreachable: Option<Vec<String>>,
241}
242
243impl common::ResponseResult for ListOperationsResponse {}
244
245/// This resource represents a long-running operation that is the result of a network API call.
246///
247/// # Activities
248///
249/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
250/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
251///
252/// * [cancel operations](OperationCancelCall) (none)
253/// * [delete operations](OperationDeleteCall) (none)
254/// * [list operations](OperationListCall) (none)
255#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
256#[serde_with::serde_as]
257#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
258pub struct Operation {
259 /// 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.
260 pub done: Option<bool>,
261 /// The error result of the operation in case of failure or cancellation.
262 pub error: Option<Status>,
263 /// 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.
264 pub metadata: Option<HashMap<String, serde_json::Value>>,
265 /// 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}`.
266 pub name: Option<String>,
267 /// 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`.
268 pub response: Option<HashMap<String, serde_json::Value>>,
269}
270
271impl common::Resource for Operation {}
272
273/// 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).
274///
275/// This type is not used in any activity, and only used as *part* of another schema.
276///
277#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
278#[serde_with::serde_as]
279#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
280pub struct Status {
281 /// The status code, which should be an enum value of google.rpc.Code.
282 pub code: Option<i32>,
283 /// A list of messages that carry the error details. There is a common set of message types for APIs to use.
284 pub details: Option<Vec<HashMap<String, serde_json::Value>>>,
285 /// 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.
286 pub message: Option<String>,
287}
288
289impl common::Part for Status {}
290
291// ###################
292// MethodBuilders ###
293// #################
294
295/// A builder providing access to all methods supported on *operation* resources.
296/// It is not used directly, but through the [`FirebaseHosting`] hub.
297///
298/// # Example
299///
300/// Instantiate a resource builder
301///
302/// ```test_harness,no_run
303/// extern crate hyper;
304/// extern crate hyper_rustls;
305/// extern crate google_firebasehosting1 as firebasehosting1;
306///
307/// # async fn dox() {
308/// use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
309///
310/// let secret: yup_oauth2::ApplicationSecret = Default::default();
311/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
312/// .with_native_roots()
313/// .unwrap()
314/// .https_only()
315/// .enable_http2()
316/// .build();
317///
318/// let executor = hyper_util::rt::TokioExecutor::new();
319/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
320/// secret,
321/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
322/// yup_oauth2::client::CustomHyperClientBuilder::from(
323/// hyper_util::client::legacy::Client::builder(executor).build(connector),
324/// ),
325/// ).build().await.unwrap();
326///
327/// let client = hyper_util::client::legacy::Client::builder(
328/// hyper_util::rt::TokioExecutor::new()
329/// )
330/// .build(
331/// hyper_rustls::HttpsConnectorBuilder::new()
332/// .with_native_roots()
333/// .unwrap()
334/// .https_or_http()
335/// .enable_http2()
336/// .build()
337/// );
338/// let mut hub = FirebaseHosting::new(client, auth);
339/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
340/// // like `cancel(...)`, `delete(...)` and `list(...)`
341/// // to build up your call.
342/// let rb = hub.operations();
343/// # }
344/// ```
345pub struct OperationMethods<'a, C>
346where
347 C: 'a,
348{
349 hub: &'a FirebaseHosting<C>,
350}
351
352impl<'a, C> common::MethodsBuilder for OperationMethods<'a, C> {}
353
354impl<'a, C> OperationMethods<'a, C> {
355 /// Create a builder to help you perform the following task:
356 ///
357 /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
358 ///
359 /// # Arguments
360 ///
361 /// * `request` - No description provided.
362 /// * `name` - The name of the operation resource to be cancelled.
363 pub fn cancel(
364 &self,
365 request: CancelOperationRequest,
366 name: &str,
367 ) -> OperationCancelCall<'a, C> {
368 OperationCancelCall {
369 hub: self.hub,
370 _request: request,
371 _name: name.to_string(),
372 _delegate: Default::default(),
373 _additional_params: Default::default(),
374 }
375 }
376
377 /// Create a builder to help you perform the following task:
378 ///
379 /// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
380 ///
381 /// # Arguments
382 ///
383 /// * `name` - The name of the operation resource to be deleted.
384 pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C> {
385 OperationDeleteCall {
386 hub: self.hub,
387 _name: name.to_string(),
388 _delegate: Default::default(),
389 _additional_params: Default::default(),
390 }
391 }
392
393 /// Create a builder to help you perform the following task:
394 ///
395 /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
396 ///
397 /// # Arguments
398 ///
399 /// * `name` - The name of the operation's parent resource.
400 pub fn list(&self, name: &str) -> OperationListCall<'a, C> {
401 OperationListCall {
402 hub: self.hub,
403 _name: name.to_string(),
404 _return_partial_success: Default::default(),
405 _page_token: Default::default(),
406 _page_size: Default::default(),
407 _filter: Default::default(),
408 _delegate: Default::default(),
409 _additional_params: Default::default(),
410 }
411 }
412}
413
414/// A builder providing access to all methods supported on *project* resources.
415/// It is not used directly, but through the [`FirebaseHosting`] hub.
416///
417/// # Example
418///
419/// Instantiate a resource builder
420///
421/// ```test_harness,no_run
422/// extern crate hyper;
423/// extern crate hyper_rustls;
424/// extern crate google_firebasehosting1 as firebasehosting1;
425///
426/// # async fn dox() {
427/// use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
428///
429/// let secret: yup_oauth2::ApplicationSecret = Default::default();
430/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
431/// .with_native_roots()
432/// .unwrap()
433/// .https_only()
434/// .enable_http2()
435/// .build();
436///
437/// let executor = hyper_util::rt::TokioExecutor::new();
438/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
439/// secret,
440/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
441/// yup_oauth2::client::CustomHyperClientBuilder::from(
442/// hyper_util::client::legacy::Client::builder(executor).build(connector),
443/// ),
444/// ).build().await.unwrap();
445///
446/// let client = hyper_util::client::legacy::Client::builder(
447/// hyper_util::rt::TokioExecutor::new()
448/// )
449/// .build(
450/// hyper_rustls::HttpsConnectorBuilder::new()
451/// .with_native_roots()
452/// .unwrap()
453/// .https_or_http()
454/// .enable_http2()
455/// .build()
456/// );
457/// let mut hub = FirebaseHosting::new(client, auth);
458/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
459/// // like `sites_custom_domains_operations_cancel(...)` and `sites_custom_domains_operations_delete(...)`
460/// // to build up your call.
461/// let rb = hub.projects();
462/// # }
463/// ```
464pub struct ProjectMethods<'a, C>
465where
466 C: 'a,
467{
468 hub: &'a FirebaseHosting<C>,
469}
470
471impl<'a, C> common::MethodsBuilder for ProjectMethods<'a, C> {}
472
473impl<'a, C> ProjectMethods<'a, C> {
474 /// Create a builder to help you perform the following task:
475 ///
476 /// CancelOperation is a part of the google.longrunning.Operations interface, but is not implemented for CustomDomain resources.
477 ///
478 /// # Arguments
479 ///
480 /// * `request` - No description provided.
481 /// * `name` - The name of the operation resource to be cancelled.
482 pub fn sites_custom_domains_operations_cancel(
483 &self,
484 request: CancelOperationRequest,
485 name: &str,
486 ) -> ProjectSiteCustomDomainOperationCancelCall<'a, C> {
487 ProjectSiteCustomDomainOperationCancelCall {
488 hub: self.hub,
489 _request: request,
490 _name: name.to_string(),
491 _delegate: Default::default(),
492 _additional_params: Default::default(),
493 _scopes: Default::default(),
494 }
495 }
496
497 /// Create a builder to help you perform the following task:
498 ///
499 /// DeleteOperation is a part of the google.longrunning.Operations interface, but is not implemented for CustomDomain resources.
500 ///
501 /// # Arguments
502 ///
503 /// * `name` - The name of the operation resource to be deleted.
504 pub fn sites_custom_domains_operations_delete(
505 &self,
506 name: &str,
507 ) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C> {
508 ProjectSiteCustomDomainOperationDeleteCall {
509 hub: self.hub,
510 _name: name.to_string(),
511 _delegate: Default::default(),
512 _additional_params: Default::default(),
513 _scopes: Default::default(),
514 }
515 }
516}
517
518// ###################
519// CallBuilders ###
520// #################
521
522/// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
523///
524/// A builder for the *cancel* method supported by a *operation* resource.
525/// It is not used directly, but through a [`OperationMethods`] instance.
526///
527/// # Example
528///
529/// Instantiate a resource method builder
530///
531/// ```test_harness,no_run
532/// # extern crate hyper;
533/// # extern crate hyper_rustls;
534/// # extern crate google_firebasehosting1 as firebasehosting1;
535/// use firebasehosting1::api::CancelOperationRequest;
536/// # async fn dox() {
537/// # use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
538///
539/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
540/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
541/// # .with_native_roots()
542/// # .unwrap()
543/// # .https_only()
544/// # .enable_http2()
545/// # .build();
546///
547/// # let executor = hyper_util::rt::TokioExecutor::new();
548/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
549/// # secret,
550/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
551/// # yup_oauth2::client::CustomHyperClientBuilder::from(
552/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
553/// # ),
554/// # ).build().await.unwrap();
555///
556/// # let client = hyper_util::client::legacy::Client::builder(
557/// # hyper_util::rt::TokioExecutor::new()
558/// # )
559/// # .build(
560/// # hyper_rustls::HttpsConnectorBuilder::new()
561/// # .with_native_roots()
562/// # .unwrap()
563/// # .https_or_http()
564/// # .enable_http2()
565/// # .build()
566/// # );
567/// # let mut hub = FirebaseHosting::new(client, auth);
568/// // As the method needs a request, you would usually fill it with the desired information
569/// // into the respective structure. Some of the parts shown here might not be applicable !
570/// // Values shown here are possibly random and not representative !
571/// let mut req = CancelOperationRequest::default();
572///
573/// // You can configure optional parameters by calling the respective setters at will, and
574/// // execute the final call using `doit()`.
575/// // Values shown here are possibly random and not representative !
576/// let result = hub.operations().cancel(req, "name")
577/// .doit().await;
578/// # }
579/// ```
580pub struct OperationCancelCall<'a, C>
581where
582 C: 'a,
583{
584 hub: &'a FirebaseHosting<C>,
585 _request: CancelOperationRequest,
586 _name: String,
587 _delegate: Option<&'a mut dyn common::Delegate>,
588 _additional_params: HashMap<String, String>,
589}
590
591impl<'a, C> common::CallBuilder for OperationCancelCall<'a, C> {}
592
593impl<'a, C> OperationCancelCall<'a, C>
594where
595 C: common::Connector,
596{
597 /// Perform the operation you have build so far.
598 pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
599 use std::borrow::Cow;
600 use std::io::{Read, Seek};
601
602 use common::{url::Params, ToParts};
603 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
604
605 let mut dd = common::DefaultDelegate;
606 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
607 dlg.begin(common::MethodInfo {
608 id: "firebasehosting.operations.cancel",
609 http_method: hyper::Method::POST,
610 });
611
612 for &field in ["alt", "name"].iter() {
613 if self._additional_params.contains_key(field) {
614 dlg.finished(false);
615 return Err(common::Error::FieldClash(field));
616 }
617 }
618
619 let mut params = Params::with_capacity(4 + self._additional_params.len());
620 params.push("name", self._name);
621
622 params.extend(self._additional_params.iter());
623
624 params.push("alt", "json");
625 let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel";
626
627 match dlg.api_key() {
628 Some(value) => params.push("key", value),
629 None => {
630 dlg.finished(false);
631 return Err(common::Error::MissingAPIKey);
632 }
633 }
634
635 #[allow(clippy::single_element_loop)]
636 for &(find_this, param_name) in [("{+name}", "name")].iter() {
637 url = params.uri_replacement(url, param_name, find_this, true);
638 }
639 {
640 let to_remove = ["name"];
641 params.remove_params(&to_remove);
642 }
643
644 let url = params.parse_with_url(&url);
645
646 let mut json_mime_type = mime::APPLICATION_JSON;
647 let mut request_value_reader = {
648 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
649 common::remove_json_null_values(&mut value);
650 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
651 serde_json::to_writer(&mut dst, &value).unwrap();
652 dst
653 };
654 let request_size = request_value_reader
655 .seek(std::io::SeekFrom::End(0))
656 .unwrap();
657 request_value_reader
658 .seek(std::io::SeekFrom::Start(0))
659 .unwrap();
660
661 loop {
662 request_value_reader
663 .seek(std::io::SeekFrom::Start(0))
664 .unwrap();
665 let mut req_result = {
666 let client = &self.hub.client;
667 dlg.pre_request();
668 let mut req_builder = hyper::Request::builder()
669 .method(hyper::Method::POST)
670 .uri(url.as_str())
671 .header(USER_AGENT, self.hub._user_agent.clone());
672
673 let request = req_builder
674 .header(CONTENT_TYPE, json_mime_type.to_string())
675 .header(CONTENT_LENGTH, request_size as u64)
676 .body(common::to_body(
677 request_value_reader.get_ref().clone().into(),
678 ));
679
680 client.request(request.unwrap()).await
681 };
682
683 match req_result {
684 Err(err) => {
685 if let common::Retry::After(d) = dlg.http_error(&err) {
686 sleep(d).await;
687 continue;
688 }
689 dlg.finished(false);
690 return Err(common::Error::HttpError(err));
691 }
692 Ok(res) => {
693 let (mut parts, body) = res.into_parts();
694 let mut body = common::Body::new(body);
695 if !parts.status.is_success() {
696 let bytes = common::to_bytes(body).await.unwrap_or_default();
697 let error = serde_json::from_str(&common::to_string(&bytes));
698 let response = common::to_response(parts, bytes.into());
699
700 if let common::Retry::After(d) =
701 dlg.http_failure(&response, error.as_ref().ok())
702 {
703 sleep(d).await;
704 continue;
705 }
706
707 dlg.finished(false);
708
709 return Err(match error {
710 Ok(value) => common::Error::BadRequest(value),
711 _ => common::Error::Failure(response),
712 });
713 }
714 let response = {
715 let bytes = common::to_bytes(body).await.unwrap_or_default();
716 let encoded = common::to_string(&bytes);
717 match serde_json::from_str(&encoded) {
718 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
719 Err(error) => {
720 dlg.response_json_decode_error(&encoded, &error);
721 return Err(common::Error::JsonDecodeError(
722 encoded.to_string(),
723 error,
724 ));
725 }
726 }
727 };
728
729 dlg.finished(true);
730 return Ok(response);
731 }
732 }
733 }
734 }
735
736 ///
737 /// Sets the *request* property to the given value.
738 ///
739 /// Even though the property as already been set when instantiating this call,
740 /// we provide this method for API completeness.
741 pub fn request(mut self, new_value: CancelOperationRequest) -> OperationCancelCall<'a, C> {
742 self._request = new_value;
743 self
744 }
745 /// The name of the operation resource to be cancelled.
746 ///
747 /// Sets the *name* path property to the given value.
748 ///
749 /// Even though the property as already been set when instantiating this call,
750 /// we provide this method for API completeness.
751 pub fn name(mut self, new_value: &str) -> OperationCancelCall<'a, C> {
752 self._name = new_value.to_string();
753 self
754 }
755 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
756 /// while executing the actual API request.
757 ///
758 /// ````text
759 /// It should be used to handle progress information, and to implement a certain level of resilience.
760 /// ````
761 ///
762 /// Sets the *delegate* property to the given value.
763 pub fn delegate(
764 mut self,
765 new_value: &'a mut dyn common::Delegate,
766 ) -> OperationCancelCall<'a, C> {
767 self._delegate = Some(new_value);
768 self
769 }
770
771 /// Set any additional parameter of the query string used in the request.
772 /// It should be used to set parameters which are not yet available through their own
773 /// setters.
774 ///
775 /// Please note that this method must not be used to set any of the known parameters
776 /// which have their own setter method. If done anyway, the request will fail.
777 ///
778 /// # Additional Parameters
779 ///
780 /// * *$.xgafv* (query-string) - V1 error format.
781 /// * *access_token* (query-string) - OAuth access token.
782 /// * *alt* (query-string) - Data format for response.
783 /// * *callback* (query-string) - JSONP
784 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
785 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
786 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
787 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
788 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
789 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
790 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
791 pub fn param<T>(mut self, name: T, value: T) -> OperationCancelCall<'a, C>
792 where
793 T: AsRef<str>,
794 {
795 self._additional_params
796 .insert(name.as_ref().to_string(), value.as_ref().to_string());
797 self
798 }
799}
800
801/// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
802///
803/// A builder for the *delete* method supported by a *operation* resource.
804/// It is not used directly, but through a [`OperationMethods`] instance.
805///
806/// # Example
807///
808/// Instantiate a resource method builder
809///
810/// ```test_harness,no_run
811/// # extern crate hyper;
812/// # extern crate hyper_rustls;
813/// # extern crate google_firebasehosting1 as firebasehosting1;
814/// # async fn dox() {
815/// # use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
816///
817/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
818/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
819/// # .with_native_roots()
820/// # .unwrap()
821/// # .https_only()
822/// # .enable_http2()
823/// # .build();
824///
825/// # let executor = hyper_util::rt::TokioExecutor::new();
826/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
827/// # secret,
828/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
829/// # yup_oauth2::client::CustomHyperClientBuilder::from(
830/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
831/// # ),
832/// # ).build().await.unwrap();
833///
834/// # let client = hyper_util::client::legacy::Client::builder(
835/// # hyper_util::rt::TokioExecutor::new()
836/// # )
837/// # .build(
838/// # hyper_rustls::HttpsConnectorBuilder::new()
839/// # .with_native_roots()
840/// # .unwrap()
841/// # .https_or_http()
842/// # .enable_http2()
843/// # .build()
844/// # );
845/// # let mut hub = FirebaseHosting::new(client, auth);
846/// // You can configure optional parameters by calling the respective setters at will, and
847/// // execute the final call using `doit()`.
848/// // Values shown here are possibly random and not representative !
849/// let result = hub.operations().delete("name")
850/// .doit().await;
851/// # }
852/// ```
853pub struct OperationDeleteCall<'a, C>
854where
855 C: 'a,
856{
857 hub: &'a FirebaseHosting<C>,
858 _name: String,
859 _delegate: Option<&'a mut dyn common::Delegate>,
860 _additional_params: HashMap<String, String>,
861}
862
863impl<'a, C> common::CallBuilder for OperationDeleteCall<'a, C> {}
864
865impl<'a, C> OperationDeleteCall<'a, C>
866where
867 C: common::Connector,
868{
869 /// Perform the operation you have build so far.
870 pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
871 use std::borrow::Cow;
872 use std::io::{Read, Seek};
873
874 use common::{url::Params, ToParts};
875 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
876
877 let mut dd = common::DefaultDelegate;
878 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
879 dlg.begin(common::MethodInfo {
880 id: "firebasehosting.operations.delete",
881 http_method: hyper::Method::DELETE,
882 });
883
884 for &field in ["alt", "name"].iter() {
885 if self._additional_params.contains_key(field) {
886 dlg.finished(false);
887 return Err(common::Error::FieldClash(field));
888 }
889 }
890
891 let mut params = Params::with_capacity(3 + self._additional_params.len());
892 params.push("name", self._name);
893
894 params.extend(self._additional_params.iter());
895
896 params.push("alt", "json");
897 let mut url = self.hub._base_url.clone() + "v1/{+name}";
898
899 match dlg.api_key() {
900 Some(value) => params.push("key", value),
901 None => {
902 dlg.finished(false);
903 return Err(common::Error::MissingAPIKey);
904 }
905 }
906
907 #[allow(clippy::single_element_loop)]
908 for &(find_this, param_name) in [("{+name}", "name")].iter() {
909 url = params.uri_replacement(url, param_name, find_this, true);
910 }
911 {
912 let to_remove = ["name"];
913 params.remove_params(&to_remove);
914 }
915
916 let url = params.parse_with_url(&url);
917
918 loop {
919 let mut req_result = {
920 let client = &self.hub.client;
921 dlg.pre_request();
922 let mut req_builder = hyper::Request::builder()
923 .method(hyper::Method::DELETE)
924 .uri(url.as_str())
925 .header(USER_AGENT, self.hub._user_agent.clone());
926
927 let request = req_builder
928 .header(CONTENT_LENGTH, 0_u64)
929 .body(common::to_body::<String>(None));
930
931 client.request(request.unwrap()).await
932 };
933
934 match req_result {
935 Err(err) => {
936 if let common::Retry::After(d) = dlg.http_error(&err) {
937 sleep(d).await;
938 continue;
939 }
940 dlg.finished(false);
941 return Err(common::Error::HttpError(err));
942 }
943 Ok(res) => {
944 let (mut parts, body) = res.into_parts();
945 let mut body = common::Body::new(body);
946 if !parts.status.is_success() {
947 let bytes = common::to_bytes(body).await.unwrap_or_default();
948 let error = serde_json::from_str(&common::to_string(&bytes));
949 let response = common::to_response(parts, bytes.into());
950
951 if let common::Retry::After(d) =
952 dlg.http_failure(&response, error.as_ref().ok())
953 {
954 sleep(d).await;
955 continue;
956 }
957
958 dlg.finished(false);
959
960 return Err(match error {
961 Ok(value) => common::Error::BadRequest(value),
962 _ => common::Error::Failure(response),
963 });
964 }
965 let response = {
966 let bytes = common::to_bytes(body).await.unwrap_or_default();
967 let encoded = common::to_string(&bytes);
968 match serde_json::from_str(&encoded) {
969 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
970 Err(error) => {
971 dlg.response_json_decode_error(&encoded, &error);
972 return Err(common::Error::JsonDecodeError(
973 encoded.to_string(),
974 error,
975 ));
976 }
977 }
978 };
979
980 dlg.finished(true);
981 return Ok(response);
982 }
983 }
984 }
985 }
986
987 /// The name of the operation resource to be deleted.
988 ///
989 /// Sets the *name* path property to the given value.
990 ///
991 /// Even though the property as already been set when instantiating this call,
992 /// we provide this method for API completeness.
993 pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C> {
994 self._name = new_value.to_string();
995 self
996 }
997 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
998 /// while executing the actual API request.
999 ///
1000 /// ````text
1001 /// It should be used to handle progress information, and to implement a certain level of resilience.
1002 /// ````
1003 ///
1004 /// Sets the *delegate* property to the given value.
1005 pub fn delegate(
1006 mut self,
1007 new_value: &'a mut dyn common::Delegate,
1008 ) -> OperationDeleteCall<'a, C> {
1009 self._delegate = Some(new_value);
1010 self
1011 }
1012
1013 /// Set any additional parameter of the query string used in the request.
1014 /// It should be used to set parameters which are not yet available through their own
1015 /// setters.
1016 ///
1017 /// Please note that this method must not be used to set any of the known parameters
1018 /// which have their own setter method. If done anyway, the request will fail.
1019 ///
1020 /// # Additional Parameters
1021 ///
1022 /// * *$.xgafv* (query-string) - V1 error format.
1023 /// * *access_token* (query-string) - OAuth access token.
1024 /// * *alt* (query-string) - Data format for response.
1025 /// * *callback* (query-string) - JSONP
1026 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1027 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1028 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1029 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1030 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1031 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1032 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1033 pub fn param<T>(mut self, name: T, value: T) -> OperationDeleteCall<'a, C>
1034 where
1035 T: AsRef<str>,
1036 {
1037 self._additional_params
1038 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1039 self
1040 }
1041}
1042
1043/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
1044///
1045/// A builder for the *list* method supported by a *operation* resource.
1046/// It is not used directly, but through a [`OperationMethods`] instance.
1047///
1048/// # Example
1049///
1050/// Instantiate a resource method builder
1051///
1052/// ```test_harness,no_run
1053/// # extern crate hyper;
1054/// # extern crate hyper_rustls;
1055/// # extern crate google_firebasehosting1 as firebasehosting1;
1056/// # async fn dox() {
1057/// # use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1058///
1059/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1060/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1061/// # .with_native_roots()
1062/// # .unwrap()
1063/// # .https_only()
1064/// # .enable_http2()
1065/// # .build();
1066///
1067/// # let executor = hyper_util::rt::TokioExecutor::new();
1068/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1069/// # secret,
1070/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1071/// # yup_oauth2::client::CustomHyperClientBuilder::from(
1072/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
1073/// # ),
1074/// # ).build().await.unwrap();
1075///
1076/// # let client = hyper_util::client::legacy::Client::builder(
1077/// # hyper_util::rt::TokioExecutor::new()
1078/// # )
1079/// # .build(
1080/// # hyper_rustls::HttpsConnectorBuilder::new()
1081/// # .with_native_roots()
1082/// # .unwrap()
1083/// # .https_or_http()
1084/// # .enable_http2()
1085/// # .build()
1086/// # );
1087/// # let mut hub = FirebaseHosting::new(client, auth);
1088/// // You can configure optional parameters by calling the respective setters at will, and
1089/// // execute the final call using `doit()`.
1090/// // Values shown here are possibly random and not representative !
1091/// let result = hub.operations().list("name")
1092/// .return_partial_success(false)
1093/// .page_token("amet.")
1094/// .page_size(-59)
1095/// .filter("amet.")
1096/// .doit().await;
1097/// # }
1098/// ```
1099pub struct OperationListCall<'a, C>
1100where
1101 C: 'a,
1102{
1103 hub: &'a FirebaseHosting<C>,
1104 _name: String,
1105 _return_partial_success: Option<bool>,
1106 _page_token: Option<String>,
1107 _page_size: Option<i32>,
1108 _filter: Option<String>,
1109 _delegate: Option<&'a mut dyn common::Delegate>,
1110 _additional_params: HashMap<String, String>,
1111}
1112
1113impl<'a, C> common::CallBuilder for OperationListCall<'a, C> {}
1114
1115impl<'a, C> OperationListCall<'a, C>
1116where
1117 C: common::Connector,
1118{
1119 /// Perform the operation you have build so far.
1120 pub async fn doit(mut self) -> common::Result<(common::Response, ListOperationsResponse)> {
1121 use std::borrow::Cow;
1122 use std::io::{Read, Seek};
1123
1124 use common::{url::Params, ToParts};
1125 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1126
1127 let mut dd = common::DefaultDelegate;
1128 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1129 dlg.begin(common::MethodInfo {
1130 id: "firebasehosting.operations.list",
1131 http_method: hyper::Method::GET,
1132 });
1133
1134 for &field in [
1135 "alt",
1136 "name",
1137 "returnPartialSuccess",
1138 "pageToken",
1139 "pageSize",
1140 "filter",
1141 ]
1142 .iter()
1143 {
1144 if self._additional_params.contains_key(field) {
1145 dlg.finished(false);
1146 return Err(common::Error::FieldClash(field));
1147 }
1148 }
1149
1150 let mut params = Params::with_capacity(7 + self._additional_params.len());
1151 params.push("name", self._name);
1152 if let Some(value) = self._return_partial_success.as_ref() {
1153 params.push("returnPartialSuccess", value.to_string());
1154 }
1155 if let Some(value) = self._page_token.as_ref() {
1156 params.push("pageToken", value);
1157 }
1158 if let Some(value) = self._page_size.as_ref() {
1159 params.push("pageSize", value.to_string());
1160 }
1161 if let Some(value) = self._filter.as_ref() {
1162 params.push("filter", value);
1163 }
1164
1165 params.extend(self._additional_params.iter());
1166
1167 params.push("alt", "json");
1168 let mut url = self.hub._base_url.clone() + "v1/{+name}";
1169
1170 match dlg.api_key() {
1171 Some(value) => params.push("key", value),
1172 None => {
1173 dlg.finished(false);
1174 return Err(common::Error::MissingAPIKey);
1175 }
1176 }
1177
1178 #[allow(clippy::single_element_loop)]
1179 for &(find_this, param_name) in [("{+name}", "name")].iter() {
1180 url = params.uri_replacement(url, param_name, find_this, true);
1181 }
1182 {
1183 let to_remove = ["name"];
1184 params.remove_params(&to_remove);
1185 }
1186
1187 let url = params.parse_with_url(&url);
1188
1189 loop {
1190 let mut req_result = {
1191 let client = &self.hub.client;
1192 dlg.pre_request();
1193 let mut req_builder = hyper::Request::builder()
1194 .method(hyper::Method::GET)
1195 .uri(url.as_str())
1196 .header(USER_AGENT, self.hub._user_agent.clone());
1197
1198 let request = req_builder
1199 .header(CONTENT_LENGTH, 0_u64)
1200 .body(common::to_body::<String>(None));
1201
1202 client.request(request.unwrap()).await
1203 };
1204
1205 match req_result {
1206 Err(err) => {
1207 if let common::Retry::After(d) = dlg.http_error(&err) {
1208 sleep(d).await;
1209 continue;
1210 }
1211 dlg.finished(false);
1212 return Err(common::Error::HttpError(err));
1213 }
1214 Ok(res) => {
1215 let (mut parts, body) = res.into_parts();
1216 let mut body = common::Body::new(body);
1217 if !parts.status.is_success() {
1218 let bytes = common::to_bytes(body).await.unwrap_or_default();
1219 let error = serde_json::from_str(&common::to_string(&bytes));
1220 let response = common::to_response(parts, bytes.into());
1221
1222 if let common::Retry::After(d) =
1223 dlg.http_failure(&response, error.as_ref().ok())
1224 {
1225 sleep(d).await;
1226 continue;
1227 }
1228
1229 dlg.finished(false);
1230
1231 return Err(match error {
1232 Ok(value) => common::Error::BadRequest(value),
1233 _ => common::Error::Failure(response),
1234 });
1235 }
1236 let response = {
1237 let bytes = common::to_bytes(body).await.unwrap_or_default();
1238 let encoded = common::to_string(&bytes);
1239 match serde_json::from_str(&encoded) {
1240 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1241 Err(error) => {
1242 dlg.response_json_decode_error(&encoded, &error);
1243 return Err(common::Error::JsonDecodeError(
1244 encoded.to_string(),
1245 error,
1246 ));
1247 }
1248 }
1249 };
1250
1251 dlg.finished(true);
1252 return Ok(response);
1253 }
1254 }
1255 }
1256 }
1257
1258 /// The name of the operation's parent resource.
1259 ///
1260 /// Sets the *name* path property to the given value.
1261 ///
1262 /// Even though the property as already been set when instantiating this call,
1263 /// we provide this method for API completeness.
1264 pub fn name(mut self, new_value: &str) -> OperationListCall<'a, C> {
1265 self._name = new_value.to_string();
1266 self
1267 }
1268 /// When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
1269 ///
1270 /// Sets the *return partial success* query property to the given value.
1271 pub fn return_partial_success(mut self, new_value: bool) -> OperationListCall<'a, C> {
1272 self._return_partial_success = Some(new_value);
1273 self
1274 }
1275 /// The standard list page token.
1276 ///
1277 /// Sets the *page token* query property to the given value.
1278 pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C> {
1279 self._page_token = Some(new_value.to_string());
1280 self
1281 }
1282 /// The standard list page size.
1283 ///
1284 /// Sets the *page size* query property to the given value.
1285 pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C> {
1286 self._page_size = Some(new_value);
1287 self
1288 }
1289 /// The standard list filter.
1290 ///
1291 /// Sets the *filter* query property to the given value.
1292 pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C> {
1293 self._filter = Some(new_value.to_string());
1294 self
1295 }
1296 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1297 /// while executing the actual API request.
1298 ///
1299 /// ````text
1300 /// It should be used to handle progress information, and to implement a certain level of resilience.
1301 /// ````
1302 ///
1303 /// Sets the *delegate* property to the given value.
1304 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> OperationListCall<'a, C> {
1305 self._delegate = Some(new_value);
1306 self
1307 }
1308
1309 /// Set any additional parameter of the query string used in the request.
1310 /// It should be used to set parameters which are not yet available through their own
1311 /// setters.
1312 ///
1313 /// Please note that this method must not be used to set any of the known parameters
1314 /// which have their own setter method. If done anyway, the request will fail.
1315 ///
1316 /// # Additional Parameters
1317 ///
1318 /// * *$.xgafv* (query-string) - V1 error format.
1319 /// * *access_token* (query-string) - OAuth access token.
1320 /// * *alt* (query-string) - Data format for response.
1321 /// * *callback* (query-string) - JSONP
1322 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1323 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1324 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1325 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1326 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1327 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1328 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1329 pub fn param<T>(mut self, name: T, value: T) -> OperationListCall<'a, C>
1330 where
1331 T: AsRef<str>,
1332 {
1333 self._additional_params
1334 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1335 self
1336 }
1337}
1338
1339/// CancelOperation is a part of the google.longrunning.Operations interface, but is not implemented for CustomDomain resources.
1340///
1341/// A builder for the *sites.customDomains.operations.cancel* method supported by a *project* resource.
1342/// It is not used directly, but through a [`ProjectMethods`] instance.
1343///
1344/// # Example
1345///
1346/// Instantiate a resource method builder
1347///
1348/// ```test_harness,no_run
1349/// # extern crate hyper;
1350/// # extern crate hyper_rustls;
1351/// # extern crate google_firebasehosting1 as firebasehosting1;
1352/// use firebasehosting1::api::CancelOperationRequest;
1353/// # async fn dox() {
1354/// # use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1355///
1356/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1357/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1358/// # .with_native_roots()
1359/// # .unwrap()
1360/// # .https_only()
1361/// # .enable_http2()
1362/// # .build();
1363///
1364/// # let executor = hyper_util::rt::TokioExecutor::new();
1365/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1366/// # secret,
1367/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1368/// # yup_oauth2::client::CustomHyperClientBuilder::from(
1369/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
1370/// # ),
1371/// # ).build().await.unwrap();
1372///
1373/// # let client = hyper_util::client::legacy::Client::builder(
1374/// # hyper_util::rt::TokioExecutor::new()
1375/// # )
1376/// # .build(
1377/// # hyper_rustls::HttpsConnectorBuilder::new()
1378/// # .with_native_roots()
1379/// # .unwrap()
1380/// # .https_or_http()
1381/// # .enable_http2()
1382/// # .build()
1383/// # );
1384/// # let mut hub = FirebaseHosting::new(client, auth);
1385/// // As the method needs a request, you would usually fill it with the desired information
1386/// // into the respective structure. Some of the parts shown here might not be applicable !
1387/// // Values shown here are possibly random and not representative !
1388/// let mut req = CancelOperationRequest::default();
1389///
1390/// // You can configure optional parameters by calling the respective setters at will, and
1391/// // execute the final call using `doit()`.
1392/// // Values shown here are possibly random and not representative !
1393/// let result = hub.projects().sites_custom_domains_operations_cancel(req, "name")
1394/// .doit().await;
1395/// # }
1396/// ```
1397pub struct ProjectSiteCustomDomainOperationCancelCall<'a, C>
1398where
1399 C: 'a,
1400{
1401 hub: &'a FirebaseHosting<C>,
1402 _request: CancelOperationRequest,
1403 _name: String,
1404 _delegate: Option<&'a mut dyn common::Delegate>,
1405 _additional_params: HashMap<String, String>,
1406 _scopes: BTreeSet<String>,
1407}
1408
1409impl<'a, C> common::CallBuilder for ProjectSiteCustomDomainOperationCancelCall<'a, C> {}
1410
1411impl<'a, C> ProjectSiteCustomDomainOperationCancelCall<'a, C>
1412where
1413 C: common::Connector,
1414{
1415 /// Perform the operation you have build so far.
1416 pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
1417 use std::borrow::Cow;
1418 use std::io::{Read, Seek};
1419
1420 use common::{url::Params, ToParts};
1421 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1422
1423 let mut dd = common::DefaultDelegate;
1424 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1425 dlg.begin(common::MethodInfo {
1426 id: "firebasehosting.projects.sites.customDomains.operations.cancel",
1427 http_method: hyper::Method::POST,
1428 });
1429
1430 for &field in ["alt", "name"].iter() {
1431 if self._additional_params.contains_key(field) {
1432 dlg.finished(false);
1433 return Err(common::Error::FieldClash(field));
1434 }
1435 }
1436
1437 let mut params = Params::with_capacity(4 + self._additional_params.len());
1438 params.push("name", self._name);
1439
1440 params.extend(self._additional_params.iter());
1441
1442 params.push("alt", "json");
1443 let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel";
1444 if self._scopes.is_empty() {
1445 self._scopes
1446 .insert(Scope::CloudPlatform.as_ref().to_string());
1447 }
1448
1449 #[allow(clippy::single_element_loop)]
1450 for &(find_this, param_name) in [("{+name}", "name")].iter() {
1451 url = params.uri_replacement(url, param_name, find_this, true);
1452 }
1453 {
1454 let to_remove = ["name"];
1455 params.remove_params(&to_remove);
1456 }
1457
1458 let url = params.parse_with_url(&url);
1459
1460 let mut json_mime_type = mime::APPLICATION_JSON;
1461 let mut request_value_reader = {
1462 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
1463 common::remove_json_null_values(&mut value);
1464 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
1465 serde_json::to_writer(&mut dst, &value).unwrap();
1466 dst
1467 };
1468 let request_size = request_value_reader
1469 .seek(std::io::SeekFrom::End(0))
1470 .unwrap();
1471 request_value_reader
1472 .seek(std::io::SeekFrom::Start(0))
1473 .unwrap();
1474
1475 loop {
1476 let token = match self
1477 .hub
1478 .auth
1479 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
1480 .await
1481 {
1482 Ok(token) => token,
1483 Err(e) => match dlg.token(e) {
1484 Ok(token) => token,
1485 Err(e) => {
1486 dlg.finished(false);
1487 return Err(common::Error::MissingToken(e));
1488 }
1489 },
1490 };
1491 request_value_reader
1492 .seek(std::io::SeekFrom::Start(0))
1493 .unwrap();
1494 let mut req_result = {
1495 let client = &self.hub.client;
1496 dlg.pre_request();
1497 let mut req_builder = hyper::Request::builder()
1498 .method(hyper::Method::POST)
1499 .uri(url.as_str())
1500 .header(USER_AGENT, self.hub._user_agent.clone());
1501
1502 if let Some(token) = token.as_ref() {
1503 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
1504 }
1505
1506 let request = req_builder
1507 .header(CONTENT_TYPE, json_mime_type.to_string())
1508 .header(CONTENT_LENGTH, request_size as u64)
1509 .body(common::to_body(
1510 request_value_reader.get_ref().clone().into(),
1511 ));
1512
1513 client.request(request.unwrap()).await
1514 };
1515
1516 match req_result {
1517 Err(err) => {
1518 if let common::Retry::After(d) = dlg.http_error(&err) {
1519 sleep(d).await;
1520 continue;
1521 }
1522 dlg.finished(false);
1523 return Err(common::Error::HttpError(err));
1524 }
1525 Ok(res) => {
1526 let (mut parts, body) = res.into_parts();
1527 let mut body = common::Body::new(body);
1528 if !parts.status.is_success() {
1529 let bytes = common::to_bytes(body).await.unwrap_or_default();
1530 let error = serde_json::from_str(&common::to_string(&bytes));
1531 let response = common::to_response(parts, bytes.into());
1532
1533 if let common::Retry::After(d) =
1534 dlg.http_failure(&response, error.as_ref().ok())
1535 {
1536 sleep(d).await;
1537 continue;
1538 }
1539
1540 dlg.finished(false);
1541
1542 return Err(match error {
1543 Ok(value) => common::Error::BadRequest(value),
1544 _ => common::Error::Failure(response),
1545 });
1546 }
1547 let response = {
1548 let bytes = common::to_bytes(body).await.unwrap_or_default();
1549 let encoded = common::to_string(&bytes);
1550 match serde_json::from_str(&encoded) {
1551 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1552 Err(error) => {
1553 dlg.response_json_decode_error(&encoded, &error);
1554 return Err(common::Error::JsonDecodeError(
1555 encoded.to_string(),
1556 error,
1557 ));
1558 }
1559 }
1560 };
1561
1562 dlg.finished(true);
1563 return Ok(response);
1564 }
1565 }
1566 }
1567 }
1568
1569 ///
1570 /// Sets the *request* property to the given value.
1571 ///
1572 /// Even though the property as already been set when instantiating this call,
1573 /// we provide this method for API completeness.
1574 pub fn request(
1575 mut self,
1576 new_value: CancelOperationRequest,
1577 ) -> ProjectSiteCustomDomainOperationCancelCall<'a, C> {
1578 self._request = new_value;
1579 self
1580 }
1581 /// The name of the operation resource to be cancelled.
1582 ///
1583 /// Sets the *name* path property to the given value.
1584 ///
1585 /// Even though the property as already been set when instantiating this call,
1586 /// we provide this method for API completeness.
1587 pub fn name(mut self, new_value: &str) -> ProjectSiteCustomDomainOperationCancelCall<'a, C> {
1588 self._name = new_value.to_string();
1589 self
1590 }
1591 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1592 /// while executing the actual API request.
1593 ///
1594 /// ````text
1595 /// It should be used to handle progress information, and to implement a certain level of resilience.
1596 /// ````
1597 ///
1598 /// Sets the *delegate* property to the given value.
1599 pub fn delegate(
1600 mut self,
1601 new_value: &'a mut dyn common::Delegate,
1602 ) -> ProjectSiteCustomDomainOperationCancelCall<'a, C> {
1603 self._delegate = Some(new_value);
1604 self
1605 }
1606
1607 /// Set any additional parameter of the query string used in the request.
1608 /// It should be used to set parameters which are not yet available through their own
1609 /// setters.
1610 ///
1611 /// Please note that this method must not be used to set any of the known parameters
1612 /// which have their own setter method. If done anyway, the request will fail.
1613 ///
1614 /// # Additional Parameters
1615 ///
1616 /// * *$.xgafv* (query-string) - V1 error format.
1617 /// * *access_token* (query-string) - OAuth access token.
1618 /// * *alt* (query-string) - Data format for response.
1619 /// * *callback* (query-string) - JSONP
1620 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1621 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1622 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1623 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1624 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1625 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1626 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1627 pub fn param<T>(
1628 mut self,
1629 name: T,
1630 value: T,
1631 ) -> ProjectSiteCustomDomainOperationCancelCall<'a, C>
1632 where
1633 T: AsRef<str>,
1634 {
1635 self._additional_params
1636 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1637 self
1638 }
1639
1640 /// Identifies the authorization scope for the method you are building.
1641 ///
1642 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
1643 /// [`Scope::CloudPlatform`].
1644 ///
1645 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
1646 /// tokens for more than one scope.
1647 ///
1648 /// Usually there is more than one suitable scope to authorize an operation, some of which may
1649 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
1650 /// sufficient, a read-write scope will do as well.
1651 pub fn add_scope<St>(mut self, scope: St) -> ProjectSiteCustomDomainOperationCancelCall<'a, C>
1652 where
1653 St: AsRef<str>,
1654 {
1655 self._scopes.insert(String::from(scope.as_ref()));
1656 self
1657 }
1658 /// Identifies the authorization scope(s) for the method you are building.
1659 ///
1660 /// See [`Self::add_scope()`] for details.
1661 pub fn add_scopes<I, St>(
1662 mut self,
1663 scopes: I,
1664 ) -> ProjectSiteCustomDomainOperationCancelCall<'a, C>
1665 where
1666 I: IntoIterator<Item = St>,
1667 St: AsRef<str>,
1668 {
1669 self._scopes
1670 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
1671 self
1672 }
1673
1674 /// Removes all scopes, and no default scope will be used either.
1675 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
1676 /// for details).
1677 pub fn clear_scopes(mut self) -> ProjectSiteCustomDomainOperationCancelCall<'a, C> {
1678 self._scopes.clear();
1679 self
1680 }
1681}
1682
1683/// DeleteOperation is a part of the google.longrunning.Operations interface, but is not implemented for CustomDomain resources.
1684///
1685/// A builder for the *sites.customDomains.operations.delete* method supported by a *project* resource.
1686/// It is not used directly, but through a [`ProjectMethods`] instance.
1687///
1688/// # Example
1689///
1690/// Instantiate a resource method builder
1691///
1692/// ```test_harness,no_run
1693/// # extern crate hyper;
1694/// # extern crate hyper_rustls;
1695/// # extern crate google_firebasehosting1 as firebasehosting1;
1696/// # async fn dox() {
1697/// # use firebasehosting1::{FirebaseHosting, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1698///
1699/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1700/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1701/// # .with_native_roots()
1702/// # .unwrap()
1703/// # .https_only()
1704/// # .enable_http2()
1705/// # .build();
1706///
1707/// # let executor = hyper_util::rt::TokioExecutor::new();
1708/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1709/// # secret,
1710/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1711/// # yup_oauth2::client::CustomHyperClientBuilder::from(
1712/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
1713/// # ),
1714/// # ).build().await.unwrap();
1715///
1716/// # let client = hyper_util::client::legacy::Client::builder(
1717/// # hyper_util::rt::TokioExecutor::new()
1718/// # )
1719/// # .build(
1720/// # hyper_rustls::HttpsConnectorBuilder::new()
1721/// # .with_native_roots()
1722/// # .unwrap()
1723/// # .https_or_http()
1724/// # .enable_http2()
1725/// # .build()
1726/// # );
1727/// # let mut hub = FirebaseHosting::new(client, auth);
1728/// // You can configure optional parameters by calling the respective setters at will, and
1729/// // execute the final call using `doit()`.
1730/// // Values shown here are possibly random and not representative !
1731/// let result = hub.projects().sites_custom_domains_operations_delete("name")
1732/// .doit().await;
1733/// # }
1734/// ```
1735pub struct ProjectSiteCustomDomainOperationDeleteCall<'a, C>
1736where
1737 C: 'a,
1738{
1739 hub: &'a FirebaseHosting<C>,
1740 _name: String,
1741 _delegate: Option<&'a mut dyn common::Delegate>,
1742 _additional_params: HashMap<String, String>,
1743 _scopes: BTreeSet<String>,
1744}
1745
1746impl<'a, C> common::CallBuilder for ProjectSiteCustomDomainOperationDeleteCall<'a, C> {}
1747
1748impl<'a, C> ProjectSiteCustomDomainOperationDeleteCall<'a, C>
1749where
1750 C: common::Connector,
1751{
1752 /// Perform the operation you have build so far.
1753 pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
1754 use std::borrow::Cow;
1755 use std::io::{Read, Seek};
1756
1757 use common::{url::Params, ToParts};
1758 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1759
1760 let mut dd = common::DefaultDelegate;
1761 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1762 dlg.begin(common::MethodInfo {
1763 id: "firebasehosting.projects.sites.customDomains.operations.delete",
1764 http_method: hyper::Method::DELETE,
1765 });
1766
1767 for &field in ["alt", "name"].iter() {
1768 if self._additional_params.contains_key(field) {
1769 dlg.finished(false);
1770 return Err(common::Error::FieldClash(field));
1771 }
1772 }
1773
1774 let mut params = Params::with_capacity(3 + self._additional_params.len());
1775 params.push("name", self._name);
1776
1777 params.extend(self._additional_params.iter());
1778
1779 params.push("alt", "json");
1780 let mut url = self.hub._base_url.clone() + "v1/{+name}";
1781 if self._scopes.is_empty() {
1782 self._scopes
1783 .insert(Scope::CloudPlatform.as_ref().to_string());
1784 }
1785
1786 #[allow(clippy::single_element_loop)]
1787 for &(find_this, param_name) in [("{+name}", "name")].iter() {
1788 url = params.uri_replacement(url, param_name, find_this, true);
1789 }
1790 {
1791 let to_remove = ["name"];
1792 params.remove_params(&to_remove);
1793 }
1794
1795 let url = params.parse_with_url(&url);
1796
1797 loop {
1798 let token = match self
1799 .hub
1800 .auth
1801 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
1802 .await
1803 {
1804 Ok(token) => token,
1805 Err(e) => match dlg.token(e) {
1806 Ok(token) => token,
1807 Err(e) => {
1808 dlg.finished(false);
1809 return Err(common::Error::MissingToken(e));
1810 }
1811 },
1812 };
1813 let mut req_result = {
1814 let client = &self.hub.client;
1815 dlg.pre_request();
1816 let mut req_builder = hyper::Request::builder()
1817 .method(hyper::Method::DELETE)
1818 .uri(url.as_str())
1819 .header(USER_AGENT, self.hub._user_agent.clone());
1820
1821 if let Some(token) = token.as_ref() {
1822 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
1823 }
1824
1825 let request = req_builder
1826 .header(CONTENT_LENGTH, 0_u64)
1827 .body(common::to_body::<String>(None));
1828
1829 client.request(request.unwrap()).await
1830 };
1831
1832 match req_result {
1833 Err(err) => {
1834 if let common::Retry::After(d) = dlg.http_error(&err) {
1835 sleep(d).await;
1836 continue;
1837 }
1838 dlg.finished(false);
1839 return Err(common::Error::HttpError(err));
1840 }
1841 Ok(res) => {
1842 let (mut parts, body) = res.into_parts();
1843 let mut body = common::Body::new(body);
1844 if !parts.status.is_success() {
1845 let bytes = common::to_bytes(body).await.unwrap_or_default();
1846 let error = serde_json::from_str(&common::to_string(&bytes));
1847 let response = common::to_response(parts, bytes.into());
1848
1849 if let common::Retry::After(d) =
1850 dlg.http_failure(&response, error.as_ref().ok())
1851 {
1852 sleep(d).await;
1853 continue;
1854 }
1855
1856 dlg.finished(false);
1857
1858 return Err(match error {
1859 Ok(value) => common::Error::BadRequest(value),
1860 _ => common::Error::Failure(response),
1861 });
1862 }
1863 let response = {
1864 let bytes = common::to_bytes(body).await.unwrap_or_default();
1865 let encoded = common::to_string(&bytes);
1866 match serde_json::from_str(&encoded) {
1867 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1868 Err(error) => {
1869 dlg.response_json_decode_error(&encoded, &error);
1870 return Err(common::Error::JsonDecodeError(
1871 encoded.to_string(),
1872 error,
1873 ));
1874 }
1875 }
1876 };
1877
1878 dlg.finished(true);
1879 return Ok(response);
1880 }
1881 }
1882 }
1883 }
1884
1885 /// The name of the operation resource to be deleted.
1886 ///
1887 /// Sets the *name* path property to the given value.
1888 ///
1889 /// Even though the property as already been set when instantiating this call,
1890 /// we provide this method for API completeness.
1891 pub fn name(mut self, new_value: &str) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C> {
1892 self._name = new_value.to_string();
1893 self
1894 }
1895 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1896 /// while executing the actual API request.
1897 ///
1898 /// ````text
1899 /// It should be used to handle progress information, and to implement a certain level of resilience.
1900 /// ````
1901 ///
1902 /// Sets the *delegate* property to the given value.
1903 pub fn delegate(
1904 mut self,
1905 new_value: &'a mut dyn common::Delegate,
1906 ) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C> {
1907 self._delegate = Some(new_value);
1908 self
1909 }
1910
1911 /// Set any additional parameter of the query string used in the request.
1912 /// It should be used to set parameters which are not yet available through their own
1913 /// setters.
1914 ///
1915 /// Please note that this method must not be used to set any of the known parameters
1916 /// which have their own setter method. If done anyway, the request will fail.
1917 ///
1918 /// # Additional Parameters
1919 ///
1920 /// * *$.xgafv* (query-string) - V1 error format.
1921 /// * *access_token* (query-string) - OAuth access token.
1922 /// * *alt* (query-string) - Data format for response.
1923 /// * *callback* (query-string) - JSONP
1924 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1925 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1926 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1927 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1928 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1929 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1930 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1931 pub fn param<T>(
1932 mut self,
1933 name: T,
1934 value: T,
1935 ) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C>
1936 where
1937 T: AsRef<str>,
1938 {
1939 self._additional_params
1940 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1941 self
1942 }
1943
1944 /// Identifies the authorization scope for the method you are building.
1945 ///
1946 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
1947 /// [`Scope::CloudPlatform`].
1948 ///
1949 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
1950 /// tokens for more than one scope.
1951 ///
1952 /// Usually there is more than one suitable scope to authorize an operation, some of which may
1953 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
1954 /// sufficient, a read-write scope will do as well.
1955 pub fn add_scope<St>(mut self, scope: St) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C>
1956 where
1957 St: AsRef<str>,
1958 {
1959 self._scopes.insert(String::from(scope.as_ref()));
1960 self
1961 }
1962 /// Identifies the authorization scope(s) for the method you are building.
1963 ///
1964 /// See [`Self::add_scope()`] for details.
1965 pub fn add_scopes<I, St>(
1966 mut self,
1967 scopes: I,
1968 ) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C>
1969 where
1970 I: IntoIterator<Item = St>,
1971 St: AsRef<str>,
1972 {
1973 self._scopes
1974 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
1975 self
1976 }
1977
1978 /// Removes all scopes, and no default scope will be used either.
1979 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
1980 /// for details).
1981 pub fn clear_scopes(mut self) -> ProjectSiteCustomDomainOperationDeleteCall<'a, C> {
1982 self._scopes.clear();
1983 self
1984 }
1985}