google_firebase1_beta1/
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 your data across Google Cloud services and see the email address of your Google Account
20    CloudPlatformReadOnly,
21
22    /// View and administer all your Firebase data and settings
23    Full,
24
25    /// View all your Firebase data and settings
26    Readonly,
27}
28
29impl AsRef<str> for Scope {
30    fn as_ref(&self) -> &str {
31        match *self {
32            Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
33            Scope::CloudPlatformReadOnly => {
34                "https://www.googleapis.com/auth/cloud-platform.read-only"
35            }
36            Scope::Full => "https://www.googleapis.com/auth/firebase",
37            Scope::Readonly => "https://www.googleapis.com/auth/firebase.readonly",
38        }
39    }
40}
41
42#[allow(clippy::derivable_impls)]
43impl Default for Scope {
44    fn default() -> Scope {
45        Scope::Readonly
46    }
47}
48
49// ########
50// HUB ###
51// ######
52
53/// Central instance to access all FirebaseManagement related resource activities
54///
55/// # Examples
56///
57/// Instantiate a new hub
58///
59/// ```test_harness,no_run
60/// extern crate hyper;
61/// extern crate hyper_rustls;
62/// extern crate google_firebase1_beta1 as firebase1_beta1;
63/// use firebase1_beta1::api::AndroidApp;
64/// use firebase1_beta1::{Result, Error};
65/// # async fn dox() {
66/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
67///
68/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
69/// // `client_secret`, among other things.
70/// let secret: yup_oauth2::ApplicationSecret = Default::default();
71/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
72/// // unless you replace  `None` with the desired Flow.
73/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
74/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
75/// // retrieve them from storage.
76/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
77///     secret,
78///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
79/// ).build().await.unwrap();
80///
81/// let client = hyper_util::client::legacy::Client::builder(
82///     hyper_util::rt::TokioExecutor::new()
83/// )
84/// .build(
85///     hyper_rustls::HttpsConnectorBuilder::new()
86///         .with_native_roots()
87///         .unwrap()
88///         .https_or_http()
89///         .enable_http1()
90///         .build()
91/// );
92/// let mut hub = FirebaseManagement::new(client, auth);
93/// // As the method needs a request, you would usually fill it with the desired information
94/// // into the respective structure. Some of the parts shown here might not be applicable !
95/// // Values shown here are possibly random and not representative !
96/// let mut req = AndroidApp::default();
97///
98/// // You can configure optional parameters by calling the respective setters at will, and
99/// // execute the final call using `doit()`.
100/// // Values shown here are possibly random and not representative !
101/// let result = hub.projects().android_apps_create(req, "parent")
102///              .doit().await;
103///
104/// match result {
105///     Err(e) => match e {
106///         // The Error enum provides details about what exactly happened.
107///         // You can also just use its `Debug`, `Display` or `Error` traits
108///          Error::HttpError(_)
109///         |Error::Io(_)
110///         |Error::MissingAPIKey
111///         |Error::MissingToken(_)
112///         |Error::Cancelled
113///         |Error::UploadSizeLimitExceeded(_, _)
114///         |Error::Failure(_)
115///         |Error::BadRequest(_)
116///         |Error::FieldClash(_)
117///         |Error::JsonDecodeError(_, _) => println!("{}", e),
118///     },
119///     Ok(res) => println!("Success: {:?}", res),
120/// }
121/// # }
122/// ```
123#[derive(Clone)]
124pub struct FirebaseManagement<C> {
125    pub client: common::Client<C>,
126    pub auth: Box<dyn common::GetToken>,
127    _user_agent: String,
128    _base_url: String,
129    _root_url: String,
130}
131
132impl<C> common::Hub for FirebaseManagement<C> {}
133
134impl<'a, C> FirebaseManagement<C> {
135    pub fn new<A: 'static + common::GetToken>(
136        client: common::Client<C>,
137        auth: A,
138    ) -> FirebaseManagement<C> {
139        FirebaseManagement {
140            client,
141            auth: Box::new(auth),
142            _user_agent: "google-api-rust-client/6.0.0".to_string(),
143            _base_url: "https://firebase.googleapis.com/".to_string(),
144            _root_url: "https://firebase.googleapis.com/".to_string(),
145        }
146    }
147
148    pub fn available_projects(&'a self) -> AvailableProjectMethods<'a, C> {
149        AvailableProjectMethods { hub: self }
150    }
151    pub fn operations(&'a self) -> OperationMethods<'a, C> {
152        OperationMethods { hub: self }
153    }
154    pub fn projects(&'a self) -> ProjectMethods<'a, C> {
155        ProjectMethods { hub: self }
156    }
157
158    /// Set the user-agent header field to use in all requests to the server.
159    /// It defaults to `google-api-rust-client/6.0.0`.
160    ///
161    /// Returns the previously set user-agent.
162    pub fn user_agent(&mut self, agent_name: String) -> String {
163        std::mem::replace(&mut self._user_agent, agent_name)
164    }
165
166    /// Set the base url to use in all requests to the server.
167    /// It defaults to `https://firebase.googleapis.com/`.
168    ///
169    /// Returns the previously set base url.
170    pub fn base_url(&mut self, new_base_url: String) -> String {
171        std::mem::replace(&mut self._base_url, new_base_url)
172    }
173
174    /// Set the root url to use in all requests to the server.
175    /// It defaults to `https://firebase.googleapis.com/`.
176    ///
177    /// Returns the previously set root url.
178    pub fn root_url(&mut self, new_root_url: String) -> String {
179        std::mem::replace(&mut self._root_url, new_root_url)
180    }
181}
182
183// ############
184// SCHEMAS ###
185// ##########
186/// All fields are required.
187///
188/// # Activities
189///
190/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
191/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
192///
193/// * [add firebase projects](ProjectAddFirebaseCall) (request)
194#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
195#[serde_with::serde_as]
196#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
197pub struct AddFirebaseRequest {
198    /// Deprecated. Instead, to set a Project’s default GCP resource location, call [`FinalizeDefaultLocation`](https://firebase.google.com/../projects.defaultLocation/finalize) after you add Firebase resources to the GCP `Project`. The ID of the Project’s default GCP resource location. The location must be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations).
199    #[serde(rename = "locationId")]
200    pub location_id: Option<String>,
201}
202
203impl common::RequestValue for AddFirebaseRequest {}
204
205/// There is no detailed description.
206///
207/// # Activities
208///
209/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
210/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
211///
212/// * [add google analytics projects](ProjectAddGoogleAnalyticCall) (request)
213#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
214#[serde_with::serde_as]
215#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
216pub struct AddGoogleAnalyticsRequest {
217    /// The ID for the existing [Google Analytics account](http://www.google.com/analytics/) that you want to link with the `FirebaseProject`. Specifying this field will provision a new Google Analytics property in your Google Analytics account and associate the new property with the `FirebaseProject`.
218    #[serde(rename = "analyticsAccountId")]
219    pub analytics_account_id: Option<String>,
220    /// The ID for the existing Google Analytics property that you want to associate with the `FirebaseProject`.
221    #[serde(rename = "analyticsPropertyId")]
222    pub analytics_property_id: Option<String>,
223}
224
225impl common::RequestValue for AddGoogleAnalyticsRequest {}
226
227/// There is no detailed description.
228///
229/// # Activities
230///
231/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
232/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
233///
234/// * [get admin sdk config projects](ProjectGetAdminSdkConfigCall) (response)
235#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
236#[serde_with::serde_as]
237#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
238pub struct AdminSdkConfig {
239    /// **DEPRECATED.** _Instead, find the default Firebase Realtime Database instance name using the [list endpoint](https://firebase.google.com/docs/reference/rest/database/database-management/rest/v1beta/projects.locations.instances/list) within the Firebase Realtime Database REST API. Note that the default instance for the Project might not yet be provisioned, so the return might not contain a default instance._ The default Firebase Realtime Database URL.
240    #[serde(rename = "databaseURL")]
241    pub database_url: Option<String>,
242    /// **DEPRECATED.** *Instead, use product-specific REST APIs to find the location of resources.* The ID of the Project’s default GCP resource location. The location is one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations). This field is omitted if the default GCP resource location has not been finalized yet. To set a Project’s default GCP resource location, call [`FinalizeDefaultLocation`](https://firebase.google.com/../projects.defaultLocation/finalize) after you add Firebase resources to the Project.
243    #[serde(rename = "locationId")]
244    pub location_id: Option<String>,
245    /// Immutable. A user-assigned unique identifier for the `FirebaseProject`. This identifier may appear in URLs or names for some Firebase resources associated with the Project, but it should generally be treated as a convenience alias to reference the Project.
246    #[serde(rename = "projectId")]
247    pub project_id: Option<String>,
248    /// **DEPRECATED.** _Instead, find the default Cloud Storage for Firebase bucket using the [list endpoint](https://firebase.google.com/docs/reference/rest/storage/rest/v1beta/projects.buckets/list) within the Cloud Storage for Firebase REST API. Note that the default bucket for the Project might not yet be provisioned, so the return might not contain a default bucket._ The default Cloud Storage for Firebase storage bucket name.
249    #[serde(rename = "storageBucket")]
250    pub storage_bucket: Option<String>,
251}
252
253impl common::ResponseResult for AdminSdkConfig {}
254
255/// There is no detailed description.
256///
257/// # Activities
258///
259/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
260/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
261///
262/// * [get analytics details projects](ProjectGetAnalyticsDetailCall) (response)
263#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
264#[serde_with::serde_as]
265#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
266pub struct AnalyticsDetails {
267    /// The Analytics Property object associated with the specified `FirebaseProject`. This object contains the details of the Google Analytics property associated with the Project.
268    #[serde(rename = "analyticsProperty")]
269    pub analytics_property: Option<AnalyticsProperty>,
270    ///  - For `AndroidApps` and `IosApps`: a map of `app` to `streamId` for each Firebase App in the specified `FirebaseProject`. Each `app` and `streamId` appears only once. - For `WebApps`: a map of `app` to `streamId` and `measurementId` for each `WebApp` in the specified `FirebaseProject`. Each `app`, `streamId`, and `measurementId` appears only once.
271    #[serde(rename = "streamMappings")]
272    pub stream_mappings: Option<Vec<StreamMapping>>,
273}
274
275impl common::ResponseResult for AnalyticsDetails {}
276
277/// Details of a Google Analytics property
278///
279/// This type is not used in any activity, and only used as *part* of another schema.
280///
281#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
282#[serde_with::serde_as]
283#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
284pub struct AnalyticsProperty {
285    /// Output only. The ID of the [Google Analytics account](https://www.google.com/analytics/) for the Google Analytics property associated with the specified FirebaseProject.
286    #[serde(rename = "analyticsAccountId")]
287    pub analytics_account_id: Option<String>,
288    /// The display name of the Google Analytics property associated with the specified `FirebaseProject`.
289    #[serde(rename = "displayName")]
290    pub display_name: Option<String>,
291    /// The globally unique, Google-assigned identifier of the Google Analytics property associated with the specified `FirebaseProject`. If you called [`AddGoogleAnalytics`](https://firebase.google.com/../../v1beta1/projects/addGoogleAnalytics) to link the `FirebaseProject` with a Google Analytics account, the value in this `id` field is the same as the ID of the property either specified or provisioned with that call to `AddGoogleAnalytics`.
292    pub id: Option<String>,
293}
294
295impl common::Part for AnalyticsProperty {}
296
297/// Details of a Firebase App for Android.
298///
299/// # Activities
300///
301/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
302/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
303///
304/// * [android apps create projects](ProjectAndroidAppCreateCall) (request)
305/// * [android apps get projects](ProjectAndroidAppGetCall) (response)
306/// * [android apps patch projects](ProjectAndroidAppPatchCall) (request|response)
307#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
308#[serde_with::serde_as]
309#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
310pub struct AndroidApp {
311    /// The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the `AndroidApp`. Be aware that this value is the UID of the API key, *not* the [`keyString`](https://cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key.FIELDS.key_string) of the API key. The `keyString` is the value that can be found in the App’s [configuration artifact](https://firebase.google.com/../../rest/v1beta1/projects.androidApps/getConfig). If `api_key_id` is not set in requests to [`androidApps.Create`](https://firebase.google.com/../../rest/v1beta1/projects.androidApps/create), then Firebase automatically associates an `api_key_id` with the `AndroidApp`. This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned. In patch requests, `api_key_id` cannot be set to an empty value, and the new UID must have no restrictions or only have restrictions that are valid for the associated `AndroidApp`. We recommend using the [Google Cloud Console](https://console.cloud.google.com/apis/credentials) to manage API keys.
312    #[serde(rename = "apiKeyId")]
313    pub api_key_id: Option<String>,
314    /// Output only. Immutable. The globally unique, Firebase-assigned identifier for the `AndroidApp`. This identifier should be treated as an opaque token, as the data format is not specified.
315    #[serde(rename = "appId")]
316    pub app_id: Option<String>,
317    /// The user-assigned display name for the `AndroidApp`.
318    #[serde(rename = "displayName")]
319    pub display_name: Option<String>,
320    /// This checksum is computed by the server based on the value of other fields, and it may be sent with update requests to ensure the client has an up-to-date value before proceeding. Learn more about `etag` in Google's [AIP-154 standard](https://google.aip.dev/154#declarative-friendly-resources). This etag is strongly validated.
321    pub etag: Option<String>,
322    /// Output only. Timestamp of when the App will be considered expired and cannot be undeleted. This value is only provided if the App is in the `DELETED` state.
323    #[serde(rename = "expireTime")]
324    pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
325    /// The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.app_id)).
326    pub name: Option<String>,
327    /// Immutable. The canonical package name of the Android app as would appear in the Google Play Developer Console.
328    #[serde(rename = "packageName")]
329    pub package_name: Option<String>,
330    /// Output only. Immutable. A user-assigned unique identifier of the parent FirebaseProject for the `AndroidApp`.
331    #[serde(rename = "projectId")]
332    pub project_id: Option<String>,
333    /// The SHA1 certificate hashes for the AndroidApp.
334    #[serde(rename = "sha1Hashes")]
335    pub sha1_hashes: Option<Vec<String>>,
336    /// The SHA256 certificate hashes for the AndroidApp.
337    #[serde(rename = "sha256Hashes")]
338    pub sha256_hashes: Option<Vec<String>>,
339    /// Output only. The lifecycle state of the App.
340    pub state: Option<String>,
341}
342
343impl common::RequestValue for AndroidApp {}
344impl common::ResponseResult for AndroidApp {}
345
346/// Configuration metadata of a single Firebase App for Android.
347///
348/// # Activities
349///
350/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
351/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
352///
353/// * [android apps get config projects](ProjectAndroidAppGetConfigCall) (response)
354#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
355#[serde_with::serde_as]
356#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
357pub struct AndroidAppConfig {
358    /// The contents of the JSON configuration file.
359    #[serde(rename = "configFileContents")]
360    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
361    pub config_file_contents: Option<Vec<u8>>,
362    /// The filename that the configuration artifact for the `AndroidApp` is typically saved as. For example: `google-services.json`
363    #[serde(rename = "configFilename")]
364    pub config_filename: Option<String>,
365}
366
367impl common::ResponseResult for AndroidAppConfig {}
368
369/// **DEPRECATED.** _Auto-provisioning of these resources is changing, so this object no longer reliably provides information about the resources within the Project. Instead, retrieve information about each resource directly from its resource-specific API._ The default auto-provisioned resources associated with the Project.
370///
371/// This type is not used in any activity, and only used as *part* of another schema.
372///
373#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
374#[serde_with::serde_as]
375#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
376pub struct DefaultResources {
377    /// Output only. **DEPRECATED.** _Instead, find the default Firebase Hosting site name using the [ListSites](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/projects.sites/list) within the Firebase Hosting REST API. Note that the default site for the Project might not yet be provisioned, so the return might not contain a default site._ The default Firebase Hosting site name, in the format: PROJECT_ID Though rare, your `projectId` might already be used as the name for an existing Hosting site in another project (learn more about creating non-default, [additional sites](https://firebase.google.com/docs/hosting/multisites)). In these cases, your `projectId` is appended with a hyphen then five alphanumeric characters to create your default Hosting site name. For example, if your `projectId` is `myproject123`, your default Hosting site name might be: `myproject123-a5c16`
378    #[serde(rename = "hostingSite")]
379    pub hosting_site: Option<String>,
380    /// Output only. **DEPRECATED.** *Instead, use product-specific REST APIs to find the location of resources.* The ID of the Project’s default GCP resource location. The location is one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations). This field is omitted if the default GCP resource location has not been finalized yet. To set a Project’s default GCP resource location, call [`FinalizeDefaultLocation`](https://firebase.google.com/../projects.defaultLocation/finalize) after you add Firebase resources to the Project.
381    #[serde(rename = "locationId")]
382    pub location_id: Option<String>,
383    /// Output only. **DEPRECATED.** _Instead, find the default Firebase Realtime Database instance name using the [list endpoint](https://firebase.google.com/docs/reference/rest/database/database-management/rest/v1beta/projects.locations.instances/list) within the Firebase Realtime Database REST API. Note that the default instance for the Project might not yet be provisioned, so the return might not contain a default instance._ The default Firebase Realtime Database instance name, in the format: PROJECT_ID Though rare, your `projectId` might already be used as the name for an existing Realtime Database instance in another project (learn more about [database sharding](https://firebase.google.com/docs/database/usage/sharding)). In these cases, your `projectId` is appended with a hyphen then five alphanumeric characters to create your default Realtime Database instance name. For example, if your `projectId` is `myproject123`, your default database instance name might be: `myproject123-a5c16`
384    #[serde(rename = "realtimeDatabaseInstance")]
385    pub realtime_database_instance: Option<String>,
386    /// Output only. **DEPRECATED.** _Instead, find the default Cloud Storage for Firebase bucket using the [list endpoint](https://firebase.google.com/docs/reference/rest/storage/rest/v1beta/projects.buckets/list) within the Cloud Storage for Firebase REST API. Note that the default bucket for the Project might not yet be provisioned, so the return might not contain a default bucket._ The default Cloud Storage for Firebase storage bucket, in the format: PROJECT_ID.appspot.com
387    #[serde(rename = "storageBucket")]
388    pub storage_bucket: Option<String>,
389}
390
391impl common::Part for DefaultResources {}
392
393/// 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); }
394///
395/// # Activities
396///
397/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
398/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
399///
400/// * [android apps sha delete projects](ProjectAndroidAppShaDeleteCall) (response)
401/// * [remove analytics projects](ProjectRemoveAnalyticCall) (response)
402#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
403#[serde_with::serde_as]
404#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
405pub struct Empty {
406    _never_set: Option<bool>,
407}
408
409impl common::ResponseResult for Empty {}
410
411/// There is no detailed description.
412///
413/// # Activities
414///
415/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
416/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
417///
418/// * [default location finalize projects](ProjectDefaultLocationFinalizeCall) (request)
419#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
420#[serde_with::serde_as]
421#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
422pub struct FinalizeDefaultLocationRequest {
423    /// The ID of the Project's default GCP resource location. The location must be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations).
424    #[serde(rename = "locationId")]
425    pub location_id: Option<String>,
426}
427
428impl common::RequestValue for FinalizeDefaultLocationRequest {}
429
430/// A high-level summary of an App.
431///
432/// This type is not used in any activity, and only used as *part* of another schema.
433///
434#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
435#[serde_with::serde_as]
436#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
437pub struct FirebaseAppInfo {
438    /// The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the App. Be aware that this value is the UID of the API key, *not* the [`keyString`](https://cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key.FIELDS.key_string) of the API key. The `keyString` is the value that can be found in the App’s configuration artifact ([`AndroidApp`](https://firebase.google.com/../../rest/v1beta1/projects.androidApps/getConfig) | [`IosApp`](https://firebase.google.com/../../rest/v1beta1/projects.iosApps/getConfig) | [`WebApp`](https://firebase.google.com/../../rest/v1beta1/projects.webApps/getConfig)). If `api_key_id` is not set in requests to create the App ([`AndroidApp`](https://firebase.google.com/../../rest/v1beta1/projects.androidApps/create) | [`IosApp`](https://firebase.google.com/../../rest/v1beta1/projects.iosApps/create) | [`WebApp`](https://firebase.google.com/../../rest/v1beta1/projects.webApps/create)), then Firebase automatically associates an `api_key_id` with the App. This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned.
439    #[serde(rename = "apiKeyId")]
440    pub api_key_id: Option<String>,
441    /// Output only. Immutable. The globally unique, Firebase-assigned identifier for the `WebApp`. This identifier should be treated as an opaque token, as the data format is not specified.
442    #[serde(rename = "appId")]
443    pub app_id: Option<String>,
444    /// The user-assigned display name of the Firebase App.
445    #[serde(rename = "displayName")]
446    pub display_name: Option<String>,
447    /// Output only. Timestamp of when the App will be considered expired and cannot be undeleted. This value is only provided if the App is in the `DELETED` state.
448    #[serde(rename = "expireTime")]
449    pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
450    /// The resource name of the Firebase App, in the format: projects/PROJECT_ID /iosApps/APP_ID or projects/PROJECT_ID/androidApps/APP_ID or projects/ PROJECT_ID/webApps/APP_ID
451    pub name: Option<String>,
452    /// Output only. Immutable. The platform-specific identifier of the App. *Note:* For most use cases, use `appId`, which is the canonical, globally unique identifier for referencing an App. This string is derived from a native identifier for each platform: `packageName` for an `AndroidApp`, `bundleId` for an `IosApp`, and `webId` for a `WebApp`. Its contents should be treated as opaque, as the native identifier format may change as platforms evolve. This string is only unique within a `FirebaseProject` and its associated Apps.
453    pub namespace: Option<String>,
454    /// The platform of the Firebase App.
455    pub platform: Option<String>,
456    /// Output only. The lifecycle state of the App.
457    pub state: Option<String>,
458}
459
460impl common::Part for FirebaseAppInfo {}
461
462/// A `FirebaseProject` is the top-level Firebase entity. It is the container for Firebase Apps, Firebase Hosting sites, storage systems (Firebase Realtime Database, Cloud Firestore, Cloud Storage buckets), and other Firebase and Google Cloud Platform (GCP) resources. You create a `FirebaseProject` by calling AddFirebase and specifying an *existing* [GCP `Project`](https://cloud.google.com/resource-manager/reference/rest/v1/projects). This adds Firebase resources to the existing GCP `Project`. Since a FirebaseProject is actually also a GCP `Project`, a `FirebaseProject` has the same underlying GCP identifiers (`projectNumber` and `projectId`). This allows for easy interop with Google APIs.
463///
464/// # Activities
465///
466/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
467/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
468///
469/// * [get projects](ProjectGetCall) (response)
470/// * [patch projects](ProjectPatchCall) (request|response)
471#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
472#[serde_with::serde_as]
473#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
474pub struct FirebaseProject {
475    /// A set of user-defined annotations for the FirebaseProject. Learn more about annotations in Google's [AIP-128 standard](https://google.aip.dev/128#annotations). These annotations are intended solely for developers and client-side tools. Firebase services will not mutate this annotations set.
476    pub annotations: Option<HashMap<String, String>>,
477    /// The user-assigned display name of the Project.
478    #[serde(rename = "displayName")]
479    pub display_name: Option<String>,
480    /// This checksum is computed by the server based on the value of other fields, and it may be sent with update requests to ensure the client has an up-to-date value before proceeding. Learn more about `etag` in Google's [AIP-154 standard](https://google.aip.dev/154#declarative-friendly-resources). This etag is strongly validated.
481    pub etag: Option<String>,
482    /// The resource name of the Project, in the format: projects/PROJECT_IDENTIFIER PROJECT_IDENTIFIER: the Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`.
483    pub name: Option<String>,
484    /// Output only. Immutable. A user-assigned unique identifier for the Project. This identifier may appear in URLs or names for some Firebase resources associated with the Project, but it should generally be treated as a convenience alias to reference the Project.
485    #[serde(rename = "projectId")]
486    pub project_id: Option<String>,
487    /// Output only. Immutable. The globally unique, Google-assigned canonical identifier for the Project. Use this identifier when configuring integrations and/or making API calls to Firebase or third-party services.
488    #[serde(rename = "projectNumber")]
489    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
490    pub project_number: Option<i64>,
491    /// Output only. **DEPRECATED.** _Auto-provisioning of these resources is changing, so this object no longer reliably provides information about the Project. Instead, retrieve information about each resource directly from its resource-specific API._ The default Firebase resources associated with the Project.
492    pub resources: Option<DefaultResources>,
493    /// Output only. The lifecycle state of the Project.
494    pub state: Option<String>,
495}
496
497impl common::RequestValue for FirebaseProject {}
498impl common::ResponseResult for FirebaseProject {}
499
500/// Details of a Firebase App for iOS.
501///
502/// # Activities
503///
504/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
505/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
506///
507/// * [ios apps create projects](ProjectIosAppCreateCall) (request)
508/// * [ios apps get projects](ProjectIosAppGetCall) (response)
509/// * [ios apps patch projects](ProjectIosAppPatchCall) (request|response)
510#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
511#[serde_with::serde_as]
512#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
513pub struct IosApp {
514    /// The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the `IosApp`. Be aware that this value is the UID of the API key, *not* the [`keyString`](https://cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key.FIELDS.key_string) of the API key. The `keyString` is the value that can be found in the App’s [configuration artifact](https://firebase.google.com/../../rest/v1beta1/projects.iosApps/getConfig). If `api_key_id` is not set in requests to [`iosApps.Create`](https://firebase.google.com/../../rest/v1beta1/projects.iosApps/create), then Firebase automatically associates an `api_key_id` with the `IosApp`. This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned. In patch requests, `api_key_id` cannot be set to an empty value, and the new UID must have no restrictions or only have restrictions that are valid for the associated `IosApp`. We recommend using the [Google Cloud Console](https://console.cloud.google.com/apis/credentials) to manage API keys.
515    #[serde(rename = "apiKeyId")]
516    pub api_key_id: Option<String>,
517    /// Output only. Immutable. The globally unique, Firebase-assigned identifier for the `IosApp`. This identifier should be treated as an opaque token, as the data format is not specified.
518    #[serde(rename = "appId")]
519    pub app_id: Option<String>,
520    /// The automatically generated Apple ID assigned to the iOS app by Apple in the iOS App Store.
521    #[serde(rename = "appStoreId")]
522    pub app_store_id: Option<String>,
523    /// Immutable. The canonical bundle ID of the iOS app as it would appear in the iOS AppStore.
524    #[serde(rename = "bundleId")]
525    pub bundle_id: Option<String>,
526    /// The user-assigned display name for the `IosApp`.
527    #[serde(rename = "displayName")]
528    pub display_name: Option<String>,
529    /// This checksum is computed by the server based on the value of other fields, and it may be sent with update requests to ensure the client has an up-to-date value before proceeding. Learn more about `etag` in Google's [AIP-154 standard](https://google.aip.dev/154#declarative-friendly-resources). This etag is strongly validated.
530    pub etag: Option<String>,
531    /// Output only. Timestamp of when the App will be considered expired and cannot be undeleted. This value is only provided if the App is in the `DELETED` state.
532    #[serde(rename = "expireTime")]
533    pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
534    /// The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.app_id)).
535    pub name: Option<String>,
536    /// Output only. Immutable. A user-assigned unique identifier of the parent FirebaseProject for the `IosApp`.
537    #[serde(rename = "projectId")]
538    pub project_id: Option<String>,
539    /// Output only. The lifecycle state of the App.
540    pub state: Option<String>,
541    /// The Apple Developer Team ID associated with the App in the App Store.
542    #[serde(rename = "teamId")]
543    pub team_id: Option<String>,
544}
545
546impl common::RequestValue for IosApp {}
547impl common::ResponseResult for IosApp {}
548
549/// Configuration metadata of a single Firebase App for iOS.
550///
551/// # Activities
552///
553/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
554/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
555///
556/// * [ios apps get config projects](ProjectIosAppGetConfigCall) (response)
557#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
558#[serde_with::serde_as]
559#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
560pub struct IosAppConfig {
561    /// The content of the XML configuration file.
562    #[serde(rename = "configFileContents")]
563    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
564    pub config_file_contents: Option<Vec<u8>>,
565    /// The filename that the configuration artifact for the `IosApp` is typically saved as. For example: `GoogleService-Info.plist`
566    #[serde(rename = "configFilename")]
567    pub config_filename: Option<String>,
568}
569
570impl common::ResponseResult for IosAppConfig {}
571
572/// There is no detailed description.
573///
574/// # Activities
575///
576/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
577/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
578///
579/// * [android apps list projects](ProjectAndroidAppListCall) (response)
580#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
581#[serde_with::serde_as]
582#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
583pub struct ListAndroidAppsResponse {
584    /// List of each `AndroidApp` associated with the specified `FirebaseProject`.
585    pub apps: Option<Vec<AndroidApp>>,
586    /// If the result list is too large to fit in a single response, then a token is returned. If the string is empty, then this response is the last page of results. This token can be used in a subsequent call to `ListAndroidApps` to find the next group of Apps. Page tokens are short-lived and should not be persisted.
587    #[serde(rename = "nextPageToken")]
588    pub next_page_token: Option<String>,
589}
590
591impl common::ResponseResult for ListAndroidAppsResponse {}
592
593/// There is no detailed description.
594///
595/// # Activities
596///
597/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
598/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
599///
600/// * [available locations list projects](ProjectAvailableLocationListCall) (response)
601#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
602#[serde_with::serde_as]
603#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
604pub struct ListAvailableLocationsResponse {
605    /// One page of results from a call to `ListAvailableLocations`.
606    pub locations: Option<Vec<Location>>,
607    /// If the result list is too large to fit in a single response, then a token is returned. If the string is empty, then this response is the last page of results and all available locations have been listed. This token can be used in a subsequent call to `ListAvailableLocations` to find more locations. Page tokens are short-lived and should not be persisted.
608    #[serde(rename = "nextPageToken")]
609    pub next_page_token: Option<String>,
610}
611
612impl common::ResponseResult for ListAvailableLocationsResponse {}
613
614/// There is no detailed description.
615///
616/// # Activities
617///
618/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
619/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
620///
621/// * [list available projects](AvailableProjectListCall) (response)
622#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
623#[serde_with::serde_as]
624#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
625pub struct ListAvailableProjectsResponse {
626    /// If the result list is too large to fit in a single response, then a token is returned. If the string is empty, then this response is the last page of results. This token can be used in a subsequent calls to `ListAvailableProjects` to find the next group of Projects. Page tokens are short-lived and should not be persisted.
627    #[serde(rename = "nextPageToken")]
628    pub next_page_token: Option<String>,
629    /// The list of GCP `Projects` which can have Firebase resources added to them.
630    #[serde(rename = "projectInfo")]
631    pub project_info: Option<Vec<ProjectInfo>>,
632}
633
634impl common::ResponseResult for ListAvailableProjectsResponse {}
635
636/// There is no detailed description.
637///
638/// # Activities
639///
640/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
641/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
642///
643/// * [list projects](ProjectListCall) (response)
644#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
645#[serde_with::serde_as]
646#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
647pub struct ListFirebaseProjectsResponse {
648    /// If the result list is too large to fit in a single response, then a token is returned. If the string is empty, then this response is the last page of results. This token can be used in a subsequent calls to `ListFirebaseProjects` to find the next group of Projects. Page tokens are short-lived and should not be persisted.
649    #[serde(rename = "nextPageToken")]
650    pub next_page_token: Option<String>,
651    /// One page of the list of Projects that are accessible to the caller.
652    pub results: Option<Vec<FirebaseProject>>,
653}
654
655impl common::ResponseResult for ListFirebaseProjectsResponse {}
656
657/// There is no detailed description.
658///
659/// # Activities
660///
661/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
662/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
663///
664/// * [ios apps list projects](ProjectIosAppListCall) (response)
665#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
666#[serde_with::serde_as]
667#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
668pub struct ListIosAppsResponse {
669    /// List of each `IosApp` associated with the specified `FirebaseProject`.
670    pub apps: Option<Vec<IosApp>>,
671    /// If the result list is too large to fit in a single response, then a token is returned. If the string is empty, then this response is the last page of results. This token can be used in a subsequent call to `ListIosApps` to find the next group of Apps. Page tokens are short-lived and should not be persisted.
672    #[serde(rename = "nextPageToken")]
673    pub next_page_token: Option<String>,
674}
675
676impl common::ResponseResult for ListIosAppsResponse {}
677
678/// There is no detailed description.
679///
680/// # Activities
681///
682/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
683/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
684///
685/// * [android apps sha list projects](ProjectAndroidAppShaListCall) (response)
686#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
687#[serde_with::serde_as]
688#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
689pub struct ListShaCertificatesResponse {
690    /// The list of each `ShaCertificate` associated with the `AndroidApp`.
691    pub certificates: Option<Vec<ShaCertificate>>,
692}
693
694impl common::ResponseResult for ListShaCertificatesResponse {}
695
696/// There is no detailed description.
697///
698/// # Activities
699///
700/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
701/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
702///
703/// * [web apps list projects](ProjectWebAppListCall) (response)
704#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
705#[serde_with::serde_as]
706#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
707pub struct ListWebAppsResponse {
708    /// List of each `WebApp` associated with the specified `FirebaseProject`.
709    pub apps: Option<Vec<WebApp>>,
710    /// If the result list is too large to fit in a single response, then a token is returned. If the string is empty, then this response is the last page of results. This token can be used in a subsequent call to `ListWebApps` to find the next group of Apps. Page tokens are short-lived and should not be persisted.
711    #[serde(rename = "nextPageToken")]
712    pub next_page_token: Option<String>,
713}
714
715impl common::ResponseResult for ListWebAppsResponse {}
716
717/// **DEPRECATED.** _This Location is no longer used to determine Firebase resource locations. Instead, consult product documentation to determine valid locations for each resource used in your Project._ A GCP resource location that can be selected for a FirebaseProject.
718///
719/// This type is not used in any activity, and only used as *part* of another schema.
720///
721#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
722#[serde_with::serde_as]
723#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
724pub struct Location {
725    /// Products and services that are available in the GCP resource location.
726    pub features: Option<Vec<String>>,
727    /// The ID of the GCP resource location. It will be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations#types).
728    #[serde(rename = "locationId")]
729    pub location_id: Option<String>,
730    /// Indicates whether the GCP resource location is a [regional or multi-regional location](https://firebase.google.com/docs/projects/locations#types) for data replication.
731    #[serde(rename = "type")]
732    pub type_: Option<String>,
733}
734
735impl common::Part for Location {}
736
737/// This resource represents a long-running operation that is the result of a network API call.
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/// * [get operations](OperationGetCall) (response)
745/// * [android apps create projects](ProjectAndroidAppCreateCall) (response)
746/// * [android apps remove projects](ProjectAndroidAppRemoveCall) (response)
747/// * [android apps undelete projects](ProjectAndroidAppUndeleteCall) (response)
748/// * [default location finalize projects](ProjectDefaultLocationFinalizeCall) (response)
749/// * [ios apps create projects](ProjectIosAppCreateCall) (response)
750/// * [ios apps remove projects](ProjectIosAppRemoveCall) (response)
751/// * [ios apps undelete projects](ProjectIosAppUndeleteCall) (response)
752/// * [web apps create projects](ProjectWebAppCreateCall) (response)
753/// * [web apps remove projects](ProjectWebAppRemoveCall) (response)
754/// * [web apps undelete projects](ProjectWebAppUndeleteCall) (response)
755/// * [add firebase projects](ProjectAddFirebaseCall) (response)
756/// * [add google analytics projects](ProjectAddGoogleAnalyticCall) (response)
757#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
758#[serde_with::serde_as]
759#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
760pub struct Operation {
761    /// 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.
762    pub done: Option<bool>,
763    /// The error result of the operation in case of failure or cancellation.
764    pub error: Option<Status>,
765    /// 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.
766    pub metadata: Option<HashMap<String, serde_json::Value>>,
767    /// 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}`.
768    pub name: Option<String>,
769    /// 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`.
770    pub response: Option<HashMap<String, serde_json::Value>>,
771}
772
773impl common::Resource for Operation {}
774impl common::ResponseResult for Operation {}
775
776/// A reference to a Google Cloud Platform (GCP) `Project`.
777///
778/// This type is not used in any activity, and only used as *part* of another schema.
779///
780#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
781#[serde_with::serde_as]
782#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
783pub struct ProjectInfo {
784    /// The user-assigned display name of the GCP `Project`, for example: `My App`
785    #[serde(rename = "displayName")]
786    pub display_name: Option<String>,
787    /// The ID of the Project’s default GCP resource location. The location is one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations). Not all Projects will have this field populated. If it is not populated, it means that the Project does not yet have a default GCP resource location. To set a Project’s default GCP resource location, call [`FinalizeDefaultLocation`](https://firebase.google.com/../projects.defaultLocation/finalize) after you add Firebase resources to the Project.
788    #[serde(rename = "locationId")]
789    pub location_id: Option<String>,
790    /// The resource name of the GCP `Project` to which Firebase resources can be added, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
791    pub project: Option<String>,
792}
793
794impl common::Part for ProjectInfo {}
795
796/// There is no detailed description.
797///
798/// # Activities
799///
800/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
801/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
802///
803/// * [remove analytics projects](ProjectRemoveAnalyticCall) (request)
804#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
805#[serde_with::serde_as]
806#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
807pub struct RemoveAnalyticsRequest {
808    /// Optional. The ID of the Google Analytics property associated with the specified `FirebaseProject`. - If not set, then the Google Analytics property that is currently associated with the specified `FirebaseProject` is removed. - If set, and the specified `FirebaseProject` is currently associated with a *different* Google Analytics property, then the response is a `412 Precondition Failed` error.
809    #[serde(rename = "analyticsPropertyId")]
810    pub analytics_property_id: Option<String>,
811}
812
813impl common::RequestValue for RemoveAnalyticsRequest {}
814
815/// There is no detailed description.
816///
817/// # Activities
818///
819/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
820/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
821///
822/// * [android apps remove projects](ProjectAndroidAppRemoveCall) (request)
823#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
824#[serde_with::serde_as]
825#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
826pub struct RemoveAndroidAppRequest {
827    /// If set to true, and the App is not found, the request will succeed but no action will be taken on the server.
828    #[serde(rename = "allowMissing")]
829    pub allow_missing: Option<bool>,
830    /// Checksum provided in the AndroidApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
831    pub etag: Option<String>,
832    /// Determines whether to _immediately_ delete the AndroidApp. If set to true, the App is immediately deleted from the Project and cannot be restored to the Project. If not set, defaults to false, which means the App will be set to expire in 30 days. Within the 30 days, the App may be restored to the Project using UndeleteAndroidApp.
833    pub immediate: Option<bool>,
834    /// If set to true, the request is only validated. The App will _not_ be removed.
835    #[serde(rename = "validateOnly")]
836    pub validate_only: Option<bool>,
837}
838
839impl common::RequestValue for RemoveAndroidAppRequest {}
840
841/// There is no detailed description.
842///
843/// # Activities
844///
845/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
846/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
847///
848/// * [ios apps remove projects](ProjectIosAppRemoveCall) (request)
849#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
850#[serde_with::serde_as]
851#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
852pub struct RemoveIosAppRequest {
853    /// If set to true, and the App is not found, the request will succeed but no action will be taken on the server.
854    #[serde(rename = "allowMissing")]
855    pub allow_missing: Option<bool>,
856    /// Checksum provided in the IosApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
857    pub etag: Option<String>,
858    /// Determines whether to _immediately_ delete the IosApp. If set to true, the App is immediately deleted from the Project and cannot be restored to the Project. If not set, defaults to false, which means the App will be set to expire in 30 days. Within the 30 days, the App may be restored to the Project using UndeleteIosApp
859    pub immediate: Option<bool>,
860    /// If set to true, the request is only validated. The App will _not_ be removed.
861    #[serde(rename = "validateOnly")]
862    pub validate_only: Option<bool>,
863}
864
865impl common::RequestValue for RemoveIosAppRequest {}
866
867/// There is no detailed description.
868///
869/// # Activities
870///
871/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
872/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
873///
874/// * [web apps remove projects](ProjectWebAppRemoveCall) (request)
875#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
876#[serde_with::serde_as]
877#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
878pub struct RemoveWebAppRequest {
879    /// If set to true, and the App is not found, the request will succeed but no action will be taken on the server.
880    #[serde(rename = "allowMissing")]
881    pub allow_missing: Option<bool>,
882    /// Checksum provided in the WebApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
883    pub etag: Option<String>,
884    /// Determines whether to _immediately_ delete the WebApp. If set to true, the App is immediately deleted from the Project and cannot be restored to the Project. If not set, defaults to false, which means the App will be set to expire in 30 days. Within the 30 days, the App may be restored to the Project using UndeleteWebApp
885    pub immediate: Option<bool>,
886    /// If set to true, the request is only validated. The App will _not_ be removed.
887    #[serde(rename = "validateOnly")]
888    pub validate_only: Option<bool>,
889}
890
891impl common::RequestValue for RemoveWebAppRequest {}
892
893/// There is no detailed description.
894///
895/// # Activities
896///
897/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
898/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
899///
900/// * [search apps projects](ProjectSearchAppCall) (response)
901#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
902#[serde_with::serde_as]
903#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
904pub struct SearchFirebaseAppsResponse {
905    /// One page of results from a call to `SearchFirebaseApps`.
906    pub apps: Option<Vec<FirebaseAppInfo>>,
907    /// If the result list is too large to fit in a single response, then a token is returned. This token can be used in a subsequent calls to `SearchFirebaseApps` to find the next group of Apps. Page tokens are short-lived and should not be persisted.
908    #[serde(rename = "nextPageToken")]
909    pub next_page_token: Option<String>,
910}
911
912impl common::ResponseResult for SearchFirebaseAppsResponse {}
913
914/// A SHA-1 or SHA-256 certificate associated with the AndroidApp.
915///
916/// # Activities
917///
918/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
919/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
920///
921/// * [android apps sha create projects](ProjectAndroidAppShaCreateCall) (request|response)
922#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
923#[serde_with::serde_as]
924#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
925pub struct ShaCertificate {
926    /// The type of SHA certificate encoded in the hash.
927    #[serde(rename = "certType")]
928    pub cert_type: Option<String>,
929    /// The resource name of the ShaCertificate for the AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID/sha/SHA_HASH * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.app_id)). * SHA_HASH: the certificate hash for the App (see [`shaHash`](https://firebase.google.com/../projects.androidApps.sha#ShaCertificate.FIELDS.sha_hash)).
930    pub name: Option<String>,
931    /// The certificate hash for the `AndroidApp`.
932    #[serde(rename = "shaHash")]
933    pub sha_hash: Option<String>,
934}
935
936impl common::RequestValue for ShaCertificate {}
937impl common::ResponseResult for ShaCertificate {}
938
939/// 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).
940///
941/// This type is not used in any activity, and only used as *part* of another schema.
942///
943#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
944#[serde_with::serde_as]
945#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
946pub struct Status {
947    /// The status code, which should be an enum value of google.rpc.Code.
948    pub code: Option<i32>,
949    /// A list of messages that carry the error details. There is a common set of message types for APIs to use.
950    pub details: Option<Vec<HashMap<String, serde_json::Value>>>,
951    /// 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.
952    pub message: Option<String>,
953}
954
955impl common::Part for Status {}
956
957/// A mapping of a Firebase App to a Google Analytics data stream
958///
959/// This type is not used in any activity, and only used as *part* of another schema.
960///
961#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
962#[serde_with::serde_as]
963#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
964pub struct StreamMapping {
965    /// The resource name of the Firebase App associated with the Google Analytics data stream, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID or projects/PROJECT_IDENTIFIER/iosApps/APP_ID or projects/PROJECT_IDENTIFIER /webApps/APP_ID Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
966    pub app: Option<String>,
967    /// Applicable for Firebase Web Apps only. The unique Google-assigned identifier of the Google Analytics web stream associated with the Firebase Web App. Firebase SDKs use this ID to interact with Google Analytics APIs. Learn more about this ID and Google Analytics web streams in the [Analytics documentation](https://support.google.com/analytics/answer/9304153).
968    #[serde(rename = "measurementId")]
969    pub measurement_id: Option<String>,
970    /// The unique Google-assigned identifier of the Google Analytics data stream associated with the Firebase App. Learn more about Google Analytics data streams in the [Analytics documentation](https://support.google.com/analytics/answer/9303323).
971    #[serde(rename = "streamId")]
972    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
973    pub stream_id: Option<i64>,
974}
975
976impl common::Part for StreamMapping {}
977
978/// There is no detailed description.
979///
980/// # Activities
981///
982/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
983/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
984///
985/// * [android apps undelete projects](ProjectAndroidAppUndeleteCall) (request)
986#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
987#[serde_with::serde_as]
988#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
989pub struct UndeleteAndroidAppRequest {
990    /// Checksum provided in the AndroidApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
991    pub etag: Option<String>,
992    /// If set to true, the request is only validated. The App will _not_ be undeleted.
993    #[serde(rename = "validateOnly")]
994    pub validate_only: Option<bool>,
995}
996
997impl common::RequestValue for UndeleteAndroidAppRequest {}
998
999/// There is no detailed description.
1000///
1001/// # Activities
1002///
1003/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1004/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1005///
1006/// * [ios apps undelete projects](ProjectIosAppUndeleteCall) (request)
1007#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1008#[serde_with::serde_as]
1009#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1010pub struct UndeleteIosAppRequest {
1011    /// Checksum provided in the IosApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
1012    pub etag: Option<String>,
1013    /// If set to true, the request is only validated. The App will _not_ be undeleted.
1014    #[serde(rename = "validateOnly")]
1015    pub validate_only: Option<bool>,
1016}
1017
1018impl common::RequestValue for UndeleteIosAppRequest {}
1019
1020/// There is no detailed description.
1021///
1022/// # Activities
1023///
1024/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1025/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1026///
1027/// * [web apps undelete projects](ProjectWebAppUndeleteCall) (request)
1028#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1029#[serde_with::serde_as]
1030#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1031pub struct UndeleteWebAppRequest {
1032    /// Checksum provided in the WebApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
1033    pub etag: Option<String>,
1034    /// If set to true, the request is only validated. The App will _not_ be undeleted.
1035    #[serde(rename = "validateOnly")]
1036    pub validate_only: Option<bool>,
1037}
1038
1039impl common::RequestValue for UndeleteWebAppRequest {}
1040
1041/// Details of a Firebase App for the web.
1042///
1043/// # Activities
1044///
1045/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1046/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1047///
1048/// * [web apps create projects](ProjectWebAppCreateCall) (request)
1049/// * [web apps get projects](ProjectWebAppGetCall) (response)
1050/// * [web apps patch projects](ProjectWebAppPatchCall) (request|response)
1051#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1052#[serde_with::serde_as]
1053#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1054pub struct WebApp {
1055    /// The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the `WebApp`. Be aware that this value is the UID of the API key, *not* the [`keyString`](https://cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key.FIELDS.key_string) of the API key. The `keyString` is the value that can be found in the App’s [configuration artifact](https://firebase.google.com/../../rest/v1beta1/projects.webApps/getConfig). If `api_key_id` is not set in requests to [`webApps.Create`](https://firebase.google.com/../../rest/v1beta1/projects.webApps/create), then Firebase automatically associates an `api_key_id` with the `WebApp`. This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned. In patch requests, `api_key_id` cannot be set to an empty value, and the new UID must have no restrictions or only have restrictions that are valid for the associated `WebApp`. We recommend using the [Google Cloud Console](https://console.cloud.google.com/apis/credentials) to manage API keys.
1056    #[serde(rename = "apiKeyId")]
1057    pub api_key_id: Option<String>,
1058    /// Output only. Immutable. The globally unique, Firebase-assigned identifier for the `WebApp`. This identifier should be treated as an opaque token, as the data format is not specified.
1059    #[serde(rename = "appId")]
1060    pub app_id: Option<String>,
1061    /// The URLs where the `WebApp` is hosted.
1062    #[serde(rename = "appUrls")]
1063    pub app_urls: Option<Vec<String>>,
1064    /// The user-assigned display name for the `WebApp`.
1065    #[serde(rename = "displayName")]
1066    pub display_name: Option<String>,
1067    /// This checksum is computed by the server based on the value of other fields, and it may be sent with update requests to ensure the client has an up-to-date value before proceeding. Learn more about `etag` in Google's [AIP-154 standard](https://google.aip.dev/154#declarative-friendly-resources). This etag is strongly validated.
1068    pub etag: Option<String>,
1069    /// Output only. Timestamp of when the App will be considered expired and cannot be undeleted. This value is only provided if the App is in the `DELETED` state.
1070    #[serde(rename = "expireTime")]
1071    pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1072    /// The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.app_id)).
1073    pub name: Option<String>,
1074    /// Output only. Immutable. A user-assigned unique identifier of the parent FirebaseProject for the `WebApp`.
1075    #[serde(rename = "projectId")]
1076    pub project_id: Option<String>,
1077    /// Output only. The lifecycle state of the App.
1078    pub state: Option<String>,
1079    /// Output only. Immutable. A unique, Firebase-assigned identifier for the `WebApp`. This identifier is only used to populate the `namespace` value for the `WebApp`. For most use cases, use `appId` to identify or reference the App. The `webId` value is only unique within a `FirebaseProject` and its associated Apps.
1080    #[serde(rename = "webId")]
1081    pub web_id: Option<String>,
1082}
1083
1084impl common::RequestValue for WebApp {}
1085impl common::ResponseResult for WebApp {}
1086
1087/// Configuration metadata of a single Firebase App for the web.
1088///
1089/// # Activities
1090///
1091/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1092/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1093///
1094/// * [web apps get config projects](ProjectWebAppGetConfigCall) (response)
1095#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1096#[serde_with::serde_as]
1097#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1098pub struct WebAppConfig {
1099    /// The [`keyString`](https://cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key.FIELDS.key_string) of the API key associated with the `WebApp`. Note that this value is *not* the [`apiKeyId`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.api_key_id) (the UID) of the API key associated with the `WebApp`.
1100    #[serde(rename = "apiKey")]
1101    pub api_key: Option<String>,
1102    /// Immutable. The globally unique, Firebase-assigned identifier for the `WebApp`.
1103    #[serde(rename = "appId")]
1104    pub app_id: Option<String>,
1105    /// The domain Firebase Auth configures for OAuth redirects, in the format: PROJECT_ID.firebaseapp.com
1106    #[serde(rename = "authDomain")]
1107    pub auth_domain: Option<String>,
1108    /// **DEPRECATED.** _Instead, find the default Firebase Realtime Database instance name using the [list endpoint](https://firebase.google.com/docs/reference/rest/database/database-management/rest/v1beta/projects.locations.instances/list) within the Firebase Realtime Database REST API. Note that the default instance for the Project might not yet be provisioned, so the return might not contain a default instance._ The default Firebase Realtime Database URL.
1109    #[serde(rename = "databaseURL")]
1110    pub database_url: Option<String>,
1111    /// **DEPRECATED.** *Instead, use product-specific REST APIs to find the location of resources.* The ID of the Project’s default GCP resource location. The location is one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations). This field is omitted if the default GCP resource location has not been finalized yet. To set a Project’s default GCP resource location, call [`FinalizeDefaultLocation`](https://firebase.google.com/../projects.defaultLocation/finalize) after you add Firebase resources to the Project.
1112    #[serde(rename = "locationId")]
1113    pub location_id: Option<String>,
1114    /// The unique Google-assigned identifier of the Google Analytics web stream associated with the `WebApp`. Firebase SDKs use this ID to interact with Google Analytics APIs. This field is only present if the `WebApp` is linked to a web stream in a Google Analytics App + Web property. Learn more about this ID and Google Analytics web streams in the [Analytics documentation](https://support.google.com/analytics/answer/9304153). To generate a `measurementId` and link the `WebApp` with a Google Analytics web stream, call [`AddGoogleAnalytics`](https://firebase.google.com/../../v1beta1/projects/addGoogleAnalytics). For apps using the Firebase JavaScript SDK v7.20.0 and later, Firebase dynamically fetches the `measurementId` when your app initializes Analytics. Having this ID in your config object is optional, but it does serve as a fallback in the rare case that the dynamic fetch fails.
1115    #[serde(rename = "measurementId")]
1116    pub measurement_id: Option<String>,
1117    /// The sender ID for use with Firebase Cloud Messaging.
1118    #[serde(rename = "messagingSenderId")]
1119    pub messaging_sender_id: Option<String>,
1120    /// Immutable. A user-assigned unique identifier for the `FirebaseProject`.
1121    #[serde(rename = "projectId")]
1122    pub project_id: Option<String>,
1123    /// **DEPRECATED.** _Instead, find the default Cloud Storage for Firebase bucket using the [list endpoint](https://firebase.google.com/docs/reference/rest/storage/rest/v1beta/projects.buckets/list) within the Cloud Storage for Firebase REST API. Note that the default bucket for the Project might not yet be provisioned, so the return might not contain a default bucket._ The default Cloud Storage for Firebase storage bucket name.
1124    #[serde(rename = "storageBucket")]
1125    pub storage_bucket: Option<String>,
1126}
1127
1128impl common::ResponseResult for WebAppConfig {}
1129
1130// ###################
1131// MethodBuilders ###
1132// #################
1133
1134/// A builder providing access to all methods supported on *availableProject* resources.
1135/// It is not used directly, but through the [`FirebaseManagement`] hub.
1136///
1137/// # Example
1138///
1139/// Instantiate a resource builder
1140///
1141/// ```test_harness,no_run
1142/// extern crate hyper;
1143/// extern crate hyper_rustls;
1144/// extern crate google_firebase1_beta1 as firebase1_beta1;
1145///
1146/// # async fn dox() {
1147/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1148///
1149/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1150/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1151///     secret,
1152///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1153/// ).build().await.unwrap();
1154///
1155/// let client = hyper_util::client::legacy::Client::builder(
1156///     hyper_util::rt::TokioExecutor::new()
1157/// )
1158/// .build(
1159///     hyper_rustls::HttpsConnectorBuilder::new()
1160///         .with_native_roots()
1161///         .unwrap()
1162///         .https_or_http()
1163///         .enable_http1()
1164///         .build()
1165/// );
1166/// let mut hub = FirebaseManagement::new(client, auth);
1167/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1168/// // like `list(...)`
1169/// // to build up your call.
1170/// let rb = hub.available_projects();
1171/// # }
1172/// ```
1173pub struct AvailableProjectMethods<'a, C>
1174where
1175    C: 'a,
1176{
1177    hub: &'a FirebaseManagement<C>,
1178}
1179
1180impl<'a, C> common::MethodsBuilder for AvailableProjectMethods<'a, C> {}
1181
1182impl<'a, C> AvailableProjectMethods<'a, C> {
1183    /// Create a builder to help you perform the following task:
1184    ///
1185    /// Lists each [Google Cloud Platform (GCP) `Project`] (https://cloud.google.com/resource-manager/reference/rest/v1/projects) that can have Firebase resources added to it. A Project will only be listed if: - The caller has sufficient [Google IAM](https://cloud.google.com/iam) permissions to call AddFirebase. - The Project is not already a FirebaseProject. - The Project is not in an Organization which has policies that prevent Firebase resources from being added.
1186    pub fn list(&self) -> AvailableProjectListCall<'a, C> {
1187        AvailableProjectListCall {
1188            hub: self.hub,
1189            _page_token: Default::default(),
1190            _page_size: Default::default(),
1191            _delegate: Default::default(),
1192            _additional_params: Default::default(),
1193            _scopes: Default::default(),
1194        }
1195    }
1196}
1197
1198/// A builder providing access to all methods supported on *operation* resources.
1199/// It is not used directly, but through the [`FirebaseManagement`] hub.
1200///
1201/// # Example
1202///
1203/// Instantiate a resource builder
1204///
1205/// ```test_harness,no_run
1206/// extern crate hyper;
1207/// extern crate hyper_rustls;
1208/// extern crate google_firebase1_beta1 as firebase1_beta1;
1209///
1210/// # async fn dox() {
1211/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1212///
1213/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1214/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1215///     secret,
1216///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1217/// ).build().await.unwrap();
1218///
1219/// let client = hyper_util::client::legacy::Client::builder(
1220///     hyper_util::rt::TokioExecutor::new()
1221/// )
1222/// .build(
1223///     hyper_rustls::HttpsConnectorBuilder::new()
1224///         .with_native_roots()
1225///         .unwrap()
1226///         .https_or_http()
1227///         .enable_http1()
1228///         .build()
1229/// );
1230/// let mut hub = FirebaseManagement::new(client, auth);
1231/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1232/// // like `get(...)`
1233/// // to build up your call.
1234/// let rb = hub.operations();
1235/// # }
1236/// ```
1237pub struct OperationMethods<'a, C>
1238where
1239    C: 'a,
1240{
1241    hub: &'a FirebaseManagement<C>,
1242}
1243
1244impl<'a, C> common::MethodsBuilder for OperationMethods<'a, C> {}
1245
1246impl<'a, C> OperationMethods<'a, C> {
1247    /// Create a builder to help you perform the following task:
1248    ///
1249    /// 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.
1250    ///
1251    /// # Arguments
1252    ///
1253    /// * `name` - The name of the operation resource.
1254    pub fn get(&self, name: &str) -> OperationGetCall<'a, C> {
1255        OperationGetCall {
1256            hub: self.hub,
1257            _name: name.to_string(),
1258            _delegate: Default::default(),
1259            _additional_params: Default::default(),
1260            _scopes: Default::default(),
1261        }
1262    }
1263}
1264
1265/// A builder providing access to all methods supported on *project* resources.
1266/// It is not used directly, but through the [`FirebaseManagement`] hub.
1267///
1268/// # Example
1269///
1270/// Instantiate a resource builder
1271///
1272/// ```test_harness,no_run
1273/// extern crate hyper;
1274/// extern crate hyper_rustls;
1275/// extern crate google_firebase1_beta1 as firebase1_beta1;
1276///
1277/// # async fn dox() {
1278/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1279///
1280/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1281/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1282///     secret,
1283///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1284/// ).build().await.unwrap();
1285///
1286/// let client = hyper_util::client::legacy::Client::builder(
1287///     hyper_util::rt::TokioExecutor::new()
1288/// )
1289/// .build(
1290///     hyper_rustls::HttpsConnectorBuilder::new()
1291///         .with_native_roots()
1292///         .unwrap()
1293///         .https_or_http()
1294///         .enable_http1()
1295///         .build()
1296/// );
1297/// let mut hub = FirebaseManagement::new(client, auth);
1298/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1299/// // like `add_firebase(...)`, `add_google_analytics(...)`, `android_apps_create(...)`, `android_apps_get(...)`, `android_apps_get_config(...)`, `android_apps_list(...)`, `android_apps_patch(...)`, `android_apps_remove(...)`, `android_apps_sha_create(...)`, `android_apps_sha_delete(...)`, `android_apps_sha_list(...)`, `android_apps_undelete(...)`, `available_locations_list(...)`, `default_location_finalize(...)`, `get(...)`, `get_admin_sdk_config(...)`, `get_analytics_details(...)`, `ios_apps_create(...)`, `ios_apps_get(...)`, `ios_apps_get_config(...)`, `ios_apps_list(...)`, `ios_apps_patch(...)`, `ios_apps_remove(...)`, `ios_apps_undelete(...)`, `list(...)`, `patch(...)`, `remove_analytics(...)`, `search_apps(...)`, `web_apps_create(...)`, `web_apps_get(...)`, `web_apps_get_config(...)`, `web_apps_list(...)`, `web_apps_patch(...)`, `web_apps_remove(...)` and `web_apps_undelete(...)`
1300/// // to build up your call.
1301/// let rb = hub.projects();
1302/// # }
1303/// ```
1304pub struct ProjectMethods<'a, C>
1305where
1306    C: 'a,
1307{
1308    hub: &'a FirebaseManagement<C>,
1309}
1310
1311impl<'a, C> common::MethodsBuilder for ProjectMethods<'a, C> {}
1312
1313impl<'a, C> ProjectMethods<'a, C> {
1314    /// Create a builder to help you perform the following task:
1315    ///
1316    /// Adds a ShaCertificate to the specified AndroidApp.
1317    ///
1318    /// # Arguments
1319    ///
1320    /// * `request` - No description provided.
1321    /// * `parent` - The resource name of the parent AndroidApp to which to add a ShaCertificate, in the format: projects/PROJECT_IDENTIFIER/androidApps/ APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1322    pub fn android_apps_sha_create(
1323        &self,
1324        request: ShaCertificate,
1325        parent: &str,
1326    ) -> ProjectAndroidAppShaCreateCall<'a, C> {
1327        ProjectAndroidAppShaCreateCall {
1328            hub: self.hub,
1329            _request: request,
1330            _parent: parent.to_string(),
1331            _delegate: Default::default(),
1332            _additional_params: Default::default(),
1333            _scopes: Default::default(),
1334        }
1335    }
1336
1337    /// Create a builder to help you perform the following task:
1338    ///
1339    /// Removes a ShaCertificate from the specified AndroidApp.
1340    ///
1341    /// # Arguments
1342    ///
1343    /// * `name` - The resource name of the ShaCertificate to remove from the parent AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID /sha/SHA_HASH Refer to the `ShaCertificate` [`name`](https://firebase.google.com/../projects.androidApps.sha#ShaCertificate.FIELDS.name) field for details about PROJECT_IDENTIFIER, APP_ID, and SHA_HASH values. You can obtain the full resource name of the `ShaCertificate` from the response of [`ListShaCertificates`](https://firebase.google.com/../projects.androidApps.sha/list) or the original [`CreateShaCertificate`](https://firebase.google.com/../projects.androidApps.sha/create).
1344    pub fn android_apps_sha_delete(&self, name: &str) -> ProjectAndroidAppShaDeleteCall<'a, C> {
1345        ProjectAndroidAppShaDeleteCall {
1346            hub: self.hub,
1347            _name: name.to_string(),
1348            _delegate: Default::default(),
1349            _additional_params: Default::default(),
1350            _scopes: Default::default(),
1351        }
1352    }
1353
1354    /// Create a builder to help you perform the following task:
1355    ///
1356    /// Lists the SHA-1 and SHA-256 certificates for the specified AndroidApp.
1357    ///
1358    /// # Arguments
1359    ///
1360    /// * `parent` - The resource name of the parent AndroidApp for which to list each associated ShaCertificate, in the format: projects/PROJECT_IDENTIFIER /androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1361    pub fn android_apps_sha_list(&self, parent: &str) -> ProjectAndroidAppShaListCall<'a, C> {
1362        ProjectAndroidAppShaListCall {
1363            hub: self.hub,
1364            _parent: parent.to_string(),
1365            _delegate: Default::default(),
1366            _additional_params: Default::default(),
1367            _scopes: Default::default(),
1368        }
1369    }
1370
1371    /// Create a builder to help you perform the following task:
1372    ///
1373    /// Requests the creation of a new AndroidApp in the specified FirebaseProject. The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`.
1374    ///
1375    /// # Arguments
1376    ///
1377    /// * `request` - No description provided.
1378    /// * `parent` - The resource name of the parent FirebaseProject in which to create an AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1379    pub fn android_apps_create(
1380        &self,
1381        request: AndroidApp,
1382        parent: &str,
1383    ) -> ProjectAndroidAppCreateCall<'a, C> {
1384        ProjectAndroidAppCreateCall {
1385            hub: self.hub,
1386            _request: request,
1387            _parent: parent.to_string(),
1388            _delegate: Default::default(),
1389            _additional_params: Default::default(),
1390            _scopes: Default::default(),
1391        }
1392    }
1393
1394    /// Create a builder to help you perform the following task:
1395    ///
1396    /// Gets the specified AndroidApp.
1397    ///
1398    /// # Arguments
1399    ///
1400    /// * `name` - The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1401    pub fn android_apps_get(&self, name: &str) -> ProjectAndroidAppGetCall<'a, C> {
1402        ProjectAndroidAppGetCall {
1403            hub: self.hub,
1404            _name: name.to_string(),
1405            _delegate: Default::default(),
1406            _additional_params: Default::default(),
1407            _scopes: Default::default(),
1408        }
1409    }
1410
1411    /// Create a builder to help you perform the following task:
1412    ///
1413    /// Gets the configuration artifact associated with the specified AndroidApp.
1414    ///
1415    /// # Arguments
1416    ///
1417    /// * `name` - The resource name of the AndroidApp configuration to download, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1418    pub fn android_apps_get_config(&self, name: &str) -> ProjectAndroidAppGetConfigCall<'a, C> {
1419        ProjectAndroidAppGetConfigCall {
1420            hub: self.hub,
1421            _name: name.to_string(),
1422            _delegate: Default::default(),
1423            _additional_params: Default::default(),
1424            _scopes: Default::default(),
1425        }
1426    }
1427
1428    /// Create a builder to help you perform the following task:
1429    ///
1430    /// Lists each AndroidApp associated with the specified FirebaseProject. The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`.
1431    ///
1432    /// # Arguments
1433    ///
1434    /// * `parent` - The resource name of the parent FirebaseProject for which to list each associated AndroidApp, in the format: projects/PROJECT_IDENTIFIER /androidApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1435    pub fn android_apps_list(&self, parent: &str) -> ProjectAndroidAppListCall<'a, C> {
1436        ProjectAndroidAppListCall {
1437            hub: self.hub,
1438            _parent: parent.to_string(),
1439            _show_deleted: Default::default(),
1440            _page_token: Default::default(),
1441            _page_size: Default::default(),
1442            _delegate: Default::default(),
1443            _additional_params: Default::default(),
1444            _scopes: Default::default(),
1445        }
1446    }
1447
1448    /// Create a builder to help you perform the following task:
1449    ///
1450    /// Updates the attributes of the specified AndroidApp.
1451    ///
1452    /// # Arguments
1453    ///
1454    /// * `request` - No description provided.
1455    /// * `name` - The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.app_id)).
1456    pub fn android_apps_patch(
1457        &self,
1458        request: AndroidApp,
1459        name: &str,
1460    ) -> ProjectAndroidAppPatchCall<'a, C> {
1461        ProjectAndroidAppPatchCall {
1462            hub: self.hub,
1463            _request: request,
1464            _name: name.to_string(),
1465            _update_mask: Default::default(),
1466            _delegate: Default::default(),
1467            _additional_params: Default::default(),
1468            _scopes: Default::default(),
1469        }
1470    }
1471
1472    /// Create a builder to help you perform the following task:
1473    ///
1474    /// Removes the specified AndroidApp from the FirebaseProject.
1475    ///
1476    /// # Arguments
1477    ///
1478    /// * `request` - No description provided.
1479    /// * `name` - Required. The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp [name](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1480    pub fn android_apps_remove(
1481        &self,
1482        request: RemoveAndroidAppRequest,
1483        name: &str,
1484    ) -> ProjectAndroidAppRemoveCall<'a, C> {
1485        ProjectAndroidAppRemoveCall {
1486            hub: self.hub,
1487            _request: request,
1488            _name: name.to_string(),
1489            _delegate: Default::default(),
1490            _additional_params: Default::default(),
1491            _scopes: Default::default(),
1492        }
1493    }
1494
1495    /// Create a builder to help you perform the following task:
1496    ///
1497    /// Restores the specified AndroidApp to the FirebaseProject.
1498    ///
1499    /// # Arguments
1500    ///
1501    /// * `request` - No description provided.
1502    /// * `name` - Required. The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp [name](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1503    pub fn android_apps_undelete(
1504        &self,
1505        request: UndeleteAndroidAppRequest,
1506        name: &str,
1507    ) -> ProjectAndroidAppUndeleteCall<'a, C> {
1508        ProjectAndroidAppUndeleteCall {
1509            hub: self.hub,
1510            _request: request,
1511            _name: name.to_string(),
1512            _delegate: Default::default(),
1513            _additional_params: Default::default(),
1514            _scopes: Default::default(),
1515        }
1516    }
1517
1518    /// Create a builder to help you perform the following task:
1519    ///
1520    /// **DEPRECATED.** _Instead, use the applicable resource-specific REST API (or associated documentation, as needed) to determine valid locations for each resource used in your Project._ Lists the valid Google Cloud Platform (GCP) resource locations for the specified Project (including a FirebaseProject). One of these locations can be selected as the Project's [_default_ GCP resource location](https://firebase.google.com/docs/projects/locations), which is the geographical location where the Project's resources, such as Cloud Firestore, will be provisioned by default. However, if the default GCP resource location has already been set for the Project, then this setting cannot be changed. This call checks for any possible [location restrictions](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations) for the specified Project and, thus, might return a subset of all possible GCP resource locations. To list all GCP resource locations (regardless of any restrictions), call the endpoint without specifying a unique project identifier (that is, `/v1beta1/{parent=projects/-}/listAvailableLocations`). To call `ListAvailableLocations` with a specified project, a member must be at minimum a Viewer of the Project. Calls without a specified project do not require any specific project permissions.
1521    ///
1522    /// # Arguments
1523    ///
1524    /// * `parent` - The FirebaseProject for which to list GCP resource locations, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values. If no unique project identifier is specified (that is, `projects/-`), the returned list does not take into account org-specific or project-specific location restrictions.
1525    pub fn available_locations_list(
1526        &self,
1527        parent: &str,
1528    ) -> ProjectAvailableLocationListCall<'a, C> {
1529        ProjectAvailableLocationListCall {
1530            hub: self.hub,
1531            _parent: parent.to_string(),
1532            _page_token: Default::default(),
1533            _page_size: Default::default(),
1534            _delegate: Default::default(),
1535            _additional_params: Default::default(),
1536            _scopes: Default::default(),
1537        }
1538    }
1539
1540    /// Create a builder to help you perform the following task:
1541    ///
1542    /// **DEPRECATED.** *Instead, use the applicable resource-specific REST API to set the location for each resource used in your Project.* Sets the default Google Cloud Platform (GCP) resource location for the specified FirebaseProject. This method creates an App Engine application with a [default Cloud Storage bucket](https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/setting-up-cloud-storage#activating_a_cloud_storage_bucket), located in the specified [`locationId`](#body.request_body.FIELDS.location_id). This location must be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations). After the default GCP resource location is finalized, or if it was already set, it cannot be changed. The default GCP resource location for the specified `FirebaseProject` might already be set because either the underlying GCP `Project` already has an App Engine application or `FinalizeDefaultLocation` was previously called with a specified `locationId`. Any new calls to `FinalizeDefaultLocation` with a *different* specified `locationId` will return a 409 error. The result of this call is an [`Operation`](https://firebase.google.com/../../v1beta1/operations), which can be used to track the provisioning process. The [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) type of the `Operation` is google.protobuf.Empty. The `Operation` can be polled by its `name` using GetOperation until `done` is true. When `done` is true, the `Operation` has either succeeded or failed. If the `Operation` has succeeded, its [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) will be set to a google.protobuf.Empty; if the `Operation` has failed, its `error` will be set to a google.rpc.Status. The `Operation` is automatically deleted after completion, so there is no need to call DeleteOperation. All fields listed in the [request body](#request-body) are required. To call `FinalizeDefaultLocation`, a member must be an Owner of the Project.
1543    ///
1544    /// # Arguments
1545    ///
1546    /// * `request` - No description provided.
1547    /// * `parent` - The resource name of the FirebaseProject for which the default GCP resource location will be set, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1548    pub fn default_location_finalize(
1549        &self,
1550        request: FinalizeDefaultLocationRequest,
1551        parent: &str,
1552    ) -> ProjectDefaultLocationFinalizeCall<'a, C> {
1553        ProjectDefaultLocationFinalizeCall {
1554            hub: self.hub,
1555            _request: request,
1556            _parent: parent.to_string(),
1557            _delegate: Default::default(),
1558            _additional_params: Default::default(),
1559            _scopes: Default::default(),
1560        }
1561    }
1562
1563    /// Create a builder to help you perform the following task:
1564    ///
1565    /// Requests the creation of a new IosApp in the specified FirebaseProject. The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`.
1566    ///
1567    /// # Arguments
1568    ///
1569    /// * `request` - No description provided.
1570    /// * `parent` - The resource name of the parent FirebaseProject in which to create an IosApp, in the format: projects/PROJECT_IDENTIFIER/iosApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1571    pub fn ios_apps_create(&self, request: IosApp, parent: &str) -> ProjectIosAppCreateCall<'a, C> {
1572        ProjectIosAppCreateCall {
1573            hub: self.hub,
1574            _request: request,
1575            _parent: parent.to_string(),
1576            _delegate: Default::default(),
1577            _additional_params: Default::default(),
1578            _scopes: Default::default(),
1579        }
1580    }
1581
1582    /// Create a builder to help you perform the following task:
1583    ///
1584    /// Gets the specified IosApp.
1585    ///
1586    /// # Arguments
1587    ///
1588    /// * `name` - The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the `IosApp` [`name`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1589    pub fn ios_apps_get(&self, name: &str) -> ProjectIosAppGetCall<'a, C> {
1590        ProjectIosAppGetCall {
1591            hub: self.hub,
1592            _name: name.to_string(),
1593            _delegate: Default::default(),
1594            _additional_params: Default::default(),
1595            _scopes: Default::default(),
1596        }
1597    }
1598
1599    /// Create a builder to help you perform the following task:
1600    ///
1601    /// Gets the configuration artifact associated with the specified IosApp.
1602    ///
1603    /// # Arguments
1604    ///
1605    /// * `name` - The resource name of the App configuration to download, in the format: projects/PROJECT_IDENTIFIER/iosApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the `IosApp` [`name`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1606    pub fn ios_apps_get_config(&self, name: &str) -> ProjectIosAppGetConfigCall<'a, C> {
1607        ProjectIosAppGetConfigCall {
1608            hub: self.hub,
1609            _name: name.to_string(),
1610            _delegate: Default::default(),
1611            _additional_params: Default::default(),
1612            _scopes: Default::default(),
1613        }
1614    }
1615
1616    /// Create a builder to help you perform the following task:
1617    ///
1618    /// Lists each IosApp associated with the specified FirebaseProject. The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`.
1619    ///
1620    /// # Arguments
1621    ///
1622    /// * `parent` - The resource name of the parent FirebaseProject for which to list each associated IosApp, in the format: projects/PROJECT_IDENTIFIER/iosApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1623    pub fn ios_apps_list(&self, parent: &str) -> ProjectIosAppListCall<'a, C> {
1624        ProjectIosAppListCall {
1625            hub: self.hub,
1626            _parent: parent.to_string(),
1627            _show_deleted: Default::default(),
1628            _page_token: Default::default(),
1629            _page_size: Default::default(),
1630            _delegate: Default::default(),
1631            _additional_params: Default::default(),
1632            _scopes: Default::default(),
1633        }
1634    }
1635
1636    /// Create a builder to help you perform the following task:
1637    ///
1638    /// Updates the attributes of the specified IosApp.
1639    ///
1640    /// # Arguments
1641    ///
1642    /// * `request` - No description provided.
1643    /// * `name` - The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.app_id)).
1644    pub fn ios_apps_patch(&self, request: IosApp, name: &str) -> ProjectIosAppPatchCall<'a, C> {
1645        ProjectIosAppPatchCall {
1646            hub: self.hub,
1647            _request: request,
1648            _name: name.to_string(),
1649            _update_mask: Default::default(),
1650            _delegate: Default::default(),
1651            _additional_params: Default::default(),
1652            _scopes: Default::default(),
1653        }
1654    }
1655
1656    /// Create a builder to help you perform the following task:
1657    ///
1658    /// Removes the specified IosApp from the FirebaseProject.
1659    ///
1660    /// # Arguments
1661    ///
1662    /// * `request` - No description provided.
1663    /// * `name` - Required. The resource name of the IosApp, in the format: projects/ PROJECT_IDENTIFIER/iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp [name](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1664    pub fn ios_apps_remove(
1665        &self,
1666        request: RemoveIosAppRequest,
1667        name: &str,
1668    ) -> ProjectIosAppRemoveCall<'a, C> {
1669        ProjectIosAppRemoveCall {
1670            hub: self.hub,
1671            _request: request,
1672            _name: name.to_string(),
1673            _delegate: Default::default(),
1674            _additional_params: Default::default(),
1675            _scopes: Default::default(),
1676        }
1677    }
1678
1679    /// Create a builder to help you perform the following task:
1680    ///
1681    /// Restores the specified IosApp to the FirebaseProject.
1682    ///
1683    /// # Arguments
1684    ///
1685    /// * `request` - No description provided.
1686    /// * `name` - Required. The resource name of the IosApp, in the format: projects/ PROJECT_IDENTIFIER/iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp [name](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1687    pub fn ios_apps_undelete(
1688        &self,
1689        request: UndeleteIosAppRequest,
1690        name: &str,
1691    ) -> ProjectIosAppUndeleteCall<'a, C> {
1692        ProjectIosAppUndeleteCall {
1693            hub: self.hub,
1694            _request: request,
1695            _name: name.to_string(),
1696            _delegate: Default::default(),
1697            _additional_params: Default::default(),
1698            _scopes: Default::default(),
1699        }
1700    }
1701
1702    /// Create a builder to help you perform the following task:
1703    ///
1704    /// Requests the creation of a new WebApp in the specified FirebaseProject. The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`.
1705    ///
1706    /// # Arguments
1707    ///
1708    /// * `request` - No description provided.
1709    /// * `parent` - The resource name of the parent FirebaseProject in which to create a WebApp, in the format: projects/PROJECT_IDENTIFIER/webApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1710    pub fn web_apps_create(&self, request: WebApp, parent: &str) -> ProjectWebAppCreateCall<'a, C> {
1711        ProjectWebAppCreateCall {
1712            hub: self.hub,
1713            _request: request,
1714            _parent: parent.to_string(),
1715            _delegate: Default::default(),
1716            _additional_params: Default::default(),
1717            _scopes: Default::default(),
1718        }
1719    }
1720
1721    /// Create a builder to help you perform the following task:
1722    ///
1723    /// Gets the specified WebApp.
1724    ///
1725    /// # Arguments
1726    ///
1727    /// * `name` - The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the `WebApp` [`name`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1728    pub fn web_apps_get(&self, name: &str) -> ProjectWebAppGetCall<'a, C> {
1729        ProjectWebAppGetCall {
1730            hub: self.hub,
1731            _name: name.to_string(),
1732            _delegate: Default::default(),
1733            _additional_params: Default::default(),
1734            _scopes: Default::default(),
1735        }
1736    }
1737
1738    /// Create a builder to help you perform the following task:
1739    ///
1740    /// Gets the configuration artifact associated with the specified WebApp.
1741    ///
1742    /// # Arguments
1743    ///
1744    /// * `name` - The resource name of the WebApp configuration to download, in the format: projects/PROJECT_IDENTIFIER/webApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the `WebApp` [`name`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1745    pub fn web_apps_get_config(&self, name: &str) -> ProjectWebAppGetConfigCall<'a, C> {
1746        ProjectWebAppGetConfigCall {
1747            hub: self.hub,
1748            _name: name.to_string(),
1749            _delegate: Default::default(),
1750            _additional_params: Default::default(),
1751            _scopes: Default::default(),
1752        }
1753    }
1754
1755    /// Create a builder to help you perform the following task:
1756    ///
1757    /// Lists each WebApp associated with the specified FirebaseProject. The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`.
1758    ///
1759    /// # Arguments
1760    ///
1761    /// * `parent` - The resource name of the parent FirebaseProject for which to list each associated WebApp, in the format: projects/PROJECT_IDENTIFIER/webApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1762    pub fn web_apps_list(&self, parent: &str) -> ProjectWebAppListCall<'a, C> {
1763        ProjectWebAppListCall {
1764            hub: self.hub,
1765            _parent: parent.to_string(),
1766            _show_deleted: Default::default(),
1767            _page_token: Default::default(),
1768            _page_size: Default::default(),
1769            _delegate: Default::default(),
1770            _additional_params: Default::default(),
1771            _scopes: Default::default(),
1772        }
1773    }
1774
1775    /// Create a builder to help you perform the following task:
1776    ///
1777    /// Updates the attributes of the specified WebApp.
1778    ///
1779    /// # Arguments
1780    ///
1781    /// * `request` - No description provided.
1782    /// * `name` - The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.app_id)).
1783    pub fn web_apps_patch(&self, request: WebApp, name: &str) -> ProjectWebAppPatchCall<'a, C> {
1784        ProjectWebAppPatchCall {
1785            hub: self.hub,
1786            _request: request,
1787            _name: name.to_string(),
1788            _update_mask: Default::default(),
1789            _delegate: Default::default(),
1790            _additional_params: Default::default(),
1791            _scopes: Default::default(),
1792        }
1793    }
1794
1795    /// Create a builder to help you perform the following task:
1796    ///
1797    /// Removes the specified WebApp from the FirebaseProject.
1798    ///
1799    /// # Arguments
1800    ///
1801    /// * `request` - No description provided.
1802    /// * `name` - Required. The resource name of the WebApp, in the format: projects/ PROJECT_IDENTIFIER/webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp [name](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1803    pub fn web_apps_remove(
1804        &self,
1805        request: RemoveWebAppRequest,
1806        name: &str,
1807    ) -> ProjectWebAppRemoveCall<'a, C> {
1808        ProjectWebAppRemoveCall {
1809            hub: self.hub,
1810            _request: request,
1811            _name: name.to_string(),
1812            _delegate: Default::default(),
1813            _additional_params: Default::default(),
1814            _scopes: Default::default(),
1815        }
1816    }
1817
1818    /// Create a builder to help you perform the following task:
1819    ///
1820    /// Restores the specified WebApp to the FirebaseProject.
1821    ///
1822    /// # Arguments
1823    ///
1824    /// * `request` - No description provided.
1825    /// * `name` - Required. The resource name of the WebApp, in the format: projects/ PROJECT_IDENTIFIER/webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp [name](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
1826    pub fn web_apps_undelete(
1827        &self,
1828        request: UndeleteWebAppRequest,
1829        name: &str,
1830    ) -> ProjectWebAppUndeleteCall<'a, C> {
1831        ProjectWebAppUndeleteCall {
1832            hub: self.hub,
1833            _request: request,
1834            _name: name.to_string(),
1835            _delegate: Default::default(),
1836            _additional_params: Default::default(),
1837            _scopes: Default::default(),
1838        }
1839    }
1840
1841    /// Create a builder to help you perform the following task:
1842    ///
1843    /// Adds Firebase resources to the specified existing \[Google Cloud Platform (GCP) `Project`\] (https://cloud.google.com/resource-manager/reference/rest/v1/projects). Since a FirebaseProject is actually also a GCP `Project`, a `FirebaseProject` has the same underlying GCP identifiers (`projectNumber` and `projectId`). This allows for easy interop with Google APIs. The result of this call is an [`Operation`](https://firebase.google.com/../../v1beta1/operations). Poll the `Operation` to track the provisioning process by calling GetOperation until [`done`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.done) is `true`. When `done` is `true`, the `Operation` has either succeeded or failed. If the `Operation` succeeded, its [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) is set to a FirebaseProject; if the `Operation` failed, its [`error`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status. The `Operation` is automatically deleted after completion, so there is no need to call DeleteOperation. This method does not modify any billing account information on the underlying GCP `Project`. To call `AddFirebase`, a project member or service account must have the following permissions (the IAM roles of Editor and Owner contain these permissions): `firebase.projects.update`, `resourcemanager.projects.get`, `serviceusage.services.enable`, and `serviceusage.services.get`.
1844    ///
1845    /// # Arguments
1846    ///
1847    /// * `request` - No description provided.
1848    /// * `project` - The resource name of the GCP `Project` to which Firebase resources will be added, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values. After calling `AddFirebase`, the unique Project identifiers ( [`projectNumber`](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_number) and [`projectId`](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_id)) of the underlying GCP `Project` are also the identifiers of the FirebaseProject.
1849    pub fn add_firebase(
1850        &self,
1851        request: AddFirebaseRequest,
1852        project: &str,
1853    ) -> ProjectAddFirebaseCall<'a, C> {
1854        ProjectAddFirebaseCall {
1855            hub: self.hub,
1856            _request: request,
1857            _project: project.to_string(),
1858            _delegate: Default::default(),
1859            _additional_params: Default::default(),
1860            _scopes: Default::default(),
1861        }
1862    }
1863
1864    /// Create a builder to help you perform the following task:
1865    ///
1866    /// Links the specified FirebaseProject with an existing [Google Analytics account](http://www.google.com/analytics/). Using this call, you can either: - Specify an `analyticsAccountId` to provision a new Google Analytics property within the specified account and associate the new property with the `FirebaseProject`. - Specify an existing `analyticsPropertyId` to associate the property with the `FirebaseProject`. Note that when you call `AddGoogleAnalytics`: 1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in the `FirebaseProject` (based on the `packageName` or `bundleId` associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies to `AndroidApps` and `IosApps`. 2. If no corresponding data streams are found for the Firebase Apps, new data streams are provisioned in the Google Analytics property for each of the Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in the Analytics property. Learn more about the hierarchy and structure of Google Analytics accounts in the [Analytics documentation](https://support.google.com/analytics/answer/9303323). The result of this call is an [`Operation`](https://firebase.google.com/../../v1beta1/operations). Poll the `Operation` to track the provisioning process by calling GetOperation until [`done`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.done) is `true`. When `done` is `true`, the `Operation` has either succeeded or failed. If the `Operation` succeeded, its [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) is set to an AnalyticsDetails; if the `Operation` failed, its [`error`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status. To call `AddGoogleAnalytics`, a project member must be an Owner for the existing `FirebaseProject` and have the [`Edit` permission](https://support.google.com/analytics/answer/2884495) for the Google Analytics account. If the `FirebaseProject` already has Google Analytics enabled, and you call `AddGoogleAnalytics` using an `analyticsPropertyId` that’s different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifying `timeZone` and `regionCode` in the call to [`AddFirebase`](https://firebase.google.com/../../v1beta1/projects/addFirebase).
1867    ///
1868    /// # Arguments
1869    ///
1870    /// * `request` - No description provided.
1871    /// * `parent` - The resource name of the FirebaseProject to link to an existing Google Analytics account, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1872    pub fn add_google_analytics(
1873        &self,
1874        request: AddGoogleAnalyticsRequest,
1875        parent: &str,
1876    ) -> ProjectAddGoogleAnalyticCall<'a, C> {
1877        ProjectAddGoogleAnalyticCall {
1878            hub: self.hub,
1879            _request: request,
1880            _parent: parent.to_string(),
1881            _delegate: Default::default(),
1882            _additional_params: Default::default(),
1883            _scopes: Default::default(),
1884        }
1885    }
1886
1887    /// Create a builder to help you perform the following task:
1888    ///
1889    /// Gets the specified FirebaseProject.
1890    ///
1891    /// # Arguments
1892    ///
1893    /// * `name` - The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1894    pub fn get(&self, name: &str) -> ProjectGetCall<'a, C> {
1895        ProjectGetCall {
1896            hub: self.hub,
1897            _name: name.to_string(),
1898            _delegate: Default::default(),
1899            _additional_params: Default::default(),
1900            _scopes: Default::default(),
1901        }
1902    }
1903
1904    /// Create a builder to help you perform the following task:
1905    ///
1906    /// Gets the configuration artifact associated with the specified FirebaseProject, which can be used by servers to simplify initialization. Typically, this configuration is used with the Firebase Admin SDK [initializeApp](https://firebase.google.com/docs/admin/setup#initialize_the_sdk) command.
1907    ///
1908    /// # Arguments
1909    ///
1910    /// * `name` - The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER/adminSdkConfig Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1911    pub fn get_admin_sdk_config(&self, name: &str) -> ProjectGetAdminSdkConfigCall<'a, C> {
1912        ProjectGetAdminSdkConfigCall {
1913            hub: self.hub,
1914            _name: name.to_string(),
1915            _delegate: Default::default(),
1916            _additional_params: Default::default(),
1917            _scopes: Default::default(),
1918        }
1919    }
1920
1921    /// Create a builder to help you perform the following task:
1922    ///
1923    /// Gets the Google Analytics details currently associated with the specified FirebaseProject. If the `FirebaseProject` is not yet linked to Google Analytics, then the response to `GetAnalyticsDetails` is `NOT_FOUND`.
1924    ///
1925    /// # Arguments
1926    ///
1927    /// * `name` - The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER/analyticsDetails Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1928    pub fn get_analytics_details(&self, name: &str) -> ProjectGetAnalyticsDetailCall<'a, C> {
1929        ProjectGetAnalyticsDetailCall {
1930            hub: self.hub,
1931            _name: name.to_string(),
1932            _delegate: Default::default(),
1933            _additional_params: Default::default(),
1934            _scopes: Default::default(),
1935        }
1936    }
1937
1938    /// Create a builder to help you perform the following task:
1939    ///
1940    /// Lists each FirebaseProject accessible to the caller. The elements are returned in no particular order, but they will be a consistent view of the Projects when additional requests are made with a `pageToken`. This method is eventually consistent with Project mutations, which means newly provisioned Projects and recent modifications to existing Projects might not be reflected in the set of Projects. The list will include only ACTIVE Projects. Use GetFirebaseProject for consistent reads as well as for additional Project details.
1941    pub fn list(&self) -> ProjectListCall<'a, C> {
1942        ProjectListCall {
1943            hub: self.hub,
1944            _show_deleted: Default::default(),
1945            _page_token: Default::default(),
1946            _page_size: Default::default(),
1947            _delegate: Default::default(),
1948            _additional_params: Default::default(),
1949            _scopes: Default::default(),
1950        }
1951    }
1952
1953    /// Create a builder to help you perform the following task:
1954    ///
1955    /// Updates the attributes of the specified FirebaseProject. All [query parameters](#query-parameters) are required.
1956    ///
1957    /// # Arguments
1958    ///
1959    /// * `request` - No description provided.
1960    /// * `name` - The resource name of the Project, in the format: projects/PROJECT_IDENTIFIER PROJECT_IDENTIFIER: the Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`.
1961    pub fn patch(&self, request: FirebaseProject, name: &str) -> ProjectPatchCall<'a, C> {
1962        ProjectPatchCall {
1963            hub: self.hub,
1964            _request: request,
1965            _name: name.to_string(),
1966            _update_mask: Default::default(),
1967            _delegate: Default::default(),
1968            _additional_params: Default::default(),
1969            _scopes: Default::default(),
1970        }
1971    }
1972
1973    /// Create a builder to help you perform the following task:
1974    ///
1975    /// Unlinks the specified FirebaseProject from its Google Analytics account. This call removes the association of the specified `FirebaseProject` with its current Google Analytics property. However, this call does not delete the Google Analytics resources, such as the Google Analytics property or any data streams. These resources may be re-associated later to the `FirebaseProject` by calling [`AddGoogleAnalytics`](https://firebase.google.com/../../v1beta1/projects/addGoogleAnalytics) and specifying the same `analyticsPropertyId`. For Android Apps and iOS Apps, this call re-links data streams with their corresponding apps. However, for Web Apps, this call provisions a *new* data stream for each Web App. To call `RemoveAnalytics`, a project member must be an Owner for the `FirebaseProject`.
1976    ///
1977    /// # Arguments
1978    ///
1979    /// * `request` - No description provided.
1980    /// * `parent` - The resource name of the FirebaseProject to unlink from its Google Analytics account, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
1981    pub fn remove_analytics(
1982        &self,
1983        request: RemoveAnalyticsRequest,
1984        parent: &str,
1985    ) -> ProjectRemoveAnalyticCall<'a, C> {
1986        ProjectRemoveAnalyticCall {
1987            hub: self.hub,
1988            _request: request,
1989            _parent: parent.to_string(),
1990            _delegate: Default::default(),
1991            _additional_params: Default::default(),
1992            _scopes: Default::default(),
1993        }
1994    }
1995
1996    /// Create a builder to help you perform the following task:
1997    ///
1998    /// Lists all available Apps for the specified FirebaseProject. This is a convenience method. Typically, interaction with an App should be done using the platform-specific service, but some tool use-cases require a summary of all known Apps (such as for App selector interfaces).
1999    ///
2000    /// # Arguments
2001    ///
2002    /// * `parent` - The parent FirebaseProject for which to list Apps, in the format: projects/ PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
2003    pub fn search_apps(&self, parent: &str) -> ProjectSearchAppCall<'a, C> {
2004        ProjectSearchAppCall {
2005            hub: self.hub,
2006            _parent: parent.to_string(),
2007            _show_deleted: Default::default(),
2008            _page_token: Default::default(),
2009            _page_size: Default::default(),
2010            _filter: Default::default(),
2011            _delegate: Default::default(),
2012            _additional_params: Default::default(),
2013            _scopes: Default::default(),
2014        }
2015    }
2016}
2017
2018// ###################
2019// CallBuilders   ###
2020// #################
2021
2022/// Lists each [Google Cloud Platform (GCP) `Project`] (https://cloud.google.com/resource-manager/reference/rest/v1/projects) that can have Firebase resources added to it. A Project will only be listed if: - The caller has sufficient [Google IAM](https://cloud.google.com/iam) permissions to call AddFirebase. - The Project is not already a FirebaseProject. - The Project is not in an Organization which has policies that prevent Firebase resources from being added.
2023///
2024/// A builder for the *list* method supported by a *availableProject* resource.
2025/// It is not used directly, but through a [`AvailableProjectMethods`] instance.
2026///
2027/// # Example
2028///
2029/// Instantiate a resource method builder
2030///
2031/// ```test_harness,no_run
2032/// # extern crate hyper;
2033/// # extern crate hyper_rustls;
2034/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2035/// # async fn dox() {
2036/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2037///
2038/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2039/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2040/// #     secret,
2041/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2042/// # ).build().await.unwrap();
2043///
2044/// # let client = hyper_util::client::legacy::Client::builder(
2045/// #     hyper_util::rt::TokioExecutor::new()
2046/// # )
2047/// # .build(
2048/// #     hyper_rustls::HttpsConnectorBuilder::new()
2049/// #         .with_native_roots()
2050/// #         .unwrap()
2051/// #         .https_or_http()
2052/// #         .enable_http1()
2053/// #         .build()
2054/// # );
2055/// # let mut hub = FirebaseManagement::new(client, auth);
2056/// // You can configure optional parameters by calling the respective setters at will, and
2057/// // execute the final call using `doit()`.
2058/// // Values shown here are possibly random and not representative !
2059/// let result = hub.available_projects().list()
2060///              .page_token("ipsum")
2061///              .page_size(-28)
2062///              .doit().await;
2063/// # }
2064/// ```
2065pub struct AvailableProjectListCall<'a, C>
2066where
2067    C: 'a,
2068{
2069    hub: &'a FirebaseManagement<C>,
2070    _page_token: Option<String>,
2071    _page_size: Option<i32>,
2072    _delegate: Option<&'a mut dyn common::Delegate>,
2073    _additional_params: HashMap<String, String>,
2074    _scopes: BTreeSet<String>,
2075}
2076
2077impl<'a, C> common::CallBuilder for AvailableProjectListCall<'a, C> {}
2078
2079impl<'a, C> AvailableProjectListCall<'a, C>
2080where
2081    C: common::Connector,
2082{
2083    /// Perform the operation you have build so far.
2084    pub async fn doit(
2085        mut self,
2086    ) -> common::Result<(common::Response, ListAvailableProjectsResponse)> {
2087        use std::borrow::Cow;
2088        use std::io::{Read, Seek};
2089
2090        use common::{url::Params, ToParts};
2091        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2092
2093        let mut dd = common::DefaultDelegate;
2094        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2095        dlg.begin(common::MethodInfo {
2096            id: "firebase.availableProjects.list",
2097            http_method: hyper::Method::GET,
2098        });
2099
2100        for &field in ["alt", "pageToken", "pageSize"].iter() {
2101            if self._additional_params.contains_key(field) {
2102                dlg.finished(false);
2103                return Err(common::Error::FieldClash(field));
2104            }
2105        }
2106
2107        let mut params = Params::with_capacity(4 + self._additional_params.len());
2108        if let Some(value) = self._page_token.as_ref() {
2109            params.push("pageToken", value);
2110        }
2111        if let Some(value) = self._page_size.as_ref() {
2112            params.push("pageSize", value.to_string());
2113        }
2114
2115        params.extend(self._additional_params.iter());
2116
2117        params.push("alt", "json");
2118        let mut url = self.hub._base_url.clone() + "v1beta1/availableProjects";
2119        if self._scopes.is_empty() {
2120            self._scopes.insert(Scope::Readonly.as_ref().to_string());
2121        }
2122
2123        let url = params.parse_with_url(&url);
2124
2125        loop {
2126            let token = match self
2127                .hub
2128                .auth
2129                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2130                .await
2131            {
2132                Ok(token) => token,
2133                Err(e) => match dlg.token(e) {
2134                    Ok(token) => token,
2135                    Err(e) => {
2136                        dlg.finished(false);
2137                        return Err(common::Error::MissingToken(e));
2138                    }
2139                },
2140            };
2141            let mut req_result = {
2142                let client = &self.hub.client;
2143                dlg.pre_request();
2144                let mut req_builder = hyper::Request::builder()
2145                    .method(hyper::Method::GET)
2146                    .uri(url.as_str())
2147                    .header(USER_AGENT, self.hub._user_agent.clone());
2148
2149                if let Some(token) = token.as_ref() {
2150                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2151                }
2152
2153                let request = req_builder
2154                    .header(CONTENT_LENGTH, 0_u64)
2155                    .body(common::to_body::<String>(None));
2156
2157                client.request(request.unwrap()).await
2158            };
2159
2160            match req_result {
2161                Err(err) => {
2162                    if let common::Retry::After(d) = dlg.http_error(&err) {
2163                        sleep(d).await;
2164                        continue;
2165                    }
2166                    dlg.finished(false);
2167                    return Err(common::Error::HttpError(err));
2168                }
2169                Ok(res) => {
2170                    let (mut parts, body) = res.into_parts();
2171                    let mut body = common::Body::new(body);
2172                    if !parts.status.is_success() {
2173                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2174                        let error = serde_json::from_str(&common::to_string(&bytes));
2175                        let response = common::to_response(parts, bytes.into());
2176
2177                        if let common::Retry::After(d) =
2178                            dlg.http_failure(&response, error.as_ref().ok())
2179                        {
2180                            sleep(d).await;
2181                            continue;
2182                        }
2183
2184                        dlg.finished(false);
2185
2186                        return Err(match error {
2187                            Ok(value) => common::Error::BadRequest(value),
2188                            _ => common::Error::Failure(response),
2189                        });
2190                    }
2191                    let response = {
2192                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2193                        let encoded = common::to_string(&bytes);
2194                        match serde_json::from_str(&encoded) {
2195                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2196                            Err(error) => {
2197                                dlg.response_json_decode_error(&encoded, &error);
2198                                return Err(common::Error::JsonDecodeError(
2199                                    encoded.to_string(),
2200                                    error,
2201                                ));
2202                            }
2203                        }
2204                    };
2205
2206                    dlg.finished(true);
2207                    return Ok(response);
2208                }
2209            }
2210        }
2211    }
2212
2213    /// Token returned from a previous call to `ListAvailableProjects` indicating where in the set of Projects to resume listing.
2214    ///
2215    /// Sets the *page token* query property to the given value.
2216    pub fn page_token(mut self, new_value: &str) -> AvailableProjectListCall<'a, C> {
2217        self._page_token = Some(new_value.to_string());
2218        self
2219    }
2220    /// The maximum number of Projects to return in the response. The server may return fewer than this value at its discretion. If no value is specified (or too large a value is specified), the server will impose its own limit. This value cannot be negative.
2221    ///
2222    /// Sets the *page size* query property to the given value.
2223    pub fn page_size(mut self, new_value: i32) -> AvailableProjectListCall<'a, C> {
2224        self._page_size = Some(new_value);
2225        self
2226    }
2227    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2228    /// while executing the actual API request.
2229    ///
2230    /// ````text
2231    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2232    /// ````
2233    ///
2234    /// Sets the *delegate* property to the given value.
2235    pub fn delegate(
2236        mut self,
2237        new_value: &'a mut dyn common::Delegate,
2238    ) -> AvailableProjectListCall<'a, C> {
2239        self._delegate = Some(new_value);
2240        self
2241    }
2242
2243    /// Set any additional parameter of the query string used in the request.
2244    /// It should be used to set parameters which are not yet available through their own
2245    /// setters.
2246    ///
2247    /// Please note that this method must not be used to set any of the known parameters
2248    /// which have their own setter method. If done anyway, the request will fail.
2249    ///
2250    /// # Additional Parameters
2251    ///
2252    /// * *$.xgafv* (query-string) - V1 error format.
2253    /// * *access_token* (query-string) - OAuth access token.
2254    /// * *alt* (query-string) - Data format for response.
2255    /// * *callback* (query-string) - JSONP
2256    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2257    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2258    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2259    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2260    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2261    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2262    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2263    pub fn param<T>(mut self, name: T, value: T) -> AvailableProjectListCall<'a, C>
2264    where
2265        T: AsRef<str>,
2266    {
2267        self._additional_params
2268            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2269        self
2270    }
2271
2272    /// Identifies the authorization scope for the method you are building.
2273    ///
2274    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2275    /// [`Scope::Readonly`].
2276    ///
2277    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2278    /// tokens for more than one scope.
2279    ///
2280    /// Usually there is more than one suitable scope to authorize an operation, some of which may
2281    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2282    /// sufficient, a read-write scope will do as well.
2283    pub fn add_scope<St>(mut self, scope: St) -> AvailableProjectListCall<'a, C>
2284    where
2285        St: AsRef<str>,
2286    {
2287        self._scopes.insert(String::from(scope.as_ref()));
2288        self
2289    }
2290    /// Identifies the authorization scope(s) for the method you are building.
2291    ///
2292    /// See [`Self::add_scope()`] for details.
2293    pub fn add_scopes<I, St>(mut self, scopes: I) -> AvailableProjectListCall<'a, C>
2294    where
2295        I: IntoIterator<Item = St>,
2296        St: AsRef<str>,
2297    {
2298        self._scopes
2299            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2300        self
2301    }
2302
2303    /// Removes all scopes, and no default scope will be used either.
2304    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2305    /// for details).
2306    pub fn clear_scopes(mut self) -> AvailableProjectListCall<'a, C> {
2307        self._scopes.clear();
2308        self
2309    }
2310}
2311
2312/// 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.
2313///
2314/// A builder for the *get* method supported by a *operation* resource.
2315/// It is not used directly, but through a [`OperationMethods`] instance.
2316///
2317/// # Example
2318///
2319/// Instantiate a resource method builder
2320///
2321/// ```test_harness,no_run
2322/// # extern crate hyper;
2323/// # extern crate hyper_rustls;
2324/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2325/// # async fn dox() {
2326/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2327///
2328/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2329/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2330/// #     secret,
2331/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2332/// # ).build().await.unwrap();
2333///
2334/// # let client = hyper_util::client::legacy::Client::builder(
2335/// #     hyper_util::rt::TokioExecutor::new()
2336/// # )
2337/// # .build(
2338/// #     hyper_rustls::HttpsConnectorBuilder::new()
2339/// #         .with_native_roots()
2340/// #         .unwrap()
2341/// #         .https_or_http()
2342/// #         .enable_http1()
2343/// #         .build()
2344/// # );
2345/// # let mut hub = FirebaseManagement::new(client, auth);
2346/// // You can configure optional parameters by calling the respective setters at will, and
2347/// // execute the final call using `doit()`.
2348/// // Values shown here are possibly random and not representative !
2349/// let result = hub.operations().get("name")
2350///              .doit().await;
2351/// # }
2352/// ```
2353pub struct OperationGetCall<'a, C>
2354where
2355    C: 'a,
2356{
2357    hub: &'a FirebaseManagement<C>,
2358    _name: String,
2359    _delegate: Option<&'a mut dyn common::Delegate>,
2360    _additional_params: HashMap<String, String>,
2361    _scopes: BTreeSet<String>,
2362}
2363
2364impl<'a, C> common::CallBuilder for OperationGetCall<'a, C> {}
2365
2366impl<'a, C> OperationGetCall<'a, C>
2367where
2368    C: common::Connector,
2369{
2370    /// Perform the operation you have build so far.
2371    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
2372        use std::borrow::Cow;
2373        use std::io::{Read, Seek};
2374
2375        use common::{url::Params, ToParts};
2376        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2377
2378        let mut dd = common::DefaultDelegate;
2379        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2380        dlg.begin(common::MethodInfo {
2381            id: "firebase.operations.get",
2382            http_method: hyper::Method::GET,
2383        });
2384
2385        for &field in ["alt", "name"].iter() {
2386            if self._additional_params.contains_key(field) {
2387                dlg.finished(false);
2388                return Err(common::Error::FieldClash(field));
2389            }
2390        }
2391
2392        let mut params = Params::with_capacity(3 + self._additional_params.len());
2393        params.push("name", self._name);
2394
2395        params.extend(self._additional_params.iter());
2396
2397        params.push("alt", "json");
2398        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
2399        if self._scopes.is_empty() {
2400            self._scopes.insert(Scope::Readonly.as_ref().to_string());
2401        }
2402
2403        #[allow(clippy::single_element_loop)]
2404        for &(find_this, param_name) in [("{+name}", "name")].iter() {
2405            url = params.uri_replacement(url, param_name, find_this, true);
2406        }
2407        {
2408            let to_remove = ["name"];
2409            params.remove_params(&to_remove);
2410        }
2411
2412        let url = params.parse_with_url(&url);
2413
2414        loop {
2415            let token = match self
2416                .hub
2417                .auth
2418                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2419                .await
2420            {
2421                Ok(token) => token,
2422                Err(e) => match dlg.token(e) {
2423                    Ok(token) => token,
2424                    Err(e) => {
2425                        dlg.finished(false);
2426                        return Err(common::Error::MissingToken(e));
2427                    }
2428                },
2429            };
2430            let mut req_result = {
2431                let client = &self.hub.client;
2432                dlg.pre_request();
2433                let mut req_builder = hyper::Request::builder()
2434                    .method(hyper::Method::GET)
2435                    .uri(url.as_str())
2436                    .header(USER_AGENT, self.hub._user_agent.clone());
2437
2438                if let Some(token) = token.as_ref() {
2439                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2440                }
2441
2442                let request = req_builder
2443                    .header(CONTENT_LENGTH, 0_u64)
2444                    .body(common::to_body::<String>(None));
2445
2446                client.request(request.unwrap()).await
2447            };
2448
2449            match req_result {
2450                Err(err) => {
2451                    if let common::Retry::After(d) = dlg.http_error(&err) {
2452                        sleep(d).await;
2453                        continue;
2454                    }
2455                    dlg.finished(false);
2456                    return Err(common::Error::HttpError(err));
2457                }
2458                Ok(res) => {
2459                    let (mut parts, body) = res.into_parts();
2460                    let mut body = common::Body::new(body);
2461                    if !parts.status.is_success() {
2462                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2463                        let error = serde_json::from_str(&common::to_string(&bytes));
2464                        let response = common::to_response(parts, bytes.into());
2465
2466                        if let common::Retry::After(d) =
2467                            dlg.http_failure(&response, error.as_ref().ok())
2468                        {
2469                            sleep(d).await;
2470                            continue;
2471                        }
2472
2473                        dlg.finished(false);
2474
2475                        return Err(match error {
2476                            Ok(value) => common::Error::BadRequest(value),
2477                            _ => common::Error::Failure(response),
2478                        });
2479                    }
2480                    let response = {
2481                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2482                        let encoded = common::to_string(&bytes);
2483                        match serde_json::from_str(&encoded) {
2484                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2485                            Err(error) => {
2486                                dlg.response_json_decode_error(&encoded, &error);
2487                                return Err(common::Error::JsonDecodeError(
2488                                    encoded.to_string(),
2489                                    error,
2490                                ));
2491                            }
2492                        }
2493                    };
2494
2495                    dlg.finished(true);
2496                    return Ok(response);
2497                }
2498            }
2499        }
2500    }
2501
2502    /// The name of the operation resource.
2503    ///
2504    /// Sets the *name* path property to the given value.
2505    ///
2506    /// Even though the property as already been set when instantiating this call,
2507    /// we provide this method for API completeness.
2508    pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C> {
2509        self._name = new_value.to_string();
2510        self
2511    }
2512    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2513    /// while executing the actual API request.
2514    ///
2515    /// ````text
2516    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2517    /// ````
2518    ///
2519    /// Sets the *delegate* property to the given value.
2520    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> OperationGetCall<'a, C> {
2521        self._delegate = Some(new_value);
2522        self
2523    }
2524
2525    /// Set any additional parameter of the query string used in the request.
2526    /// It should be used to set parameters which are not yet available through their own
2527    /// setters.
2528    ///
2529    /// Please note that this method must not be used to set any of the known parameters
2530    /// which have their own setter method. If done anyway, the request will fail.
2531    ///
2532    /// # Additional Parameters
2533    ///
2534    /// * *$.xgafv* (query-string) - V1 error format.
2535    /// * *access_token* (query-string) - OAuth access token.
2536    /// * *alt* (query-string) - Data format for response.
2537    /// * *callback* (query-string) - JSONP
2538    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2539    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2540    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2541    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2542    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2543    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2544    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2545    pub fn param<T>(mut self, name: T, value: T) -> OperationGetCall<'a, C>
2546    where
2547        T: AsRef<str>,
2548    {
2549        self._additional_params
2550            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2551        self
2552    }
2553
2554    /// Identifies the authorization scope for the method you are building.
2555    ///
2556    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2557    /// [`Scope::Readonly`].
2558    ///
2559    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2560    /// tokens for more than one scope.
2561    ///
2562    /// Usually there is more than one suitable scope to authorize an operation, some of which may
2563    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2564    /// sufficient, a read-write scope will do as well.
2565    pub fn add_scope<St>(mut self, scope: St) -> OperationGetCall<'a, C>
2566    where
2567        St: AsRef<str>,
2568    {
2569        self._scopes.insert(String::from(scope.as_ref()));
2570        self
2571    }
2572    /// Identifies the authorization scope(s) for the method you are building.
2573    ///
2574    /// See [`Self::add_scope()`] for details.
2575    pub fn add_scopes<I, St>(mut self, scopes: I) -> OperationGetCall<'a, C>
2576    where
2577        I: IntoIterator<Item = St>,
2578        St: AsRef<str>,
2579    {
2580        self._scopes
2581            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2582        self
2583    }
2584
2585    /// Removes all scopes, and no default scope will be used either.
2586    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2587    /// for details).
2588    pub fn clear_scopes(mut self) -> OperationGetCall<'a, C> {
2589        self._scopes.clear();
2590        self
2591    }
2592}
2593
2594/// Adds a ShaCertificate to the specified AndroidApp.
2595///
2596/// A builder for the *androidApps.sha.create* method supported by a *project* resource.
2597/// It is not used directly, but through a [`ProjectMethods`] instance.
2598///
2599/// # Example
2600///
2601/// Instantiate a resource method builder
2602///
2603/// ```test_harness,no_run
2604/// # extern crate hyper;
2605/// # extern crate hyper_rustls;
2606/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2607/// use firebase1_beta1::api::ShaCertificate;
2608/// # async fn dox() {
2609/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2610///
2611/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2612/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2613/// #     secret,
2614/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2615/// # ).build().await.unwrap();
2616///
2617/// # let client = hyper_util::client::legacy::Client::builder(
2618/// #     hyper_util::rt::TokioExecutor::new()
2619/// # )
2620/// # .build(
2621/// #     hyper_rustls::HttpsConnectorBuilder::new()
2622/// #         .with_native_roots()
2623/// #         .unwrap()
2624/// #         .https_or_http()
2625/// #         .enable_http1()
2626/// #         .build()
2627/// # );
2628/// # let mut hub = FirebaseManagement::new(client, auth);
2629/// // As the method needs a request, you would usually fill it with the desired information
2630/// // into the respective structure. Some of the parts shown here might not be applicable !
2631/// // Values shown here are possibly random and not representative !
2632/// let mut req = ShaCertificate::default();
2633///
2634/// // You can configure optional parameters by calling the respective setters at will, and
2635/// // execute the final call using `doit()`.
2636/// // Values shown here are possibly random and not representative !
2637/// let result = hub.projects().android_apps_sha_create(req, "parent")
2638///              .doit().await;
2639/// # }
2640/// ```
2641pub struct ProjectAndroidAppShaCreateCall<'a, C>
2642where
2643    C: 'a,
2644{
2645    hub: &'a FirebaseManagement<C>,
2646    _request: ShaCertificate,
2647    _parent: String,
2648    _delegate: Option<&'a mut dyn common::Delegate>,
2649    _additional_params: HashMap<String, String>,
2650    _scopes: BTreeSet<String>,
2651}
2652
2653impl<'a, C> common::CallBuilder for ProjectAndroidAppShaCreateCall<'a, C> {}
2654
2655impl<'a, C> ProjectAndroidAppShaCreateCall<'a, C>
2656where
2657    C: common::Connector,
2658{
2659    /// Perform the operation you have build so far.
2660    pub async fn doit(mut self) -> common::Result<(common::Response, ShaCertificate)> {
2661        use std::borrow::Cow;
2662        use std::io::{Read, Seek};
2663
2664        use common::{url::Params, ToParts};
2665        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2666
2667        let mut dd = common::DefaultDelegate;
2668        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2669        dlg.begin(common::MethodInfo {
2670            id: "firebase.projects.androidApps.sha.create",
2671            http_method: hyper::Method::POST,
2672        });
2673
2674        for &field in ["alt", "parent"].iter() {
2675            if self._additional_params.contains_key(field) {
2676                dlg.finished(false);
2677                return Err(common::Error::FieldClash(field));
2678            }
2679        }
2680
2681        let mut params = Params::with_capacity(4 + self._additional_params.len());
2682        params.push("parent", self._parent);
2683
2684        params.extend(self._additional_params.iter());
2685
2686        params.push("alt", "json");
2687        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/sha";
2688        if self._scopes.is_empty() {
2689            self._scopes
2690                .insert(Scope::CloudPlatform.as_ref().to_string());
2691        }
2692
2693        #[allow(clippy::single_element_loop)]
2694        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
2695            url = params.uri_replacement(url, param_name, find_this, true);
2696        }
2697        {
2698            let to_remove = ["parent"];
2699            params.remove_params(&to_remove);
2700        }
2701
2702        let url = params.parse_with_url(&url);
2703
2704        let mut json_mime_type = mime::APPLICATION_JSON;
2705        let mut request_value_reader = {
2706            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
2707            common::remove_json_null_values(&mut value);
2708            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
2709            serde_json::to_writer(&mut dst, &value).unwrap();
2710            dst
2711        };
2712        let request_size = request_value_reader
2713            .seek(std::io::SeekFrom::End(0))
2714            .unwrap();
2715        request_value_reader
2716            .seek(std::io::SeekFrom::Start(0))
2717            .unwrap();
2718
2719        loop {
2720            let token = match self
2721                .hub
2722                .auth
2723                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2724                .await
2725            {
2726                Ok(token) => token,
2727                Err(e) => match dlg.token(e) {
2728                    Ok(token) => token,
2729                    Err(e) => {
2730                        dlg.finished(false);
2731                        return Err(common::Error::MissingToken(e));
2732                    }
2733                },
2734            };
2735            request_value_reader
2736                .seek(std::io::SeekFrom::Start(0))
2737                .unwrap();
2738            let mut req_result = {
2739                let client = &self.hub.client;
2740                dlg.pre_request();
2741                let mut req_builder = hyper::Request::builder()
2742                    .method(hyper::Method::POST)
2743                    .uri(url.as_str())
2744                    .header(USER_AGENT, self.hub._user_agent.clone());
2745
2746                if let Some(token) = token.as_ref() {
2747                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2748                }
2749
2750                let request = req_builder
2751                    .header(CONTENT_TYPE, json_mime_type.to_string())
2752                    .header(CONTENT_LENGTH, request_size as u64)
2753                    .body(common::to_body(
2754                        request_value_reader.get_ref().clone().into(),
2755                    ));
2756
2757                client.request(request.unwrap()).await
2758            };
2759
2760            match req_result {
2761                Err(err) => {
2762                    if let common::Retry::After(d) = dlg.http_error(&err) {
2763                        sleep(d).await;
2764                        continue;
2765                    }
2766                    dlg.finished(false);
2767                    return Err(common::Error::HttpError(err));
2768                }
2769                Ok(res) => {
2770                    let (mut parts, body) = res.into_parts();
2771                    let mut body = common::Body::new(body);
2772                    if !parts.status.is_success() {
2773                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2774                        let error = serde_json::from_str(&common::to_string(&bytes));
2775                        let response = common::to_response(parts, bytes.into());
2776
2777                        if let common::Retry::After(d) =
2778                            dlg.http_failure(&response, error.as_ref().ok())
2779                        {
2780                            sleep(d).await;
2781                            continue;
2782                        }
2783
2784                        dlg.finished(false);
2785
2786                        return Err(match error {
2787                            Ok(value) => common::Error::BadRequest(value),
2788                            _ => common::Error::Failure(response),
2789                        });
2790                    }
2791                    let response = {
2792                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2793                        let encoded = common::to_string(&bytes);
2794                        match serde_json::from_str(&encoded) {
2795                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2796                            Err(error) => {
2797                                dlg.response_json_decode_error(&encoded, &error);
2798                                return Err(common::Error::JsonDecodeError(
2799                                    encoded.to_string(),
2800                                    error,
2801                                ));
2802                            }
2803                        }
2804                    };
2805
2806                    dlg.finished(true);
2807                    return Ok(response);
2808                }
2809            }
2810        }
2811    }
2812
2813    ///
2814    /// Sets the *request* property to the given value.
2815    ///
2816    /// Even though the property as already been set when instantiating this call,
2817    /// we provide this method for API completeness.
2818    pub fn request(mut self, new_value: ShaCertificate) -> ProjectAndroidAppShaCreateCall<'a, C> {
2819        self._request = new_value;
2820        self
2821    }
2822    /// The resource name of the parent AndroidApp to which to add a ShaCertificate, in the format: projects/PROJECT_IDENTIFIER/androidApps/ APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
2823    ///
2824    /// Sets the *parent* path property to the given value.
2825    ///
2826    /// Even though the property as already been set when instantiating this call,
2827    /// we provide this method for API completeness.
2828    pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppShaCreateCall<'a, C> {
2829        self._parent = new_value.to_string();
2830        self
2831    }
2832    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2833    /// while executing the actual API request.
2834    ///
2835    /// ````text
2836    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2837    /// ````
2838    ///
2839    /// Sets the *delegate* property to the given value.
2840    pub fn delegate(
2841        mut self,
2842        new_value: &'a mut dyn common::Delegate,
2843    ) -> ProjectAndroidAppShaCreateCall<'a, C> {
2844        self._delegate = Some(new_value);
2845        self
2846    }
2847
2848    /// Set any additional parameter of the query string used in the request.
2849    /// It should be used to set parameters which are not yet available through their own
2850    /// setters.
2851    ///
2852    /// Please note that this method must not be used to set any of the known parameters
2853    /// which have their own setter method. If done anyway, the request will fail.
2854    ///
2855    /// # Additional Parameters
2856    ///
2857    /// * *$.xgafv* (query-string) - V1 error format.
2858    /// * *access_token* (query-string) - OAuth access token.
2859    /// * *alt* (query-string) - Data format for response.
2860    /// * *callback* (query-string) - JSONP
2861    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2862    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2863    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2864    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2865    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2866    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2867    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2868    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppShaCreateCall<'a, C>
2869    where
2870        T: AsRef<str>,
2871    {
2872        self._additional_params
2873            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2874        self
2875    }
2876
2877    /// Identifies the authorization scope for the method you are building.
2878    ///
2879    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2880    /// [`Scope::CloudPlatform`].
2881    ///
2882    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2883    /// tokens for more than one scope.
2884    ///
2885    /// Usually there is more than one suitable scope to authorize an operation, some of which may
2886    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2887    /// sufficient, a read-write scope will do as well.
2888    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppShaCreateCall<'a, C>
2889    where
2890        St: AsRef<str>,
2891    {
2892        self._scopes.insert(String::from(scope.as_ref()));
2893        self
2894    }
2895    /// Identifies the authorization scope(s) for the method you are building.
2896    ///
2897    /// See [`Self::add_scope()`] for details.
2898    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppShaCreateCall<'a, C>
2899    where
2900        I: IntoIterator<Item = St>,
2901        St: AsRef<str>,
2902    {
2903        self._scopes
2904            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2905        self
2906    }
2907
2908    /// Removes all scopes, and no default scope will be used either.
2909    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2910    /// for details).
2911    pub fn clear_scopes(mut self) -> ProjectAndroidAppShaCreateCall<'a, C> {
2912        self._scopes.clear();
2913        self
2914    }
2915}
2916
2917/// Removes a ShaCertificate from the specified AndroidApp.
2918///
2919/// A builder for the *androidApps.sha.delete* method supported by a *project* resource.
2920/// It is not used directly, but through a [`ProjectMethods`] instance.
2921///
2922/// # Example
2923///
2924/// Instantiate a resource method builder
2925///
2926/// ```test_harness,no_run
2927/// # extern crate hyper;
2928/// # extern crate hyper_rustls;
2929/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2930/// # async fn dox() {
2931/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2932///
2933/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2934/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2935/// #     secret,
2936/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2937/// # ).build().await.unwrap();
2938///
2939/// # let client = hyper_util::client::legacy::Client::builder(
2940/// #     hyper_util::rt::TokioExecutor::new()
2941/// # )
2942/// # .build(
2943/// #     hyper_rustls::HttpsConnectorBuilder::new()
2944/// #         .with_native_roots()
2945/// #         .unwrap()
2946/// #         .https_or_http()
2947/// #         .enable_http1()
2948/// #         .build()
2949/// # );
2950/// # let mut hub = FirebaseManagement::new(client, auth);
2951/// // You can configure optional parameters by calling the respective setters at will, and
2952/// // execute the final call using `doit()`.
2953/// // Values shown here are possibly random and not representative !
2954/// let result = hub.projects().android_apps_sha_delete("name")
2955///              .doit().await;
2956/// # }
2957/// ```
2958pub struct ProjectAndroidAppShaDeleteCall<'a, C>
2959where
2960    C: 'a,
2961{
2962    hub: &'a FirebaseManagement<C>,
2963    _name: String,
2964    _delegate: Option<&'a mut dyn common::Delegate>,
2965    _additional_params: HashMap<String, String>,
2966    _scopes: BTreeSet<String>,
2967}
2968
2969impl<'a, C> common::CallBuilder for ProjectAndroidAppShaDeleteCall<'a, C> {}
2970
2971impl<'a, C> ProjectAndroidAppShaDeleteCall<'a, C>
2972where
2973    C: common::Connector,
2974{
2975    /// Perform the operation you have build so far.
2976    pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
2977        use std::borrow::Cow;
2978        use std::io::{Read, Seek};
2979
2980        use common::{url::Params, ToParts};
2981        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2982
2983        let mut dd = common::DefaultDelegate;
2984        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2985        dlg.begin(common::MethodInfo {
2986            id: "firebase.projects.androidApps.sha.delete",
2987            http_method: hyper::Method::DELETE,
2988        });
2989
2990        for &field in ["alt", "name"].iter() {
2991            if self._additional_params.contains_key(field) {
2992                dlg.finished(false);
2993                return Err(common::Error::FieldClash(field));
2994            }
2995        }
2996
2997        let mut params = Params::with_capacity(3 + self._additional_params.len());
2998        params.push("name", self._name);
2999
3000        params.extend(self._additional_params.iter());
3001
3002        params.push("alt", "json");
3003        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
3004        if self._scopes.is_empty() {
3005            self._scopes
3006                .insert(Scope::CloudPlatform.as_ref().to_string());
3007        }
3008
3009        #[allow(clippy::single_element_loop)]
3010        for &(find_this, param_name) in [("{+name}", "name")].iter() {
3011            url = params.uri_replacement(url, param_name, find_this, true);
3012        }
3013        {
3014            let to_remove = ["name"];
3015            params.remove_params(&to_remove);
3016        }
3017
3018        let url = params.parse_with_url(&url);
3019
3020        loop {
3021            let token = match self
3022                .hub
3023                .auth
3024                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3025                .await
3026            {
3027                Ok(token) => token,
3028                Err(e) => match dlg.token(e) {
3029                    Ok(token) => token,
3030                    Err(e) => {
3031                        dlg.finished(false);
3032                        return Err(common::Error::MissingToken(e));
3033                    }
3034                },
3035            };
3036            let mut req_result = {
3037                let client = &self.hub.client;
3038                dlg.pre_request();
3039                let mut req_builder = hyper::Request::builder()
3040                    .method(hyper::Method::DELETE)
3041                    .uri(url.as_str())
3042                    .header(USER_AGENT, self.hub._user_agent.clone());
3043
3044                if let Some(token) = token.as_ref() {
3045                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3046                }
3047
3048                let request = req_builder
3049                    .header(CONTENT_LENGTH, 0_u64)
3050                    .body(common::to_body::<String>(None));
3051
3052                client.request(request.unwrap()).await
3053            };
3054
3055            match req_result {
3056                Err(err) => {
3057                    if let common::Retry::After(d) = dlg.http_error(&err) {
3058                        sleep(d).await;
3059                        continue;
3060                    }
3061                    dlg.finished(false);
3062                    return Err(common::Error::HttpError(err));
3063                }
3064                Ok(res) => {
3065                    let (mut parts, body) = res.into_parts();
3066                    let mut body = common::Body::new(body);
3067                    if !parts.status.is_success() {
3068                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3069                        let error = serde_json::from_str(&common::to_string(&bytes));
3070                        let response = common::to_response(parts, bytes.into());
3071
3072                        if let common::Retry::After(d) =
3073                            dlg.http_failure(&response, error.as_ref().ok())
3074                        {
3075                            sleep(d).await;
3076                            continue;
3077                        }
3078
3079                        dlg.finished(false);
3080
3081                        return Err(match error {
3082                            Ok(value) => common::Error::BadRequest(value),
3083                            _ => common::Error::Failure(response),
3084                        });
3085                    }
3086                    let response = {
3087                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3088                        let encoded = common::to_string(&bytes);
3089                        match serde_json::from_str(&encoded) {
3090                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3091                            Err(error) => {
3092                                dlg.response_json_decode_error(&encoded, &error);
3093                                return Err(common::Error::JsonDecodeError(
3094                                    encoded.to_string(),
3095                                    error,
3096                                ));
3097                            }
3098                        }
3099                    };
3100
3101                    dlg.finished(true);
3102                    return Ok(response);
3103                }
3104            }
3105        }
3106    }
3107
3108    /// The resource name of the ShaCertificate to remove from the parent AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID /sha/SHA_HASH Refer to the `ShaCertificate` [`name`](https://firebase.google.com/../projects.androidApps.sha#ShaCertificate.FIELDS.name) field for details about PROJECT_IDENTIFIER, APP_ID, and SHA_HASH values. You can obtain the full resource name of the `ShaCertificate` from the response of [`ListShaCertificates`](https://firebase.google.com/../projects.androidApps.sha/list) or the original [`CreateShaCertificate`](https://firebase.google.com/../projects.androidApps.sha/create).
3109    ///
3110    /// Sets the *name* path property to the given value.
3111    ///
3112    /// Even though the property as already been set when instantiating this call,
3113    /// we provide this method for API completeness.
3114    pub fn name(mut self, new_value: &str) -> ProjectAndroidAppShaDeleteCall<'a, C> {
3115        self._name = new_value.to_string();
3116        self
3117    }
3118    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3119    /// while executing the actual API request.
3120    ///
3121    /// ````text
3122    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
3123    /// ````
3124    ///
3125    /// Sets the *delegate* property to the given value.
3126    pub fn delegate(
3127        mut self,
3128        new_value: &'a mut dyn common::Delegate,
3129    ) -> ProjectAndroidAppShaDeleteCall<'a, C> {
3130        self._delegate = Some(new_value);
3131        self
3132    }
3133
3134    /// Set any additional parameter of the query string used in the request.
3135    /// It should be used to set parameters which are not yet available through their own
3136    /// setters.
3137    ///
3138    /// Please note that this method must not be used to set any of the known parameters
3139    /// which have their own setter method. If done anyway, the request will fail.
3140    ///
3141    /// # Additional Parameters
3142    ///
3143    /// * *$.xgafv* (query-string) - V1 error format.
3144    /// * *access_token* (query-string) - OAuth access token.
3145    /// * *alt* (query-string) - Data format for response.
3146    /// * *callback* (query-string) - JSONP
3147    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3148    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3149    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3150    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3151    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3152    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3153    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3154    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppShaDeleteCall<'a, C>
3155    where
3156        T: AsRef<str>,
3157    {
3158        self._additional_params
3159            .insert(name.as_ref().to_string(), value.as_ref().to_string());
3160        self
3161    }
3162
3163    /// Identifies the authorization scope for the method you are building.
3164    ///
3165    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3166    /// [`Scope::CloudPlatform`].
3167    ///
3168    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3169    /// tokens for more than one scope.
3170    ///
3171    /// Usually there is more than one suitable scope to authorize an operation, some of which may
3172    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3173    /// sufficient, a read-write scope will do as well.
3174    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppShaDeleteCall<'a, C>
3175    where
3176        St: AsRef<str>,
3177    {
3178        self._scopes.insert(String::from(scope.as_ref()));
3179        self
3180    }
3181    /// Identifies the authorization scope(s) for the method you are building.
3182    ///
3183    /// See [`Self::add_scope()`] for details.
3184    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppShaDeleteCall<'a, C>
3185    where
3186        I: IntoIterator<Item = St>,
3187        St: AsRef<str>,
3188    {
3189        self._scopes
3190            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3191        self
3192    }
3193
3194    /// Removes all scopes, and no default scope will be used either.
3195    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3196    /// for details).
3197    pub fn clear_scopes(mut self) -> ProjectAndroidAppShaDeleteCall<'a, C> {
3198        self._scopes.clear();
3199        self
3200    }
3201}
3202
3203/// Lists the SHA-1 and SHA-256 certificates for the specified AndroidApp.
3204///
3205/// A builder for the *androidApps.sha.list* method supported by a *project* resource.
3206/// It is not used directly, but through a [`ProjectMethods`] instance.
3207///
3208/// # Example
3209///
3210/// Instantiate a resource method builder
3211///
3212/// ```test_harness,no_run
3213/// # extern crate hyper;
3214/// # extern crate hyper_rustls;
3215/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3216/// # async fn dox() {
3217/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3218///
3219/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3220/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
3221/// #     secret,
3222/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3223/// # ).build().await.unwrap();
3224///
3225/// # let client = hyper_util::client::legacy::Client::builder(
3226/// #     hyper_util::rt::TokioExecutor::new()
3227/// # )
3228/// # .build(
3229/// #     hyper_rustls::HttpsConnectorBuilder::new()
3230/// #         .with_native_roots()
3231/// #         .unwrap()
3232/// #         .https_or_http()
3233/// #         .enable_http1()
3234/// #         .build()
3235/// # );
3236/// # let mut hub = FirebaseManagement::new(client, auth);
3237/// // You can configure optional parameters by calling the respective setters at will, and
3238/// // execute the final call using `doit()`.
3239/// // Values shown here are possibly random and not representative !
3240/// let result = hub.projects().android_apps_sha_list("parent")
3241///              .doit().await;
3242/// # }
3243/// ```
3244pub struct ProjectAndroidAppShaListCall<'a, C>
3245where
3246    C: 'a,
3247{
3248    hub: &'a FirebaseManagement<C>,
3249    _parent: String,
3250    _delegate: Option<&'a mut dyn common::Delegate>,
3251    _additional_params: HashMap<String, String>,
3252    _scopes: BTreeSet<String>,
3253}
3254
3255impl<'a, C> common::CallBuilder for ProjectAndroidAppShaListCall<'a, C> {}
3256
3257impl<'a, C> ProjectAndroidAppShaListCall<'a, C>
3258where
3259    C: common::Connector,
3260{
3261    /// Perform the operation you have build so far.
3262    pub async fn doit(mut self) -> common::Result<(common::Response, ListShaCertificatesResponse)> {
3263        use std::borrow::Cow;
3264        use std::io::{Read, Seek};
3265
3266        use common::{url::Params, ToParts};
3267        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3268
3269        let mut dd = common::DefaultDelegate;
3270        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3271        dlg.begin(common::MethodInfo {
3272            id: "firebase.projects.androidApps.sha.list",
3273            http_method: hyper::Method::GET,
3274        });
3275
3276        for &field in ["alt", "parent"].iter() {
3277            if self._additional_params.contains_key(field) {
3278                dlg.finished(false);
3279                return Err(common::Error::FieldClash(field));
3280            }
3281        }
3282
3283        let mut params = Params::with_capacity(3 + self._additional_params.len());
3284        params.push("parent", self._parent);
3285
3286        params.extend(self._additional_params.iter());
3287
3288        params.push("alt", "json");
3289        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/sha";
3290        if self._scopes.is_empty() {
3291            self._scopes.insert(Scope::Readonly.as_ref().to_string());
3292        }
3293
3294        #[allow(clippy::single_element_loop)]
3295        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
3296            url = params.uri_replacement(url, param_name, find_this, true);
3297        }
3298        {
3299            let to_remove = ["parent"];
3300            params.remove_params(&to_remove);
3301        }
3302
3303        let url = params.parse_with_url(&url);
3304
3305        loop {
3306            let token = match self
3307                .hub
3308                .auth
3309                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3310                .await
3311            {
3312                Ok(token) => token,
3313                Err(e) => match dlg.token(e) {
3314                    Ok(token) => token,
3315                    Err(e) => {
3316                        dlg.finished(false);
3317                        return Err(common::Error::MissingToken(e));
3318                    }
3319                },
3320            };
3321            let mut req_result = {
3322                let client = &self.hub.client;
3323                dlg.pre_request();
3324                let mut req_builder = hyper::Request::builder()
3325                    .method(hyper::Method::GET)
3326                    .uri(url.as_str())
3327                    .header(USER_AGENT, self.hub._user_agent.clone());
3328
3329                if let Some(token) = token.as_ref() {
3330                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3331                }
3332
3333                let request = req_builder
3334                    .header(CONTENT_LENGTH, 0_u64)
3335                    .body(common::to_body::<String>(None));
3336
3337                client.request(request.unwrap()).await
3338            };
3339
3340            match req_result {
3341                Err(err) => {
3342                    if let common::Retry::After(d) = dlg.http_error(&err) {
3343                        sleep(d).await;
3344                        continue;
3345                    }
3346                    dlg.finished(false);
3347                    return Err(common::Error::HttpError(err));
3348                }
3349                Ok(res) => {
3350                    let (mut parts, body) = res.into_parts();
3351                    let mut body = common::Body::new(body);
3352                    if !parts.status.is_success() {
3353                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3354                        let error = serde_json::from_str(&common::to_string(&bytes));
3355                        let response = common::to_response(parts, bytes.into());
3356
3357                        if let common::Retry::After(d) =
3358                            dlg.http_failure(&response, error.as_ref().ok())
3359                        {
3360                            sleep(d).await;
3361                            continue;
3362                        }
3363
3364                        dlg.finished(false);
3365
3366                        return Err(match error {
3367                            Ok(value) => common::Error::BadRequest(value),
3368                            _ => common::Error::Failure(response),
3369                        });
3370                    }
3371                    let response = {
3372                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3373                        let encoded = common::to_string(&bytes);
3374                        match serde_json::from_str(&encoded) {
3375                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3376                            Err(error) => {
3377                                dlg.response_json_decode_error(&encoded, &error);
3378                                return Err(common::Error::JsonDecodeError(
3379                                    encoded.to_string(),
3380                                    error,
3381                                ));
3382                            }
3383                        }
3384                    };
3385
3386                    dlg.finished(true);
3387                    return Ok(response);
3388                }
3389            }
3390        }
3391    }
3392
3393    /// The resource name of the parent AndroidApp for which to list each associated ShaCertificate, in the format: projects/PROJECT_IDENTIFIER /androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
3394    ///
3395    /// Sets the *parent* path property to the given value.
3396    ///
3397    /// Even though the property as already been set when instantiating this call,
3398    /// we provide this method for API completeness.
3399    pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppShaListCall<'a, C> {
3400        self._parent = new_value.to_string();
3401        self
3402    }
3403    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3404    /// while executing the actual API request.
3405    ///
3406    /// ````text
3407    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
3408    /// ````
3409    ///
3410    /// Sets the *delegate* property to the given value.
3411    pub fn delegate(
3412        mut self,
3413        new_value: &'a mut dyn common::Delegate,
3414    ) -> ProjectAndroidAppShaListCall<'a, C> {
3415        self._delegate = Some(new_value);
3416        self
3417    }
3418
3419    /// Set any additional parameter of the query string used in the request.
3420    /// It should be used to set parameters which are not yet available through their own
3421    /// setters.
3422    ///
3423    /// Please note that this method must not be used to set any of the known parameters
3424    /// which have their own setter method. If done anyway, the request will fail.
3425    ///
3426    /// # Additional Parameters
3427    ///
3428    /// * *$.xgafv* (query-string) - V1 error format.
3429    /// * *access_token* (query-string) - OAuth access token.
3430    /// * *alt* (query-string) - Data format for response.
3431    /// * *callback* (query-string) - JSONP
3432    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3433    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3434    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3435    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3436    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3437    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3438    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3439    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppShaListCall<'a, C>
3440    where
3441        T: AsRef<str>,
3442    {
3443        self._additional_params
3444            .insert(name.as_ref().to_string(), value.as_ref().to_string());
3445        self
3446    }
3447
3448    /// Identifies the authorization scope for the method you are building.
3449    ///
3450    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3451    /// [`Scope::Readonly`].
3452    ///
3453    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3454    /// tokens for more than one scope.
3455    ///
3456    /// Usually there is more than one suitable scope to authorize an operation, some of which may
3457    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3458    /// sufficient, a read-write scope will do as well.
3459    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppShaListCall<'a, C>
3460    where
3461        St: AsRef<str>,
3462    {
3463        self._scopes.insert(String::from(scope.as_ref()));
3464        self
3465    }
3466    /// Identifies the authorization scope(s) for the method you are building.
3467    ///
3468    /// See [`Self::add_scope()`] for details.
3469    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppShaListCall<'a, C>
3470    where
3471        I: IntoIterator<Item = St>,
3472        St: AsRef<str>,
3473    {
3474        self._scopes
3475            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3476        self
3477    }
3478
3479    /// Removes all scopes, and no default scope will be used either.
3480    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3481    /// for details).
3482    pub fn clear_scopes(mut self) -> ProjectAndroidAppShaListCall<'a, C> {
3483        self._scopes.clear();
3484        self
3485    }
3486}
3487
3488/// Requests the creation of a new AndroidApp in the specified FirebaseProject. The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`.
3489///
3490/// A builder for the *androidApps.create* method supported by a *project* resource.
3491/// It is not used directly, but through a [`ProjectMethods`] instance.
3492///
3493/// # Example
3494///
3495/// Instantiate a resource method builder
3496///
3497/// ```test_harness,no_run
3498/// # extern crate hyper;
3499/// # extern crate hyper_rustls;
3500/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3501/// use firebase1_beta1::api::AndroidApp;
3502/// # async fn dox() {
3503/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3504///
3505/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3506/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
3507/// #     secret,
3508/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3509/// # ).build().await.unwrap();
3510///
3511/// # let client = hyper_util::client::legacy::Client::builder(
3512/// #     hyper_util::rt::TokioExecutor::new()
3513/// # )
3514/// # .build(
3515/// #     hyper_rustls::HttpsConnectorBuilder::new()
3516/// #         .with_native_roots()
3517/// #         .unwrap()
3518/// #         .https_or_http()
3519/// #         .enable_http1()
3520/// #         .build()
3521/// # );
3522/// # let mut hub = FirebaseManagement::new(client, auth);
3523/// // As the method needs a request, you would usually fill it with the desired information
3524/// // into the respective structure. Some of the parts shown here might not be applicable !
3525/// // Values shown here are possibly random and not representative !
3526/// let mut req = AndroidApp::default();
3527///
3528/// // You can configure optional parameters by calling the respective setters at will, and
3529/// // execute the final call using `doit()`.
3530/// // Values shown here are possibly random and not representative !
3531/// let result = hub.projects().android_apps_create(req, "parent")
3532///              .doit().await;
3533/// # }
3534/// ```
3535pub struct ProjectAndroidAppCreateCall<'a, C>
3536where
3537    C: 'a,
3538{
3539    hub: &'a FirebaseManagement<C>,
3540    _request: AndroidApp,
3541    _parent: String,
3542    _delegate: Option<&'a mut dyn common::Delegate>,
3543    _additional_params: HashMap<String, String>,
3544    _scopes: BTreeSet<String>,
3545}
3546
3547impl<'a, C> common::CallBuilder for ProjectAndroidAppCreateCall<'a, C> {}
3548
3549impl<'a, C> ProjectAndroidAppCreateCall<'a, C>
3550where
3551    C: common::Connector,
3552{
3553    /// Perform the operation you have build so far.
3554    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
3555        use std::borrow::Cow;
3556        use std::io::{Read, Seek};
3557
3558        use common::{url::Params, ToParts};
3559        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3560
3561        let mut dd = common::DefaultDelegate;
3562        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3563        dlg.begin(common::MethodInfo {
3564            id: "firebase.projects.androidApps.create",
3565            http_method: hyper::Method::POST,
3566        });
3567
3568        for &field in ["alt", "parent"].iter() {
3569            if self._additional_params.contains_key(field) {
3570                dlg.finished(false);
3571                return Err(common::Error::FieldClash(field));
3572            }
3573        }
3574
3575        let mut params = Params::with_capacity(4 + self._additional_params.len());
3576        params.push("parent", self._parent);
3577
3578        params.extend(self._additional_params.iter());
3579
3580        params.push("alt", "json");
3581        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/androidApps";
3582        if self._scopes.is_empty() {
3583            self._scopes
3584                .insert(Scope::CloudPlatform.as_ref().to_string());
3585        }
3586
3587        #[allow(clippy::single_element_loop)]
3588        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
3589            url = params.uri_replacement(url, param_name, find_this, true);
3590        }
3591        {
3592            let to_remove = ["parent"];
3593            params.remove_params(&to_remove);
3594        }
3595
3596        let url = params.parse_with_url(&url);
3597
3598        let mut json_mime_type = mime::APPLICATION_JSON;
3599        let mut request_value_reader = {
3600            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
3601            common::remove_json_null_values(&mut value);
3602            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
3603            serde_json::to_writer(&mut dst, &value).unwrap();
3604            dst
3605        };
3606        let request_size = request_value_reader
3607            .seek(std::io::SeekFrom::End(0))
3608            .unwrap();
3609        request_value_reader
3610            .seek(std::io::SeekFrom::Start(0))
3611            .unwrap();
3612
3613        loop {
3614            let token = match self
3615                .hub
3616                .auth
3617                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3618                .await
3619            {
3620                Ok(token) => token,
3621                Err(e) => match dlg.token(e) {
3622                    Ok(token) => token,
3623                    Err(e) => {
3624                        dlg.finished(false);
3625                        return Err(common::Error::MissingToken(e));
3626                    }
3627                },
3628            };
3629            request_value_reader
3630                .seek(std::io::SeekFrom::Start(0))
3631                .unwrap();
3632            let mut req_result = {
3633                let client = &self.hub.client;
3634                dlg.pre_request();
3635                let mut req_builder = hyper::Request::builder()
3636                    .method(hyper::Method::POST)
3637                    .uri(url.as_str())
3638                    .header(USER_AGENT, self.hub._user_agent.clone());
3639
3640                if let Some(token) = token.as_ref() {
3641                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3642                }
3643
3644                let request = req_builder
3645                    .header(CONTENT_TYPE, json_mime_type.to_string())
3646                    .header(CONTENT_LENGTH, request_size as u64)
3647                    .body(common::to_body(
3648                        request_value_reader.get_ref().clone().into(),
3649                    ));
3650
3651                client.request(request.unwrap()).await
3652            };
3653
3654            match req_result {
3655                Err(err) => {
3656                    if let common::Retry::After(d) = dlg.http_error(&err) {
3657                        sleep(d).await;
3658                        continue;
3659                    }
3660                    dlg.finished(false);
3661                    return Err(common::Error::HttpError(err));
3662                }
3663                Ok(res) => {
3664                    let (mut parts, body) = res.into_parts();
3665                    let mut body = common::Body::new(body);
3666                    if !parts.status.is_success() {
3667                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3668                        let error = serde_json::from_str(&common::to_string(&bytes));
3669                        let response = common::to_response(parts, bytes.into());
3670
3671                        if let common::Retry::After(d) =
3672                            dlg.http_failure(&response, error.as_ref().ok())
3673                        {
3674                            sleep(d).await;
3675                            continue;
3676                        }
3677
3678                        dlg.finished(false);
3679
3680                        return Err(match error {
3681                            Ok(value) => common::Error::BadRequest(value),
3682                            _ => common::Error::Failure(response),
3683                        });
3684                    }
3685                    let response = {
3686                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3687                        let encoded = common::to_string(&bytes);
3688                        match serde_json::from_str(&encoded) {
3689                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3690                            Err(error) => {
3691                                dlg.response_json_decode_error(&encoded, &error);
3692                                return Err(common::Error::JsonDecodeError(
3693                                    encoded.to_string(),
3694                                    error,
3695                                ));
3696                            }
3697                        }
3698                    };
3699
3700                    dlg.finished(true);
3701                    return Ok(response);
3702                }
3703            }
3704        }
3705    }
3706
3707    ///
3708    /// Sets the *request* property to the given value.
3709    ///
3710    /// Even though the property as already been set when instantiating this call,
3711    /// we provide this method for API completeness.
3712    pub fn request(mut self, new_value: AndroidApp) -> ProjectAndroidAppCreateCall<'a, C> {
3713        self._request = new_value;
3714        self
3715    }
3716    /// The resource name of the parent FirebaseProject in which to create an AndroidApp, in the format: projects/PROJECT_IDENTIFIER/androidApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
3717    ///
3718    /// Sets the *parent* 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 parent(mut self, new_value: &str) -> ProjectAndroidAppCreateCall<'a, C> {
3723        self._parent = new_value.to_string();
3724        self
3725    }
3726    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3727    /// while executing the actual API request.
3728    ///
3729    /// ````text
3730    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
3731    /// ````
3732    ///
3733    /// Sets the *delegate* property to the given value.
3734    pub fn delegate(
3735        mut self,
3736        new_value: &'a mut dyn common::Delegate,
3737    ) -> ProjectAndroidAppCreateCall<'a, C> {
3738        self._delegate = Some(new_value);
3739        self
3740    }
3741
3742    /// Set any additional parameter of the query string used in the request.
3743    /// It should be used to set parameters which are not yet available through their own
3744    /// setters.
3745    ///
3746    /// Please note that this method must not be used to set any of the known parameters
3747    /// which have their own setter method. If done anyway, the request will fail.
3748    ///
3749    /// # Additional Parameters
3750    ///
3751    /// * *$.xgafv* (query-string) - V1 error format.
3752    /// * *access_token* (query-string) - OAuth access token.
3753    /// * *alt* (query-string) - Data format for response.
3754    /// * *callback* (query-string) - JSONP
3755    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3756    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3757    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3758    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3759    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3760    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3761    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3762    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppCreateCall<'a, C>
3763    where
3764        T: AsRef<str>,
3765    {
3766        self._additional_params
3767            .insert(name.as_ref().to_string(), value.as_ref().to_string());
3768        self
3769    }
3770
3771    /// Identifies the authorization scope for the method you are building.
3772    ///
3773    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3774    /// [`Scope::CloudPlatform`].
3775    ///
3776    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3777    /// tokens for more than one scope.
3778    ///
3779    /// Usually there is more than one suitable scope to authorize an operation, some of which may
3780    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3781    /// sufficient, a read-write scope will do as well.
3782    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppCreateCall<'a, C>
3783    where
3784        St: AsRef<str>,
3785    {
3786        self._scopes.insert(String::from(scope.as_ref()));
3787        self
3788    }
3789    /// Identifies the authorization scope(s) for the method you are building.
3790    ///
3791    /// See [`Self::add_scope()`] for details.
3792    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppCreateCall<'a, C>
3793    where
3794        I: IntoIterator<Item = St>,
3795        St: AsRef<str>,
3796    {
3797        self._scopes
3798            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3799        self
3800    }
3801
3802    /// Removes all scopes, and no default scope will be used either.
3803    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3804    /// for details).
3805    pub fn clear_scopes(mut self) -> ProjectAndroidAppCreateCall<'a, C> {
3806        self._scopes.clear();
3807        self
3808    }
3809}
3810
3811/// Gets the specified AndroidApp.
3812///
3813/// A builder for the *androidApps.get* method supported by a *project* resource.
3814/// It is not used directly, but through a [`ProjectMethods`] instance.
3815///
3816/// # Example
3817///
3818/// Instantiate a resource method builder
3819///
3820/// ```test_harness,no_run
3821/// # extern crate hyper;
3822/// # extern crate hyper_rustls;
3823/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3824/// # async fn dox() {
3825/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3826///
3827/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3828/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
3829/// #     secret,
3830/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3831/// # ).build().await.unwrap();
3832///
3833/// # let client = hyper_util::client::legacy::Client::builder(
3834/// #     hyper_util::rt::TokioExecutor::new()
3835/// # )
3836/// # .build(
3837/// #     hyper_rustls::HttpsConnectorBuilder::new()
3838/// #         .with_native_roots()
3839/// #         .unwrap()
3840/// #         .https_or_http()
3841/// #         .enable_http1()
3842/// #         .build()
3843/// # );
3844/// # let mut hub = FirebaseManagement::new(client, auth);
3845/// // You can configure optional parameters by calling the respective setters at will, and
3846/// // execute the final call using `doit()`.
3847/// // Values shown here are possibly random and not representative !
3848/// let result = hub.projects().android_apps_get("name")
3849///              .doit().await;
3850/// # }
3851/// ```
3852pub struct ProjectAndroidAppGetCall<'a, C>
3853where
3854    C: 'a,
3855{
3856    hub: &'a FirebaseManagement<C>,
3857    _name: String,
3858    _delegate: Option<&'a mut dyn common::Delegate>,
3859    _additional_params: HashMap<String, String>,
3860    _scopes: BTreeSet<String>,
3861}
3862
3863impl<'a, C> common::CallBuilder for ProjectAndroidAppGetCall<'a, C> {}
3864
3865impl<'a, C> ProjectAndroidAppGetCall<'a, C>
3866where
3867    C: common::Connector,
3868{
3869    /// Perform the operation you have build so far.
3870    pub async fn doit(mut self) -> common::Result<(common::Response, AndroidApp)> {
3871        use std::borrow::Cow;
3872        use std::io::{Read, Seek};
3873
3874        use common::{url::Params, ToParts};
3875        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3876
3877        let mut dd = common::DefaultDelegate;
3878        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3879        dlg.begin(common::MethodInfo {
3880            id: "firebase.projects.androidApps.get",
3881            http_method: hyper::Method::GET,
3882        });
3883
3884        for &field in ["alt", "name"].iter() {
3885            if self._additional_params.contains_key(field) {
3886                dlg.finished(false);
3887                return Err(common::Error::FieldClash(field));
3888            }
3889        }
3890
3891        let mut params = Params::with_capacity(3 + self._additional_params.len());
3892        params.push("name", self._name);
3893
3894        params.extend(self._additional_params.iter());
3895
3896        params.push("alt", "json");
3897        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
3898        if self._scopes.is_empty() {
3899            self._scopes.insert(Scope::Readonly.as_ref().to_string());
3900        }
3901
3902        #[allow(clippy::single_element_loop)]
3903        for &(find_this, param_name) in [("{+name}", "name")].iter() {
3904            url = params.uri_replacement(url, param_name, find_this, true);
3905        }
3906        {
3907            let to_remove = ["name"];
3908            params.remove_params(&to_remove);
3909        }
3910
3911        let url = params.parse_with_url(&url);
3912
3913        loop {
3914            let token = match self
3915                .hub
3916                .auth
3917                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3918                .await
3919            {
3920                Ok(token) => token,
3921                Err(e) => match dlg.token(e) {
3922                    Ok(token) => token,
3923                    Err(e) => {
3924                        dlg.finished(false);
3925                        return Err(common::Error::MissingToken(e));
3926                    }
3927                },
3928            };
3929            let mut req_result = {
3930                let client = &self.hub.client;
3931                dlg.pre_request();
3932                let mut req_builder = hyper::Request::builder()
3933                    .method(hyper::Method::GET)
3934                    .uri(url.as_str())
3935                    .header(USER_AGENT, self.hub._user_agent.clone());
3936
3937                if let Some(token) = token.as_ref() {
3938                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3939                }
3940
3941                let request = req_builder
3942                    .header(CONTENT_LENGTH, 0_u64)
3943                    .body(common::to_body::<String>(None));
3944
3945                client.request(request.unwrap()).await
3946            };
3947
3948            match req_result {
3949                Err(err) => {
3950                    if let common::Retry::After(d) = dlg.http_error(&err) {
3951                        sleep(d).await;
3952                        continue;
3953                    }
3954                    dlg.finished(false);
3955                    return Err(common::Error::HttpError(err));
3956                }
3957                Ok(res) => {
3958                    let (mut parts, body) = res.into_parts();
3959                    let mut body = common::Body::new(body);
3960                    if !parts.status.is_success() {
3961                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3962                        let error = serde_json::from_str(&common::to_string(&bytes));
3963                        let response = common::to_response(parts, bytes.into());
3964
3965                        if let common::Retry::After(d) =
3966                            dlg.http_failure(&response, error.as_ref().ok())
3967                        {
3968                            sleep(d).await;
3969                            continue;
3970                        }
3971
3972                        dlg.finished(false);
3973
3974                        return Err(match error {
3975                            Ok(value) => common::Error::BadRequest(value),
3976                            _ => common::Error::Failure(response),
3977                        });
3978                    }
3979                    let response = {
3980                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3981                        let encoded = common::to_string(&bytes);
3982                        match serde_json::from_str(&encoded) {
3983                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3984                            Err(error) => {
3985                                dlg.response_json_decode_error(&encoded, &error);
3986                                return Err(common::Error::JsonDecodeError(
3987                                    encoded.to_string(),
3988                                    error,
3989                                ));
3990                            }
3991                        }
3992                    };
3993
3994                    dlg.finished(true);
3995                    return Ok(response);
3996                }
3997            }
3998        }
3999    }
4000
4001    /// The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
4002    ///
4003    /// Sets the *name* path property to the given value.
4004    ///
4005    /// Even though the property as already been set when instantiating this call,
4006    /// we provide this method for API completeness.
4007    pub fn name(mut self, new_value: &str) -> ProjectAndroidAppGetCall<'a, C> {
4008        self._name = new_value.to_string();
4009        self
4010    }
4011    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4012    /// while executing the actual API request.
4013    ///
4014    /// ````text
4015    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
4016    /// ````
4017    ///
4018    /// Sets the *delegate* property to the given value.
4019    pub fn delegate(
4020        mut self,
4021        new_value: &'a mut dyn common::Delegate,
4022    ) -> ProjectAndroidAppGetCall<'a, C> {
4023        self._delegate = Some(new_value);
4024        self
4025    }
4026
4027    /// Set any additional parameter of the query string used in the request.
4028    /// It should be used to set parameters which are not yet available through their own
4029    /// setters.
4030    ///
4031    /// Please note that this method must not be used to set any of the known parameters
4032    /// which have their own setter method. If done anyway, the request will fail.
4033    ///
4034    /// # Additional Parameters
4035    ///
4036    /// * *$.xgafv* (query-string) - V1 error format.
4037    /// * *access_token* (query-string) - OAuth access token.
4038    /// * *alt* (query-string) - Data format for response.
4039    /// * *callback* (query-string) - JSONP
4040    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4041    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4042    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4043    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4044    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4045    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4046    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4047    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppGetCall<'a, C>
4048    where
4049        T: AsRef<str>,
4050    {
4051        self._additional_params
4052            .insert(name.as_ref().to_string(), value.as_ref().to_string());
4053        self
4054    }
4055
4056    /// Identifies the authorization scope for the method you are building.
4057    ///
4058    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4059    /// [`Scope::Readonly`].
4060    ///
4061    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4062    /// tokens for more than one scope.
4063    ///
4064    /// Usually there is more than one suitable scope to authorize an operation, some of which may
4065    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4066    /// sufficient, a read-write scope will do as well.
4067    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppGetCall<'a, C>
4068    where
4069        St: AsRef<str>,
4070    {
4071        self._scopes.insert(String::from(scope.as_ref()));
4072        self
4073    }
4074    /// Identifies the authorization scope(s) for the method you are building.
4075    ///
4076    /// See [`Self::add_scope()`] for details.
4077    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppGetCall<'a, C>
4078    where
4079        I: IntoIterator<Item = St>,
4080        St: AsRef<str>,
4081    {
4082        self._scopes
4083            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4084        self
4085    }
4086
4087    /// Removes all scopes, and no default scope will be used either.
4088    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4089    /// for details).
4090    pub fn clear_scopes(mut self) -> ProjectAndroidAppGetCall<'a, C> {
4091        self._scopes.clear();
4092        self
4093    }
4094}
4095
4096/// Gets the configuration artifact associated with the specified AndroidApp.
4097///
4098/// A builder for the *androidApps.getConfig* method supported by a *project* resource.
4099/// It is not used directly, but through a [`ProjectMethods`] instance.
4100///
4101/// # Example
4102///
4103/// Instantiate a resource method builder
4104///
4105/// ```test_harness,no_run
4106/// # extern crate hyper;
4107/// # extern crate hyper_rustls;
4108/// # extern crate google_firebase1_beta1 as firebase1_beta1;
4109/// # async fn dox() {
4110/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4111///
4112/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4113/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
4114/// #     secret,
4115/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4116/// # ).build().await.unwrap();
4117///
4118/// # let client = hyper_util::client::legacy::Client::builder(
4119/// #     hyper_util::rt::TokioExecutor::new()
4120/// # )
4121/// # .build(
4122/// #     hyper_rustls::HttpsConnectorBuilder::new()
4123/// #         .with_native_roots()
4124/// #         .unwrap()
4125/// #         .https_or_http()
4126/// #         .enable_http1()
4127/// #         .build()
4128/// # );
4129/// # let mut hub = FirebaseManagement::new(client, auth);
4130/// // You can configure optional parameters by calling the respective setters at will, and
4131/// // execute the final call using `doit()`.
4132/// // Values shown here are possibly random and not representative !
4133/// let result = hub.projects().android_apps_get_config("name")
4134///              .doit().await;
4135/// # }
4136/// ```
4137pub struct ProjectAndroidAppGetConfigCall<'a, C>
4138where
4139    C: 'a,
4140{
4141    hub: &'a FirebaseManagement<C>,
4142    _name: String,
4143    _delegate: Option<&'a mut dyn common::Delegate>,
4144    _additional_params: HashMap<String, String>,
4145    _scopes: BTreeSet<String>,
4146}
4147
4148impl<'a, C> common::CallBuilder for ProjectAndroidAppGetConfigCall<'a, C> {}
4149
4150impl<'a, C> ProjectAndroidAppGetConfigCall<'a, C>
4151where
4152    C: common::Connector,
4153{
4154    /// Perform the operation you have build so far.
4155    pub async fn doit(mut self) -> common::Result<(common::Response, AndroidAppConfig)> {
4156        use std::borrow::Cow;
4157        use std::io::{Read, Seek};
4158
4159        use common::{url::Params, ToParts};
4160        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4161
4162        let mut dd = common::DefaultDelegate;
4163        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4164        dlg.begin(common::MethodInfo {
4165            id: "firebase.projects.androidApps.getConfig",
4166            http_method: hyper::Method::GET,
4167        });
4168
4169        for &field in ["alt", "name"].iter() {
4170            if self._additional_params.contains_key(field) {
4171                dlg.finished(false);
4172                return Err(common::Error::FieldClash(field));
4173            }
4174        }
4175
4176        let mut params = Params::with_capacity(3 + self._additional_params.len());
4177        params.push("name", self._name);
4178
4179        params.extend(self._additional_params.iter());
4180
4181        params.push("alt", "json");
4182        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
4183        if self._scopes.is_empty() {
4184            self._scopes.insert(Scope::Readonly.as_ref().to_string());
4185        }
4186
4187        #[allow(clippy::single_element_loop)]
4188        for &(find_this, param_name) in [("{+name}", "name")].iter() {
4189            url = params.uri_replacement(url, param_name, find_this, true);
4190        }
4191        {
4192            let to_remove = ["name"];
4193            params.remove_params(&to_remove);
4194        }
4195
4196        let url = params.parse_with_url(&url);
4197
4198        loop {
4199            let token = match self
4200                .hub
4201                .auth
4202                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4203                .await
4204            {
4205                Ok(token) => token,
4206                Err(e) => match dlg.token(e) {
4207                    Ok(token) => token,
4208                    Err(e) => {
4209                        dlg.finished(false);
4210                        return Err(common::Error::MissingToken(e));
4211                    }
4212                },
4213            };
4214            let mut req_result = {
4215                let client = &self.hub.client;
4216                dlg.pre_request();
4217                let mut req_builder = hyper::Request::builder()
4218                    .method(hyper::Method::GET)
4219                    .uri(url.as_str())
4220                    .header(USER_AGENT, self.hub._user_agent.clone());
4221
4222                if let Some(token) = token.as_ref() {
4223                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4224                }
4225
4226                let request = req_builder
4227                    .header(CONTENT_LENGTH, 0_u64)
4228                    .body(common::to_body::<String>(None));
4229
4230                client.request(request.unwrap()).await
4231            };
4232
4233            match req_result {
4234                Err(err) => {
4235                    if let common::Retry::After(d) = dlg.http_error(&err) {
4236                        sleep(d).await;
4237                        continue;
4238                    }
4239                    dlg.finished(false);
4240                    return Err(common::Error::HttpError(err));
4241                }
4242                Ok(res) => {
4243                    let (mut parts, body) = res.into_parts();
4244                    let mut body = common::Body::new(body);
4245                    if !parts.status.is_success() {
4246                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4247                        let error = serde_json::from_str(&common::to_string(&bytes));
4248                        let response = common::to_response(parts, bytes.into());
4249
4250                        if let common::Retry::After(d) =
4251                            dlg.http_failure(&response, error.as_ref().ok())
4252                        {
4253                            sleep(d).await;
4254                            continue;
4255                        }
4256
4257                        dlg.finished(false);
4258
4259                        return Err(match error {
4260                            Ok(value) => common::Error::BadRequest(value),
4261                            _ => common::Error::Failure(response),
4262                        });
4263                    }
4264                    let response = {
4265                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4266                        let encoded = common::to_string(&bytes);
4267                        match serde_json::from_str(&encoded) {
4268                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4269                            Err(error) => {
4270                                dlg.response_json_decode_error(&encoded, &error);
4271                                return Err(common::Error::JsonDecodeError(
4272                                    encoded.to_string(),
4273                                    error,
4274                                ));
4275                            }
4276                        }
4277                    };
4278
4279                    dlg.finished(true);
4280                    return Ok(response);
4281                }
4282            }
4283        }
4284    }
4285
4286    /// The resource name of the AndroidApp configuration to download, in the format: projects/PROJECT_IDENTIFIER/androidApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
4287    ///
4288    /// Sets the *name* path property to the given value.
4289    ///
4290    /// Even though the property as already been set when instantiating this call,
4291    /// we provide this method for API completeness.
4292    pub fn name(mut self, new_value: &str) -> ProjectAndroidAppGetConfigCall<'a, C> {
4293        self._name = new_value.to_string();
4294        self
4295    }
4296    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4297    /// while executing the actual API request.
4298    ///
4299    /// ````text
4300    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
4301    /// ````
4302    ///
4303    /// Sets the *delegate* property to the given value.
4304    pub fn delegate(
4305        mut self,
4306        new_value: &'a mut dyn common::Delegate,
4307    ) -> ProjectAndroidAppGetConfigCall<'a, C> {
4308        self._delegate = Some(new_value);
4309        self
4310    }
4311
4312    /// Set any additional parameter of the query string used in the request.
4313    /// It should be used to set parameters which are not yet available through their own
4314    /// setters.
4315    ///
4316    /// Please note that this method must not be used to set any of the known parameters
4317    /// which have their own setter method. If done anyway, the request will fail.
4318    ///
4319    /// # Additional Parameters
4320    ///
4321    /// * *$.xgafv* (query-string) - V1 error format.
4322    /// * *access_token* (query-string) - OAuth access token.
4323    /// * *alt* (query-string) - Data format for response.
4324    /// * *callback* (query-string) - JSONP
4325    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4326    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4327    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4328    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4329    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4330    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4331    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4332    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppGetConfigCall<'a, C>
4333    where
4334        T: AsRef<str>,
4335    {
4336        self._additional_params
4337            .insert(name.as_ref().to_string(), value.as_ref().to_string());
4338        self
4339    }
4340
4341    /// Identifies the authorization scope for the method you are building.
4342    ///
4343    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4344    /// [`Scope::Readonly`].
4345    ///
4346    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4347    /// tokens for more than one scope.
4348    ///
4349    /// Usually there is more than one suitable scope to authorize an operation, some of which may
4350    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4351    /// sufficient, a read-write scope will do as well.
4352    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppGetConfigCall<'a, C>
4353    where
4354        St: AsRef<str>,
4355    {
4356        self._scopes.insert(String::from(scope.as_ref()));
4357        self
4358    }
4359    /// Identifies the authorization scope(s) for the method you are building.
4360    ///
4361    /// See [`Self::add_scope()`] for details.
4362    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppGetConfigCall<'a, C>
4363    where
4364        I: IntoIterator<Item = St>,
4365        St: AsRef<str>,
4366    {
4367        self._scopes
4368            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4369        self
4370    }
4371
4372    /// Removes all scopes, and no default scope will be used either.
4373    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4374    /// for details).
4375    pub fn clear_scopes(mut self) -> ProjectAndroidAppGetConfigCall<'a, C> {
4376        self._scopes.clear();
4377        self
4378    }
4379}
4380
4381/// Lists each AndroidApp associated with the specified FirebaseProject. The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`.
4382///
4383/// A builder for the *androidApps.list* method supported by a *project* resource.
4384/// It is not used directly, but through a [`ProjectMethods`] instance.
4385///
4386/// # Example
4387///
4388/// Instantiate a resource method builder
4389///
4390/// ```test_harness,no_run
4391/// # extern crate hyper;
4392/// # extern crate hyper_rustls;
4393/// # extern crate google_firebase1_beta1 as firebase1_beta1;
4394/// # async fn dox() {
4395/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4396///
4397/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4398/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
4399/// #     secret,
4400/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4401/// # ).build().await.unwrap();
4402///
4403/// # let client = hyper_util::client::legacy::Client::builder(
4404/// #     hyper_util::rt::TokioExecutor::new()
4405/// # )
4406/// # .build(
4407/// #     hyper_rustls::HttpsConnectorBuilder::new()
4408/// #         .with_native_roots()
4409/// #         .unwrap()
4410/// #         .https_or_http()
4411/// #         .enable_http1()
4412/// #         .build()
4413/// # );
4414/// # let mut hub = FirebaseManagement::new(client, auth);
4415/// // You can configure optional parameters by calling the respective setters at will, and
4416/// // execute the final call using `doit()`.
4417/// // Values shown here are possibly random and not representative !
4418/// let result = hub.projects().android_apps_list("parent")
4419///              .show_deleted(true)
4420///              .page_token("Lorem")
4421///              .page_size(-12)
4422///              .doit().await;
4423/// # }
4424/// ```
4425pub struct ProjectAndroidAppListCall<'a, C>
4426where
4427    C: 'a,
4428{
4429    hub: &'a FirebaseManagement<C>,
4430    _parent: String,
4431    _show_deleted: Option<bool>,
4432    _page_token: Option<String>,
4433    _page_size: Option<i32>,
4434    _delegate: Option<&'a mut dyn common::Delegate>,
4435    _additional_params: HashMap<String, String>,
4436    _scopes: BTreeSet<String>,
4437}
4438
4439impl<'a, C> common::CallBuilder for ProjectAndroidAppListCall<'a, C> {}
4440
4441impl<'a, C> ProjectAndroidAppListCall<'a, C>
4442where
4443    C: common::Connector,
4444{
4445    /// Perform the operation you have build so far.
4446    pub async fn doit(mut self) -> common::Result<(common::Response, ListAndroidAppsResponse)> {
4447        use std::borrow::Cow;
4448        use std::io::{Read, Seek};
4449
4450        use common::{url::Params, ToParts};
4451        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4452
4453        let mut dd = common::DefaultDelegate;
4454        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4455        dlg.begin(common::MethodInfo {
4456            id: "firebase.projects.androidApps.list",
4457            http_method: hyper::Method::GET,
4458        });
4459
4460        for &field in ["alt", "parent", "showDeleted", "pageToken", "pageSize"].iter() {
4461            if self._additional_params.contains_key(field) {
4462                dlg.finished(false);
4463                return Err(common::Error::FieldClash(field));
4464            }
4465        }
4466
4467        let mut params = Params::with_capacity(6 + self._additional_params.len());
4468        params.push("parent", self._parent);
4469        if let Some(value) = self._show_deleted.as_ref() {
4470            params.push("showDeleted", value.to_string());
4471        }
4472        if let Some(value) = self._page_token.as_ref() {
4473            params.push("pageToken", value);
4474        }
4475        if let Some(value) = self._page_size.as_ref() {
4476            params.push("pageSize", value.to_string());
4477        }
4478
4479        params.extend(self._additional_params.iter());
4480
4481        params.push("alt", "json");
4482        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/androidApps";
4483        if self._scopes.is_empty() {
4484            self._scopes.insert(Scope::Readonly.as_ref().to_string());
4485        }
4486
4487        #[allow(clippy::single_element_loop)]
4488        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
4489            url = params.uri_replacement(url, param_name, find_this, true);
4490        }
4491        {
4492            let to_remove = ["parent"];
4493            params.remove_params(&to_remove);
4494        }
4495
4496        let url = params.parse_with_url(&url);
4497
4498        loop {
4499            let token = match self
4500                .hub
4501                .auth
4502                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4503                .await
4504            {
4505                Ok(token) => token,
4506                Err(e) => match dlg.token(e) {
4507                    Ok(token) => token,
4508                    Err(e) => {
4509                        dlg.finished(false);
4510                        return Err(common::Error::MissingToken(e));
4511                    }
4512                },
4513            };
4514            let mut req_result = {
4515                let client = &self.hub.client;
4516                dlg.pre_request();
4517                let mut req_builder = hyper::Request::builder()
4518                    .method(hyper::Method::GET)
4519                    .uri(url.as_str())
4520                    .header(USER_AGENT, self.hub._user_agent.clone());
4521
4522                if let Some(token) = token.as_ref() {
4523                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4524                }
4525
4526                let request = req_builder
4527                    .header(CONTENT_LENGTH, 0_u64)
4528                    .body(common::to_body::<String>(None));
4529
4530                client.request(request.unwrap()).await
4531            };
4532
4533            match req_result {
4534                Err(err) => {
4535                    if let common::Retry::After(d) = dlg.http_error(&err) {
4536                        sleep(d).await;
4537                        continue;
4538                    }
4539                    dlg.finished(false);
4540                    return Err(common::Error::HttpError(err));
4541                }
4542                Ok(res) => {
4543                    let (mut parts, body) = res.into_parts();
4544                    let mut body = common::Body::new(body);
4545                    if !parts.status.is_success() {
4546                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4547                        let error = serde_json::from_str(&common::to_string(&bytes));
4548                        let response = common::to_response(parts, bytes.into());
4549
4550                        if let common::Retry::After(d) =
4551                            dlg.http_failure(&response, error.as_ref().ok())
4552                        {
4553                            sleep(d).await;
4554                            continue;
4555                        }
4556
4557                        dlg.finished(false);
4558
4559                        return Err(match error {
4560                            Ok(value) => common::Error::BadRequest(value),
4561                            _ => common::Error::Failure(response),
4562                        });
4563                    }
4564                    let response = {
4565                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4566                        let encoded = common::to_string(&bytes);
4567                        match serde_json::from_str(&encoded) {
4568                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4569                            Err(error) => {
4570                                dlg.response_json_decode_error(&encoded, &error);
4571                                return Err(common::Error::JsonDecodeError(
4572                                    encoded.to_string(),
4573                                    error,
4574                                ));
4575                            }
4576                        }
4577                    };
4578
4579                    dlg.finished(true);
4580                    return Ok(response);
4581                }
4582            }
4583        }
4584    }
4585
4586    /// The resource name of the parent FirebaseProject for which to list each associated AndroidApp, in the format: projects/PROJECT_IDENTIFIER /androidApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
4587    ///
4588    /// Sets the *parent* path property to the given value.
4589    ///
4590    /// Even though the property as already been set when instantiating this call,
4591    /// we provide this method for API completeness.
4592    pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppListCall<'a, C> {
4593        self._parent = new_value.to_string();
4594        self
4595    }
4596    /// Controls whether Apps in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Apps will be returned.
4597    ///
4598    /// Sets the *show deleted* query property to the given value.
4599    pub fn show_deleted(mut self, new_value: bool) -> ProjectAndroidAppListCall<'a, C> {
4600        self._show_deleted = Some(new_value);
4601        self
4602    }
4603    /// Token returned from a previous call to `ListAndroidApps` indicating where in the set of Apps to resume listing.
4604    ///
4605    /// Sets the *page token* query property to the given value.
4606    pub fn page_token(mut self, new_value: &str) -> ProjectAndroidAppListCall<'a, C> {
4607        self._page_token = Some(new_value.to_string());
4608        self
4609    }
4610    /// The maximum number of Apps to return in the response. The server may return fewer than this at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit.
4611    ///
4612    /// Sets the *page size* query property to the given value.
4613    pub fn page_size(mut self, new_value: i32) -> ProjectAndroidAppListCall<'a, C> {
4614        self._page_size = Some(new_value);
4615        self
4616    }
4617    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4618    /// while executing the actual API request.
4619    ///
4620    /// ````text
4621    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
4622    /// ````
4623    ///
4624    /// Sets the *delegate* property to the given value.
4625    pub fn delegate(
4626        mut self,
4627        new_value: &'a mut dyn common::Delegate,
4628    ) -> ProjectAndroidAppListCall<'a, C> {
4629        self._delegate = Some(new_value);
4630        self
4631    }
4632
4633    /// Set any additional parameter of the query string used in the request.
4634    /// It should be used to set parameters which are not yet available through their own
4635    /// setters.
4636    ///
4637    /// Please note that this method must not be used to set any of the known parameters
4638    /// which have their own setter method. If done anyway, the request will fail.
4639    ///
4640    /// # Additional Parameters
4641    ///
4642    /// * *$.xgafv* (query-string) - V1 error format.
4643    /// * *access_token* (query-string) - OAuth access token.
4644    /// * *alt* (query-string) - Data format for response.
4645    /// * *callback* (query-string) - JSONP
4646    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4647    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4648    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4649    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4650    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4651    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4652    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4653    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppListCall<'a, C>
4654    where
4655        T: AsRef<str>,
4656    {
4657        self._additional_params
4658            .insert(name.as_ref().to_string(), value.as_ref().to_string());
4659        self
4660    }
4661
4662    /// Identifies the authorization scope for the method you are building.
4663    ///
4664    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4665    /// [`Scope::Readonly`].
4666    ///
4667    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4668    /// tokens for more than one scope.
4669    ///
4670    /// Usually there is more than one suitable scope to authorize an operation, some of which may
4671    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4672    /// sufficient, a read-write scope will do as well.
4673    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppListCall<'a, C>
4674    where
4675        St: AsRef<str>,
4676    {
4677        self._scopes.insert(String::from(scope.as_ref()));
4678        self
4679    }
4680    /// Identifies the authorization scope(s) for the method you are building.
4681    ///
4682    /// See [`Self::add_scope()`] for details.
4683    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppListCall<'a, C>
4684    where
4685        I: IntoIterator<Item = St>,
4686        St: AsRef<str>,
4687    {
4688        self._scopes
4689            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4690        self
4691    }
4692
4693    /// Removes all scopes, and no default scope will be used either.
4694    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4695    /// for details).
4696    pub fn clear_scopes(mut self) -> ProjectAndroidAppListCall<'a, C> {
4697        self._scopes.clear();
4698        self
4699    }
4700}
4701
4702/// Updates the attributes of the specified AndroidApp.
4703///
4704/// A builder for the *androidApps.patch* method supported by a *project* resource.
4705/// It is not used directly, but through a [`ProjectMethods`] instance.
4706///
4707/// # Example
4708///
4709/// Instantiate a resource method builder
4710///
4711/// ```test_harness,no_run
4712/// # extern crate hyper;
4713/// # extern crate hyper_rustls;
4714/// # extern crate google_firebase1_beta1 as firebase1_beta1;
4715/// use firebase1_beta1::api::AndroidApp;
4716/// # async fn dox() {
4717/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4718///
4719/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4720/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
4721/// #     secret,
4722/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4723/// # ).build().await.unwrap();
4724///
4725/// # let client = hyper_util::client::legacy::Client::builder(
4726/// #     hyper_util::rt::TokioExecutor::new()
4727/// # )
4728/// # .build(
4729/// #     hyper_rustls::HttpsConnectorBuilder::new()
4730/// #         .with_native_roots()
4731/// #         .unwrap()
4732/// #         .https_or_http()
4733/// #         .enable_http1()
4734/// #         .build()
4735/// # );
4736/// # let mut hub = FirebaseManagement::new(client, auth);
4737/// // As the method needs a request, you would usually fill it with the desired information
4738/// // into the respective structure. Some of the parts shown here might not be applicable !
4739/// // Values shown here are possibly random and not representative !
4740/// let mut req = AndroidApp::default();
4741///
4742/// // You can configure optional parameters by calling the respective setters at will, and
4743/// // execute the final call using `doit()`.
4744/// // Values shown here are possibly random and not representative !
4745/// let result = hub.projects().android_apps_patch(req, "name")
4746///              .update_mask(FieldMask::new::<&str>(&[]))
4747///              .doit().await;
4748/// # }
4749/// ```
4750pub struct ProjectAndroidAppPatchCall<'a, C>
4751where
4752    C: 'a,
4753{
4754    hub: &'a FirebaseManagement<C>,
4755    _request: AndroidApp,
4756    _name: String,
4757    _update_mask: Option<common::FieldMask>,
4758    _delegate: Option<&'a mut dyn common::Delegate>,
4759    _additional_params: HashMap<String, String>,
4760    _scopes: BTreeSet<String>,
4761}
4762
4763impl<'a, C> common::CallBuilder for ProjectAndroidAppPatchCall<'a, C> {}
4764
4765impl<'a, C> ProjectAndroidAppPatchCall<'a, C>
4766where
4767    C: common::Connector,
4768{
4769    /// Perform the operation you have build so far.
4770    pub async fn doit(mut self) -> common::Result<(common::Response, AndroidApp)> {
4771        use std::borrow::Cow;
4772        use std::io::{Read, Seek};
4773
4774        use common::{url::Params, ToParts};
4775        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4776
4777        let mut dd = common::DefaultDelegate;
4778        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4779        dlg.begin(common::MethodInfo {
4780            id: "firebase.projects.androidApps.patch",
4781            http_method: hyper::Method::PATCH,
4782        });
4783
4784        for &field in ["alt", "name", "updateMask"].iter() {
4785            if self._additional_params.contains_key(field) {
4786                dlg.finished(false);
4787                return Err(common::Error::FieldClash(field));
4788            }
4789        }
4790
4791        let mut params = Params::with_capacity(5 + self._additional_params.len());
4792        params.push("name", self._name);
4793        if let Some(value) = self._update_mask.as_ref() {
4794            params.push("updateMask", value.to_string());
4795        }
4796
4797        params.extend(self._additional_params.iter());
4798
4799        params.push("alt", "json");
4800        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
4801        if self._scopes.is_empty() {
4802            self._scopes
4803                .insert(Scope::CloudPlatform.as_ref().to_string());
4804        }
4805
4806        #[allow(clippy::single_element_loop)]
4807        for &(find_this, param_name) in [("{+name}", "name")].iter() {
4808            url = params.uri_replacement(url, param_name, find_this, true);
4809        }
4810        {
4811            let to_remove = ["name"];
4812            params.remove_params(&to_remove);
4813        }
4814
4815        let url = params.parse_with_url(&url);
4816
4817        let mut json_mime_type = mime::APPLICATION_JSON;
4818        let mut request_value_reader = {
4819            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
4820            common::remove_json_null_values(&mut value);
4821            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
4822            serde_json::to_writer(&mut dst, &value).unwrap();
4823            dst
4824        };
4825        let request_size = request_value_reader
4826            .seek(std::io::SeekFrom::End(0))
4827            .unwrap();
4828        request_value_reader
4829            .seek(std::io::SeekFrom::Start(0))
4830            .unwrap();
4831
4832        loop {
4833            let token = match self
4834                .hub
4835                .auth
4836                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4837                .await
4838            {
4839                Ok(token) => token,
4840                Err(e) => match dlg.token(e) {
4841                    Ok(token) => token,
4842                    Err(e) => {
4843                        dlg.finished(false);
4844                        return Err(common::Error::MissingToken(e));
4845                    }
4846                },
4847            };
4848            request_value_reader
4849                .seek(std::io::SeekFrom::Start(0))
4850                .unwrap();
4851            let mut req_result = {
4852                let client = &self.hub.client;
4853                dlg.pre_request();
4854                let mut req_builder = hyper::Request::builder()
4855                    .method(hyper::Method::PATCH)
4856                    .uri(url.as_str())
4857                    .header(USER_AGENT, self.hub._user_agent.clone());
4858
4859                if let Some(token) = token.as_ref() {
4860                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4861                }
4862
4863                let request = req_builder
4864                    .header(CONTENT_TYPE, json_mime_type.to_string())
4865                    .header(CONTENT_LENGTH, request_size as u64)
4866                    .body(common::to_body(
4867                        request_value_reader.get_ref().clone().into(),
4868                    ));
4869
4870                client.request(request.unwrap()).await
4871            };
4872
4873            match req_result {
4874                Err(err) => {
4875                    if let common::Retry::After(d) = dlg.http_error(&err) {
4876                        sleep(d).await;
4877                        continue;
4878                    }
4879                    dlg.finished(false);
4880                    return Err(common::Error::HttpError(err));
4881                }
4882                Ok(res) => {
4883                    let (mut parts, body) = res.into_parts();
4884                    let mut body = common::Body::new(body);
4885                    if !parts.status.is_success() {
4886                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4887                        let error = serde_json::from_str(&common::to_string(&bytes));
4888                        let response = common::to_response(parts, bytes.into());
4889
4890                        if let common::Retry::After(d) =
4891                            dlg.http_failure(&response, error.as_ref().ok())
4892                        {
4893                            sleep(d).await;
4894                            continue;
4895                        }
4896
4897                        dlg.finished(false);
4898
4899                        return Err(match error {
4900                            Ok(value) => common::Error::BadRequest(value),
4901                            _ => common::Error::Failure(response),
4902                        });
4903                    }
4904                    let response = {
4905                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4906                        let encoded = common::to_string(&bytes);
4907                        match serde_json::from_str(&encoded) {
4908                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4909                            Err(error) => {
4910                                dlg.response_json_decode_error(&encoded, &error);
4911                                return Err(common::Error::JsonDecodeError(
4912                                    encoded.to_string(),
4913                                    error,
4914                                ));
4915                            }
4916                        }
4917                    };
4918
4919                    dlg.finished(true);
4920                    return Ok(response);
4921                }
4922            }
4923        }
4924    }
4925
4926    ///
4927    /// Sets the *request* property to the given value.
4928    ///
4929    /// Even though the property as already been set when instantiating this call,
4930    /// we provide this method for API completeness.
4931    pub fn request(mut self, new_value: AndroidApp) -> ProjectAndroidAppPatchCall<'a, C> {
4932        self._request = new_value;
4933        self
4934    }
4935    /// The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.app_id)).
4936    ///
4937    /// Sets the *name* path property to the given value.
4938    ///
4939    /// Even though the property as already been set when instantiating this call,
4940    /// we provide this method for API completeness.
4941    pub fn name(mut self, new_value: &str) -> ProjectAndroidAppPatchCall<'a, C> {
4942        self._name = new_value.to_string();
4943        self
4944    }
4945    /// Specifies which fields of the AndroidApp to update. Note that the following fields are immutable: `name`, `app_id`, `project_id`, and `package_name`. To update `state`, use any of the following endpoints: RemoveAndroidApp or UndeleteAndroidApp.
4946    ///
4947    /// Sets the *update mask* query property to the given value.
4948    pub fn update_mask(
4949        mut self,
4950        new_value: common::FieldMask,
4951    ) -> ProjectAndroidAppPatchCall<'a, C> {
4952        self._update_mask = Some(new_value);
4953        self
4954    }
4955    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4956    /// while executing the actual API request.
4957    ///
4958    /// ````text
4959    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
4960    /// ````
4961    ///
4962    /// Sets the *delegate* property to the given value.
4963    pub fn delegate(
4964        mut self,
4965        new_value: &'a mut dyn common::Delegate,
4966    ) -> ProjectAndroidAppPatchCall<'a, C> {
4967        self._delegate = Some(new_value);
4968        self
4969    }
4970
4971    /// Set any additional parameter of the query string used in the request.
4972    /// It should be used to set parameters which are not yet available through their own
4973    /// setters.
4974    ///
4975    /// Please note that this method must not be used to set any of the known parameters
4976    /// which have their own setter method. If done anyway, the request will fail.
4977    ///
4978    /// # Additional Parameters
4979    ///
4980    /// * *$.xgafv* (query-string) - V1 error format.
4981    /// * *access_token* (query-string) - OAuth access token.
4982    /// * *alt* (query-string) - Data format for response.
4983    /// * *callback* (query-string) - JSONP
4984    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4985    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4986    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4987    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4988    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4989    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4990    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4991    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppPatchCall<'a, C>
4992    where
4993        T: AsRef<str>,
4994    {
4995        self._additional_params
4996            .insert(name.as_ref().to_string(), value.as_ref().to_string());
4997        self
4998    }
4999
5000    /// Identifies the authorization scope for the method you are building.
5001    ///
5002    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5003    /// [`Scope::CloudPlatform`].
5004    ///
5005    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5006    /// tokens for more than one scope.
5007    ///
5008    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5009    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5010    /// sufficient, a read-write scope will do as well.
5011    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppPatchCall<'a, C>
5012    where
5013        St: AsRef<str>,
5014    {
5015        self._scopes.insert(String::from(scope.as_ref()));
5016        self
5017    }
5018    /// Identifies the authorization scope(s) for the method you are building.
5019    ///
5020    /// See [`Self::add_scope()`] for details.
5021    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppPatchCall<'a, C>
5022    where
5023        I: IntoIterator<Item = St>,
5024        St: AsRef<str>,
5025    {
5026        self._scopes
5027            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5028        self
5029    }
5030
5031    /// Removes all scopes, and no default scope will be used either.
5032    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5033    /// for details).
5034    pub fn clear_scopes(mut self) -> ProjectAndroidAppPatchCall<'a, C> {
5035        self._scopes.clear();
5036        self
5037    }
5038}
5039
5040/// Removes the specified AndroidApp from the FirebaseProject.
5041///
5042/// A builder for the *androidApps.remove* method supported by a *project* resource.
5043/// It is not used directly, but through a [`ProjectMethods`] instance.
5044///
5045/// # Example
5046///
5047/// Instantiate a resource method builder
5048///
5049/// ```test_harness,no_run
5050/// # extern crate hyper;
5051/// # extern crate hyper_rustls;
5052/// # extern crate google_firebase1_beta1 as firebase1_beta1;
5053/// use firebase1_beta1::api::RemoveAndroidAppRequest;
5054/// # async fn dox() {
5055/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5056///
5057/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5058/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
5059/// #     secret,
5060/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5061/// # ).build().await.unwrap();
5062///
5063/// # let client = hyper_util::client::legacy::Client::builder(
5064/// #     hyper_util::rt::TokioExecutor::new()
5065/// # )
5066/// # .build(
5067/// #     hyper_rustls::HttpsConnectorBuilder::new()
5068/// #         .with_native_roots()
5069/// #         .unwrap()
5070/// #         .https_or_http()
5071/// #         .enable_http1()
5072/// #         .build()
5073/// # );
5074/// # let mut hub = FirebaseManagement::new(client, auth);
5075/// // As the method needs a request, you would usually fill it with the desired information
5076/// // into the respective structure. Some of the parts shown here might not be applicable !
5077/// // Values shown here are possibly random and not representative !
5078/// let mut req = RemoveAndroidAppRequest::default();
5079///
5080/// // You can configure optional parameters by calling the respective setters at will, and
5081/// // execute the final call using `doit()`.
5082/// // Values shown here are possibly random and not representative !
5083/// let result = hub.projects().android_apps_remove(req, "name")
5084///              .doit().await;
5085/// # }
5086/// ```
5087pub struct ProjectAndroidAppRemoveCall<'a, C>
5088where
5089    C: 'a,
5090{
5091    hub: &'a FirebaseManagement<C>,
5092    _request: RemoveAndroidAppRequest,
5093    _name: String,
5094    _delegate: Option<&'a mut dyn common::Delegate>,
5095    _additional_params: HashMap<String, String>,
5096    _scopes: BTreeSet<String>,
5097}
5098
5099impl<'a, C> common::CallBuilder for ProjectAndroidAppRemoveCall<'a, C> {}
5100
5101impl<'a, C> ProjectAndroidAppRemoveCall<'a, C>
5102where
5103    C: common::Connector,
5104{
5105    /// Perform the operation you have build so far.
5106    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
5107        use std::borrow::Cow;
5108        use std::io::{Read, Seek};
5109
5110        use common::{url::Params, ToParts};
5111        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5112
5113        let mut dd = common::DefaultDelegate;
5114        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5115        dlg.begin(common::MethodInfo {
5116            id: "firebase.projects.androidApps.remove",
5117            http_method: hyper::Method::POST,
5118        });
5119
5120        for &field in ["alt", "name"].iter() {
5121            if self._additional_params.contains_key(field) {
5122                dlg.finished(false);
5123                return Err(common::Error::FieldClash(field));
5124            }
5125        }
5126
5127        let mut params = Params::with_capacity(4 + self._additional_params.len());
5128        params.push("name", self._name);
5129
5130        params.extend(self._additional_params.iter());
5131
5132        params.push("alt", "json");
5133        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:remove";
5134        if self._scopes.is_empty() {
5135            self._scopes
5136                .insert(Scope::CloudPlatform.as_ref().to_string());
5137        }
5138
5139        #[allow(clippy::single_element_loop)]
5140        for &(find_this, param_name) in [("{+name}", "name")].iter() {
5141            url = params.uri_replacement(url, param_name, find_this, true);
5142        }
5143        {
5144            let to_remove = ["name"];
5145            params.remove_params(&to_remove);
5146        }
5147
5148        let url = params.parse_with_url(&url);
5149
5150        let mut json_mime_type = mime::APPLICATION_JSON;
5151        let mut request_value_reader = {
5152            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
5153            common::remove_json_null_values(&mut value);
5154            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
5155            serde_json::to_writer(&mut dst, &value).unwrap();
5156            dst
5157        };
5158        let request_size = request_value_reader
5159            .seek(std::io::SeekFrom::End(0))
5160            .unwrap();
5161        request_value_reader
5162            .seek(std::io::SeekFrom::Start(0))
5163            .unwrap();
5164
5165        loop {
5166            let token = match self
5167                .hub
5168                .auth
5169                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5170                .await
5171            {
5172                Ok(token) => token,
5173                Err(e) => match dlg.token(e) {
5174                    Ok(token) => token,
5175                    Err(e) => {
5176                        dlg.finished(false);
5177                        return Err(common::Error::MissingToken(e));
5178                    }
5179                },
5180            };
5181            request_value_reader
5182                .seek(std::io::SeekFrom::Start(0))
5183                .unwrap();
5184            let mut req_result = {
5185                let client = &self.hub.client;
5186                dlg.pre_request();
5187                let mut req_builder = hyper::Request::builder()
5188                    .method(hyper::Method::POST)
5189                    .uri(url.as_str())
5190                    .header(USER_AGENT, self.hub._user_agent.clone());
5191
5192                if let Some(token) = token.as_ref() {
5193                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5194                }
5195
5196                let request = req_builder
5197                    .header(CONTENT_TYPE, json_mime_type.to_string())
5198                    .header(CONTENT_LENGTH, request_size as u64)
5199                    .body(common::to_body(
5200                        request_value_reader.get_ref().clone().into(),
5201                    ));
5202
5203                client.request(request.unwrap()).await
5204            };
5205
5206            match req_result {
5207                Err(err) => {
5208                    if let common::Retry::After(d) = dlg.http_error(&err) {
5209                        sleep(d).await;
5210                        continue;
5211                    }
5212                    dlg.finished(false);
5213                    return Err(common::Error::HttpError(err));
5214                }
5215                Ok(res) => {
5216                    let (mut parts, body) = res.into_parts();
5217                    let mut body = common::Body::new(body);
5218                    if !parts.status.is_success() {
5219                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5220                        let error = serde_json::from_str(&common::to_string(&bytes));
5221                        let response = common::to_response(parts, bytes.into());
5222
5223                        if let common::Retry::After(d) =
5224                            dlg.http_failure(&response, error.as_ref().ok())
5225                        {
5226                            sleep(d).await;
5227                            continue;
5228                        }
5229
5230                        dlg.finished(false);
5231
5232                        return Err(match error {
5233                            Ok(value) => common::Error::BadRequest(value),
5234                            _ => common::Error::Failure(response),
5235                        });
5236                    }
5237                    let response = {
5238                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5239                        let encoded = common::to_string(&bytes);
5240                        match serde_json::from_str(&encoded) {
5241                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5242                            Err(error) => {
5243                                dlg.response_json_decode_error(&encoded, &error);
5244                                return Err(common::Error::JsonDecodeError(
5245                                    encoded.to_string(),
5246                                    error,
5247                                ));
5248                            }
5249                        }
5250                    };
5251
5252                    dlg.finished(true);
5253                    return Ok(response);
5254                }
5255            }
5256        }
5257    }
5258
5259    ///
5260    /// Sets the *request* property to the given value.
5261    ///
5262    /// Even though the property as already been set when instantiating this call,
5263    /// we provide this method for API completeness.
5264    pub fn request(
5265        mut self,
5266        new_value: RemoveAndroidAppRequest,
5267    ) -> ProjectAndroidAppRemoveCall<'a, C> {
5268        self._request = new_value;
5269        self
5270    }
5271    /// Required. The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp [name](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
5272    ///
5273    /// Sets the *name* path property to the given value.
5274    ///
5275    /// Even though the property as already been set when instantiating this call,
5276    /// we provide this method for API completeness.
5277    pub fn name(mut self, new_value: &str) -> ProjectAndroidAppRemoveCall<'a, C> {
5278        self._name = new_value.to_string();
5279        self
5280    }
5281    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5282    /// while executing the actual API request.
5283    ///
5284    /// ````text
5285    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
5286    /// ````
5287    ///
5288    /// Sets the *delegate* property to the given value.
5289    pub fn delegate(
5290        mut self,
5291        new_value: &'a mut dyn common::Delegate,
5292    ) -> ProjectAndroidAppRemoveCall<'a, C> {
5293        self._delegate = Some(new_value);
5294        self
5295    }
5296
5297    /// Set any additional parameter of the query string used in the request.
5298    /// It should be used to set parameters which are not yet available through their own
5299    /// setters.
5300    ///
5301    /// Please note that this method must not be used to set any of the known parameters
5302    /// which have their own setter method. If done anyway, the request will fail.
5303    ///
5304    /// # Additional Parameters
5305    ///
5306    /// * *$.xgafv* (query-string) - V1 error format.
5307    /// * *access_token* (query-string) - OAuth access token.
5308    /// * *alt* (query-string) - Data format for response.
5309    /// * *callback* (query-string) - JSONP
5310    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5311    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5312    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5313    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5314    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5315    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5316    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5317    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppRemoveCall<'a, C>
5318    where
5319        T: AsRef<str>,
5320    {
5321        self._additional_params
5322            .insert(name.as_ref().to_string(), value.as_ref().to_string());
5323        self
5324    }
5325
5326    /// Identifies the authorization scope for the method you are building.
5327    ///
5328    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5329    /// [`Scope::CloudPlatform`].
5330    ///
5331    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5332    /// tokens for more than one scope.
5333    ///
5334    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5335    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5336    /// sufficient, a read-write scope will do as well.
5337    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppRemoveCall<'a, C>
5338    where
5339        St: AsRef<str>,
5340    {
5341        self._scopes.insert(String::from(scope.as_ref()));
5342        self
5343    }
5344    /// Identifies the authorization scope(s) for the method you are building.
5345    ///
5346    /// See [`Self::add_scope()`] for details.
5347    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppRemoveCall<'a, C>
5348    where
5349        I: IntoIterator<Item = St>,
5350        St: AsRef<str>,
5351    {
5352        self._scopes
5353            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5354        self
5355    }
5356
5357    /// Removes all scopes, and no default scope will be used either.
5358    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5359    /// for details).
5360    pub fn clear_scopes(mut self) -> ProjectAndroidAppRemoveCall<'a, C> {
5361        self._scopes.clear();
5362        self
5363    }
5364}
5365
5366/// Restores the specified AndroidApp to the FirebaseProject.
5367///
5368/// A builder for the *androidApps.undelete* method supported by a *project* resource.
5369/// It is not used directly, but through a [`ProjectMethods`] instance.
5370///
5371/// # Example
5372///
5373/// Instantiate a resource method builder
5374///
5375/// ```test_harness,no_run
5376/// # extern crate hyper;
5377/// # extern crate hyper_rustls;
5378/// # extern crate google_firebase1_beta1 as firebase1_beta1;
5379/// use firebase1_beta1::api::UndeleteAndroidAppRequest;
5380/// # async fn dox() {
5381/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5382///
5383/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5384/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
5385/// #     secret,
5386/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5387/// # ).build().await.unwrap();
5388///
5389/// # let client = hyper_util::client::legacy::Client::builder(
5390/// #     hyper_util::rt::TokioExecutor::new()
5391/// # )
5392/// # .build(
5393/// #     hyper_rustls::HttpsConnectorBuilder::new()
5394/// #         .with_native_roots()
5395/// #         .unwrap()
5396/// #         .https_or_http()
5397/// #         .enable_http1()
5398/// #         .build()
5399/// # );
5400/// # let mut hub = FirebaseManagement::new(client, auth);
5401/// // As the method needs a request, you would usually fill it with the desired information
5402/// // into the respective structure. Some of the parts shown here might not be applicable !
5403/// // Values shown here are possibly random and not representative !
5404/// let mut req = UndeleteAndroidAppRequest::default();
5405///
5406/// // You can configure optional parameters by calling the respective setters at will, and
5407/// // execute the final call using `doit()`.
5408/// // Values shown here are possibly random and not representative !
5409/// let result = hub.projects().android_apps_undelete(req, "name")
5410///              .doit().await;
5411/// # }
5412/// ```
5413pub struct ProjectAndroidAppUndeleteCall<'a, C>
5414where
5415    C: 'a,
5416{
5417    hub: &'a FirebaseManagement<C>,
5418    _request: UndeleteAndroidAppRequest,
5419    _name: String,
5420    _delegate: Option<&'a mut dyn common::Delegate>,
5421    _additional_params: HashMap<String, String>,
5422    _scopes: BTreeSet<String>,
5423}
5424
5425impl<'a, C> common::CallBuilder for ProjectAndroidAppUndeleteCall<'a, C> {}
5426
5427impl<'a, C> ProjectAndroidAppUndeleteCall<'a, C>
5428where
5429    C: common::Connector,
5430{
5431    /// Perform the operation you have build so far.
5432    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
5433        use std::borrow::Cow;
5434        use std::io::{Read, Seek};
5435
5436        use common::{url::Params, ToParts};
5437        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5438
5439        let mut dd = common::DefaultDelegate;
5440        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5441        dlg.begin(common::MethodInfo {
5442            id: "firebase.projects.androidApps.undelete",
5443            http_method: hyper::Method::POST,
5444        });
5445
5446        for &field in ["alt", "name"].iter() {
5447            if self._additional_params.contains_key(field) {
5448                dlg.finished(false);
5449                return Err(common::Error::FieldClash(field));
5450            }
5451        }
5452
5453        let mut params = Params::with_capacity(4 + self._additional_params.len());
5454        params.push("name", self._name);
5455
5456        params.extend(self._additional_params.iter());
5457
5458        params.push("alt", "json");
5459        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:undelete";
5460        if self._scopes.is_empty() {
5461            self._scopes
5462                .insert(Scope::CloudPlatform.as_ref().to_string());
5463        }
5464
5465        #[allow(clippy::single_element_loop)]
5466        for &(find_this, param_name) in [("{+name}", "name")].iter() {
5467            url = params.uri_replacement(url, param_name, find_this, true);
5468        }
5469        {
5470            let to_remove = ["name"];
5471            params.remove_params(&to_remove);
5472        }
5473
5474        let url = params.parse_with_url(&url);
5475
5476        let mut json_mime_type = mime::APPLICATION_JSON;
5477        let mut request_value_reader = {
5478            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
5479            common::remove_json_null_values(&mut value);
5480            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
5481            serde_json::to_writer(&mut dst, &value).unwrap();
5482            dst
5483        };
5484        let request_size = request_value_reader
5485            .seek(std::io::SeekFrom::End(0))
5486            .unwrap();
5487        request_value_reader
5488            .seek(std::io::SeekFrom::Start(0))
5489            .unwrap();
5490
5491        loop {
5492            let token = match self
5493                .hub
5494                .auth
5495                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5496                .await
5497            {
5498                Ok(token) => token,
5499                Err(e) => match dlg.token(e) {
5500                    Ok(token) => token,
5501                    Err(e) => {
5502                        dlg.finished(false);
5503                        return Err(common::Error::MissingToken(e));
5504                    }
5505                },
5506            };
5507            request_value_reader
5508                .seek(std::io::SeekFrom::Start(0))
5509                .unwrap();
5510            let mut req_result = {
5511                let client = &self.hub.client;
5512                dlg.pre_request();
5513                let mut req_builder = hyper::Request::builder()
5514                    .method(hyper::Method::POST)
5515                    .uri(url.as_str())
5516                    .header(USER_AGENT, self.hub._user_agent.clone());
5517
5518                if let Some(token) = token.as_ref() {
5519                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5520                }
5521
5522                let request = req_builder
5523                    .header(CONTENT_TYPE, json_mime_type.to_string())
5524                    .header(CONTENT_LENGTH, request_size as u64)
5525                    .body(common::to_body(
5526                        request_value_reader.get_ref().clone().into(),
5527                    ));
5528
5529                client.request(request.unwrap()).await
5530            };
5531
5532            match req_result {
5533                Err(err) => {
5534                    if let common::Retry::After(d) = dlg.http_error(&err) {
5535                        sleep(d).await;
5536                        continue;
5537                    }
5538                    dlg.finished(false);
5539                    return Err(common::Error::HttpError(err));
5540                }
5541                Ok(res) => {
5542                    let (mut parts, body) = res.into_parts();
5543                    let mut body = common::Body::new(body);
5544                    if !parts.status.is_success() {
5545                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5546                        let error = serde_json::from_str(&common::to_string(&bytes));
5547                        let response = common::to_response(parts, bytes.into());
5548
5549                        if let common::Retry::After(d) =
5550                            dlg.http_failure(&response, error.as_ref().ok())
5551                        {
5552                            sleep(d).await;
5553                            continue;
5554                        }
5555
5556                        dlg.finished(false);
5557
5558                        return Err(match error {
5559                            Ok(value) => common::Error::BadRequest(value),
5560                            _ => common::Error::Failure(response),
5561                        });
5562                    }
5563                    let response = {
5564                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5565                        let encoded = common::to_string(&bytes);
5566                        match serde_json::from_str(&encoded) {
5567                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5568                            Err(error) => {
5569                                dlg.response_json_decode_error(&encoded, &error);
5570                                return Err(common::Error::JsonDecodeError(
5571                                    encoded.to_string(),
5572                                    error,
5573                                ));
5574                            }
5575                        }
5576                    };
5577
5578                    dlg.finished(true);
5579                    return Ok(response);
5580                }
5581            }
5582        }
5583    }
5584
5585    ///
5586    /// Sets the *request* property to the given value.
5587    ///
5588    /// Even though the property as already been set when instantiating this call,
5589    /// we provide this method for API completeness.
5590    pub fn request(
5591        mut self,
5592        new_value: UndeleteAndroidAppRequest,
5593    ) -> ProjectAndroidAppUndeleteCall<'a, C> {
5594        self._request = new_value;
5595        self
5596    }
5597    /// Required. The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the AndroidApp [name](https://firebase.google.com/../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
5598    ///
5599    /// Sets the *name* path property to the given value.
5600    ///
5601    /// Even though the property as already been set when instantiating this call,
5602    /// we provide this method for API completeness.
5603    pub fn name(mut self, new_value: &str) -> ProjectAndroidAppUndeleteCall<'a, C> {
5604        self._name = new_value.to_string();
5605        self
5606    }
5607    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5608    /// while executing the actual API request.
5609    ///
5610    /// ````text
5611    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
5612    /// ````
5613    ///
5614    /// Sets the *delegate* property to the given value.
5615    pub fn delegate(
5616        mut self,
5617        new_value: &'a mut dyn common::Delegate,
5618    ) -> ProjectAndroidAppUndeleteCall<'a, C> {
5619        self._delegate = Some(new_value);
5620        self
5621    }
5622
5623    /// Set any additional parameter of the query string used in the request.
5624    /// It should be used to set parameters which are not yet available through their own
5625    /// setters.
5626    ///
5627    /// Please note that this method must not be used to set any of the known parameters
5628    /// which have their own setter method. If done anyway, the request will fail.
5629    ///
5630    /// # Additional Parameters
5631    ///
5632    /// * *$.xgafv* (query-string) - V1 error format.
5633    /// * *access_token* (query-string) - OAuth access token.
5634    /// * *alt* (query-string) - Data format for response.
5635    /// * *callback* (query-string) - JSONP
5636    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5637    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5638    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5639    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5640    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5641    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5642    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5643    pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppUndeleteCall<'a, C>
5644    where
5645        T: AsRef<str>,
5646    {
5647        self._additional_params
5648            .insert(name.as_ref().to_string(), value.as_ref().to_string());
5649        self
5650    }
5651
5652    /// Identifies the authorization scope for the method you are building.
5653    ///
5654    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5655    /// [`Scope::CloudPlatform`].
5656    ///
5657    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5658    /// tokens for more than one scope.
5659    ///
5660    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5661    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5662    /// sufficient, a read-write scope will do as well.
5663    pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppUndeleteCall<'a, C>
5664    where
5665        St: AsRef<str>,
5666    {
5667        self._scopes.insert(String::from(scope.as_ref()));
5668        self
5669    }
5670    /// Identifies the authorization scope(s) for the method you are building.
5671    ///
5672    /// See [`Self::add_scope()`] for details.
5673    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppUndeleteCall<'a, C>
5674    where
5675        I: IntoIterator<Item = St>,
5676        St: AsRef<str>,
5677    {
5678        self._scopes
5679            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5680        self
5681    }
5682
5683    /// Removes all scopes, and no default scope will be used either.
5684    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5685    /// for details).
5686    pub fn clear_scopes(mut self) -> ProjectAndroidAppUndeleteCall<'a, C> {
5687        self._scopes.clear();
5688        self
5689    }
5690}
5691
5692/// **DEPRECATED.** _Instead, use the applicable resource-specific REST API (or associated documentation, as needed) to determine valid locations for each resource used in your Project._ Lists the valid Google Cloud Platform (GCP) resource locations for the specified Project (including a FirebaseProject). One of these locations can be selected as the Project's [_default_ GCP resource location](https://firebase.google.com/docs/projects/locations), which is the geographical location where the Project's resources, such as Cloud Firestore, will be provisioned by default. However, if the default GCP resource location has already been set for the Project, then this setting cannot be changed. This call checks for any possible [location restrictions](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations) for the specified Project and, thus, might return a subset of all possible GCP resource locations. To list all GCP resource locations (regardless of any restrictions), call the endpoint without specifying a unique project identifier (that is, `/v1beta1/{parent=projects/-}/listAvailableLocations`). To call `ListAvailableLocations` with a specified project, a member must be at minimum a Viewer of the Project. Calls without a specified project do not require any specific project permissions.
5693///
5694/// A builder for the *availableLocations.list* method supported by a *project* resource.
5695/// It is not used directly, but through a [`ProjectMethods`] instance.
5696///
5697/// # Example
5698///
5699/// Instantiate a resource method builder
5700///
5701/// ```test_harness,no_run
5702/// # extern crate hyper;
5703/// # extern crate hyper_rustls;
5704/// # extern crate google_firebase1_beta1 as firebase1_beta1;
5705/// # async fn dox() {
5706/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5707///
5708/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5709/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
5710/// #     secret,
5711/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5712/// # ).build().await.unwrap();
5713///
5714/// # let client = hyper_util::client::legacy::Client::builder(
5715/// #     hyper_util::rt::TokioExecutor::new()
5716/// # )
5717/// # .build(
5718/// #     hyper_rustls::HttpsConnectorBuilder::new()
5719/// #         .with_native_roots()
5720/// #         .unwrap()
5721/// #         .https_or_http()
5722/// #         .enable_http1()
5723/// #         .build()
5724/// # );
5725/// # let mut hub = FirebaseManagement::new(client, auth);
5726/// // You can configure optional parameters by calling the respective setters at will, and
5727/// // execute the final call using `doit()`.
5728/// // Values shown here are possibly random and not representative !
5729/// let result = hub.projects().available_locations_list("parent")
5730///              .page_token("invidunt")
5731///              .page_size(-47)
5732///              .doit().await;
5733/// # }
5734/// ```
5735pub struct ProjectAvailableLocationListCall<'a, C>
5736where
5737    C: 'a,
5738{
5739    hub: &'a FirebaseManagement<C>,
5740    _parent: String,
5741    _page_token: Option<String>,
5742    _page_size: Option<i32>,
5743    _delegate: Option<&'a mut dyn common::Delegate>,
5744    _additional_params: HashMap<String, String>,
5745    _scopes: BTreeSet<String>,
5746}
5747
5748impl<'a, C> common::CallBuilder for ProjectAvailableLocationListCall<'a, C> {}
5749
5750impl<'a, C> ProjectAvailableLocationListCall<'a, C>
5751where
5752    C: common::Connector,
5753{
5754    /// Perform the operation you have build so far.
5755    pub async fn doit(
5756        mut self,
5757    ) -> common::Result<(common::Response, ListAvailableLocationsResponse)> {
5758        use std::borrow::Cow;
5759        use std::io::{Read, Seek};
5760
5761        use common::{url::Params, ToParts};
5762        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5763
5764        let mut dd = common::DefaultDelegate;
5765        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5766        dlg.begin(common::MethodInfo {
5767            id: "firebase.projects.availableLocations.list",
5768            http_method: hyper::Method::GET,
5769        });
5770
5771        for &field in ["alt", "parent", "pageToken", "pageSize"].iter() {
5772            if self._additional_params.contains_key(field) {
5773                dlg.finished(false);
5774                return Err(common::Error::FieldClash(field));
5775            }
5776        }
5777
5778        let mut params = Params::with_capacity(5 + self._additional_params.len());
5779        params.push("parent", self._parent);
5780        if let Some(value) = self._page_token.as_ref() {
5781            params.push("pageToken", value);
5782        }
5783        if let Some(value) = self._page_size.as_ref() {
5784            params.push("pageSize", value.to_string());
5785        }
5786
5787        params.extend(self._additional_params.iter());
5788
5789        params.push("alt", "json");
5790        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/availableLocations";
5791        if self._scopes.is_empty() {
5792            self._scopes.insert(Scope::Readonly.as_ref().to_string());
5793        }
5794
5795        #[allow(clippy::single_element_loop)]
5796        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
5797            url = params.uri_replacement(url, param_name, find_this, true);
5798        }
5799        {
5800            let to_remove = ["parent"];
5801            params.remove_params(&to_remove);
5802        }
5803
5804        let url = params.parse_with_url(&url);
5805
5806        loop {
5807            let token = match self
5808                .hub
5809                .auth
5810                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5811                .await
5812            {
5813                Ok(token) => token,
5814                Err(e) => match dlg.token(e) {
5815                    Ok(token) => token,
5816                    Err(e) => {
5817                        dlg.finished(false);
5818                        return Err(common::Error::MissingToken(e));
5819                    }
5820                },
5821            };
5822            let mut req_result = {
5823                let client = &self.hub.client;
5824                dlg.pre_request();
5825                let mut req_builder = hyper::Request::builder()
5826                    .method(hyper::Method::GET)
5827                    .uri(url.as_str())
5828                    .header(USER_AGENT, self.hub._user_agent.clone());
5829
5830                if let Some(token) = token.as_ref() {
5831                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5832                }
5833
5834                let request = req_builder
5835                    .header(CONTENT_LENGTH, 0_u64)
5836                    .body(common::to_body::<String>(None));
5837
5838                client.request(request.unwrap()).await
5839            };
5840
5841            match req_result {
5842                Err(err) => {
5843                    if let common::Retry::After(d) = dlg.http_error(&err) {
5844                        sleep(d).await;
5845                        continue;
5846                    }
5847                    dlg.finished(false);
5848                    return Err(common::Error::HttpError(err));
5849                }
5850                Ok(res) => {
5851                    let (mut parts, body) = res.into_parts();
5852                    let mut body = common::Body::new(body);
5853                    if !parts.status.is_success() {
5854                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5855                        let error = serde_json::from_str(&common::to_string(&bytes));
5856                        let response = common::to_response(parts, bytes.into());
5857
5858                        if let common::Retry::After(d) =
5859                            dlg.http_failure(&response, error.as_ref().ok())
5860                        {
5861                            sleep(d).await;
5862                            continue;
5863                        }
5864
5865                        dlg.finished(false);
5866
5867                        return Err(match error {
5868                            Ok(value) => common::Error::BadRequest(value),
5869                            _ => common::Error::Failure(response),
5870                        });
5871                    }
5872                    let response = {
5873                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5874                        let encoded = common::to_string(&bytes);
5875                        match serde_json::from_str(&encoded) {
5876                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5877                            Err(error) => {
5878                                dlg.response_json_decode_error(&encoded, &error);
5879                                return Err(common::Error::JsonDecodeError(
5880                                    encoded.to_string(),
5881                                    error,
5882                                ));
5883                            }
5884                        }
5885                    };
5886
5887                    dlg.finished(true);
5888                    return Ok(response);
5889                }
5890            }
5891        }
5892    }
5893
5894    /// The FirebaseProject for which to list GCP resource locations, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values. If no unique project identifier is specified (that is, `projects/-`), the returned list does not take into account org-specific or project-specific location restrictions.
5895    ///
5896    /// Sets the *parent* path property to the given value.
5897    ///
5898    /// Even though the property as already been set when instantiating this call,
5899    /// we provide this method for API completeness.
5900    pub fn parent(mut self, new_value: &str) -> ProjectAvailableLocationListCall<'a, C> {
5901        self._parent = new_value.to_string();
5902        self
5903    }
5904    /// Token returned from a previous call to `ListAvailableLocations` indicating where in the list of locations to resume listing.
5905    ///
5906    /// Sets the *page token* query property to the given value.
5907    pub fn page_token(mut self, new_value: &str) -> ProjectAvailableLocationListCall<'a, C> {
5908        self._page_token = Some(new_value.to_string());
5909        self
5910    }
5911    /// The maximum number of locations to return in the response. The server may return fewer than this value at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit. This value cannot be negative.
5912    ///
5913    /// Sets the *page size* query property to the given value.
5914    pub fn page_size(mut self, new_value: i32) -> ProjectAvailableLocationListCall<'a, C> {
5915        self._page_size = Some(new_value);
5916        self
5917    }
5918    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5919    /// while executing the actual API request.
5920    ///
5921    /// ````text
5922    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
5923    /// ````
5924    ///
5925    /// Sets the *delegate* property to the given value.
5926    pub fn delegate(
5927        mut self,
5928        new_value: &'a mut dyn common::Delegate,
5929    ) -> ProjectAvailableLocationListCall<'a, C> {
5930        self._delegate = Some(new_value);
5931        self
5932    }
5933
5934    /// Set any additional parameter of the query string used in the request.
5935    /// It should be used to set parameters which are not yet available through their own
5936    /// setters.
5937    ///
5938    /// Please note that this method must not be used to set any of the known parameters
5939    /// which have their own setter method. If done anyway, the request will fail.
5940    ///
5941    /// # Additional Parameters
5942    ///
5943    /// * *$.xgafv* (query-string) - V1 error format.
5944    /// * *access_token* (query-string) - OAuth access token.
5945    /// * *alt* (query-string) - Data format for response.
5946    /// * *callback* (query-string) - JSONP
5947    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5948    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5949    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5950    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5951    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5952    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5953    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5954    pub fn param<T>(mut self, name: T, value: T) -> ProjectAvailableLocationListCall<'a, C>
5955    where
5956        T: AsRef<str>,
5957    {
5958        self._additional_params
5959            .insert(name.as_ref().to_string(), value.as_ref().to_string());
5960        self
5961    }
5962
5963    /// Identifies the authorization scope for the method you are building.
5964    ///
5965    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5966    /// [`Scope::Readonly`].
5967    ///
5968    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5969    /// tokens for more than one scope.
5970    ///
5971    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5972    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5973    /// sufficient, a read-write scope will do as well.
5974    pub fn add_scope<St>(mut self, scope: St) -> ProjectAvailableLocationListCall<'a, C>
5975    where
5976        St: AsRef<str>,
5977    {
5978        self._scopes.insert(String::from(scope.as_ref()));
5979        self
5980    }
5981    /// Identifies the authorization scope(s) for the method you are building.
5982    ///
5983    /// See [`Self::add_scope()`] for details.
5984    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAvailableLocationListCall<'a, C>
5985    where
5986        I: IntoIterator<Item = St>,
5987        St: AsRef<str>,
5988    {
5989        self._scopes
5990            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5991        self
5992    }
5993
5994    /// Removes all scopes, and no default scope will be used either.
5995    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5996    /// for details).
5997    pub fn clear_scopes(mut self) -> ProjectAvailableLocationListCall<'a, C> {
5998        self._scopes.clear();
5999        self
6000    }
6001}
6002
6003/// **DEPRECATED.** *Instead, use the applicable resource-specific REST API to set the location for each resource used in your Project.* Sets the default Google Cloud Platform (GCP) resource location for the specified FirebaseProject. This method creates an App Engine application with a [default Cloud Storage bucket](https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/setting-up-cloud-storage#activating_a_cloud_storage_bucket), located in the specified [`locationId`](#body.request_body.FIELDS.location_id). This location must be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations). After the default GCP resource location is finalized, or if it was already set, it cannot be changed. The default GCP resource location for the specified `FirebaseProject` might already be set because either the underlying GCP `Project` already has an App Engine application or `FinalizeDefaultLocation` was previously called with a specified `locationId`. Any new calls to `FinalizeDefaultLocation` with a *different* specified `locationId` will return a 409 error. The result of this call is an [`Operation`](https://firebase.google.com/../../v1beta1/operations), which can be used to track the provisioning process. The [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) type of the `Operation` is google.protobuf.Empty. The `Operation` can be polled by its `name` using GetOperation until `done` is true. When `done` is true, the `Operation` has either succeeded or failed. If the `Operation` has succeeded, its [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) will be set to a google.protobuf.Empty; if the `Operation` has failed, its `error` will be set to a google.rpc.Status. The `Operation` is automatically deleted after completion, so there is no need to call DeleteOperation. All fields listed in the [request body](#request-body) are required. To call `FinalizeDefaultLocation`, a member must be an Owner of the Project.
6004///
6005/// A builder for the *defaultLocation.finalize* method supported by a *project* resource.
6006/// It is not used directly, but through a [`ProjectMethods`] instance.
6007///
6008/// # Example
6009///
6010/// Instantiate a resource method builder
6011///
6012/// ```test_harness,no_run
6013/// # extern crate hyper;
6014/// # extern crate hyper_rustls;
6015/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6016/// use firebase1_beta1::api::FinalizeDefaultLocationRequest;
6017/// # async fn dox() {
6018/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6019///
6020/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6021/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6022/// #     secret,
6023/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6024/// # ).build().await.unwrap();
6025///
6026/// # let client = hyper_util::client::legacy::Client::builder(
6027/// #     hyper_util::rt::TokioExecutor::new()
6028/// # )
6029/// # .build(
6030/// #     hyper_rustls::HttpsConnectorBuilder::new()
6031/// #         .with_native_roots()
6032/// #         .unwrap()
6033/// #         .https_or_http()
6034/// #         .enable_http1()
6035/// #         .build()
6036/// # );
6037/// # let mut hub = FirebaseManagement::new(client, auth);
6038/// // As the method needs a request, you would usually fill it with the desired information
6039/// // into the respective structure. Some of the parts shown here might not be applicable !
6040/// // Values shown here are possibly random and not representative !
6041/// let mut req = FinalizeDefaultLocationRequest::default();
6042///
6043/// // You can configure optional parameters by calling the respective setters at will, and
6044/// // execute the final call using `doit()`.
6045/// // Values shown here are possibly random and not representative !
6046/// let result = hub.projects().default_location_finalize(req, "parent")
6047///              .doit().await;
6048/// # }
6049/// ```
6050pub struct ProjectDefaultLocationFinalizeCall<'a, C>
6051where
6052    C: 'a,
6053{
6054    hub: &'a FirebaseManagement<C>,
6055    _request: FinalizeDefaultLocationRequest,
6056    _parent: String,
6057    _delegate: Option<&'a mut dyn common::Delegate>,
6058    _additional_params: HashMap<String, String>,
6059    _scopes: BTreeSet<String>,
6060}
6061
6062impl<'a, C> common::CallBuilder for ProjectDefaultLocationFinalizeCall<'a, C> {}
6063
6064impl<'a, C> ProjectDefaultLocationFinalizeCall<'a, C>
6065where
6066    C: common::Connector,
6067{
6068    /// Perform the operation you have build so far.
6069    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
6070        use std::borrow::Cow;
6071        use std::io::{Read, Seek};
6072
6073        use common::{url::Params, ToParts};
6074        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6075
6076        let mut dd = common::DefaultDelegate;
6077        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6078        dlg.begin(common::MethodInfo {
6079            id: "firebase.projects.defaultLocation.finalize",
6080            http_method: hyper::Method::POST,
6081        });
6082
6083        for &field in ["alt", "parent"].iter() {
6084            if self._additional_params.contains_key(field) {
6085                dlg.finished(false);
6086                return Err(common::Error::FieldClash(field));
6087            }
6088        }
6089
6090        let mut params = Params::with_capacity(4 + self._additional_params.len());
6091        params.push("parent", self._parent);
6092
6093        params.extend(self._additional_params.iter());
6094
6095        params.push("alt", "json");
6096        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/defaultLocation:finalize";
6097        if self._scopes.is_empty() {
6098            self._scopes
6099                .insert(Scope::CloudPlatform.as_ref().to_string());
6100        }
6101
6102        #[allow(clippy::single_element_loop)]
6103        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
6104            url = params.uri_replacement(url, param_name, find_this, true);
6105        }
6106        {
6107            let to_remove = ["parent"];
6108            params.remove_params(&to_remove);
6109        }
6110
6111        let url = params.parse_with_url(&url);
6112
6113        let mut json_mime_type = mime::APPLICATION_JSON;
6114        let mut request_value_reader = {
6115            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
6116            common::remove_json_null_values(&mut value);
6117            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
6118            serde_json::to_writer(&mut dst, &value).unwrap();
6119            dst
6120        };
6121        let request_size = request_value_reader
6122            .seek(std::io::SeekFrom::End(0))
6123            .unwrap();
6124        request_value_reader
6125            .seek(std::io::SeekFrom::Start(0))
6126            .unwrap();
6127
6128        loop {
6129            let token = match self
6130                .hub
6131                .auth
6132                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6133                .await
6134            {
6135                Ok(token) => token,
6136                Err(e) => match dlg.token(e) {
6137                    Ok(token) => token,
6138                    Err(e) => {
6139                        dlg.finished(false);
6140                        return Err(common::Error::MissingToken(e));
6141                    }
6142                },
6143            };
6144            request_value_reader
6145                .seek(std::io::SeekFrom::Start(0))
6146                .unwrap();
6147            let mut req_result = {
6148                let client = &self.hub.client;
6149                dlg.pre_request();
6150                let mut req_builder = hyper::Request::builder()
6151                    .method(hyper::Method::POST)
6152                    .uri(url.as_str())
6153                    .header(USER_AGENT, self.hub._user_agent.clone());
6154
6155                if let Some(token) = token.as_ref() {
6156                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6157                }
6158
6159                let request = req_builder
6160                    .header(CONTENT_TYPE, json_mime_type.to_string())
6161                    .header(CONTENT_LENGTH, request_size as u64)
6162                    .body(common::to_body(
6163                        request_value_reader.get_ref().clone().into(),
6164                    ));
6165
6166                client.request(request.unwrap()).await
6167            };
6168
6169            match req_result {
6170                Err(err) => {
6171                    if let common::Retry::After(d) = dlg.http_error(&err) {
6172                        sleep(d).await;
6173                        continue;
6174                    }
6175                    dlg.finished(false);
6176                    return Err(common::Error::HttpError(err));
6177                }
6178                Ok(res) => {
6179                    let (mut parts, body) = res.into_parts();
6180                    let mut body = common::Body::new(body);
6181                    if !parts.status.is_success() {
6182                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6183                        let error = serde_json::from_str(&common::to_string(&bytes));
6184                        let response = common::to_response(parts, bytes.into());
6185
6186                        if let common::Retry::After(d) =
6187                            dlg.http_failure(&response, error.as_ref().ok())
6188                        {
6189                            sleep(d).await;
6190                            continue;
6191                        }
6192
6193                        dlg.finished(false);
6194
6195                        return Err(match error {
6196                            Ok(value) => common::Error::BadRequest(value),
6197                            _ => common::Error::Failure(response),
6198                        });
6199                    }
6200                    let response = {
6201                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6202                        let encoded = common::to_string(&bytes);
6203                        match serde_json::from_str(&encoded) {
6204                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6205                            Err(error) => {
6206                                dlg.response_json_decode_error(&encoded, &error);
6207                                return Err(common::Error::JsonDecodeError(
6208                                    encoded.to_string(),
6209                                    error,
6210                                ));
6211                            }
6212                        }
6213                    };
6214
6215                    dlg.finished(true);
6216                    return Ok(response);
6217                }
6218            }
6219        }
6220    }
6221
6222    ///
6223    /// Sets the *request* property to the given value.
6224    ///
6225    /// Even though the property as already been set when instantiating this call,
6226    /// we provide this method for API completeness.
6227    pub fn request(
6228        mut self,
6229        new_value: FinalizeDefaultLocationRequest,
6230    ) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6231        self._request = new_value;
6232        self
6233    }
6234    /// The resource name of the FirebaseProject for which the default GCP resource location will be set, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
6235    ///
6236    /// Sets the *parent* path property to the given value.
6237    ///
6238    /// Even though the property as already been set when instantiating this call,
6239    /// we provide this method for API completeness.
6240    pub fn parent(mut self, new_value: &str) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6241        self._parent = new_value.to_string();
6242        self
6243    }
6244    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6245    /// while executing the actual API request.
6246    ///
6247    /// ````text
6248    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
6249    /// ````
6250    ///
6251    /// Sets the *delegate* property to the given value.
6252    pub fn delegate(
6253        mut self,
6254        new_value: &'a mut dyn common::Delegate,
6255    ) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6256        self._delegate = Some(new_value);
6257        self
6258    }
6259
6260    /// Set any additional parameter of the query string used in the request.
6261    /// It should be used to set parameters which are not yet available through their own
6262    /// setters.
6263    ///
6264    /// Please note that this method must not be used to set any of the known parameters
6265    /// which have their own setter method. If done anyway, the request will fail.
6266    ///
6267    /// # Additional Parameters
6268    ///
6269    /// * *$.xgafv* (query-string) - V1 error format.
6270    /// * *access_token* (query-string) - OAuth access token.
6271    /// * *alt* (query-string) - Data format for response.
6272    /// * *callback* (query-string) - JSONP
6273    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6274    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6275    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6276    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6277    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6278    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6279    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6280    pub fn param<T>(mut self, name: T, value: T) -> ProjectDefaultLocationFinalizeCall<'a, C>
6281    where
6282        T: AsRef<str>,
6283    {
6284        self._additional_params
6285            .insert(name.as_ref().to_string(), value.as_ref().to_string());
6286        self
6287    }
6288
6289    /// Identifies the authorization scope for the method you are building.
6290    ///
6291    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6292    /// [`Scope::CloudPlatform`].
6293    ///
6294    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6295    /// tokens for more than one scope.
6296    ///
6297    /// Usually there is more than one suitable scope to authorize an operation, some of which may
6298    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6299    /// sufficient, a read-write scope will do as well.
6300    pub fn add_scope<St>(mut self, scope: St) -> ProjectDefaultLocationFinalizeCall<'a, C>
6301    where
6302        St: AsRef<str>,
6303    {
6304        self._scopes.insert(String::from(scope.as_ref()));
6305        self
6306    }
6307    /// Identifies the authorization scope(s) for the method you are building.
6308    ///
6309    /// See [`Self::add_scope()`] for details.
6310    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectDefaultLocationFinalizeCall<'a, C>
6311    where
6312        I: IntoIterator<Item = St>,
6313        St: AsRef<str>,
6314    {
6315        self._scopes
6316            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6317        self
6318    }
6319
6320    /// Removes all scopes, and no default scope will be used either.
6321    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6322    /// for details).
6323    pub fn clear_scopes(mut self) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6324        self._scopes.clear();
6325        self
6326    }
6327}
6328
6329/// Requests the creation of a new IosApp in the specified FirebaseProject. The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`.
6330///
6331/// A builder for the *iosApps.create* method supported by a *project* resource.
6332/// It is not used directly, but through a [`ProjectMethods`] instance.
6333///
6334/// # Example
6335///
6336/// Instantiate a resource method builder
6337///
6338/// ```test_harness,no_run
6339/// # extern crate hyper;
6340/// # extern crate hyper_rustls;
6341/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6342/// use firebase1_beta1::api::IosApp;
6343/// # async fn dox() {
6344/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6345///
6346/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6347/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6348/// #     secret,
6349/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6350/// # ).build().await.unwrap();
6351///
6352/// # let client = hyper_util::client::legacy::Client::builder(
6353/// #     hyper_util::rt::TokioExecutor::new()
6354/// # )
6355/// # .build(
6356/// #     hyper_rustls::HttpsConnectorBuilder::new()
6357/// #         .with_native_roots()
6358/// #         .unwrap()
6359/// #         .https_or_http()
6360/// #         .enable_http1()
6361/// #         .build()
6362/// # );
6363/// # let mut hub = FirebaseManagement::new(client, auth);
6364/// // As the method needs a request, you would usually fill it with the desired information
6365/// // into the respective structure. Some of the parts shown here might not be applicable !
6366/// // Values shown here are possibly random and not representative !
6367/// let mut req = IosApp::default();
6368///
6369/// // You can configure optional parameters by calling the respective setters at will, and
6370/// // execute the final call using `doit()`.
6371/// // Values shown here are possibly random and not representative !
6372/// let result = hub.projects().ios_apps_create(req, "parent")
6373///              .doit().await;
6374/// # }
6375/// ```
6376pub struct ProjectIosAppCreateCall<'a, C>
6377where
6378    C: 'a,
6379{
6380    hub: &'a FirebaseManagement<C>,
6381    _request: IosApp,
6382    _parent: String,
6383    _delegate: Option<&'a mut dyn common::Delegate>,
6384    _additional_params: HashMap<String, String>,
6385    _scopes: BTreeSet<String>,
6386}
6387
6388impl<'a, C> common::CallBuilder for ProjectIosAppCreateCall<'a, C> {}
6389
6390impl<'a, C> ProjectIosAppCreateCall<'a, C>
6391where
6392    C: common::Connector,
6393{
6394    /// Perform the operation you have build so far.
6395    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
6396        use std::borrow::Cow;
6397        use std::io::{Read, Seek};
6398
6399        use common::{url::Params, ToParts};
6400        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6401
6402        let mut dd = common::DefaultDelegate;
6403        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6404        dlg.begin(common::MethodInfo {
6405            id: "firebase.projects.iosApps.create",
6406            http_method: hyper::Method::POST,
6407        });
6408
6409        for &field in ["alt", "parent"].iter() {
6410            if self._additional_params.contains_key(field) {
6411                dlg.finished(false);
6412                return Err(common::Error::FieldClash(field));
6413            }
6414        }
6415
6416        let mut params = Params::with_capacity(4 + self._additional_params.len());
6417        params.push("parent", self._parent);
6418
6419        params.extend(self._additional_params.iter());
6420
6421        params.push("alt", "json");
6422        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/iosApps";
6423        if self._scopes.is_empty() {
6424            self._scopes
6425                .insert(Scope::CloudPlatform.as_ref().to_string());
6426        }
6427
6428        #[allow(clippy::single_element_loop)]
6429        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
6430            url = params.uri_replacement(url, param_name, find_this, true);
6431        }
6432        {
6433            let to_remove = ["parent"];
6434            params.remove_params(&to_remove);
6435        }
6436
6437        let url = params.parse_with_url(&url);
6438
6439        let mut json_mime_type = mime::APPLICATION_JSON;
6440        let mut request_value_reader = {
6441            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
6442            common::remove_json_null_values(&mut value);
6443            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
6444            serde_json::to_writer(&mut dst, &value).unwrap();
6445            dst
6446        };
6447        let request_size = request_value_reader
6448            .seek(std::io::SeekFrom::End(0))
6449            .unwrap();
6450        request_value_reader
6451            .seek(std::io::SeekFrom::Start(0))
6452            .unwrap();
6453
6454        loop {
6455            let token = match self
6456                .hub
6457                .auth
6458                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6459                .await
6460            {
6461                Ok(token) => token,
6462                Err(e) => match dlg.token(e) {
6463                    Ok(token) => token,
6464                    Err(e) => {
6465                        dlg.finished(false);
6466                        return Err(common::Error::MissingToken(e));
6467                    }
6468                },
6469            };
6470            request_value_reader
6471                .seek(std::io::SeekFrom::Start(0))
6472                .unwrap();
6473            let mut req_result = {
6474                let client = &self.hub.client;
6475                dlg.pre_request();
6476                let mut req_builder = hyper::Request::builder()
6477                    .method(hyper::Method::POST)
6478                    .uri(url.as_str())
6479                    .header(USER_AGENT, self.hub._user_agent.clone());
6480
6481                if let Some(token) = token.as_ref() {
6482                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6483                }
6484
6485                let request = req_builder
6486                    .header(CONTENT_TYPE, json_mime_type.to_string())
6487                    .header(CONTENT_LENGTH, request_size as u64)
6488                    .body(common::to_body(
6489                        request_value_reader.get_ref().clone().into(),
6490                    ));
6491
6492                client.request(request.unwrap()).await
6493            };
6494
6495            match req_result {
6496                Err(err) => {
6497                    if let common::Retry::After(d) = dlg.http_error(&err) {
6498                        sleep(d).await;
6499                        continue;
6500                    }
6501                    dlg.finished(false);
6502                    return Err(common::Error::HttpError(err));
6503                }
6504                Ok(res) => {
6505                    let (mut parts, body) = res.into_parts();
6506                    let mut body = common::Body::new(body);
6507                    if !parts.status.is_success() {
6508                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6509                        let error = serde_json::from_str(&common::to_string(&bytes));
6510                        let response = common::to_response(parts, bytes.into());
6511
6512                        if let common::Retry::After(d) =
6513                            dlg.http_failure(&response, error.as_ref().ok())
6514                        {
6515                            sleep(d).await;
6516                            continue;
6517                        }
6518
6519                        dlg.finished(false);
6520
6521                        return Err(match error {
6522                            Ok(value) => common::Error::BadRequest(value),
6523                            _ => common::Error::Failure(response),
6524                        });
6525                    }
6526                    let response = {
6527                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6528                        let encoded = common::to_string(&bytes);
6529                        match serde_json::from_str(&encoded) {
6530                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6531                            Err(error) => {
6532                                dlg.response_json_decode_error(&encoded, &error);
6533                                return Err(common::Error::JsonDecodeError(
6534                                    encoded.to_string(),
6535                                    error,
6536                                ));
6537                            }
6538                        }
6539                    };
6540
6541                    dlg.finished(true);
6542                    return Ok(response);
6543                }
6544            }
6545        }
6546    }
6547
6548    ///
6549    /// Sets the *request* property to the given value.
6550    ///
6551    /// Even though the property as already been set when instantiating this call,
6552    /// we provide this method for API completeness.
6553    pub fn request(mut self, new_value: IosApp) -> ProjectIosAppCreateCall<'a, C> {
6554        self._request = new_value;
6555        self
6556    }
6557    /// The resource name of the parent FirebaseProject in which to create an IosApp, in the format: projects/PROJECT_IDENTIFIER/iosApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
6558    ///
6559    /// Sets the *parent* path property to the given value.
6560    ///
6561    /// Even though the property as already been set when instantiating this call,
6562    /// we provide this method for API completeness.
6563    pub fn parent(mut self, new_value: &str) -> ProjectIosAppCreateCall<'a, C> {
6564        self._parent = new_value.to_string();
6565        self
6566    }
6567    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6568    /// while executing the actual API request.
6569    ///
6570    /// ````text
6571    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
6572    /// ````
6573    ///
6574    /// Sets the *delegate* property to the given value.
6575    pub fn delegate(
6576        mut self,
6577        new_value: &'a mut dyn common::Delegate,
6578    ) -> ProjectIosAppCreateCall<'a, C> {
6579        self._delegate = Some(new_value);
6580        self
6581    }
6582
6583    /// Set any additional parameter of the query string used in the request.
6584    /// It should be used to set parameters which are not yet available through their own
6585    /// setters.
6586    ///
6587    /// Please note that this method must not be used to set any of the known parameters
6588    /// which have their own setter method. If done anyway, the request will fail.
6589    ///
6590    /// # Additional Parameters
6591    ///
6592    /// * *$.xgafv* (query-string) - V1 error format.
6593    /// * *access_token* (query-string) - OAuth access token.
6594    /// * *alt* (query-string) - Data format for response.
6595    /// * *callback* (query-string) - JSONP
6596    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6597    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6598    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6599    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6600    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6601    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6602    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6603    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppCreateCall<'a, C>
6604    where
6605        T: AsRef<str>,
6606    {
6607        self._additional_params
6608            .insert(name.as_ref().to_string(), value.as_ref().to_string());
6609        self
6610    }
6611
6612    /// Identifies the authorization scope for the method you are building.
6613    ///
6614    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6615    /// [`Scope::CloudPlatform`].
6616    ///
6617    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6618    /// tokens for more than one scope.
6619    ///
6620    /// Usually there is more than one suitable scope to authorize an operation, some of which may
6621    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6622    /// sufficient, a read-write scope will do as well.
6623    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppCreateCall<'a, C>
6624    where
6625        St: AsRef<str>,
6626    {
6627        self._scopes.insert(String::from(scope.as_ref()));
6628        self
6629    }
6630    /// Identifies the authorization scope(s) for the method you are building.
6631    ///
6632    /// See [`Self::add_scope()`] for details.
6633    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppCreateCall<'a, C>
6634    where
6635        I: IntoIterator<Item = St>,
6636        St: AsRef<str>,
6637    {
6638        self._scopes
6639            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6640        self
6641    }
6642
6643    /// Removes all scopes, and no default scope will be used either.
6644    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6645    /// for details).
6646    pub fn clear_scopes(mut self) -> ProjectIosAppCreateCall<'a, C> {
6647        self._scopes.clear();
6648        self
6649    }
6650}
6651
6652/// Gets the specified IosApp.
6653///
6654/// A builder for the *iosApps.get* method supported by a *project* resource.
6655/// It is not used directly, but through a [`ProjectMethods`] instance.
6656///
6657/// # Example
6658///
6659/// Instantiate a resource method builder
6660///
6661/// ```test_harness,no_run
6662/// # extern crate hyper;
6663/// # extern crate hyper_rustls;
6664/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6665/// # async fn dox() {
6666/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6667///
6668/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6669/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6670/// #     secret,
6671/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6672/// # ).build().await.unwrap();
6673///
6674/// # let client = hyper_util::client::legacy::Client::builder(
6675/// #     hyper_util::rt::TokioExecutor::new()
6676/// # )
6677/// # .build(
6678/// #     hyper_rustls::HttpsConnectorBuilder::new()
6679/// #         .with_native_roots()
6680/// #         .unwrap()
6681/// #         .https_or_http()
6682/// #         .enable_http1()
6683/// #         .build()
6684/// # );
6685/// # let mut hub = FirebaseManagement::new(client, auth);
6686/// // You can configure optional parameters by calling the respective setters at will, and
6687/// // execute the final call using `doit()`.
6688/// // Values shown here are possibly random and not representative !
6689/// let result = hub.projects().ios_apps_get("name")
6690///              .doit().await;
6691/// # }
6692/// ```
6693pub struct ProjectIosAppGetCall<'a, C>
6694where
6695    C: 'a,
6696{
6697    hub: &'a FirebaseManagement<C>,
6698    _name: String,
6699    _delegate: Option<&'a mut dyn common::Delegate>,
6700    _additional_params: HashMap<String, String>,
6701    _scopes: BTreeSet<String>,
6702}
6703
6704impl<'a, C> common::CallBuilder for ProjectIosAppGetCall<'a, C> {}
6705
6706impl<'a, C> ProjectIosAppGetCall<'a, C>
6707where
6708    C: common::Connector,
6709{
6710    /// Perform the operation you have build so far.
6711    pub async fn doit(mut self) -> common::Result<(common::Response, IosApp)> {
6712        use std::borrow::Cow;
6713        use std::io::{Read, Seek};
6714
6715        use common::{url::Params, ToParts};
6716        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6717
6718        let mut dd = common::DefaultDelegate;
6719        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6720        dlg.begin(common::MethodInfo {
6721            id: "firebase.projects.iosApps.get",
6722            http_method: hyper::Method::GET,
6723        });
6724
6725        for &field in ["alt", "name"].iter() {
6726            if self._additional_params.contains_key(field) {
6727                dlg.finished(false);
6728                return Err(common::Error::FieldClash(field));
6729            }
6730        }
6731
6732        let mut params = Params::with_capacity(3 + self._additional_params.len());
6733        params.push("name", self._name);
6734
6735        params.extend(self._additional_params.iter());
6736
6737        params.push("alt", "json");
6738        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
6739        if self._scopes.is_empty() {
6740            self._scopes.insert(Scope::Readonly.as_ref().to_string());
6741        }
6742
6743        #[allow(clippy::single_element_loop)]
6744        for &(find_this, param_name) in [("{+name}", "name")].iter() {
6745            url = params.uri_replacement(url, param_name, find_this, true);
6746        }
6747        {
6748            let to_remove = ["name"];
6749            params.remove_params(&to_remove);
6750        }
6751
6752        let url = params.parse_with_url(&url);
6753
6754        loop {
6755            let token = match self
6756                .hub
6757                .auth
6758                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6759                .await
6760            {
6761                Ok(token) => token,
6762                Err(e) => match dlg.token(e) {
6763                    Ok(token) => token,
6764                    Err(e) => {
6765                        dlg.finished(false);
6766                        return Err(common::Error::MissingToken(e));
6767                    }
6768                },
6769            };
6770            let mut req_result = {
6771                let client = &self.hub.client;
6772                dlg.pre_request();
6773                let mut req_builder = hyper::Request::builder()
6774                    .method(hyper::Method::GET)
6775                    .uri(url.as_str())
6776                    .header(USER_AGENT, self.hub._user_agent.clone());
6777
6778                if let Some(token) = token.as_ref() {
6779                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6780                }
6781
6782                let request = req_builder
6783                    .header(CONTENT_LENGTH, 0_u64)
6784                    .body(common::to_body::<String>(None));
6785
6786                client.request(request.unwrap()).await
6787            };
6788
6789            match req_result {
6790                Err(err) => {
6791                    if let common::Retry::After(d) = dlg.http_error(&err) {
6792                        sleep(d).await;
6793                        continue;
6794                    }
6795                    dlg.finished(false);
6796                    return Err(common::Error::HttpError(err));
6797                }
6798                Ok(res) => {
6799                    let (mut parts, body) = res.into_parts();
6800                    let mut body = common::Body::new(body);
6801                    if !parts.status.is_success() {
6802                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6803                        let error = serde_json::from_str(&common::to_string(&bytes));
6804                        let response = common::to_response(parts, bytes.into());
6805
6806                        if let common::Retry::After(d) =
6807                            dlg.http_failure(&response, error.as_ref().ok())
6808                        {
6809                            sleep(d).await;
6810                            continue;
6811                        }
6812
6813                        dlg.finished(false);
6814
6815                        return Err(match error {
6816                            Ok(value) => common::Error::BadRequest(value),
6817                            _ => common::Error::Failure(response),
6818                        });
6819                    }
6820                    let response = {
6821                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6822                        let encoded = common::to_string(&bytes);
6823                        match serde_json::from_str(&encoded) {
6824                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6825                            Err(error) => {
6826                                dlg.response_json_decode_error(&encoded, &error);
6827                                return Err(common::Error::JsonDecodeError(
6828                                    encoded.to_string(),
6829                                    error,
6830                                ));
6831                            }
6832                        }
6833                    };
6834
6835                    dlg.finished(true);
6836                    return Ok(response);
6837                }
6838            }
6839        }
6840    }
6841
6842    /// The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the `IosApp` [`name`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
6843    ///
6844    /// Sets the *name* path property to the given value.
6845    ///
6846    /// Even though the property as already been set when instantiating this call,
6847    /// we provide this method for API completeness.
6848    pub fn name(mut self, new_value: &str) -> ProjectIosAppGetCall<'a, C> {
6849        self._name = new_value.to_string();
6850        self
6851    }
6852    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6853    /// while executing the actual API request.
6854    ///
6855    /// ````text
6856    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
6857    /// ````
6858    ///
6859    /// Sets the *delegate* property to the given value.
6860    pub fn delegate(
6861        mut self,
6862        new_value: &'a mut dyn common::Delegate,
6863    ) -> ProjectIosAppGetCall<'a, C> {
6864        self._delegate = Some(new_value);
6865        self
6866    }
6867
6868    /// Set any additional parameter of the query string used in the request.
6869    /// It should be used to set parameters which are not yet available through their own
6870    /// setters.
6871    ///
6872    /// Please note that this method must not be used to set any of the known parameters
6873    /// which have their own setter method. If done anyway, the request will fail.
6874    ///
6875    /// # Additional Parameters
6876    ///
6877    /// * *$.xgafv* (query-string) - V1 error format.
6878    /// * *access_token* (query-string) - OAuth access token.
6879    /// * *alt* (query-string) - Data format for response.
6880    /// * *callback* (query-string) - JSONP
6881    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6882    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6883    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6884    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6885    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6886    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6887    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6888    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppGetCall<'a, C>
6889    where
6890        T: AsRef<str>,
6891    {
6892        self._additional_params
6893            .insert(name.as_ref().to_string(), value.as_ref().to_string());
6894        self
6895    }
6896
6897    /// Identifies the authorization scope for the method you are building.
6898    ///
6899    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6900    /// [`Scope::Readonly`].
6901    ///
6902    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6903    /// tokens for more than one scope.
6904    ///
6905    /// Usually there is more than one suitable scope to authorize an operation, some of which may
6906    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6907    /// sufficient, a read-write scope will do as well.
6908    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppGetCall<'a, C>
6909    where
6910        St: AsRef<str>,
6911    {
6912        self._scopes.insert(String::from(scope.as_ref()));
6913        self
6914    }
6915    /// Identifies the authorization scope(s) for the method you are building.
6916    ///
6917    /// See [`Self::add_scope()`] for details.
6918    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppGetCall<'a, C>
6919    where
6920        I: IntoIterator<Item = St>,
6921        St: AsRef<str>,
6922    {
6923        self._scopes
6924            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6925        self
6926    }
6927
6928    /// Removes all scopes, and no default scope will be used either.
6929    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6930    /// for details).
6931    pub fn clear_scopes(mut self) -> ProjectIosAppGetCall<'a, C> {
6932        self._scopes.clear();
6933        self
6934    }
6935}
6936
6937/// Gets the configuration artifact associated with the specified IosApp.
6938///
6939/// A builder for the *iosApps.getConfig* method supported by a *project* resource.
6940/// It is not used directly, but through a [`ProjectMethods`] instance.
6941///
6942/// # Example
6943///
6944/// Instantiate a resource method builder
6945///
6946/// ```test_harness,no_run
6947/// # extern crate hyper;
6948/// # extern crate hyper_rustls;
6949/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6950/// # async fn dox() {
6951/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6952///
6953/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6954/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
6955/// #     secret,
6956/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6957/// # ).build().await.unwrap();
6958///
6959/// # let client = hyper_util::client::legacy::Client::builder(
6960/// #     hyper_util::rt::TokioExecutor::new()
6961/// # )
6962/// # .build(
6963/// #     hyper_rustls::HttpsConnectorBuilder::new()
6964/// #         .with_native_roots()
6965/// #         .unwrap()
6966/// #         .https_or_http()
6967/// #         .enable_http1()
6968/// #         .build()
6969/// # );
6970/// # let mut hub = FirebaseManagement::new(client, auth);
6971/// // You can configure optional parameters by calling the respective setters at will, and
6972/// // execute the final call using `doit()`.
6973/// // Values shown here are possibly random and not representative !
6974/// let result = hub.projects().ios_apps_get_config("name")
6975///              .doit().await;
6976/// # }
6977/// ```
6978pub struct ProjectIosAppGetConfigCall<'a, C>
6979where
6980    C: 'a,
6981{
6982    hub: &'a FirebaseManagement<C>,
6983    _name: String,
6984    _delegate: Option<&'a mut dyn common::Delegate>,
6985    _additional_params: HashMap<String, String>,
6986    _scopes: BTreeSet<String>,
6987}
6988
6989impl<'a, C> common::CallBuilder for ProjectIosAppGetConfigCall<'a, C> {}
6990
6991impl<'a, C> ProjectIosAppGetConfigCall<'a, C>
6992where
6993    C: common::Connector,
6994{
6995    /// Perform the operation you have build so far.
6996    pub async fn doit(mut self) -> common::Result<(common::Response, IosAppConfig)> {
6997        use std::borrow::Cow;
6998        use std::io::{Read, Seek};
6999
7000        use common::{url::Params, ToParts};
7001        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7002
7003        let mut dd = common::DefaultDelegate;
7004        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7005        dlg.begin(common::MethodInfo {
7006            id: "firebase.projects.iosApps.getConfig",
7007            http_method: hyper::Method::GET,
7008        });
7009
7010        for &field in ["alt", "name"].iter() {
7011            if self._additional_params.contains_key(field) {
7012                dlg.finished(false);
7013                return Err(common::Error::FieldClash(field));
7014            }
7015        }
7016
7017        let mut params = Params::with_capacity(3 + self._additional_params.len());
7018        params.push("name", self._name);
7019
7020        params.extend(self._additional_params.iter());
7021
7022        params.push("alt", "json");
7023        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
7024        if self._scopes.is_empty() {
7025            self._scopes.insert(Scope::Readonly.as_ref().to_string());
7026        }
7027
7028        #[allow(clippy::single_element_loop)]
7029        for &(find_this, param_name) in [("{+name}", "name")].iter() {
7030            url = params.uri_replacement(url, param_name, find_this, true);
7031        }
7032        {
7033            let to_remove = ["name"];
7034            params.remove_params(&to_remove);
7035        }
7036
7037        let url = params.parse_with_url(&url);
7038
7039        loop {
7040            let token = match self
7041                .hub
7042                .auth
7043                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7044                .await
7045            {
7046                Ok(token) => token,
7047                Err(e) => match dlg.token(e) {
7048                    Ok(token) => token,
7049                    Err(e) => {
7050                        dlg.finished(false);
7051                        return Err(common::Error::MissingToken(e));
7052                    }
7053                },
7054            };
7055            let mut req_result = {
7056                let client = &self.hub.client;
7057                dlg.pre_request();
7058                let mut req_builder = hyper::Request::builder()
7059                    .method(hyper::Method::GET)
7060                    .uri(url.as_str())
7061                    .header(USER_AGENT, self.hub._user_agent.clone());
7062
7063                if let Some(token) = token.as_ref() {
7064                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7065                }
7066
7067                let request = req_builder
7068                    .header(CONTENT_LENGTH, 0_u64)
7069                    .body(common::to_body::<String>(None));
7070
7071                client.request(request.unwrap()).await
7072            };
7073
7074            match req_result {
7075                Err(err) => {
7076                    if let common::Retry::After(d) = dlg.http_error(&err) {
7077                        sleep(d).await;
7078                        continue;
7079                    }
7080                    dlg.finished(false);
7081                    return Err(common::Error::HttpError(err));
7082                }
7083                Ok(res) => {
7084                    let (mut parts, body) = res.into_parts();
7085                    let mut body = common::Body::new(body);
7086                    if !parts.status.is_success() {
7087                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7088                        let error = serde_json::from_str(&common::to_string(&bytes));
7089                        let response = common::to_response(parts, bytes.into());
7090
7091                        if let common::Retry::After(d) =
7092                            dlg.http_failure(&response, error.as_ref().ok())
7093                        {
7094                            sleep(d).await;
7095                            continue;
7096                        }
7097
7098                        dlg.finished(false);
7099
7100                        return Err(match error {
7101                            Ok(value) => common::Error::BadRequest(value),
7102                            _ => common::Error::Failure(response),
7103                        });
7104                    }
7105                    let response = {
7106                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7107                        let encoded = common::to_string(&bytes);
7108                        match serde_json::from_str(&encoded) {
7109                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7110                            Err(error) => {
7111                                dlg.response_json_decode_error(&encoded, &error);
7112                                return Err(common::Error::JsonDecodeError(
7113                                    encoded.to_string(),
7114                                    error,
7115                                ));
7116                            }
7117                        }
7118                    };
7119
7120                    dlg.finished(true);
7121                    return Ok(response);
7122                }
7123            }
7124        }
7125    }
7126
7127    /// The resource name of the App configuration to download, in the format: projects/PROJECT_IDENTIFIER/iosApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the `IosApp` [`name`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
7128    ///
7129    /// Sets the *name* path property to the given value.
7130    ///
7131    /// Even though the property as already been set when instantiating this call,
7132    /// we provide this method for API completeness.
7133    pub fn name(mut self, new_value: &str) -> ProjectIosAppGetConfigCall<'a, C> {
7134        self._name = new_value.to_string();
7135        self
7136    }
7137    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7138    /// while executing the actual API request.
7139    ///
7140    /// ````text
7141    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7142    /// ````
7143    ///
7144    /// Sets the *delegate* property to the given value.
7145    pub fn delegate(
7146        mut self,
7147        new_value: &'a mut dyn common::Delegate,
7148    ) -> ProjectIosAppGetConfigCall<'a, C> {
7149        self._delegate = Some(new_value);
7150        self
7151    }
7152
7153    /// Set any additional parameter of the query string used in the request.
7154    /// It should be used to set parameters which are not yet available through their own
7155    /// setters.
7156    ///
7157    /// Please note that this method must not be used to set any of the known parameters
7158    /// which have their own setter method. If done anyway, the request will fail.
7159    ///
7160    /// # Additional Parameters
7161    ///
7162    /// * *$.xgafv* (query-string) - V1 error format.
7163    /// * *access_token* (query-string) - OAuth access token.
7164    /// * *alt* (query-string) - Data format for response.
7165    /// * *callback* (query-string) - JSONP
7166    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7167    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7168    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7169    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7170    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7171    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7172    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7173    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppGetConfigCall<'a, C>
7174    where
7175        T: AsRef<str>,
7176    {
7177        self._additional_params
7178            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7179        self
7180    }
7181
7182    /// Identifies the authorization scope for the method you are building.
7183    ///
7184    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7185    /// [`Scope::Readonly`].
7186    ///
7187    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7188    /// tokens for more than one scope.
7189    ///
7190    /// Usually there is more than one suitable scope to authorize an operation, some of which may
7191    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7192    /// sufficient, a read-write scope will do as well.
7193    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppGetConfigCall<'a, C>
7194    where
7195        St: AsRef<str>,
7196    {
7197        self._scopes.insert(String::from(scope.as_ref()));
7198        self
7199    }
7200    /// Identifies the authorization scope(s) for the method you are building.
7201    ///
7202    /// See [`Self::add_scope()`] for details.
7203    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppGetConfigCall<'a, C>
7204    where
7205        I: IntoIterator<Item = St>,
7206        St: AsRef<str>,
7207    {
7208        self._scopes
7209            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7210        self
7211    }
7212
7213    /// Removes all scopes, and no default scope will be used either.
7214    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7215    /// for details).
7216    pub fn clear_scopes(mut self) -> ProjectIosAppGetConfigCall<'a, C> {
7217        self._scopes.clear();
7218        self
7219    }
7220}
7221
7222/// Lists each IosApp associated with the specified FirebaseProject. The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`.
7223///
7224/// A builder for the *iosApps.list* method supported by a *project* resource.
7225/// It is not used directly, but through a [`ProjectMethods`] instance.
7226///
7227/// # Example
7228///
7229/// Instantiate a resource method builder
7230///
7231/// ```test_harness,no_run
7232/// # extern crate hyper;
7233/// # extern crate hyper_rustls;
7234/// # extern crate google_firebase1_beta1 as firebase1_beta1;
7235/// # async fn dox() {
7236/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7237///
7238/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7239/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
7240/// #     secret,
7241/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7242/// # ).build().await.unwrap();
7243///
7244/// # let client = hyper_util::client::legacy::Client::builder(
7245/// #     hyper_util::rt::TokioExecutor::new()
7246/// # )
7247/// # .build(
7248/// #     hyper_rustls::HttpsConnectorBuilder::new()
7249/// #         .with_native_roots()
7250/// #         .unwrap()
7251/// #         .https_or_http()
7252/// #         .enable_http1()
7253/// #         .build()
7254/// # );
7255/// # let mut hub = FirebaseManagement::new(client, auth);
7256/// // You can configure optional parameters by calling the respective setters at will, and
7257/// // execute the final call using `doit()`.
7258/// // Values shown here are possibly random and not representative !
7259/// let result = hub.projects().ios_apps_list("parent")
7260///              .show_deleted(true)
7261///              .page_token("ipsum")
7262///              .page_size(-50)
7263///              .doit().await;
7264/// # }
7265/// ```
7266pub struct ProjectIosAppListCall<'a, C>
7267where
7268    C: 'a,
7269{
7270    hub: &'a FirebaseManagement<C>,
7271    _parent: String,
7272    _show_deleted: Option<bool>,
7273    _page_token: Option<String>,
7274    _page_size: Option<i32>,
7275    _delegate: Option<&'a mut dyn common::Delegate>,
7276    _additional_params: HashMap<String, String>,
7277    _scopes: BTreeSet<String>,
7278}
7279
7280impl<'a, C> common::CallBuilder for ProjectIosAppListCall<'a, C> {}
7281
7282impl<'a, C> ProjectIosAppListCall<'a, C>
7283where
7284    C: common::Connector,
7285{
7286    /// Perform the operation you have build so far.
7287    pub async fn doit(mut self) -> common::Result<(common::Response, ListIosAppsResponse)> {
7288        use std::borrow::Cow;
7289        use std::io::{Read, Seek};
7290
7291        use common::{url::Params, ToParts};
7292        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7293
7294        let mut dd = common::DefaultDelegate;
7295        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7296        dlg.begin(common::MethodInfo {
7297            id: "firebase.projects.iosApps.list",
7298            http_method: hyper::Method::GET,
7299        });
7300
7301        for &field in ["alt", "parent", "showDeleted", "pageToken", "pageSize"].iter() {
7302            if self._additional_params.contains_key(field) {
7303                dlg.finished(false);
7304                return Err(common::Error::FieldClash(field));
7305            }
7306        }
7307
7308        let mut params = Params::with_capacity(6 + self._additional_params.len());
7309        params.push("parent", self._parent);
7310        if let Some(value) = self._show_deleted.as_ref() {
7311            params.push("showDeleted", value.to_string());
7312        }
7313        if let Some(value) = self._page_token.as_ref() {
7314            params.push("pageToken", value);
7315        }
7316        if let Some(value) = self._page_size.as_ref() {
7317            params.push("pageSize", value.to_string());
7318        }
7319
7320        params.extend(self._additional_params.iter());
7321
7322        params.push("alt", "json");
7323        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/iosApps";
7324        if self._scopes.is_empty() {
7325            self._scopes.insert(Scope::Readonly.as_ref().to_string());
7326        }
7327
7328        #[allow(clippy::single_element_loop)]
7329        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
7330            url = params.uri_replacement(url, param_name, find_this, true);
7331        }
7332        {
7333            let to_remove = ["parent"];
7334            params.remove_params(&to_remove);
7335        }
7336
7337        let url = params.parse_with_url(&url);
7338
7339        loop {
7340            let token = match self
7341                .hub
7342                .auth
7343                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7344                .await
7345            {
7346                Ok(token) => token,
7347                Err(e) => match dlg.token(e) {
7348                    Ok(token) => token,
7349                    Err(e) => {
7350                        dlg.finished(false);
7351                        return Err(common::Error::MissingToken(e));
7352                    }
7353                },
7354            };
7355            let mut req_result = {
7356                let client = &self.hub.client;
7357                dlg.pre_request();
7358                let mut req_builder = hyper::Request::builder()
7359                    .method(hyper::Method::GET)
7360                    .uri(url.as_str())
7361                    .header(USER_AGENT, self.hub._user_agent.clone());
7362
7363                if let Some(token) = token.as_ref() {
7364                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7365                }
7366
7367                let request = req_builder
7368                    .header(CONTENT_LENGTH, 0_u64)
7369                    .body(common::to_body::<String>(None));
7370
7371                client.request(request.unwrap()).await
7372            };
7373
7374            match req_result {
7375                Err(err) => {
7376                    if let common::Retry::After(d) = dlg.http_error(&err) {
7377                        sleep(d).await;
7378                        continue;
7379                    }
7380                    dlg.finished(false);
7381                    return Err(common::Error::HttpError(err));
7382                }
7383                Ok(res) => {
7384                    let (mut parts, body) = res.into_parts();
7385                    let mut body = common::Body::new(body);
7386                    if !parts.status.is_success() {
7387                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7388                        let error = serde_json::from_str(&common::to_string(&bytes));
7389                        let response = common::to_response(parts, bytes.into());
7390
7391                        if let common::Retry::After(d) =
7392                            dlg.http_failure(&response, error.as_ref().ok())
7393                        {
7394                            sleep(d).await;
7395                            continue;
7396                        }
7397
7398                        dlg.finished(false);
7399
7400                        return Err(match error {
7401                            Ok(value) => common::Error::BadRequest(value),
7402                            _ => common::Error::Failure(response),
7403                        });
7404                    }
7405                    let response = {
7406                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7407                        let encoded = common::to_string(&bytes);
7408                        match serde_json::from_str(&encoded) {
7409                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7410                            Err(error) => {
7411                                dlg.response_json_decode_error(&encoded, &error);
7412                                return Err(common::Error::JsonDecodeError(
7413                                    encoded.to_string(),
7414                                    error,
7415                                ));
7416                            }
7417                        }
7418                    };
7419
7420                    dlg.finished(true);
7421                    return Ok(response);
7422                }
7423            }
7424        }
7425    }
7426
7427    /// The resource name of the parent FirebaseProject for which to list each associated IosApp, in the format: projects/PROJECT_IDENTIFIER/iosApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
7428    ///
7429    /// Sets the *parent* path property to the given value.
7430    ///
7431    /// Even though the property as already been set when instantiating this call,
7432    /// we provide this method for API completeness.
7433    pub fn parent(mut self, new_value: &str) -> ProjectIosAppListCall<'a, C> {
7434        self._parent = new_value.to_string();
7435        self
7436    }
7437    /// Controls whether Apps in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Apps will be returned.
7438    ///
7439    /// Sets the *show deleted* query property to the given value.
7440    pub fn show_deleted(mut self, new_value: bool) -> ProjectIosAppListCall<'a, C> {
7441        self._show_deleted = Some(new_value);
7442        self
7443    }
7444    /// Token returned from a previous call to `ListIosApps` indicating where in the set of Apps to resume listing.
7445    ///
7446    /// Sets the *page token* query property to the given value.
7447    pub fn page_token(mut self, new_value: &str) -> ProjectIosAppListCall<'a, C> {
7448        self._page_token = Some(new_value.to_string());
7449        self
7450    }
7451    /// The maximum number of Apps to return in the response. The server may return fewer than this at its discretion. If no value is specified (or too large a value is specified), the server will impose its own limit.
7452    ///
7453    /// Sets the *page size* query property to the given value.
7454    pub fn page_size(mut self, new_value: i32) -> ProjectIosAppListCall<'a, C> {
7455        self._page_size = Some(new_value);
7456        self
7457    }
7458    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7459    /// while executing the actual API request.
7460    ///
7461    /// ````text
7462    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7463    /// ````
7464    ///
7465    /// Sets the *delegate* property to the given value.
7466    pub fn delegate(
7467        mut self,
7468        new_value: &'a mut dyn common::Delegate,
7469    ) -> ProjectIosAppListCall<'a, C> {
7470        self._delegate = Some(new_value);
7471        self
7472    }
7473
7474    /// Set any additional parameter of the query string used in the request.
7475    /// It should be used to set parameters which are not yet available through their own
7476    /// setters.
7477    ///
7478    /// Please note that this method must not be used to set any of the known parameters
7479    /// which have their own setter method. If done anyway, the request will fail.
7480    ///
7481    /// # Additional Parameters
7482    ///
7483    /// * *$.xgafv* (query-string) - V1 error format.
7484    /// * *access_token* (query-string) - OAuth access token.
7485    /// * *alt* (query-string) - Data format for response.
7486    /// * *callback* (query-string) - JSONP
7487    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7488    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7489    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7490    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7491    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7492    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7493    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7494    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppListCall<'a, C>
7495    where
7496        T: AsRef<str>,
7497    {
7498        self._additional_params
7499            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7500        self
7501    }
7502
7503    /// Identifies the authorization scope for the method you are building.
7504    ///
7505    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7506    /// [`Scope::Readonly`].
7507    ///
7508    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7509    /// tokens for more than one scope.
7510    ///
7511    /// Usually there is more than one suitable scope to authorize an operation, some of which may
7512    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7513    /// sufficient, a read-write scope will do as well.
7514    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppListCall<'a, C>
7515    where
7516        St: AsRef<str>,
7517    {
7518        self._scopes.insert(String::from(scope.as_ref()));
7519        self
7520    }
7521    /// Identifies the authorization scope(s) for the method you are building.
7522    ///
7523    /// See [`Self::add_scope()`] for details.
7524    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppListCall<'a, C>
7525    where
7526        I: IntoIterator<Item = St>,
7527        St: AsRef<str>,
7528    {
7529        self._scopes
7530            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7531        self
7532    }
7533
7534    /// Removes all scopes, and no default scope will be used either.
7535    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7536    /// for details).
7537    pub fn clear_scopes(mut self) -> ProjectIosAppListCall<'a, C> {
7538        self._scopes.clear();
7539        self
7540    }
7541}
7542
7543/// Updates the attributes of the specified IosApp.
7544///
7545/// A builder for the *iosApps.patch* method supported by a *project* resource.
7546/// It is not used directly, but through a [`ProjectMethods`] instance.
7547///
7548/// # Example
7549///
7550/// Instantiate a resource method builder
7551///
7552/// ```test_harness,no_run
7553/// # extern crate hyper;
7554/// # extern crate hyper_rustls;
7555/// # extern crate google_firebase1_beta1 as firebase1_beta1;
7556/// use firebase1_beta1::api::IosApp;
7557/// # async fn dox() {
7558/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7559///
7560/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7561/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
7562/// #     secret,
7563/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7564/// # ).build().await.unwrap();
7565///
7566/// # let client = hyper_util::client::legacy::Client::builder(
7567/// #     hyper_util::rt::TokioExecutor::new()
7568/// # )
7569/// # .build(
7570/// #     hyper_rustls::HttpsConnectorBuilder::new()
7571/// #         .with_native_roots()
7572/// #         .unwrap()
7573/// #         .https_or_http()
7574/// #         .enable_http1()
7575/// #         .build()
7576/// # );
7577/// # let mut hub = FirebaseManagement::new(client, auth);
7578/// // As the method needs a request, you would usually fill it with the desired information
7579/// // into the respective structure. Some of the parts shown here might not be applicable !
7580/// // Values shown here are possibly random and not representative !
7581/// let mut req = IosApp::default();
7582///
7583/// // You can configure optional parameters by calling the respective setters at will, and
7584/// // execute the final call using `doit()`.
7585/// // Values shown here are possibly random and not representative !
7586/// let result = hub.projects().ios_apps_patch(req, "name")
7587///              .update_mask(FieldMask::new::<&str>(&[]))
7588///              .doit().await;
7589/// # }
7590/// ```
7591pub struct ProjectIosAppPatchCall<'a, C>
7592where
7593    C: 'a,
7594{
7595    hub: &'a FirebaseManagement<C>,
7596    _request: IosApp,
7597    _name: String,
7598    _update_mask: Option<common::FieldMask>,
7599    _delegate: Option<&'a mut dyn common::Delegate>,
7600    _additional_params: HashMap<String, String>,
7601    _scopes: BTreeSet<String>,
7602}
7603
7604impl<'a, C> common::CallBuilder for ProjectIosAppPatchCall<'a, C> {}
7605
7606impl<'a, C> ProjectIosAppPatchCall<'a, C>
7607where
7608    C: common::Connector,
7609{
7610    /// Perform the operation you have build so far.
7611    pub async fn doit(mut self) -> common::Result<(common::Response, IosApp)> {
7612        use std::borrow::Cow;
7613        use std::io::{Read, Seek};
7614
7615        use common::{url::Params, ToParts};
7616        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7617
7618        let mut dd = common::DefaultDelegate;
7619        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7620        dlg.begin(common::MethodInfo {
7621            id: "firebase.projects.iosApps.patch",
7622            http_method: hyper::Method::PATCH,
7623        });
7624
7625        for &field in ["alt", "name", "updateMask"].iter() {
7626            if self._additional_params.contains_key(field) {
7627                dlg.finished(false);
7628                return Err(common::Error::FieldClash(field));
7629            }
7630        }
7631
7632        let mut params = Params::with_capacity(5 + self._additional_params.len());
7633        params.push("name", self._name);
7634        if let Some(value) = self._update_mask.as_ref() {
7635            params.push("updateMask", value.to_string());
7636        }
7637
7638        params.extend(self._additional_params.iter());
7639
7640        params.push("alt", "json");
7641        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
7642        if self._scopes.is_empty() {
7643            self._scopes
7644                .insert(Scope::CloudPlatform.as_ref().to_string());
7645        }
7646
7647        #[allow(clippy::single_element_loop)]
7648        for &(find_this, param_name) in [("{+name}", "name")].iter() {
7649            url = params.uri_replacement(url, param_name, find_this, true);
7650        }
7651        {
7652            let to_remove = ["name"];
7653            params.remove_params(&to_remove);
7654        }
7655
7656        let url = params.parse_with_url(&url);
7657
7658        let mut json_mime_type = mime::APPLICATION_JSON;
7659        let mut request_value_reader = {
7660            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7661            common::remove_json_null_values(&mut value);
7662            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7663            serde_json::to_writer(&mut dst, &value).unwrap();
7664            dst
7665        };
7666        let request_size = request_value_reader
7667            .seek(std::io::SeekFrom::End(0))
7668            .unwrap();
7669        request_value_reader
7670            .seek(std::io::SeekFrom::Start(0))
7671            .unwrap();
7672
7673        loop {
7674            let token = match self
7675                .hub
7676                .auth
7677                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7678                .await
7679            {
7680                Ok(token) => token,
7681                Err(e) => match dlg.token(e) {
7682                    Ok(token) => token,
7683                    Err(e) => {
7684                        dlg.finished(false);
7685                        return Err(common::Error::MissingToken(e));
7686                    }
7687                },
7688            };
7689            request_value_reader
7690                .seek(std::io::SeekFrom::Start(0))
7691                .unwrap();
7692            let mut req_result = {
7693                let client = &self.hub.client;
7694                dlg.pre_request();
7695                let mut req_builder = hyper::Request::builder()
7696                    .method(hyper::Method::PATCH)
7697                    .uri(url.as_str())
7698                    .header(USER_AGENT, self.hub._user_agent.clone());
7699
7700                if let Some(token) = token.as_ref() {
7701                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7702                }
7703
7704                let request = req_builder
7705                    .header(CONTENT_TYPE, json_mime_type.to_string())
7706                    .header(CONTENT_LENGTH, request_size as u64)
7707                    .body(common::to_body(
7708                        request_value_reader.get_ref().clone().into(),
7709                    ));
7710
7711                client.request(request.unwrap()).await
7712            };
7713
7714            match req_result {
7715                Err(err) => {
7716                    if let common::Retry::After(d) = dlg.http_error(&err) {
7717                        sleep(d).await;
7718                        continue;
7719                    }
7720                    dlg.finished(false);
7721                    return Err(common::Error::HttpError(err));
7722                }
7723                Ok(res) => {
7724                    let (mut parts, body) = res.into_parts();
7725                    let mut body = common::Body::new(body);
7726                    if !parts.status.is_success() {
7727                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7728                        let error = serde_json::from_str(&common::to_string(&bytes));
7729                        let response = common::to_response(parts, bytes.into());
7730
7731                        if let common::Retry::After(d) =
7732                            dlg.http_failure(&response, error.as_ref().ok())
7733                        {
7734                            sleep(d).await;
7735                            continue;
7736                        }
7737
7738                        dlg.finished(false);
7739
7740                        return Err(match error {
7741                            Ok(value) => common::Error::BadRequest(value),
7742                            _ => common::Error::Failure(response),
7743                        });
7744                    }
7745                    let response = {
7746                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7747                        let encoded = common::to_string(&bytes);
7748                        match serde_json::from_str(&encoded) {
7749                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7750                            Err(error) => {
7751                                dlg.response_json_decode_error(&encoded, &error);
7752                                return Err(common::Error::JsonDecodeError(
7753                                    encoded.to_string(),
7754                                    error,
7755                                ));
7756                            }
7757                        }
7758                    };
7759
7760                    dlg.finished(true);
7761                    return Ok(response);
7762                }
7763            }
7764        }
7765    }
7766
7767    ///
7768    /// Sets the *request* property to the given value.
7769    ///
7770    /// Even though the property as already been set when instantiating this call,
7771    /// we provide this method for API completeness.
7772    pub fn request(mut self, new_value: IosApp) -> ProjectIosAppPatchCall<'a, C> {
7773        self._request = new_value;
7774        self
7775    }
7776    /// The resource name of the IosApp, in the format: projects/PROJECT_IDENTIFIER /iosApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.app_id)).
7777    ///
7778    /// Sets the *name* path property to the given value.
7779    ///
7780    /// Even though the property as already been set when instantiating this call,
7781    /// we provide this method for API completeness.
7782    pub fn name(mut self, new_value: &str) -> ProjectIosAppPatchCall<'a, C> {
7783        self._name = new_value.to_string();
7784        self
7785    }
7786    /// Specifies which fields of the IosApp to update. Note that the following fields are immutable: `name`, `app_id`, `project_id`, and `bundle_id`. To update `state`, use any of the following endpoints: RemoveIosApp or UndeleteIosApp.
7787    ///
7788    /// Sets the *update mask* query property to the given value.
7789    pub fn update_mask(mut self, new_value: common::FieldMask) -> ProjectIosAppPatchCall<'a, C> {
7790        self._update_mask = Some(new_value);
7791        self
7792    }
7793    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7794    /// while executing the actual API request.
7795    ///
7796    /// ````text
7797    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7798    /// ````
7799    ///
7800    /// Sets the *delegate* property to the given value.
7801    pub fn delegate(
7802        mut self,
7803        new_value: &'a mut dyn common::Delegate,
7804    ) -> ProjectIosAppPatchCall<'a, C> {
7805        self._delegate = Some(new_value);
7806        self
7807    }
7808
7809    /// Set any additional parameter of the query string used in the request.
7810    /// It should be used to set parameters which are not yet available through their own
7811    /// setters.
7812    ///
7813    /// Please note that this method must not be used to set any of the known parameters
7814    /// which have their own setter method. If done anyway, the request will fail.
7815    ///
7816    /// # Additional Parameters
7817    ///
7818    /// * *$.xgafv* (query-string) - V1 error format.
7819    /// * *access_token* (query-string) - OAuth access token.
7820    /// * *alt* (query-string) - Data format for response.
7821    /// * *callback* (query-string) - JSONP
7822    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7823    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7824    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7825    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7826    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7827    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7828    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7829    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppPatchCall<'a, C>
7830    where
7831        T: AsRef<str>,
7832    {
7833        self._additional_params
7834            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7835        self
7836    }
7837
7838    /// Identifies the authorization scope for the method you are building.
7839    ///
7840    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7841    /// [`Scope::CloudPlatform`].
7842    ///
7843    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7844    /// tokens for more than one scope.
7845    ///
7846    /// Usually there is more than one suitable scope to authorize an operation, some of which may
7847    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7848    /// sufficient, a read-write scope will do as well.
7849    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppPatchCall<'a, C>
7850    where
7851        St: AsRef<str>,
7852    {
7853        self._scopes.insert(String::from(scope.as_ref()));
7854        self
7855    }
7856    /// Identifies the authorization scope(s) for the method you are building.
7857    ///
7858    /// See [`Self::add_scope()`] for details.
7859    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppPatchCall<'a, C>
7860    where
7861        I: IntoIterator<Item = St>,
7862        St: AsRef<str>,
7863    {
7864        self._scopes
7865            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7866        self
7867    }
7868
7869    /// Removes all scopes, and no default scope will be used either.
7870    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7871    /// for details).
7872    pub fn clear_scopes(mut self) -> ProjectIosAppPatchCall<'a, C> {
7873        self._scopes.clear();
7874        self
7875    }
7876}
7877
7878/// Removes the specified IosApp from the FirebaseProject.
7879///
7880/// A builder for the *iosApps.remove* method supported by a *project* resource.
7881/// It is not used directly, but through a [`ProjectMethods`] instance.
7882///
7883/// # Example
7884///
7885/// Instantiate a resource method builder
7886///
7887/// ```test_harness,no_run
7888/// # extern crate hyper;
7889/// # extern crate hyper_rustls;
7890/// # extern crate google_firebase1_beta1 as firebase1_beta1;
7891/// use firebase1_beta1::api::RemoveIosAppRequest;
7892/// # async fn dox() {
7893/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7894///
7895/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7896/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
7897/// #     secret,
7898/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7899/// # ).build().await.unwrap();
7900///
7901/// # let client = hyper_util::client::legacy::Client::builder(
7902/// #     hyper_util::rt::TokioExecutor::new()
7903/// # )
7904/// # .build(
7905/// #     hyper_rustls::HttpsConnectorBuilder::new()
7906/// #         .with_native_roots()
7907/// #         .unwrap()
7908/// #         .https_or_http()
7909/// #         .enable_http1()
7910/// #         .build()
7911/// # );
7912/// # let mut hub = FirebaseManagement::new(client, auth);
7913/// // As the method needs a request, you would usually fill it with the desired information
7914/// // into the respective structure. Some of the parts shown here might not be applicable !
7915/// // Values shown here are possibly random and not representative !
7916/// let mut req = RemoveIosAppRequest::default();
7917///
7918/// // You can configure optional parameters by calling the respective setters at will, and
7919/// // execute the final call using `doit()`.
7920/// // Values shown here are possibly random and not representative !
7921/// let result = hub.projects().ios_apps_remove(req, "name")
7922///              .doit().await;
7923/// # }
7924/// ```
7925pub struct ProjectIosAppRemoveCall<'a, C>
7926where
7927    C: 'a,
7928{
7929    hub: &'a FirebaseManagement<C>,
7930    _request: RemoveIosAppRequest,
7931    _name: String,
7932    _delegate: Option<&'a mut dyn common::Delegate>,
7933    _additional_params: HashMap<String, String>,
7934    _scopes: BTreeSet<String>,
7935}
7936
7937impl<'a, C> common::CallBuilder for ProjectIosAppRemoveCall<'a, C> {}
7938
7939impl<'a, C> ProjectIosAppRemoveCall<'a, C>
7940where
7941    C: common::Connector,
7942{
7943    /// Perform the operation you have build so far.
7944    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
7945        use std::borrow::Cow;
7946        use std::io::{Read, Seek};
7947
7948        use common::{url::Params, ToParts};
7949        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7950
7951        let mut dd = common::DefaultDelegate;
7952        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7953        dlg.begin(common::MethodInfo {
7954            id: "firebase.projects.iosApps.remove",
7955            http_method: hyper::Method::POST,
7956        });
7957
7958        for &field in ["alt", "name"].iter() {
7959            if self._additional_params.contains_key(field) {
7960                dlg.finished(false);
7961                return Err(common::Error::FieldClash(field));
7962            }
7963        }
7964
7965        let mut params = Params::with_capacity(4 + self._additional_params.len());
7966        params.push("name", self._name);
7967
7968        params.extend(self._additional_params.iter());
7969
7970        params.push("alt", "json");
7971        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:remove";
7972        if self._scopes.is_empty() {
7973            self._scopes
7974                .insert(Scope::CloudPlatform.as_ref().to_string());
7975        }
7976
7977        #[allow(clippy::single_element_loop)]
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        let mut json_mime_type = mime::APPLICATION_JSON;
7989        let mut request_value_reader = {
7990            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7991            common::remove_json_null_values(&mut value);
7992            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7993            serde_json::to_writer(&mut dst, &value).unwrap();
7994            dst
7995        };
7996        let request_size = request_value_reader
7997            .seek(std::io::SeekFrom::End(0))
7998            .unwrap();
7999        request_value_reader
8000            .seek(std::io::SeekFrom::Start(0))
8001            .unwrap();
8002
8003        loop {
8004            let token = match self
8005                .hub
8006                .auth
8007                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8008                .await
8009            {
8010                Ok(token) => token,
8011                Err(e) => match dlg.token(e) {
8012                    Ok(token) => token,
8013                    Err(e) => {
8014                        dlg.finished(false);
8015                        return Err(common::Error::MissingToken(e));
8016                    }
8017                },
8018            };
8019            request_value_reader
8020                .seek(std::io::SeekFrom::Start(0))
8021                .unwrap();
8022            let mut req_result = {
8023                let client = &self.hub.client;
8024                dlg.pre_request();
8025                let mut req_builder = hyper::Request::builder()
8026                    .method(hyper::Method::POST)
8027                    .uri(url.as_str())
8028                    .header(USER_AGENT, self.hub._user_agent.clone());
8029
8030                if let Some(token) = token.as_ref() {
8031                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8032                }
8033
8034                let request = req_builder
8035                    .header(CONTENT_TYPE, json_mime_type.to_string())
8036                    .header(CONTENT_LENGTH, request_size as u64)
8037                    .body(common::to_body(
8038                        request_value_reader.get_ref().clone().into(),
8039                    ));
8040
8041                client.request(request.unwrap()).await
8042            };
8043
8044            match req_result {
8045                Err(err) => {
8046                    if let common::Retry::After(d) = dlg.http_error(&err) {
8047                        sleep(d).await;
8048                        continue;
8049                    }
8050                    dlg.finished(false);
8051                    return Err(common::Error::HttpError(err));
8052                }
8053                Ok(res) => {
8054                    let (mut parts, body) = res.into_parts();
8055                    let mut body = common::Body::new(body);
8056                    if !parts.status.is_success() {
8057                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8058                        let error = serde_json::from_str(&common::to_string(&bytes));
8059                        let response = common::to_response(parts, bytes.into());
8060
8061                        if let common::Retry::After(d) =
8062                            dlg.http_failure(&response, error.as_ref().ok())
8063                        {
8064                            sleep(d).await;
8065                            continue;
8066                        }
8067
8068                        dlg.finished(false);
8069
8070                        return Err(match error {
8071                            Ok(value) => common::Error::BadRequest(value),
8072                            _ => common::Error::Failure(response),
8073                        });
8074                    }
8075                    let response = {
8076                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8077                        let encoded = common::to_string(&bytes);
8078                        match serde_json::from_str(&encoded) {
8079                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8080                            Err(error) => {
8081                                dlg.response_json_decode_error(&encoded, &error);
8082                                return Err(common::Error::JsonDecodeError(
8083                                    encoded.to_string(),
8084                                    error,
8085                                ));
8086                            }
8087                        }
8088                    };
8089
8090                    dlg.finished(true);
8091                    return Ok(response);
8092                }
8093            }
8094        }
8095    }
8096
8097    ///
8098    /// Sets the *request* property to the given value.
8099    ///
8100    /// Even though the property as already been set when instantiating this call,
8101    /// we provide this method for API completeness.
8102    pub fn request(mut self, new_value: RemoveIosAppRequest) -> ProjectIosAppRemoveCall<'a, C> {
8103        self._request = new_value;
8104        self
8105    }
8106    /// Required. The resource name of the IosApp, in the format: projects/ PROJECT_IDENTIFIER/iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp [name](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
8107    ///
8108    /// Sets the *name* path property to the given value.
8109    ///
8110    /// Even though the property as already been set when instantiating this call,
8111    /// we provide this method for API completeness.
8112    pub fn name(mut self, new_value: &str) -> ProjectIosAppRemoveCall<'a, C> {
8113        self._name = new_value.to_string();
8114        self
8115    }
8116    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8117    /// while executing the actual API request.
8118    ///
8119    /// ````text
8120    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
8121    /// ````
8122    ///
8123    /// Sets the *delegate* property to the given value.
8124    pub fn delegate(
8125        mut self,
8126        new_value: &'a mut dyn common::Delegate,
8127    ) -> ProjectIosAppRemoveCall<'a, C> {
8128        self._delegate = Some(new_value);
8129        self
8130    }
8131
8132    /// Set any additional parameter of the query string used in the request.
8133    /// It should be used to set parameters which are not yet available through their own
8134    /// setters.
8135    ///
8136    /// Please note that this method must not be used to set any of the known parameters
8137    /// which have their own setter method. If done anyway, the request will fail.
8138    ///
8139    /// # Additional Parameters
8140    ///
8141    /// * *$.xgafv* (query-string) - V1 error format.
8142    /// * *access_token* (query-string) - OAuth access token.
8143    /// * *alt* (query-string) - Data format for response.
8144    /// * *callback* (query-string) - JSONP
8145    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8146    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8147    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8148    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8149    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8150    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8151    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8152    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppRemoveCall<'a, C>
8153    where
8154        T: AsRef<str>,
8155    {
8156        self._additional_params
8157            .insert(name.as_ref().to_string(), value.as_ref().to_string());
8158        self
8159    }
8160
8161    /// Identifies the authorization scope for the method you are building.
8162    ///
8163    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8164    /// [`Scope::CloudPlatform`].
8165    ///
8166    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8167    /// tokens for more than one scope.
8168    ///
8169    /// Usually there is more than one suitable scope to authorize an operation, some of which may
8170    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8171    /// sufficient, a read-write scope will do as well.
8172    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppRemoveCall<'a, C>
8173    where
8174        St: AsRef<str>,
8175    {
8176        self._scopes.insert(String::from(scope.as_ref()));
8177        self
8178    }
8179    /// Identifies the authorization scope(s) for the method you are building.
8180    ///
8181    /// See [`Self::add_scope()`] for details.
8182    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppRemoveCall<'a, C>
8183    where
8184        I: IntoIterator<Item = St>,
8185        St: AsRef<str>,
8186    {
8187        self._scopes
8188            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8189        self
8190    }
8191
8192    /// Removes all scopes, and no default scope will be used either.
8193    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8194    /// for details).
8195    pub fn clear_scopes(mut self) -> ProjectIosAppRemoveCall<'a, C> {
8196        self._scopes.clear();
8197        self
8198    }
8199}
8200
8201/// Restores the specified IosApp to the FirebaseProject.
8202///
8203/// A builder for the *iosApps.undelete* method supported by a *project* resource.
8204/// It is not used directly, but through a [`ProjectMethods`] instance.
8205///
8206/// # Example
8207///
8208/// Instantiate a resource method builder
8209///
8210/// ```test_harness,no_run
8211/// # extern crate hyper;
8212/// # extern crate hyper_rustls;
8213/// # extern crate google_firebase1_beta1 as firebase1_beta1;
8214/// use firebase1_beta1::api::UndeleteIosAppRequest;
8215/// # async fn dox() {
8216/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8217///
8218/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8219/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
8220/// #     secret,
8221/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8222/// # ).build().await.unwrap();
8223///
8224/// # let client = hyper_util::client::legacy::Client::builder(
8225/// #     hyper_util::rt::TokioExecutor::new()
8226/// # )
8227/// # .build(
8228/// #     hyper_rustls::HttpsConnectorBuilder::new()
8229/// #         .with_native_roots()
8230/// #         .unwrap()
8231/// #         .https_or_http()
8232/// #         .enable_http1()
8233/// #         .build()
8234/// # );
8235/// # let mut hub = FirebaseManagement::new(client, auth);
8236/// // As the method needs a request, you would usually fill it with the desired information
8237/// // into the respective structure. Some of the parts shown here might not be applicable !
8238/// // Values shown here are possibly random and not representative !
8239/// let mut req = UndeleteIosAppRequest::default();
8240///
8241/// // You can configure optional parameters by calling the respective setters at will, and
8242/// // execute the final call using `doit()`.
8243/// // Values shown here are possibly random and not representative !
8244/// let result = hub.projects().ios_apps_undelete(req, "name")
8245///              .doit().await;
8246/// # }
8247/// ```
8248pub struct ProjectIosAppUndeleteCall<'a, C>
8249where
8250    C: 'a,
8251{
8252    hub: &'a FirebaseManagement<C>,
8253    _request: UndeleteIosAppRequest,
8254    _name: String,
8255    _delegate: Option<&'a mut dyn common::Delegate>,
8256    _additional_params: HashMap<String, String>,
8257    _scopes: BTreeSet<String>,
8258}
8259
8260impl<'a, C> common::CallBuilder for ProjectIosAppUndeleteCall<'a, C> {}
8261
8262impl<'a, C> ProjectIosAppUndeleteCall<'a, C>
8263where
8264    C: common::Connector,
8265{
8266    /// Perform the operation you have build so far.
8267    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
8268        use std::borrow::Cow;
8269        use std::io::{Read, Seek};
8270
8271        use common::{url::Params, ToParts};
8272        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8273
8274        let mut dd = common::DefaultDelegate;
8275        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8276        dlg.begin(common::MethodInfo {
8277            id: "firebase.projects.iosApps.undelete",
8278            http_method: hyper::Method::POST,
8279        });
8280
8281        for &field in ["alt", "name"].iter() {
8282            if self._additional_params.contains_key(field) {
8283                dlg.finished(false);
8284                return Err(common::Error::FieldClash(field));
8285            }
8286        }
8287
8288        let mut params = Params::with_capacity(4 + self._additional_params.len());
8289        params.push("name", self._name);
8290
8291        params.extend(self._additional_params.iter());
8292
8293        params.push("alt", "json");
8294        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:undelete";
8295        if self._scopes.is_empty() {
8296            self._scopes
8297                .insert(Scope::CloudPlatform.as_ref().to_string());
8298        }
8299
8300        #[allow(clippy::single_element_loop)]
8301        for &(find_this, param_name) in [("{+name}", "name")].iter() {
8302            url = params.uri_replacement(url, param_name, find_this, true);
8303        }
8304        {
8305            let to_remove = ["name"];
8306            params.remove_params(&to_remove);
8307        }
8308
8309        let url = params.parse_with_url(&url);
8310
8311        let mut json_mime_type = mime::APPLICATION_JSON;
8312        let mut request_value_reader = {
8313            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8314            common::remove_json_null_values(&mut value);
8315            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8316            serde_json::to_writer(&mut dst, &value).unwrap();
8317            dst
8318        };
8319        let request_size = request_value_reader
8320            .seek(std::io::SeekFrom::End(0))
8321            .unwrap();
8322        request_value_reader
8323            .seek(std::io::SeekFrom::Start(0))
8324            .unwrap();
8325
8326        loop {
8327            let token = match self
8328                .hub
8329                .auth
8330                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8331                .await
8332            {
8333                Ok(token) => token,
8334                Err(e) => match dlg.token(e) {
8335                    Ok(token) => token,
8336                    Err(e) => {
8337                        dlg.finished(false);
8338                        return Err(common::Error::MissingToken(e));
8339                    }
8340                },
8341            };
8342            request_value_reader
8343                .seek(std::io::SeekFrom::Start(0))
8344                .unwrap();
8345            let mut req_result = {
8346                let client = &self.hub.client;
8347                dlg.pre_request();
8348                let mut req_builder = hyper::Request::builder()
8349                    .method(hyper::Method::POST)
8350                    .uri(url.as_str())
8351                    .header(USER_AGENT, self.hub._user_agent.clone());
8352
8353                if let Some(token) = token.as_ref() {
8354                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8355                }
8356
8357                let request = req_builder
8358                    .header(CONTENT_TYPE, json_mime_type.to_string())
8359                    .header(CONTENT_LENGTH, request_size as u64)
8360                    .body(common::to_body(
8361                        request_value_reader.get_ref().clone().into(),
8362                    ));
8363
8364                client.request(request.unwrap()).await
8365            };
8366
8367            match req_result {
8368                Err(err) => {
8369                    if let common::Retry::After(d) = dlg.http_error(&err) {
8370                        sleep(d).await;
8371                        continue;
8372                    }
8373                    dlg.finished(false);
8374                    return Err(common::Error::HttpError(err));
8375                }
8376                Ok(res) => {
8377                    let (mut parts, body) = res.into_parts();
8378                    let mut body = common::Body::new(body);
8379                    if !parts.status.is_success() {
8380                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8381                        let error = serde_json::from_str(&common::to_string(&bytes));
8382                        let response = common::to_response(parts, bytes.into());
8383
8384                        if let common::Retry::After(d) =
8385                            dlg.http_failure(&response, error.as_ref().ok())
8386                        {
8387                            sleep(d).await;
8388                            continue;
8389                        }
8390
8391                        dlg.finished(false);
8392
8393                        return Err(match error {
8394                            Ok(value) => common::Error::BadRequest(value),
8395                            _ => common::Error::Failure(response),
8396                        });
8397                    }
8398                    let response = {
8399                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8400                        let encoded = common::to_string(&bytes);
8401                        match serde_json::from_str(&encoded) {
8402                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8403                            Err(error) => {
8404                                dlg.response_json_decode_error(&encoded, &error);
8405                                return Err(common::Error::JsonDecodeError(
8406                                    encoded.to_string(),
8407                                    error,
8408                                ));
8409                            }
8410                        }
8411                    };
8412
8413                    dlg.finished(true);
8414                    return Ok(response);
8415                }
8416            }
8417        }
8418    }
8419
8420    ///
8421    /// Sets the *request* property to the given value.
8422    ///
8423    /// Even though the property as already been set when instantiating this call,
8424    /// we provide this method for API completeness.
8425    pub fn request(mut self, new_value: UndeleteIosAppRequest) -> ProjectIosAppUndeleteCall<'a, C> {
8426        self._request = new_value;
8427        self
8428    }
8429    /// Required. The resource name of the IosApp, in the format: projects/ PROJECT_IDENTIFIER/iosApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/iosApps/APP_ID Refer to the IosApp [name](https://firebase.google.com/../projects.iosApps#IosApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
8430    ///
8431    /// Sets the *name* path property to the given value.
8432    ///
8433    /// Even though the property as already been set when instantiating this call,
8434    /// we provide this method for API completeness.
8435    pub fn name(mut self, new_value: &str) -> ProjectIosAppUndeleteCall<'a, C> {
8436        self._name = new_value.to_string();
8437        self
8438    }
8439    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8440    /// while executing the actual API request.
8441    ///
8442    /// ````text
8443    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
8444    /// ````
8445    ///
8446    /// Sets the *delegate* property to the given value.
8447    pub fn delegate(
8448        mut self,
8449        new_value: &'a mut dyn common::Delegate,
8450    ) -> ProjectIosAppUndeleteCall<'a, C> {
8451        self._delegate = Some(new_value);
8452        self
8453    }
8454
8455    /// Set any additional parameter of the query string used in the request.
8456    /// It should be used to set parameters which are not yet available through their own
8457    /// setters.
8458    ///
8459    /// Please note that this method must not be used to set any of the known parameters
8460    /// which have their own setter method. If done anyway, the request will fail.
8461    ///
8462    /// # Additional Parameters
8463    ///
8464    /// * *$.xgafv* (query-string) - V1 error format.
8465    /// * *access_token* (query-string) - OAuth access token.
8466    /// * *alt* (query-string) - Data format for response.
8467    /// * *callback* (query-string) - JSONP
8468    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8469    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8470    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8471    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8472    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8473    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8474    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8475    pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppUndeleteCall<'a, C>
8476    where
8477        T: AsRef<str>,
8478    {
8479        self._additional_params
8480            .insert(name.as_ref().to_string(), value.as_ref().to_string());
8481        self
8482    }
8483
8484    /// Identifies the authorization scope for the method you are building.
8485    ///
8486    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8487    /// [`Scope::CloudPlatform`].
8488    ///
8489    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8490    /// tokens for more than one scope.
8491    ///
8492    /// Usually there is more than one suitable scope to authorize an operation, some of which may
8493    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8494    /// sufficient, a read-write scope will do as well.
8495    pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppUndeleteCall<'a, C>
8496    where
8497        St: AsRef<str>,
8498    {
8499        self._scopes.insert(String::from(scope.as_ref()));
8500        self
8501    }
8502    /// Identifies the authorization scope(s) for the method you are building.
8503    ///
8504    /// See [`Self::add_scope()`] for details.
8505    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppUndeleteCall<'a, C>
8506    where
8507        I: IntoIterator<Item = St>,
8508        St: AsRef<str>,
8509    {
8510        self._scopes
8511            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8512        self
8513    }
8514
8515    /// Removes all scopes, and no default scope will be used either.
8516    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8517    /// for details).
8518    pub fn clear_scopes(mut self) -> ProjectIosAppUndeleteCall<'a, C> {
8519        self._scopes.clear();
8520        self
8521    }
8522}
8523
8524/// Requests the creation of a new WebApp in the specified FirebaseProject. The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`.
8525///
8526/// A builder for the *webApps.create* method supported by a *project* resource.
8527/// It is not used directly, but through a [`ProjectMethods`] instance.
8528///
8529/// # Example
8530///
8531/// Instantiate a resource method builder
8532///
8533/// ```test_harness,no_run
8534/// # extern crate hyper;
8535/// # extern crate hyper_rustls;
8536/// # extern crate google_firebase1_beta1 as firebase1_beta1;
8537/// use firebase1_beta1::api::WebApp;
8538/// # async fn dox() {
8539/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8540///
8541/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8542/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
8543/// #     secret,
8544/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8545/// # ).build().await.unwrap();
8546///
8547/// # let client = hyper_util::client::legacy::Client::builder(
8548/// #     hyper_util::rt::TokioExecutor::new()
8549/// # )
8550/// # .build(
8551/// #     hyper_rustls::HttpsConnectorBuilder::new()
8552/// #         .with_native_roots()
8553/// #         .unwrap()
8554/// #         .https_or_http()
8555/// #         .enable_http1()
8556/// #         .build()
8557/// # );
8558/// # let mut hub = FirebaseManagement::new(client, auth);
8559/// // As the method needs a request, you would usually fill it with the desired information
8560/// // into the respective structure. Some of the parts shown here might not be applicable !
8561/// // Values shown here are possibly random and not representative !
8562/// let mut req = WebApp::default();
8563///
8564/// // You can configure optional parameters by calling the respective setters at will, and
8565/// // execute the final call using `doit()`.
8566/// // Values shown here are possibly random and not representative !
8567/// let result = hub.projects().web_apps_create(req, "parent")
8568///              .doit().await;
8569/// # }
8570/// ```
8571pub struct ProjectWebAppCreateCall<'a, C>
8572where
8573    C: 'a,
8574{
8575    hub: &'a FirebaseManagement<C>,
8576    _request: WebApp,
8577    _parent: String,
8578    _delegate: Option<&'a mut dyn common::Delegate>,
8579    _additional_params: HashMap<String, String>,
8580    _scopes: BTreeSet<String>,
8581}
8582
8583impl<'a, C> common::CallBuilder for ProjectWebAppCreateCall<'a, C> {}
8584
8585impl<'a, C> ProjectWebAppCreateCall<'a, C>
8586where
8587    C: common::Connector,
8588{
8589    /// Perform the operation you have build so far.
8590    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
8591        use std::borrow::Cow;
8592        use std::io::{Read, Seek};
8593
8594        use common::{url::Params, ToParts};
8595        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8596
8597        let mut dd = common::DefaultDelegate;
8598        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8599        dlg.begin(common::MethodInfo {
8600            id: "firebase.projects.webApps.create",
8601            http_method: hyper::Method::POST,
8602        });
8603
8604        for &field in ["alt", "parent"].iter() {
8605            if self._additional_params.contains_key(field) {
8606                dlg.finished(false);
8607                return Err(common::Error::FieldClash(field));
8608            }
8609        }
8610
8611        let mut params = Params::with_capacity(4 + self._additional_params.len());
8612        params.push("parent", self._parent);
8613
8614        params.extend(self._additional_params.iter());
8615
8616        params.push("alt", "json");
8617        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/webApps";
8618        if self._scopes.is_empty() {
8619            self._scopes
8620                .insert(Scope::CloudPlatform.as_ref().to_string());
8621        }
8622
8623        #[allow(clippy::single_element_loop)]
8624        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
8625            url = params.uri_replacement(url, param_name, find_this, true);
8626        }
8627        {
8628            let to_remove = ["parent"];
8629            params.remove_params(&to_remove);
8630        }
8631
8632        let url = params.parse_with_url(&url);
8633
8634        let mut json_mime_type = mime::APPLICATION_JSON;
8635        let mut request_value_reader = {
8636            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8637            common::remove_json_null_values(&mut value);
8638            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8639            serde_json::to_writer(&mut dst, &value).unwrap();
8640            dst
8641        };
8642        let request_size = request_value_reader
8643            .seek(std::io::SeekFrom::End(0))
8644            .unwrap();
8645        request_value_reader
8646            .seek(std::io::SeekFrom::Start(0))
8647            .unwrap();
8648
8649        loop {
8650            let token = match self
8651                .hub
8652                .auth
8653                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8654                .await
8655            {
8656                Ok(token) => token,
8657                Err(e) => match dlg.token(e) {
8658                    Ok(token) => token,
8659                    Err(e) => {
8660                        dlg.finished(false);
8661                        return Err(common::Error::MissingToken(e));
8662                    }
8663                },
8664            };
8665            request_value_reader
8666                .seek(std::io::SeekFrom::Start(0))
8667                .unwrap();
8668            let mut req_result = {
8669                let client = &self.hub.client;
8670                dlg.pre_request();
8671                let mut req_builder = hyper::Request::builder()
8672                    .method(hyper::Method::POST)
8673                    .uri(url.as_str())
8674                    .header(USER_AGENT, self.hub._user_agent.clone());
8675
8676                if let Some(token) = token.as_ref() {
8677                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8678                }
8679
8680                let request = req_builder
8681                    .header(CONTENT_TYPE, json_mime_type.to_string())
8682                    .header(CONTENT_LENGTH, request_size as u64)
8683                    .body(common::to_body(
8684                        request_value_reader.get_ref().clone().into(),
8685                    ));
8686
8687                client.request(request.unwrap()).await
8688            };
8689
8690            match req_result {
8691                Err(err) => {
8692                    if let common::Retry::After(d) = dlg.http_error(&err) {
8693                        sleep(d).await;
8694                        continue;
8695                    }
8696                    dlg.finished(false);
8697                    return Err(common::Error::HttpError(err));
8698                }
8699                Ok(res) => {
8700                    let (mut parts, body) = res.into_parts();
8701                    let mut body = common::Body::new(body);
8702                    if !parts.status.is_success() {
8703                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8704                        let error = serde_json::from_str(&common::to_string(&bytes));
8705                        let response = common::to_response(parts, bytes.into());
8706
8707                        if let common::Retry::After(d) =
8708                            dlg.http_failure(&response, error.as_ref().ok())
8709                        {
8710                            sleep(d).await;
8711                            continue;
8712                        }
8713
8714                        dlg.finished(false);
8715
8716                        return Err(match error {
8717                            Ok(value) => common::Error::BadRequest(value),
8718                            _ => common::Error::Failure(response),
8719                        });
8720                    }
8721                    let response = {
8722                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8723                        let encoded = common::to_string(&bytes);
8724                        match serde_json::from_str(&encoded) {
8725                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8726                            Err(error) => {
8727                                dlg.response_json_decode_error(&encoded, &error);
8728                                return Err(common::Error::JsonDecodeError(
8729                                    encoded.to_string(),
8730                                    error,
8731                                ));
8732                            }
8733                        }
8734                    };
8735
8736                    dlg.finished(true);
8737                    return Ok(response);
8738                }
8739            }
8740        }
8741    }
8742
8743    ///
8744    /// Sets the *request* property to the given value.
8745    ///
8746    /// Even though the property as already been set when instantiating this call,
8747    /// we provide this method for API completeness.
8748    pub fn request(mut self, new_value: WebApp) -> ProjectWebAppCreateCall<'a, C> {
8749        self._request = new_value;
8750        self
8751    }
8752    /// The resource name of the parent FirebaseProject in which to create a WebApp, in the format: projects/PROJECT_IDENTIFIER/webApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
8753    ///
8754    /// Sets the *parent* path property to the given value.
8755    ///
8756    /// Even though the property as already been set when instantiating this call,
8757    /// we provide this method for API completeness.
8758    pub fn parent(mut self, new_value: &str) -> ProjectWebAppCreateCall<'a, C> {
8759        self._parent = new_value.to_string();
8760        self
8761    }
8762    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8763    /// while executing the actual API request.
8764    ///
8765    /// ````text
8766    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
8767    /// ````
8768    ///
8769    /// Sets the *delegate* property to the given value.
8770    pub fn delegate(
8771        mut self,
8772        new_value: &'a mut dyn common::Delegate,
8773    ) -> ProjectWebAppCreateCall<'a, C> {
8774        self._delegate = Some(new_value);
8775        self
8776    }
8777
8778    /// Set any additional parameter of the query string used in the request.
8779    /// It should be used to set parameters which are not yet available through their own
8780    /// setters.
8781    ///
8782    /// Please note that this method must not be used to set any of the known parameters
8783    /// which have their own setter method. If done anyway, the request will fail.
8784    ///
8785    /// # Additional Parameters
8786    ///
8787    /// * *$.xgafv* (query-string) - V1 error format.
8788    /// * *access_token* (query-string) - OAuth access token.
8789    /// * *alt* (query-string) - Data format for response.
8790    /// * *callback* (query-string) - JSONP
8791    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8792    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8793    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8794    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8795    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8796    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8797    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8798    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppCreateCall<'a, C>
8799    where
8800        T: AsRef<str>,
8801    {
8802        self._additional_params
8803            .insert(name.as_ref().to_string(), value.as_ref().to_string());
8804        self
8805    }
8806
8807    /// Identifies the authorization scope for the method you are building.
8808    ///
8809    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8810    /// [`Scope::CloudPlatform`].
8811    ///
8812    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8813    /// tokens for more than one scope.
8814    ///
8815    /// Usually there is more than one suitable scope to authorize an operation, some of which may
8816    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8817    /// sufficient, a read-write scope will do as well.
8818    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppCreateCall<'a, C>
8819    where
8820        St: AsRef<str>,
8821    {
8822        self._scopes.insert(String::from(scope.as_ref()));
8823        self
8824    }
8825    /// Identifies the authorization scope(s) for the method you are building.
8826    ///
8827    /// See [`Self::add_scope()`] for details.
8828    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppCreateCall<'a, C>
8829    where
8830        I: IntoIterator<Item = St>,
8831        St: AsRef<str>,
8832    {
8833        self._scopes
8834            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8835        self
8836    }
8837
8838    /// Removes all scopes, and no default scope will be used either.
8839    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8840    /// for details).
8841    pub fn clear_scopes(mut self) -> ProjectWebAppCreateCall<'a, C> {
8842        self._scopes.clear();
8843        self
8844    }
8845}
8846
8847/// Gets the specified WebApp.
8848///
8849/// A builder for the *webApps.get* method supported by a *project* resource.
8850/// It is not used directly, but through a [`ProjectMethods`] instance.
8851///
8852/// # Example
8853///
8854/// Instantiate a resource method builder
8855///
8856/// ```test_harness,no_run
8857/// # extern crate hyper;
8858/// # extern crate hyper_rustls;
8859/// # extern crate google_firebase1_beta1 as firebase1_beta1;
8860/// # async fn dox() {
8861/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8862///
8863/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8864/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
8865/// #     secret,
8866/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8867/// # ).build().await.unwrap();
8868///
8869/// # let client = hyper_util::client::legacy::Client::builder(
8870/// #     hyper_util::rt::TokioExecutor::new()
8871/// # )
8872/// # .build(
8873/// #     hyper_rustls::HttpsConnectorBuilder::new()
8874/// #         .with_native_roots()
8875/// #         .unwrap()
8876/// #         .https_or_http()
8877/// #         .enable_http1()
8878/// #         .build()
8879/// # );
8880/// # let mut hub = FirebaseManagement::new(client, auth);
8881/// // You can configure optional parameters by calling the respective setters at will, and
8882/// // execute the final call using `doit()`.
8883/// // Values shown here are possibly random and not representative !
8884/// let result = hub.projects().web_apps_get("name")
8885///              .doit().await;
8886/// # }
8887/// ```
8888pub struct ProjectWebAppGetCall<'a, C>
8889where
8890    C: 'a,
8891{
8892    hub: &'a FirebaseManagement<C>,
8893    _name: String,
8894    _delegate: Option<&'a mut dyn common::Delegate>,
8895    _additional_params: HashMap<String, String>,
8896    _scopes: BTreeSet<String>,
8897}
8898
8899impl<'a, C> common::CallBuilder for ProjectWebAppGetCall<'a, C> {}
8900
8901impl<'a, C> ProjectWebAppGetCall<'a, C>
8902where
8903    C: common::Connector,
8904{
8905    /// Perform the operation you have build so far.
8906    pub async fn doit(mut self) -> common::Result<(common::Response, WebApp)> {
8907        use std::borrow::Cow;
8908        use std::io::{Read, Seek};
8909
8910        use common::{url::Params, ToParts};
8911        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8912
8913        let mut dd = common::DefaultDelegate;
8914        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8915        dlg.begin(common::MethodInfo {
8916            id: "firebase.projects.webApps.get",
8917            http_method: hyper::Method::GET,
8918        });
8919
8920        for &field in ["alt", "name"].iter() {
8921            if self._additional_params.contains_key(field) {
8922                dlg.finished(false);
8923                return Err(common::Error::FieldClash(field));
8924            }
8925        }
8926
8927        let mut params = Params::with_capacity(3 + self._additional_params.len());
8928        params.push("name", self._name);
8929
8930        params.extend(self._additional_params.iter());
8931
8932        params.push("alt", "json");
8933        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
8934        if self._scopes.is_empty() {
8935            self._scopes.insert(Scope::Readonly.as_ref().to_string());
8936        }
8937
8938        #[allow(clippy::single_element_loop)]
8939        for &(find_this, param_name) in [("{+name}", "name")].iter() {
8940            url = params.uri_replacement(url, param_name, find_this, true);
8941        }
8942        {
8943            let to_remove = ["name"];
8944            params.remove_params(&to_remove);
8945        }
8946
8947        let url = params.parse_with_url(&url);
8948
8949        loop {
8950            let token = match self
8951                .hub
8952                .auth
8953                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8954                .await
8955            {
8956                Ok(token) => token,
8957                Err(e) => match dlg.token(e) {
8958                    Ok(token) => token,
8959                    Err(e) => {
8960                        dlg.finished(false);
8961                        return Err(common::Error::MissingToken(e));
8962                    }
8963                },
8964            };
8965            let mut req_result = {
8966                let client = &self.hub.client;
8967                dlg.pre_request();
8968                let mut req_builder = hyper::Request::builder()
8969                    .method(hyper::Method::GET)
8970                    .uri(url.as_str())
8971                    .header(USER_AGENT, self.hub._user_agent.clone());
8972
8973                if let Some(token) = token.as_ref() {
8974                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8975                }
8976
8977                let request = req_builder
8978                    .header(CONTENT_LENGTH, 0_u64)
8979                    .body(common::to_body::<String>(None));
8980
8981                client.request(request.unwrap()).await
8982            };
8983
8984            match req_result {
8985                Err(err) => {
8986                    if let common::Retry::After(d) = dlg.http_error(&err) {
8987                        sleep(d).await;
8988                        continue;
8989                    }
8990                    dlg.finished(false);
8991                    return Err(common::Error::HttpError(err));
8992                }
8993                Ok(res) => {
8994                    let (mut parts, body) = res.into_parts();
8995                    let mut body = common::Body::new(body);
8996                    if !parts.status.is_success() {
8997                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8998                        let error = serde_json::from_str(&common::to_string(&bytes));
8999                        let response = common::to_response(parts, bytes.into());
9000
9001                        if let common::Retry::After(d) =
9002                            dlg.http_failure(&response, error.as_ref().ok())
9003                        {
9004                            sleep(d).await;
9005                            continue;
9006                        }
9007
9008                        dlg.finished(false);
9009
9010                        return Err(match error {
9011                            Ok(value) => common::Error::BadRequest(value),
9012                            _ => common::Error::Failure(response),
9013                        });
9014                    }
9015                    let response = {
9016                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9017                        let encoded = common::to_string(&bytes);
9018                        match serde_json::from_str(&encoded) {
9019                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9020                            Err(error) => {
9021                                dlg.response_json_decode_error(&encoded, &error);
9022                                return Err(common::Error::JsonDecodeError(
9023                                    encoded.to_string(),
9024                                    error,
9025                                ));
9026                            }
9027                        }
9028                    };
9029
9030                    dlg.finished(true);
9031                    return Ok(response);
9032                }
9033            }
9034        }
9035    }
9036
9037    /// The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the `WebApp` [`name`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
9038    ///
9039    /// Sets the *name* path property to the given value.
9040    ///
9041    /// Even though the property as already been set when instantiating this call,
9042    /// we provide this method for API completeness.
9043    pub fn name(mut self, new_value: &str) -> ProjectWebAppGetCall<'a, C> {
9044        self._name = new_value.to_string();
9045        self
9046    }
9047    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9048    /// while executing the actual API request.
9049    ///
9050    /// ````text
9051    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9052    /// ````
9053    ///
9054    /// Sets the *delegate* property to the given value.
9055    pub fn delegate(
9056        mut self,
9057        new_value: &'a mut dyn common::Delegate,
9058    ) -> ProjectWebAppGetCall<'a, C> {
9059        self._delegate = Some(new_value);
9060        self
9061    }
9062
9063    /// Set any additional parameter of the query string used in the request.
9064    /// It should be used to set parameters which are not yet available through their own
9065    /// setters.
9066    ///
9067    /// Please note that this method must not be used to set any of the known parameters
9068    /// which have their own setter method. If done anyway, the request will fail.
9069    ///
9070    /// # Additional Parameters
9071    ///
9072    /// * *$.xgafv* (query-string) - V1 error format.
9073    /// * *access_token* (query-string) - OAuth access token.
9074    /// * *alt* (query-string) - Data format for response.
9075    /// * *callback* (query-string) - JSONP
9076    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9077    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9078    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9079    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9080    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9081    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9082    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9083    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppGetCall<'a, C>
9084    where
9085        T: AsRef<str>,
9086    {
9087        self._additional_params
9088            .insert(name.as_ref().to_string(), value.as_ref().to_string());
9089        self
9090    }
9091
9092    /// Identifies the authorization scope for the method you are building.
9093    ///
9094    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9095    /// [`Scope::Readonly`].
9096    ///
9097    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9098    /// tokens for more than one scope.
9099    ///
9100    /// Usually there is more than one suitable scope to authorize an operation, some of which may
9101    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9102    /// sufficient, a read-write scope will do as well.
9103    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppGetCall<'a, C>
9104    where
9105        St: AsRef<str>,
9106    {
9107        self._scopes.insert(String::from(scope.as_ref()));
9108        self
9109    }
9110    /// Identifies the authorization scope(s) for the method you are building.
9111    ///
9112    /// See [`Self::add_scope()`] for details.
9113    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppGetCall<'a, C>
9114    where
9115        I: IntoIterator<Item = St>,
9116        St: AsRef<str>,
9117    {
9118        self._scopes
9119            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9120        self
9121    }
9122
9123    /// Removes all scopes, and no default scope will be used either.
9124    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9125    /// for details).
9126    pub fn clear_scopes(mut self) -> ProjectWebAppGetCall<'a, C> {
9127        self._scopes.clear();
9128        self
9129    }
9130}
9131
9132/// Gets the configuration artifact associated with the specified WebApp.
9133///
9134/// A builder for the *webApps.getConfig* method supported by a *project* resource.
9135/// It is not used directly, but through a [`ProjectMethods`] instance.
9136///
9137/// # Example
9138///
9139/// Instantiate a resource method builder
9140///
9141/// ```test_harness,no_run
9142/// # extern crate hyper;
9143/// # extern crate hyper_rustls;
9144/// # extern crate google_firebase1_beta1 as firebase1_beta1;
9145/// # async fn dox() {
9146/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9147///
9148/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9149/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
9150/// #     secret,
9151/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9152/// # ).build().await.unwrap();
9153///
9154/// # let client = hyper_util::client::legacy::Client::builder(
9155/// #     hyper_util::rt::TokioExecutor::new()
9156/// # )
9157/// # .build(
9158/// #     hyper_rustls::HttpsConnectorBuilder::new()
9159/// #         .with_native_roots()
9160/// #         .unwrap()
9161/// #         .https_or_http()
9162/// #         .enable_http1()
9163/// #         .build()
9164/// # );
9165/// # let mut hub = FirebaseManagement::new(client, auth);
9166/// // You can configure optional parameters by calling the respective setters at will, and
9167/// // execute the final call using `doit()`.
9168/// // Values shown here are possibly random and not representative !
9169/// let result = hub.projects().web_apps_get_config("name")
9170///              .doit().await;
9171/// # }
9172/// ```
9173pub struct ProjectWebAppGetConfigCall<'a, C>
9174where
9175    C: 'a,
9176{
9177    hub: &'a FirebaseManagement<C>,
9178    _name: String,
9179    _delegate: Option<&'a mut dyn common::Delegate>,
9180    _additional_params: HashMap<String, String>,
9181    _scopes: BTreeSet<String>,
9182}
9183
9184impl<'a, C> common::CallBuilder for ProjectWebAppGetConfigCall<'a, C> {}
9185
9186impl<'a, C> ProjectWebAppGetConfigCall<'a, C>
9187where
9188    C: common::Connector,
9189{
9190    /// Perform the operation you have build so far.
9191    pub async fn doit(mut self) -> common::Result<(common::Response, WebAppConfig)> {
9192        use std::borrow::Cow;
9193        use std::io::{Read, Seek};
9194
9195        use common::{url::Params, ToParts};
9196        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9197
9198        let mut dd = common::DefaultDelegate;
9199        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9200        dlg.begin(common::MethodInfo {
9201            id: "firebase.projects.webApps.getConfig",
9202            http_method: hyper::Method::GET,
9203        });
9204
9205        for &field in ["alt", "name"].iter() {
9206            if self._additional_params.contains_key(field) {
9207                dlg.finished(false);
9208                return Err(common::Error::FieldClash(field));
9209            }
9210        }
9211
9212        let mut params = Params::with_capacity(3 + self._additional_params.len());
9213        params.push("name", self._name);
9214
9215        params.extend(self._additional_params.iter());
9216
9217        params.push("alt", "json");
9218        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
9219        if self._scopes.is_empty() {
9220            self._scopes.insert(Scope::Readonly.as_ref().to_string());
9221        }
9222
9223        #[allow(clippy::single_element_loop)]
9224        for &(find_this, param_name) in [("{+name}", "name")].iter() {
9225            url = params.uri_replacement(url, param_name, find_this, true);
9226        }
9227        {
9228            let to_remove = ["name"];
9229            params.remove_params(&to_remove);
9230        }
9231
9232        let url = params.parse_with_url(&url);
9233
9234        loop {
9235            let token = match self
9236                .hub
9237                .auth
9238                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9239                .await
9240            {
9241                Ok(token) => token,
9242                Err(e) => match dlg.token(e) {
9243                    Ok(token) => token,
9244                    Err(e) => {
9245                        dlg.finished(false);
9246                        return Err(common::Error::MissingToken(e));
9247                    }
9248                },
9249            };
9250            let mut req_result = {
9251                let client = &self.hub.client;
9252                dlg.pre_request();
9253                let mut req_builder = hyper::Request::builder()
9254                    .method(hyper::Method::GET)
9255                    .uri(url.as_str())
9256                    .header(USER_AGENT, self.hub._user_agent.clone());
9257
9258                if let Some(token) = token.as_ref() {
9259                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9260                }
9261
9262                let request = req_builder
9263                    .header(CONTENT_LENGTH, 0_u64)
9264                    .body(common::to_body::<String>(None));
9265
9266                client.request(request.unwrap()).await
9267            };
9268
9269            match req_result {
9270                Err(err) => {
9271                    if let common::Retry::After(d) = dlg.http_error(&err) {
9272                        sleep(d).await;
9273                        continue;
9274                    }
9275                    dlg.finished(false);
9276                    return Err(common::Error::HttpError(err));
9277                }
9278                Ok(res) => {
9279                    let (mut parts, body) = res.into_parts();
9280                    let mut body = common::Body::new(body);
9281                    if !parts.status.is_success() {
9282                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9283                        let error = serde_json::from_str(&common::to_string(&bytes));
9284                        let response = common::to_response(parts, bytes.into());
9285
9286                        if let common::Retry::After(d) =
9287                            dlg.http_failure(&response, error.as_ref().ok())
9288                        {
9289                            sleep(d).await;
9290                            continue;
9291                        }
9292
9293                        dlg.finished(false);
9294
9295                        return Err(match error {
9296                            Ok(value) => common::Error::BadRequest(value),
9297                            _ => common::Error::Failure(response),
9298                        });
9299                    }
9300                    let response = {
9301                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9302                        let encoded = common::to_string(&bytes);
9303                        match serde_json::from_str(&encoded) {
9304                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9305                            Err(error) => {
9306                                dlg.response_json_decode_error(&encoded, &error);
9307                                return Err(common::Error::JsonDecodeError(
9308                                    encoded.to_string(),
9309                                    error,
9310                                ));
9311                            }
9312                        }
9313                    };
9314
9315                    dlg.finished(true);
9316                    return Ok(response);
9317                }
9318            }
9319        }
9320    }
9321
9322    /// The resource name of the WebApp configuration to download, in the format: projects/PROJECT_IDENTIFIER/webApps/APP_ID/config Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the `WebApp` [`name`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
9323    ///
9324    /// Sets the *name* path property to the given value.
9325    ///
9326    /// Even though the property as already been set when instantiating this call,
9327    /// we provide this method for API completeness.
9328    pub fn name(mut self, new_value: &str) -> ProjectWebAppGetConfigCall<'a, C> {
9329        self._name = new_value.to_string();
9330        self
9331    }
9332    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9333    /// while executing the actual API request.
9334    ///
9335    /// ````text
9336    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9337    /// ````
9338    ///
9339    /// Sets the *delegate* property to the given value.
9340    pub fn delegate(
9341        mut self,
9342        new_value: &'a mut dyn common::Delegate,
9343    ) -> ProjectWebAppGetConfigCall<'a, C> {
9344        self._delegate = Some(new_value);
9345        self
9346    }
9347
9348    /// Set any additional parameter of the query string used in the request.
9349    /// It should be used to set parameters which are not yet available through their own
9350    /// setters.
9351    ///
9352    /// Please note that this method must not be used to set any of the known parameters
9353    /// which have their own setter method. If done anyway, the request will fail.
9354    ///
9355    /// # Additional Parameters
9356    ///
9357    /// * *$.xgafv* (query-string) - V1 error format.
9358    /// * *access_token* (query-string) - OAuth access token.
9359    /// * *alt* (query-string) - Data format for response.
9360    /// * *callback* (query-string) - JSONP
9361    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9362    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9363    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9364    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9365    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9366    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9367    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9368    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppGetConfigCall<'a, C>
9369    where
9370        T: AsRef<str>,
9371    {
9372        self._additional_params
9373            .insert(name.as_ref().to_string(), value.as_ref().to_string());
9374        self
9375    }
9376
9377    /// Identifies the authorization scope for the method you are building.
9378    ///
9379    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9380    /// [`Scope::Readonly`].
9381    ///
9382    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9383    /// tokens for more than one scope.
9384    ///
9385    /// Usually there is more than one suitable scope to authorize an operation, some of which may
9386    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9387    /// sufficient, a read-write scope will do as well.
9388    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppGetConfigCall<'a, C>
9389    where
9390        St: AsRef<str>,
9391    {
9392        self._scopes.insert(String::from(scope.as_ref()));
9393        self
9394    }
9395    /// Identifies the authorization scope(s) for the method you are building.
9396    ///
9397    /// See [`Self::add_scope()`] for details.
9398    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppGetConfigCall<'a, C>
9399    where
9400        I: IntoIterator<Item = St>,
9401        St: AsRef<str>,
9402    {
9403        self._scopes
9404            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9405        self
9406    }
9407
9408    /// Removes all scopes, and no default scope will be used either.
9409    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9410    /// for details).
9411    pub fn clear_scopes(mut self) -> ProjectWebAppGetConfigCall<'a, C> {
9412        self._scopes.clear();
9413        self
9414    }
9415}
9416
9417/// Lists each WebApp associated with the specified FirebaseProject. The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`.
9418///
9419/// A builder for the *webApps.list* method supported by a *project* resource.
9420/// It is not used directly, but through a [`ProjectMethods`] instance.
9421///
9422/// # Example
9423///
9424/// Instantiate a resource method builder
9425///
9426/// ```test_harness,no_run
9427/// # extern crate hyper;
9428/// # extern crate hyper_rustls;
9429/// # extern crate google_firebase1_beta1 as firebase1_beta1;
9430/// # async fn dox() {
9431/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9432///
9433/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9434/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
9435/// #     secret,
9436/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9437/// # ).build().await.unwrap();
9438///
9439/// # let client = hyper_util::client::legacy::Client::builder(
9440/// #     hyper_util::rt::TokioExecutor::new()
9441/// # )
9442/// # .build(
9443/// #     hyper_rustls::HttpsConnectorBuilder::new()
9444/// #         .with_native_roots()
9445/// #         .unwrap()
9446/// #         .https_or_http()
9447/// #         .enable_http1()
9448/// #         .build()
9449/// # );
9450/// # let mut hub = FirebaseManagement::new(client, auth);
9451/// // You can configure optional parameters by calling the respective setters at will, and
9452/// // execute the final call using `doit()`.
9453/// // Values shown here are possibly random and not representative !
9454/// let result = hub.projects().web_apps_list("parent")
9455///              .show_deleted(true)
9456///              .page_token("duo")
9457///              .page_size(-80)
9458///              .doit().await;
9459/// # }
9460/// ```
9461pub struct ProjectWebAppListCall<'a, C>
9462where
9463    C: 'a,
9464{
9465    hub: &'a FirebaseManagement<C>,
9466    _parent: String,
9467    _show_deleted: Option<bool>,
9468    _page_token: Option<String>,
9469    _page_size: Option<i32>,
9470    _delegate: Option<&'a mut dyn common::Delegate>,
9471    _additional_params: HashMap<String, String>,
9472    _scopes: BTreeSet<String>,
9473}
9474
9475impl<'a, C> common::CallBuilder for ProjectWebAppListCall<'a, C> {}
9476
9477impl<'a, C> ProjectWebAppListCall<'a, C>
9478where
9479    C: common::Connector,
9480{
9481    /// Perform the operation you have build so far.
9482    pub async fn doit(mut self) -> common::Result<(common::Response, ListWebAppsResponse)> {
9483        use std::borrow::Cow;
9484        use std::io::{Read, Seek};
9485
9486        use common::{url::Params, ToParts};
9487        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9488
9489        let mut dd = common::DefaultDelegate;
9490        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9491        dlg.begin(common::MethodInfo {
9492            id: "firebase.projects.webApps.list",
9493            http_method: hyper::Method::GET,
9494        });
9495
9496        for &field in ["alt", "parent", "showDeleted", "pageToken", "pageSize"].iter() {
9497            if self._additional_params.contains_key(field) {
9498                dlg.finished(false);
9499                return Err(common::Error::FieldClash(field));
9500            }
9501        }
9502
9503        let mut params = Params::with_capacity(6 + self._additional_params.len());
9504        params.push("parent", self._parent);
9505        if let Some(value) = self._show_deleted.as_ref() {
9506            params.push("showDeleted", value.to_string());
9507        }
9508        if let Some(value) = self._page_token.as_ref() {
9509            params.push("pageToken", value);
9510        }
9511        if let Some(value) = self._page_size.as_ref() {
9512            params.push("pageSize", value.to_string());
9513        }
9514
9515        params.extend(self._additional_params.iter());
9516
9517        params.push("alt", "json");
9518        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/webApps";
9519        if self._scopes.is_empty() {
9520            self._scopes.insert(Scope::Readonly.as_ref().to_string());
9521        }
9522
9523        #[allow(clippy::single_element_loop)]
9524        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
9525            url = params.uri_replacement(url, param_name, find_this, true);
9526        }
9527        {
9528            let to_remove = ["parent"];
9529            params.remove_params(&to_remove);
9530        }
9531
9532        let url = params.parse_with_url(&url);
9533
9534        loop {
9535            let token = match self
9536                .hub
9537                .auth
9538                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9539                .await
9540            {
9541                Ok(token) => token,
9542                Err(e) => match dlg.token(e) {
9543                    Ok(token) => token,
9544                    Err(e) => {
9545                        dlg.finished(false);
9546                        return Err(common::Error::MissingToken(e));
9547                    }
9548                },
9549            };
9550            let mut req_result = {
9551                let client = &self.hub.client;
9552                dlg.pre_request();
9553                let mut req_builder = hyper::Request::builder()
9554                    .method(hyper::Method::GET)
9555                    .uri(url.as_str())
9556                    .header(USER_AGENT, self.hub._user_agent.clone());
9557
9558                if let Some(token) = token.as_ref() {
9559                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9560                }
9561
9562                let request = req_builder
9563                    .header(CONTENT_LENGTH, 0_u64)
9564                    .body(common::to_body::<String>(None));
9565
9566                client.request(request.unwrap()).await
9567            };
9568
9569            match req_result {
9570                Err(err) => {
9571                    if let common::Retry::After(d) = dlg.http_error(&err) {
9572                        sleep(d).await;
9573                        continue;
9574                    }
9575                    dlg.finished(false);
9576                    return Err(common::Error::HttpError(err));
9577                }
9578                Ok(res) => {
9579                    let (mut parts, body) = res.into_parts();
9580                    let mut body = common::Body::new(body);
9581                    if !parts.status.is_success() {
9582                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9583                        let error = serde_json::from_str(&common::to_string(&bytes));
9584                        let response = common::to_response(parts, bytes.into());
9585
9586                        if let common::Retry::After(d) =
9587                            dlg.http_failure(&response, error.as_ref().ok())
9588                        {
9589                            sleep(d).await;
9590                            continue;
9591                        }
9592
9593                        dlg.finished(false);
9594
9595                        return Err(match error {
9596                            Ok(value) => common::Error::BadRequest(value),
9597                            _ => common::Error::Failure(response),
9598                        });
9599                    }
9600                    let response = {
9601                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9602                        let encoded = common::to_string(&bytes);
9603                        match serde_json::from_str(&encoded) {
9604                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9605                            Err(error) => {
9606                                dlg.response_json_decode_error(&encoded, &error);
9607                                return Err(common::Error::JsonDecodeError(
9608                                    encoded.to_string(),
9609                                    error,
9610                                ));
9611                            }
9612                        }
9613                    };
9614
9615                    dlg.finished(true);
9616                    return Ok(response);
9617                }
9618            }
9619        }
9620    }
9621
9622    /// The resource name of the parent FirebaseProject for which to list each associated WebApp, in the format: projects/PROJECT_IDENTIFIER/webApps Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
9623    ///
9624    /// Sets the *parent* path property to the given value.
9625    ///
9626    /// Even though the property as already been set when instantiating this call,
9627    /// we provide this method for API completeness.
9628    pub fn parent(mut self, new_value: &str) -> ProjectWebAppListCall<'a, C> {
9629        self._parent = new_value.to_string();
9630        self
9631    }
9632    /// Controls whether Apps in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Apps will be returned.
9633    ///
9634    /// Sets the *show deleted* query property to the given value.
9635    pub fn show_deleted(mut self, new_value: bool) -> ProjectWebAppListCall<'a, C> {
9636        self._show_deleted = Some(new_value);
9637        self
9638    }
9639    /// Token returned from a previous call to `ListWebApps` indicating where in the set of Apps to resume listing.
9640    ///
9641    /// Sets the *page token* query property to the given value.
9642    pub fn page_token(mut self, new_value: &str) -> ProjectWebAppListCall<'a, C> {
9643        self._page_token = Some(new_value.to_string());
9644        self
9645    }
9646    /// The maximum number of Apps to return in the response. The server may return fewer than this value at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit.
9647    ///
9648    /// Sets the *page size* query property to the given value.
9649    pub fn page_size(mut self, new_value: i32) -> ProjectWebAppListCall<'a, C> {
9650        self._page_size = Some(new_value);
9651        self
9652    }
9653    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9654    /// while executing the actual API request.
9655    ///
9656    /// ````text
9657    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9658    /// ````
9659    ///
9660    /// Sets the *delegate* property to the given value.
9661    pub fn delegate(
9662        mut self,
9663        new_value: &'a mut dyn common::Delegate,
9664    ) -> ProjectWebAppListCall<'a, C> {
9665        self._delegate = Some(new_value);
9666        self
9667    }
9668
9669    /// Set any additional parameter of the query string used in the request.
9670    /// It should be used to set parameters which are not yet available through their own
9671    /// setters.
9672    ///
9673    /// Please note that this method must not be used to set any of the known parameters
9674    /// which have their own setter method. If done anyway, the request will fail.
9675    ///
9676    /// # Additional Parameters
9677    ///
9678    /// * *$.xgafv* (query-string) - V1 error format.
9679    /// * *access_token* (query-string) - OAuth access token.
9680    /// * *alt* (query-string) - Data format for response.
9681    /// * *callback* (query-string) - JSONP
9682    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9683    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9684    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9685    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9686    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9687    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9688    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9689    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppListCall<'a, C>
9690    where
9691        T: AsRef<str>,
9692    {
9693        self._additional_params
9694            .insert(name.as_ref().to_string(), value.as_ref().to_string());
9695        self
9696    }
9697
9698    /// Identifies the authorization scope for the method you are building.
9699    ///
9700    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9701    /// [`Scope::Readonly`].
9702    ///
9703    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9704    /// tokens for more than one scope.
9705    ///
9706    /// Usually there is more than one suitable scope to authorize an operation, some of which may
9707    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9708    /// sufficient, a read-write scope will do as well.
9709    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppListCall<'a, C>
9710    where
9711        St: AsRef<str>,
9712    {
9713        self._scopes.insert(String::from(scope.as_ref()));
9714        self
9715    }
9716    /// Identifies the authorization scope(s) for the method you are building.
9717    ///
9718    /// See [`Self::add_scope()`] for details.
9719    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppListCall<'a, C>
9720    where
9721        I: IntoIterator<Item = St>,
9722        St: AsRef<str>,
9723    {
9724        self._scopes
9725            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9726        self
9727    }
9728
9729    /// Removes all scopes, and no default scope will be used either.
9730    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9731    /// for details).
9732    pub fn clear_scopes(mut self) -> ProjectWebAppListCall<'a, C> {
9733        self._scopes.clear();
9734        self
9735    }
9736}
9737
9738/// Updates the attributes of the specified WebApp.
9739///
9740/// A builder for the *webApps.patch* method supported by a *project* resource.
9741/// It is not used directly, but through a [`ProjectMethods`] instance.
9742///
9743/// # Example
9744///
9745/// Instantiate a resource method builder
9746///
9747/// ```test_harness,no_run
9748/// # extern crate hyper;
9749/// # extern crate hyper_rustls;
9750/// # extern crate google_firebase1_beta1 as firebase1_beta1;
9751/// use firebase1_beta1::api::WebApp;
9752/// # async fn dox() {
9753/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9754///
9755/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9756/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
9757/// #     secret,
9758/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9759/// # ).build().await.unwrap();
9760///
9761/// # let client = hyper_util::client::legacy::Client::builder(
9762/// #     hyper_util::rt::TokioExecutor::new()
9763/// # )
9764/// # .build(
9765/// #     hyper_rustls::HttpsConnectorBuilder::new()
9766/// #         .with_native_roots()
9767/// #         .unwrap()
9768/// #         .https_or_http()
9769/// #         .enable_http1()
9770/// #         .build()
9771/// # );
9772/// # let mut hub = FirebaseManagement::new(client, auth);
9773/// // As the method needs a request, you would usually fill it with the desired information
9774/// // into the respective structure. Some of the parts shown here might not be applicable !
9775/// // Values shown here are possibly random and not representative !
9776/// let mut req = WebApp::default();
9777///
9778/// // You can configure optional parameters by calling the respective setters at will, and
9779/// // execute the final call using `doit()`.
9780/// // Values shown here are possibly random and not representative !
9781/// let result = hub.projects().web_apps_patch(req, "name")
9782///              .update_mask(FieldMask::new::<&str>(&[]))
9783///              .doit().await;
9784/// # }
9785/// ```
9786pub struct ProjectWebAppPatchCall<'a, C>
9787where
9788    C: 'a,
9789{
9790    hub: &'a FirebaseManagement<C>,
9791    _request: WebApp,
9792    _name: String,
9793    _update_mask: Option<common::FieldMask>,
9794    _delegate: Option<&'a mut dyn common::Delegate>,
9795    _additional_params: HashMap<String, String>,
9796    _scopes: BTreeSet<String>,
9797}
9798
9799impl<'a, C> common::CallBuilder for ProjectWebAppPatchCall<'a, C> {}
9800
9801impl<'a, C> ProjectWebAppPatchCall<'a, C>
9802where
9803    C: common::Connector,
9804{
9805    /// Perform the operation you have build so far.
9806    pub async fn doit(mut self) -> common::Result<(common::Response, WebApp)> {
9807        use std::borrow::Cow;
9808        use std::io::{Read, Seek};
9809
9810        use common::{url::Params, ToParts};
9811        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9812
9813        let mut dd = common::DefaultDelegate;
9814        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9815        dlg.begin(common::MethodInfo {
9816            id: "firebase.projects.webApps.patch",
9817            http_method: hyper::Method::PATCH,
9818        });
9819
9820        for &field in ["alt", "name", "updateMask"].iter() {
9821            if self._additional_params.contains_key(field) {
9822                dlg.finished(false);
9823                return Err(common::Error::FieldClash(field));
9824            }
9825        }
9826
9827        let mut params = Params::with_capacity(5 + self._additional_params.len());
9828        params.push("name", self._name);
9829        if let Some(value) = self._update_mask.as_ref() {
9830            params.push("updateMask", value.to_string());
9831        }
9832
9833        params.extend(self._additional_params.iter());
9834
9835        params.push("alt", "json");
9836        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
9837        if self._scopes.is_empty() {
9838            self._scopes
9839                .insert(Scope::CloudPlatform.as_ref().to_string());
9840        }
9841
9842        #[allow(clippy::single_element_loop)]
9843        for &(find_this, param_name) in [("{+name}", "name")].iter() {
9844            url = params.uri_replacement(url, param_name, find_this, true);
9845        }
9846        {
9847            let to_remove = ["name"];
9848            params.remove_params(&to_remove);
9849        }
9850
9851        let url = params.parse_with_url(&url);
9852
9853        let mut json_mime_type = mime::APPLICATION_JSON;
9854        let mut request_value_reader = {
9855            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
9856            common::remove_json_null_values(&mut value);
9857            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
9858            serde_json::to_writer(&mut dst, &value).unwrap();
9859            dst
9860        };
9861        let request_size = request_value_reader
9862            .seek(std::io::SeekFrom::End(0))
9863            .unwrap();
9864        request_value_reader
9865            .seek(std::io::SeekFrom::Start(0))
9866            .unwrap();
9867
9868        loop {
9869            let token = match self
9870                .hub
9871                .auth
9872                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9873                .await
9874            {
9875                Ok(token) => token,
9876                Err(e) => match dlg.token(e) {
9877                    Ok(token) => token,
9878                    Err(e) => {
9879                        dlg.finished(false);
9880                        return Err(common::Error::MissingToken(e));
9881                    }
9882                },
9883            };
9884            request_value_reader
9885                .seek(std::io::SeekFrom::Start(0))
9886                .unwrap();
9887            let mut req_result = {
9888                let client = &self.hub.client;
9889                dlg.pre_request();
9890                let mut req_builder = hyper::Request::builder()
9891                    .method(hyper::Method::PATCH)
9892                    .uri(url.as_str())
9893                    .header(USER_AGENT, self.hub._user_agent.clone());
9894
9895                if let Some(token) = token.as_ref() {
9896                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9897                }
9898
9899                let request = req_builder
9900                    .header(CONTENT_TYPE, json_mime_type.to_string())
9901                    .header(CONTENT_LENGTH, request_size as u64)
9902                    .body(common::to_body(
9903                        request_value_reader.get_ref().clone().into(),
9904                    ));
9905
9906                client.request(request.unwrap()).await
9907            };
9908
9909            match req_result {
9910                Err(err) => {
9911                    if let common::Retry::After(d) = dlg.http_error(&err) {
9912                        sleep(d).await;
9913                        continue;
9914                    }
9915                    dlg.finished(false);
9916                    return Err(common::Error::HttpError(err));
9917                }
9918                Ok(res) => {
9919                    let (mut parts, body) = res.into_parts();
9920                    let mut body = common::Body::new(body);
9921                    if !parts.status.is_success() {
9922                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9923                        let error = serde_json::from_str(&common::to_string(&bytes));
9924                        let response = common::to_response(parts, bytes.into());
9925
9926                        if let common::Retry::After(d) =
9927                            dlg.http_failure(&response, error.as_ref().ok())
9928                        {
9929                            sleep(d).await;
9930                            continue;
9931                        }
9932
9933                        dlg.finished(false);
9934
9935                        return Err(match error {
9936                            Ok(value) => common::Error::BadRequest(value),
9937                            _ => common::Error::Failure(response),
9938                        });
9939                    }
9940                    let response = {
9941                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9942                        let encoded = common::to_string(&bytes);
9943                        match serde_json::from_str(&encoded) {
9944                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9945                            Err(error) => {
9946                                dlg.response_json_decode_error(&encoded, &error);
9947                                return Err(common::Error::JsonDecodeError(
9948                                    encoded.to_string(),
9949                                    error,
9950                                ));
9951                            }
9952                        }
9953                    };
9954
9955                    dlg.finished(true);
9956                    return Ok(response);
9957                }
9958            }
9959        }
9960    }
9961
9962    ///
9963    /// Sets the *request* property to the given value.
9964    ///
9965    /// Even though the property as already been set when instantiating this call,
9966    /// we provide this method for API completeness.
9967    pub fn request(mut self, new_value: WebApp) -> ProjectWebAppPatchCall<'a, C> {
9968        self._request = new_value;
9969        self
9970    }
9971    /// The resource name of the WebApp, in the format: projects/PROJECT_IDENTIFIER /webApps/APP_ID * PROJECT_IDENTIFIER: the parent Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID: the globally unique, Firebase-assigned identifier for the App (see [`appId`](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.app_id)).
9972    ///
9973    /// Sets the *name* path property to the given value.
9974    ///
9975    /// Even though the property as already been set when instantiating this call,
9976    /// we provide this method for API completeness.
9977    pub fn name(mut self, new_value: &str) -> ProjectWebAppPatchCall<'a, C> {
9978        self._name = new_value.to_string();
9979        self
9980    }
9981    /// Specifies which fields of the WebApp to update. Note that the following fields are immutable: `name`, `app_id`, and `project_id`. To update `state`, use any of the following endpoints: RemoveWebApp or UndeleteWebApp.
9982    ///
9983    /// Sets the *update mask* query property to the given value.
9984    pub fn update_mask(mut self, new_value: common::FieldMask) -> ProjectWebAppPatchCall<'a, C> {
9985        self._update_mask = Some(new_value);
9986        self
9987    }
9988    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9989    /// while executing the actual API request.
9990    ///
9991    /// ````text
9992    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9993    /// ````
9994    ///
9995    /// Sets the *delegate* property to the given value.
9996    pub fn delegate(
9997        mut self,
9998        new_value: &'a mut dyn common::Delegate,
9999    ) -> ProjectWebAppPatchCall<'a, C> {
10000        self._delegate = Some(new_value);
10001        self
10002    }
10003
10004    /// Set any additional parameter of the query string used in the request.
10005    /// It should be used to set parameters which are not yet available through their own
10006    /// setters.
10007    ///
10008    /// Please note that this method must not be used to set any of the known parameters
10009    /// which have their own setter method. If done anyway, the request will fail.
10010    ///
10011    /// # Additional Parameters
10012    ///
10013    /// * *$.xgafv* (query-string) - V1 error format.
10014    /// * *access_token* (query-string) - OAuth access token.
10015    /// * *alt* (query-string) - Data format for response.
10016    /// * *callback* (query-string) - JSONP
10017    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10018    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10019    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10020    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10021    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10022    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10023    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10024    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppPatchCall<'a, C>
10025    where
10026        T: AsRef<str>,
10027    {
10028        self._additional_params
10029            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10030        self
10031    }
10032
10033    /// Identifies the authorization scope for the method you are building.
10034    ///
10035    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10036    /// [`Scope::CloudPlatform`].
10037    ///
10038    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10039    /// tokens for more than one scope.
10040    ///
10041    /// Usually there is more than one suitable scope to authorize an operation, some of which may
10042    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10043    /// sufficient, a read-write scope will do as well.
10044    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppPatchCall<'a, C>
10045    where
10046        St: AsRef<str>,
10047    {
10048        self._scopes.insert(String::from(scope.as_ref()));
10049        self
10050    }
10051    /// Identifies the authorization scope(s) for the method you are building.
10052    ///
10053    /// See [`Self::add_scope()`] for details.
10054    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppPatchCall<'a, C>
10055    where
10056        I: IntoIterator<Item = St>,
10057        St: AsRef<str>,
10058    {
10059        self._scopes
10060            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10061        self
10062    }
10063
10064    /// Removes all scopes, and no default scope will be used either.
10065    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10066    /// for details).
10067    pub fn clear_scopes(mut self) -> ProjectWebAppPatchCall<'a, C> {
10068        self._scopes.clear();
10069        self
10070    }
10071}
10072
10073/// Removes the specified WebApp from the FirebaseProject.
10074///
10075/// A builder for the *webApps.remove* method supported by a *project* resource.
10076/// It is not used directly, but through a [`ProjectMethods`] instance.
10077///
10078/// # Example
10079///
10080/// Instantiate a resource method builder
10081///
10082/// ```test_harness,no_run
10083/// # extern crate hyper;
10084/// # extern crate hyper_rustls;
10085/// # extern crate google_firebase1_beta1 as firebase1_beta1;
10086/// use firebase1_beta1::api::RemoveWebAppRequest;
10087/// # async fn dox() {
10088/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10089///
10090/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10091/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
10092/// #     secret,
10093/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10094/// # ).build().await.unwrap();
10095///
10096/// # let client = hyper_util::client::legacy::Client::builder(
10097/// #     hyper_util::rt::TokioExecutor::new()
10098/// # )
10099/// # .build(
10100/// #     hyper_rustls::HttpsConnectorBuilder::new()
10101/// #         .with_native_roots()
10102/// #         .unwrap()
10103/// #         .https_or_http()
10104/// #         .enable_http1()
10105/// #         .build()
10106/// # );
10107/// # let mut hub = FirebaseManagement::new(client, auth);
10108/// // As the method needs a request, you would usually fill it with the desired information
10109/// // into the respective structure. Some of the parts shown here might not be applicable !
10110/// // Values shown here are possibly random and not representative !
10111/// let mut req = RemoveWebAppRequest::default();
10112///
10113/// // You can configure optional parameters by calling the respective setters at will, and
10114/// // execute the final call using `doit()`.
10115/// // Values shown here are possibly random and not representative !
10116/// let result = hub.projects().web_apps_remove(req, "name")
10117///              .doit().await;
10118/// # }
10119/// ```
10120pub struct ProjectWebAppRemoveCall<'a, C>
10121where
10122    C: 'a,
10123{
10124    hub: &'a FirebaseManagement<C>,
10125    _request: RemoveWebAppRequest,
10126    _name: String,
10127    _delegate: Option<&'a mut dyn common::Delegate>,
10128    _additional_params: HashMap<String, String>,
10129    _scopes: BTreeSet<String>,
10130}
10131
10132impl<'a, C> common::CallBuilder for ProjectWebAppRemoveCall<'a, C> {}
10133
10134impl<'a, C> ProjectWebAppRemoveCall<'a, C>
10135where
10136    C: common::Connector,
10137{
10138    /// Perform the operation you have build so far.
10139    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
10140        use std::borrow::Cow;
10141        use std::io::{Read, Seek};
10142
10143        use common::{url::Params, ToParts};
10144        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10145
10146        let mut dd = common::DefaultDelegate;
10147        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10148        dlg.begin(common::MethodInfo {
10149            id: "firebase.projects.webApps.remove",
10150            http_method: hyper::Method::POST,
10151        });
10152
10153        for &field in ["alt", "name"].iter() {
10154            if self._additional_params.contains_key(field) {
10155                dlg.finished(false);
10156                return Err(common::Error::FieldClash(field));
10157            }
10158        }
10159
10160        let mut params = Params::with_capacity(4 + self._additional_params.len());
10161        params.push("name", self._name);
10162
10163        params.extend(self._additional_params.iter());
10164
10165        params.push("alt", "json");
10166        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:remove";
10167        if self._scopes.is_empty() {
10168            self._scopes
10169                .insert(Scope::CloudPlatform.as_ref().to_string());
10170        }
10171
10172        #[allow(clippy::single_element_loop)]
10173        for &(find_this, param_name) in [("{+name}", "name")].iter() {
10174            url = params.uri_replacement(url, param_name, find_this, true);
10175        }
10176        {
10177            let to_remove = ["name"];
10178            params.remove_params(&to_remove);
10179        }
10180
10181        let url = params.parse_with_url(&url);
10182
10183        let mut json_mime_type = mime::APPLICATION_JSON;
10184        let mut request_value_reader = {
10185            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10186            common::remove_json_null_values(&mut value);
10187            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10188            serde_json::to_writer(&mut dst, &value).unwrap();
10189            dst
10190        };
10191        let request_size = request_value_reader
10192            .seek(std::io::SeekFrom::End(0))
10193            .unwrap();
10194        request_value_reader
10195            .seek(std::io::SeekFrom::Start(0))
10196            .unwrap();
10197
10198        loop {
10199            let token = match self
10200                .hub
10201                .auth
10202                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10203                .await
10204            {
10205                Ok(token) => token,
10206                Err(e) => match dlg.token(e) {
10207                    Ok(token) => token,
10208                    Err(e) => {
10209                        dlg.finished(false);
10210                        return Err(common::Error::MissingToken(e));
10211                    }
10212                },
10213            };
10214            request_value_reader
10215                .seek(std::io::SeekFrom::Start(0))
10216                .unwrap();
10217            let mut req_result = {
10218                let client = &self.hub.client;
10219                dlg.pre_request();
10220                let mut req_builder = hyper::Request::builder()
10221                    .method(hyper::Method::POST)
10222                    .uri(url.as_str())
10223                    .header(USER_AGENT, self.hub._user_agent.clone());
10224
10225                if let Some(token) = token.as_ref() {
10226                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10227                }
10228
10229                let request = req_builder
10230                    .header(CONTENT_TYPE, json_mime_type.to_string())
10231                    .header(CONTENT_LENGTH, request_size as u64)
10232                    .body(common::to_body(
10233                        request_value_reader.get_ref().clone().into(),
10234                    ));
10235
10236                client.request(request.unwrap()).await
10237            };
10238
10239            match req_result {
10240                Err(err) => {
10241                    if let common::Retry::After(d) = dlg.http_error(&err) {
10242                        sleep(d).await;
10243                        continue;
10244                    }
10245                    dlg.finished(false);
10246                    return Err(common::Error::HttpError(err));
10247                }
10248                Ok(res) => {
10249                    let (mut parts, body) = res.into_parts();
10250                    let mut body = common::Body::new(body);
10251                    if !parts.status.is_success() {
10252                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10253                        let error = serde_json::from_str(&common::to_string(&bytes));
10254                        let response = common::to_response(parts, bytes.into());
10255
10256                        if let common::Retry::After(d) =
10257                            dlg.http_failure(&response, error.as_ref().ok())
10258                        {
10259                            sleep(d).await;
10260                            continue;
10261                        }
10262
10263                        dlg.finished(false);
10264
10265                        return Err(match error {
10266                            Ok(value) => common::Error::BadRequest(value),
10267                            _ => common::Error::Failure(response),
10268                        });
10269                    }
10270                    let response = {
10271                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10272                        let encoded = common::to_string(&bytes);
10273                        match serde_json::from_str(&encoded) {
10274                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10275                            Err(error) => {
10276                                dlg.response_json_decode_error(&encoded, &error);
10277                                return Err(common::Error::JsonDecodeError(
10278                                    encoded.to_string(),
10279                                    error,
10280                                ));
10281                            }
10282                        }
10283                    };
10284
10285                    dlg.finished(true);
10286                    return Ok(response);
10287                }
10288            }
10289        }
10290    }
10291
10292    ///
10293    /// Sets the *request* property to the given value.
10294    ///
10295    /// Even though the property as already been set when instantiating this call,
10296    /// we provide this method for API completeness.
10297    pub fn request(mut self, new_value: RemoveWebAppRequest) -> ProjectWebAppRemoveCall<'a, C> {
10298        self._request = new_value;
10299        self
10300    }
10301    /// Required. The resource name of the WebApp, in the format: projects/ PROJECT_IDENTIFIER/webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp [name](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
10302    ///
10303    /// Sets the *name* path property to the given value.
10304    ///
10305    /// Even though the property as already been set when instantiating this call,
10306    /// we provide this method for API completeness.
10307    pub fn name(mut self, new_value: &str) -> ProjectWebAppRemoveCall<'a, C> {
10308        self._name = new_value.to_string();
10309        self
10310    }
10311    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10312    /// while executing the actual API request.
10313    ///
10314    /// ````text
10315    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
10316    /// ````
10317    ///
10318    /// Sets the *delegate* property to the given value.
10319    pub fn delegate(
10320        mut self,
10321        new_value: &'a mut dyn common::Delegate,
10322    ) -> ProjectWebAppRemoveCall<'a, C> {
10323        self._delegate = Some(new_value);
10324        self
10325    }
10326
10327    /// Set any additional parameter of the query string used in the request.
10328    /// It should be used to set parameters which are not yet available through their own
10329    /// setters.
10330    ///
10331    /// Please note that this method must not be used to set any of the known parameters
10332    /// which have their own setter method. If done anyway, the request will fail.
10333    ///
10334    /// # Additional Parameters
10335    ///
10336    /// * *$.xgafv* (query-string) - V1 error format.
10337    /// * *access_token* (query-string) - OAuth access token.
10338    /// * *alt* (query-string) - Data format for response.
10339    /// * *callback* (query-string) - JSONP
10340    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10341    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10342    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10343    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10344    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10345    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10346    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10347    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppRemoveCall<'a, C>
10348    where
10349        T: AsRef<str>,
10350    {
10351        self._additional_params
10352            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10353        self
10354    }
10355
10356    /// Identifies the authorization scope for the method you are building.
10357    ///
10358    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10359    /// [`Scope::CloudPlatform`].
10360    ///
10361    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10362    /// tokens for more than one scope.
10363    ///
10364    /// Usually there is more than one suitable scope to authorize an operation, some of which may
10365    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10366    /// sufficient, a read-write scope will do as well.
10367    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppRemoveCall<'a, C>
10368    where
10369        St: AsRef<str>,
10370    {
10371        self._scopes.insert(String::from(scope.as_ref()));
10372        self
10373    }
10374    /// Identifies the authorization scope(s) for the method you are building.
10375    ///
10376    /// See [`Self::add_scope()`] for details.
10377    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppRemoveCall<'a, C>
10378    where
10379        I: IntoIterator<Item = St>,
10380        St: AsRef<str>,
10381    {
10382        self._scopes
10383            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10384        self
10385    }
10386
10387    /// Removes all scopes, and no default scope will be used either.
10388    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10389    /// for details).
10390    pub fn clear_scopes(mut self) -> ProjectWebAppRemoveCall<'a, C> {
10391        self._scopes.clear();
10392        self
10393    }
10394}
10395
10396/// Restores the specified WebApp to the FirebaseProject.
10397///
10398/// A builder for the *webApps.undelete* method supported by a *project* resource.
10399/// It is not used directly, but through a [`ProjectMethods`] instance.
10400///
10401/// # Example
10402///
10403/// Instantiate a resource method builder
10404///
10405/// ```test_harness,no_run
10406/// # extern crate hyper;
10407/// # extern crate hyper_rustls;
10408/// # extern crate google_firebase1_beta1 as firebase1_beta1;
10409/// use firebase1_beta1::api::UndeleteWebAppRequest;
10410/// # async fn dox() {
10411/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10412///
10413/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10414/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
10415/// #     secret,
10416/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10417/// # ).build().await.unwrap();
10418///
10419/// # let client = hyper_util::client::legacy::Client::builder(
10420/// #     hyper_util::rt::TokioExecutor::new()
10421/// # )
10422/// # .build(
10423/// #     hyper_rustls::HttpsConnectorBuilder::new()
10424/// #         .with_native_roots()
10425/// #         .unwrap()
10426/// #         .https_or_http()
10427/// #         .enable_http1()
10428/// #         .build()
10429/// # );
10430/// # let mut hub = FirebaseManagement::new(client, auth);
10431/// // As the method needs a request, you would usually fill it with the desired information
10432/// // into the respective structure. Some of the parts shown here might not be applicable !
10433/// // Values shown here are possibly random and not representative !
10434/// let mut req = UndeleteWebAppRequest::default();
10435///
10436/// // You can configure optional parameters by calling the respective setters at will, and
10437/// // execute the final call using `doit()`.
10438/// // Values shown here are possibly random and not representative !
10439/// let result = hub.projects().web_apps_undelete(req, "name")
10440///              .doit().await;
10441/// # }
10442/// ```
10443pub struct ProjectWebAppUndeleteCall<'a, C>
10444where
10445    C: 'a,
10446{
10447    hub: &'a FirebaseManagement<C>,
10448    _request: UndeleteWebAppRequest,
10449    _name: String,
10450    _delegate: Option<&'a mut dyn common::Delegate>,
10451    _additional_params: HashMap<String, String>,
10452    _scopes: BTreeSet<String>,
10453}
10454
10455impl<'a, C> common::CallBuilder for ProjectWebAppUndeleteCall<'a, C> {}
10456
10457impl<'a, C> ProjectWebAppUndeleteCall<'a, C>
10458where
10459    C: common::Connector,
10460{
10461    /// Perform the operation you have build so far.
10462    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
10463        use std::borrow::Cow;
10464        use std::io::{Read, Seek};
10465
10466        use common::{url::Params, ToParts};
10467        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10468
10469        let mut dd = common::DefaultDelegate;
10470        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10471        dlg.begin(common::MethodInfo {
10472            id: "firebase.projects.webApps.undelete",
10473            http_method: hyper::Method::POST,
10474        });
10475
10476        for &field in ["alt", "name"].iter() {
10477            if self._additional_params.contains_key(field) {
10478                dlg.finished(false);
10479                return Err(common::Error::FieldClash(field));
10480            }
10481        }
10482
10483        let mut params = Params::with_capacity(4 + self._additional_params.len());
10484        params.push("name", self._name);
10485
10486        params.extend(self._additional_params.iter());
10487
10488        params.push("alt", "json");
10489        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:undelete";
10490        if self._scopes.is_empty() {
10491            self._scopes
10492                .insert(Scope::CloudPlatform.as_ref().to_string());
10493        }
10494
10495        #[allow(clippy::single_element_loop)]
10496        for &(find_this, param_name) in [("{+name}", "name")].iter() {
10497            url = params.uri_replacement(url, param_name, find_this, true);
10498        }
10499        {
10500            let to_remove = ["name"];
10501            params.remove_params(&to_remove);
10502        }
10503
10504        let url = params.parse_with_url(&url);
10505
10506        let mut json_mime_type = mime::APPLICATION_JSON;
10507        let mut request_value_reader = {
10508            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10509            common::remove_json_null_values(&mut value);
10510            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10511            serde_json::to_writer(&mut dst, &value).unwrap();
10512            dst
10513        };
10514        let request_size = request_value_reader
10515            .seek(std::io::SeekFrom::End(0))
10516            .unwrap();
10517        request_value_reader
10518            .seek(std::io::SeekFrom::Start(0))
10519            .unwrap();
10520
10521        loop {
10522            let token = match self
10523                .hub
10524                .auth
10525                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10526                .await
10527            {
10528                Ok(token) => token,
10529                Err(e) => match dlg.token(e) {
10530                    Ok(token) => token,
10531                    Err(e) => {
10532                        dlg.finished(false);
10533                        return Err(common::Error::MissingToken(e));
10534                    }
10535                },
10536            };
10537            request_value_reader
10538                .seek(std::io::SeekFrom::Start(0))
10539                .unwrap();
10540            let mut req_result = {
10541                let client = &self.hub.client;
10542                dlg.pre_request();
10543                let mut req_builder = hyper::Request::builder()
10544                    .method(hyper::Method::POST)
10545                    .uri(url.as_str())
10546                    .header(USER_AGENT, self.hub._user_agent.clone());
10547
10548                if let Some(token) = token.as_ref() {
10549                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10550                }
10551
10552                let request = req_builder
10553                    .header(CONTENT_TYPE, json_mime_type.to_string())
10554                    .header(CONTENT_LENGTH, request_size as u64)
10555                    .body(common::to_body(
10556                        request_value_reader.get_ref().clone().into(),
10557                    ));
10558
10559                client.request(request.unwrap()).await
10560            };
10561
10562            match req_result {
10563                Err(err) => {
10564                    if let common::Retry::After(d) = dlg.http_error(&err) {
10565                        sleep(d).await;
10566                        continue;
10567                    }
10568                    dlg.finished(false);
10569                    return Err(common::Error::HttpError(err));
10570                }
10571                Ok(res) => {
10572                    let (mut parts, body) = res.into_parts();
10573                    let mut body = common::Body::new(body);
10574                    if !parts.status.is_success() {
10575                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10576                        let error = serde_json::from_str(&common::to_string(&bytes));
10577                        let response = common::to_response(parts, bytes.into());
10578
10579                        if let common::Retry::After(d) =
10580                            dlg.http_failure(&response, error.as_ref().ok())
10581                        {
10582                            sleep(d).await;
10583                            continue;
10584                        }
10585
10586                        dlg.finished(false);
10587
10588                        return Err(match error {
10589                            Ok(value) => common::Error::BadRequest(value),
10590                            _ => common::Error::Failure(response),
10591                        });
10592                    }
10593                    let response = {
10594                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10595                        let encoded = common::to_string(&bytes);
10596                        match serde_json::from_str(&encoded) {
10597                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10598                            Err(error) => {
10599                                dlg.response_json_decode_error(&encoded, &error);
10600                                return Err(common::Error::JsonDecodeError(
10601                                    encoded.to_string(),
10602                                    error,
10603                                ));
10604                            }
10605                        }
10606                    };
10607
10608                    dlg.finished(true);
10609                    return Ok(response);
10610                }
10611            }
10612        }
10613    }
10614
10615    ///
10616    /// Sets the *request* property to the given value.
10617    ///
10618    /// Even though the property as already been set when instantiating this call,
10619    /// we provide this method for API completeness.
10620    pub fn request(mut self, new_value: UndeleteWebAppRequest) -> ProjectWebAppUndeleteCall<'a, C> {
10621        self._request = new_value;
10622        self
10623    }
10624    /// Required. The resource name of the WebApp, in the format: projects/ PROJECT_IDENTIFIER/webApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/webApps/APP_ID Refer to the WebApp [name](https://firebase.google.com/../projects.webApps#WebApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
10625    ///
10626    /// Sets the *name* path property to the given value.
10627    ///
10628    /// Even though the property as already been set when instantiating this call,
10629    /// we provide this method for API completeness.
10630    pub fn name(mut self, new_value: &str) -> ProjectWebAppUndeleteCall<'a, C> {
10631        self._name = new_value.to_string();
10632        self
10633    }
10634    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10635    /// while executing the actual API request.
10636    ///
10637    /// ````text
10638    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
10639    /// ````
10640    ///
10641    /// Sets the *delegate* property to the given value.
10642    pub fn delegate(
10643        mut self,
10644        new_value: &'a mut dyn common::Delegate,
10645    ) -> ProjectWebAppUndeleteCall<'a, C> {
10646        self._delegate = Some(new_value);
10647        self
10648    }
10649
10650    /// Set any additional parameter of the query string used in the request.
10651    /// It should be used to set parameters which are not yet available through their own
10652    /// setters.
10653    ///
10654    /// Please note that this method must not be used to set any of the known parameters
10655    /// which have their own setter method. If done anyway, the request will fail.
10656    ///
10657    /// # Additional Parameters
10658    ///
10659    /// * *$.xgafv* (query-string) - V1 error format.
10660    /// * *access_token* (query-string) - OAuth access token.
10661    /// * *alt* (query-string) - Data format for response.
10662    /// * *callback* (query-string) - JSONP
10663    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10664    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10665    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10666    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10667    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10668    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10669    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10670    pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppUndeleteCall<'a, C>
10671    where
10672        T: AsRef<str>,
10673    {
10674        self._additional_params
10675            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10676        self
10677    }
10678
10679    /// Identifies the authorization scope for the method you are building.
10680    ///
10681    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10682    /// [`Scope::CloudPlatform`].
10683    ///
10684    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10685    /// tokens for more than one scope.
10686    ///
10687    /// Usually there is more than one suitable scope to authorize an operation, some of which may
10688    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10689    /// sufficient, a read-write scope will do as well.
10690    pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppUndeleteCall<'a, C>
10691    where
10692        St: AsRef<str>,
10693    {
10694        self._scopes.insert(String::from(scope.as_ref()));
10695        self
10696    }
10697    /// Identifies the authorization scope(s) for the method you are building.
10698    ///
10699    /// See [`Self::add_scope()`] for details.
10700    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppUndeleteCall<'a, C>
10701    where
10702        I: IntoIterator<Item = St>,
10703        St: AsRef<str>,
10704    {
10705        self._scopes
10706            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10707        self
10708    }
10709
10710    /// Removes all scopes, and no default scope will be used either.
10711    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10712    /// for details).
10713    pub fn clear_scopes(mut self) -> ProjectWebAppUndeleteCall<'a, C> {
10714        self._scopes.clear();
10715        self
10716    }
10717}
10718
10719/// Adds Firebase resources to the specified existing \[Google Cloud Platform (GCP) `Project`\] (https://cloud.google.com/resource-manager/reference/rest/v1/projects). Since a FirebaseProject is actually also a GCP `Project`, a `FirebaseProject` has the same underlying GCP identifiers (`projectNumber` and `projectId`). This allows for easy interop with Google APIs. The result of this call is an [`Operation`](https://firebase.google.com/../../v1beta1/operations). Poll the `Operation` to track the provisioning process by calling GetOperation until [`done`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.done) is `true`. When `done` is `true`, the `Operation` has either succeeded or failed. If the `Operation` succeeded, its [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) is set to a FirebaseProject; if the `Operation` failed, its [`error`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status. The `Operation` is automatically deleted after completion, so there is no need to call DeleteOperation. This method does not modify any billing account information on the underlying GCP `Project`. To call `AddFirebase`, a project member or service account must have the following permissions (the IAM roles of Editor and Owner contain these permissions): `firebase.projects.update`, `resourcemanager.projects.get`, `serviceusage.services.enable`, and `serviceusage.services.get`.
10720///
10721/// A builder for the *addFirebase* method supported by a *project* resource.
10722/// It is not used directly, but through a [`ProjectMethods`] instance.
10723///
10724/// # Example
10725///
10726/// Instantiate a resource method builder
10727///
10728/// ```test_harness,no_run
10729/// # extern crate hyper;
10730/// # extern crate hyper_rustls;
10731/// # extern crate google_firebase1_beta1 as firebase1_beta1;
10732/// use firebase1_beta1::api::AddFirebaseRequest;
10733/// # async fn dox() {
10734/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10735///
10736/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10737/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
10738/// #     secret,
10739/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10740/// # ).build().await.unwrap();
10741///
10742/// # let client = hyper_util::client::legacy::Client::builder(
10743/// #     hyper_util::rt::TokioExecutor::new()
10744/// # )
10745/// # .build(
10746/// #     hyper_rustls::HttpsConnectorBuilder::new()
10747/// #         .with_native_roots()
10748/// #         .unwrap()
10749/// #         .https_or_http()
10750/// #         .enable_http1()
10751/// #         .build()
10752/// # );
10753/// # let mut hub = FirebaseManagement::new(client, auth);
10754/// // As the method needs a request, you would usually fill it with the desired information
10755/// // into the respective structure. Some of the parts shown here might not be applicable !
10756/// // Values shown here are possibly random and not representative !
10757/// let mut req = AddFirebaseRequest::default();
10758///
10759/// // You can configure optional parameters by calling the respective setters at will, and
10760/// // execute the final call using `doit()`.
10761/// // Values shown here are possibly random and not representative !
10762/// let result = hub.projects().add_firebase(req, "project")
10763///              .doit().await;
10764/// # }
10765/// ```
10766pub struct ProjectAddFirebaseCall<'a, C>
10767where
10768    C: 'a,
10769{
10770    hub: &'a FirebaseManagement<C>,
10771    _request: AddFirebaseRequest,
10772    _project: String,
10773    _delegate: Option<&'a mut dyn common::Delegate>,
10774    _additional_params: HashMap<String, String>,
10775    _scopes: BTreeSet<String>,
10776}
10777
10778impl<'a, C> common::CallBuilder for ProjectAddFirebaseCall<'a, C> {}
10779
10780impl<'a, C> ProjectAddFirebaseCall<'a, C>
10781where
10782    C: common::Connector,
10783{
10784    /// Perform the operation you have build so far.
10785    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
10786        use std::borrow::Cow;
10787        use std::io::{Read, Seek};
10788
10789        use common::{url::Params, ToParts};
10790        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10791
10792        let mut dd = common::DefaultDelegate;
10793        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10794        dlg.begin(common::MethodInfo {
10795            id: "firebase.projects.addFirebase",
10796            http_method: hyper::Method::POST,
10797        });
10798
10799        for &field in ["alt", "project"].iter() {
10800            if self._additional_params.contains_key(field) {
10801                dlg.finished(false);
10802                return Err(common::Error::FieldClash(field));
10803            }
10804        }
10805
10806        let mut params = Params::with_capacity(4 + self._additional_params.len());
10807        params.push("project", self._project);
10808
10809        params.extend(self._additional_params.iter());
10810
10811        params.push("alt", "json");
10812        let mut url = self.hub._base_url.clone() + "v1beta1/{+project}:addFirebase";
10813        if self._scopes.is_empty() {
10814            self._scopes
10815                .insert(Scope::CloudPlatform.as_ref().to_string());
10816        }
10817
10818        #[allow(clippy::single_element_loop)]
10819        for &(find_this, param_name) in [("{+project}", "project")].iter() {
10820            url = params.uri_replacement(url, param_name, find_this, true);
10821        }
10822        {
10823            let to_remove = ["project"];
10824            params.remove_params(&to_remove);
10825        }
10826
10827        let url = params.parse_with_url(&url);
10828
10829        let mut json_mime_type = mime::APPLICATION_JSON;
10830        let mut request_value_reader = {
10831            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10832            common::remove_json_null_values(&mut value);
10833            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10834            serde_json::to_writer(&mut dst, &value).unwrap();
10835            dst
10836        };
10837        let request_size = request_value_reader
10838            .seek(std::io::SeekFrom::End(0))
10839            .unwrap();
10840        request_value_reader
10841            .seek(std::io::SeekFrom::Start(0))
10842            .unwrap();
10843
10844        loop {
10845            let token = match self
10846                .hub
10847                .auth
10848                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10849                .await
10850            {
10851                Ok(token) => token,
10852                Err(e) => match dlg.token(e) {
10853                    Ok(token) => token,
10854                    Err(e) => {
10855                        dlg.finished(false);
10856                        return Err(common::Error::MissingToken(e));
10857                    }
10858                },
10859            };
10860            request_value_reader
10861                .seek(std::io::SeekFrom::Start(0))
10862                .unwrap();
10863            let mut req_result = {
10864                let client = &self.hub.client;
10865                dlg.pre_request();
10866                let mut req_builder = hyper::Request::builder()
10867                    .method(hyper::Method::POST)
10868                    .uri(url.as_str())
10869                    .header(USER_AGENT, self.hub._user_agent.clone());
10870
10871                if let Some(token) = token.as_ref() {
10872                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10873                }
10874
10875                let request = req_builder
10876                    .header(CONTENT_TYPE, json_mime_type.to_string())
10877                    .header(CONTENT_LENGTH, request_size as u64)
10878                    .body(common::to_body(
10879                        request_value_reader.get_ref().clone().into(),
10880                    ));
10881
10882                client.request(request.unwrap()).await
10883            };
10884
10885            match req_result {
10886                Err(err) => {
10887                    if let common::Retry::After(d) = dlg.http_error(&err) {
10888                        sleep(d).await;
10889                        continue;
10890                    }
10891                    dlg.finished(false);
10892                    return Err(common::Error::HttpError(err));
10893                }
10894                Ok(res) => {
10895                    let (mut parts, body) = res.into_parts();
10896                    let mut body = common::Body::new(body);
10897                    if !parts.status.is_success() {
10898                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10899                        let error = serde_json::from_str(&common::to_string(&bytes));
10900                        let response = common::to_response(parts, bytes.into());
10901
10902                        if let common::Retry::After(d) =
10903                            dlg.http_failure(&response, error.as_ref().ok())
10904                        {
10905                            sleep(d).await;
10906                            continue;
10907                        }
10908
10909                        dlg.finished(false);
10910
10911                        return Err(match error {
10912                            Ok(value) => common::Error::BadRequest(value),
10913                            _ => common::Error::Failure(response),
10914                        });
10915                    }
10916                    let response = {
10917                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10918                        let encoded = common::to_string(&bytes);
10919                        match serde_json::from_str(&encoded) {
10920                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10921                            Err(error) => {
10922                                dlg.response_json_decode_error(&encoded, &error);
10923                                return Err(common::Error::JsonDecodeError(
10924                                    encoded.to_string(),
10925                                    error,
10926                                ));
10927                            }
10928                        }
10929                    };
10930
10931                    dlg.finished(true);
10932                    return Ok(response);
10933                }
10934            }
10935        }
10936    }
10937
10938    ///
10939    /// Sets the *request* property to the given value.
10940    ///
10941    /// Even though the property as already been set when instantiating this call,
10942    /// we provide this method for API completeness.
10943    pub fn request(mut self, new_value: AddFirebaseRequest) -> ProjectAddFirebaseCall<'a, C> {
10944        self._request = new_value;
10945        self
10946    }
10947    /// The resource name of the GCP `Project` to which Firebase resources will be added, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values. After calling `AddFirebase`, the unique Project identifiers ( [`projectNumber`](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_number) and [`projectId`](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_id)) of the underlying GCP `Project` are also the identifiers of the FirebaseProject.
10948    ///
10949    /// Sets the *project* path property to the given value.
10950    ///
10951    /// Even though the property as already been set when instantiating this call,
10952    /// we provide this method for API completeness.
10953    pub fn project(mut self, new_value: &str) -> ProjectAddFirebaseCall<'a, C> {
10954        self._project = new_value.to_string();
10955        self
10956    }
10957    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10958    /// while executing the actual API request.
10959    ///
10960    /// ````text
10961    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
10962    /// ````
10963    ///
10964    /// Sets the *delegate* property to the given value.
10965    pub fn delegate(
10966        mut self,
10967        new_value: &'a mut dyn common::Delegate,
10968    ) -> ProjectAddFirebaseCall<'a, C> {
10969        self._delegate = Some(new_value);
10970        self
10971    }
10972
10973    /// Set any additional parameter of the query string used in the request.
10974    /// It should be used to set parameters which are not yet available through their own
10975    /// setters.
10976    ///
10977    /// Please note that this method must not be used to set any of the known parameters
10978    /// which have their own setter method. If done anyway, the request will fail.
10979    ///
10980    /// # Additional Parameters
10981    ///
10982    /// * *$.xgafv* (query-string) - V1 error format.
10983    /// * *access_token* (query-string) - OAuth access token.
10984    /// * *alt* (query-string) - Data format for response.
10985    /// * *callback* (query-string) - JSONP
10986    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10987    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10988    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10989    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10990    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10991    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10992    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10993    pub fn param<T>(mut self, name: T, value: T) -> ProjectAddFirebaseCall<'a, C>
10994    where
10995        T: AsRef<str>,
10996    {
10997        self._additional_params
10998            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10999        self
11000    }
11001
11002    /// Identifies the authorization scope for the method you are building.
11003    ///
11004    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11005    /// [`Scope::CloudPlatform`].
11006    ///
11007    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11008    /// tokens for more than one scope.
11009    ///
11010    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11011    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11012    /// sufficient, a read-write scope will do as well.
11013    pub fn add_scope<St>(mut self, scope: St) -> ProjectAddFirebaseCall<'a, C>
11014    where
11015        St: AsRef<str>,
11016    {
11017        self._scopes.insert(String::from(scope.as_ref()));
11018        self
11019    }
11020    /// Identifies the authorization scope(s) for the method you are building.
11021    ///
11022    /// See [`Self::add_scope()`] for details.
11023    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAddFirebaseCall<'a, C>
11024    where
11025        I: IntoIterator<Item = St>,
11026        St: AsRef<str>,
11027    {
11028        self._scopes
11029            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11030        self
11031    }
11032
11033    /// Removes all scopes, and no default scope will be used either.
11034    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11035    /// for details).
11036    pub fn clear_scopes(mut self) -> ProjectAddFirebaseCall<'a, C> {
11037        self._scopes.clear();
11038        self
11039    }
11040}
11041
11042/// Links the specified FirebaseProject with an existing [Google Analytics account](http://www.google.com/analytics/). Using this call, you can either: - Specify an `analyticsAccountId` to provision a new Google Analytics property within the specified account and associate the new property with the `FirebaseProject`. - Specify an existing `analyticsPropertyId` to associate the property with the `FirebaseProject`. Note that when you call `AddGoogleAnalytics`: 1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in the `FirebaseProject` (based on the `packageName` or `bundleId` associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies to `AndroidApps` and `IosApps`. 2. If no corresponding data streams are found for the Firebase Apps, new data streams are provisioned in the Google Analytics property for each of the Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in the Analytics property. Learn more about the hierarchy and structure of Google Analytics accounts in the [Analytics documentation](https://support.google.com/analytics/answer/9303323). The result of this call is an [`Operation`](https://firebase.google.com/../../v1beta1/operations). Poll the `Operation` to track the provisioning process by calling GetOperation until [`done`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.done) is `true`. When `done` is `true`, the `Operation` has either succeeded or failed. If the `Operation` succeeded, its [`response`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.response) is set to an AnalyticsDetails; if the `Operation` failed, its [`error`](https://firebase.google.com/../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status. To call `AddGoogleAnalytics`, a project member must be an Owner for the existing `FirebaseProject` and have the [`Edit` permission](https://support.google.com/analytics/answer/2884495) for the Google Analytics account. If the `FirebaseProject` already has Google Analytics enabled, and you call `AddGoogleAnalytics` using an `analyticsPropertyId` that’s different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifying `timeZone` and `regionCode` in the call to [`AddFirebase`](https://firebase.google.com/../../v1beta1/projects/addFirebase).
11043///
11044/// A builder for the *addGoogleAnalytics* method supported by a *project* resource.
11045/// It is not used directly, but through a [`ProjectMethods`] instance.
11046///
11047/// # Example
11048///
11049/// Instantiate a resource method builder
11050///
11051/// ```test_harness,no_run
11052/// # extern crate hyper;
11053/// # extern crate hyper_rustls;
11054/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11055/// use firebase1_beta1::api::AddGoogleAnalyticsRequest;
11056/// # async fn dox() {
11057/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11058///
11059/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11060/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11061/// #     secret,
11062/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11063/// # ).build().await.unwrap();
11064///
11065/// # let client = hyper_util::client::legacy::Client::builder(
11066/// #     hyper_util::rt::TokioExecutor::new()
11067/// # )
11068/// # .build(
11069/// #     hyper_rustls::HttpsConnectorBuilder::new()
11070/// #         .with_native_roots()
11071/// #         .unwrap()
11072/// #         .https_or_http()
11073/// #         .enable_http1()
11074/// #         .build()
11075/// # );
11076/// # let mut hub = FirebaseManagement::new(client, auth);
11077/// // As the method needs a request, you would usually fill it with the desired information
11078/// // into the respective structure. Some of the parts shown here might not be applicable !
11079/// // Values shown here are possibly random and not representative !
11080/// let mut req = AddGoogleAnalyticsRequest::default();
11081///
11082/// // You can configure optional parameters by calling the respective setters at will, and
11083/// // execute the final call using `doit()`.
11084/// // Values shown here are possibly random and not representative !
11085/// let result = hub.projects().add_google_analytics(req, "parent")
11086///              .doit().await;
11087/// # }
11088/// ```
11089pub struct ProjectAddGoogleAnalyticCall<'a, C>
11090where
11091    C: 'a,
11092{
11093    hub: &'a FirebaseManagement<C>,
11094    _request: AddGoogleAnalyticsRequest,
11095    _parent: String,
11096    _delegate: Option<&'a mut dyn common::Delegate>,
11097    _additional_params: HashMap<String, String>,
11098    _scopes: BTreeSet<String>,
11099}
11100
11101impl<'a, C> common::CallBuilder for ProjectAddGoogleAnalyticCall<'a, C> {}
11102
11103impl<'a, C> ProjectAddGoogleAnalyticCall<'a, C>
11104where
11105    C: common::Connector,
11106{
11107    /// Perform the operation you have build so far.
11108    pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
11109        use std::borrow::Cow;
11110        use std::io::{Read, Seek};
11111
11112        use common::{url::Params, ToParts};
11113        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11114
11115        let mut dd = common::DefaultDelegate;
11116        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11117        dlg.begin(common::MethodInfo {
11118            id: "firebase.projects.addGoogleAnalytics",
11119            http_method: hyper::Method::POST,
11120        });
11121
11122        for &field in ["alt", "parent"].iter() {
11123            if self._additional_params.contains_key(field) {
11124                dlg.finished(false);
11125                return Err(common::Error::FieldClash(field));
11126            }
11127        }
11128
11129        let mut params = Params::with_capacity(4 + self._additional_params.len());
11130        params.push("parent", self._parent);
11131
11132        params.extend(self._additional_params.iter());
11133
11134        params.push("alt", "json");
11135        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:addGoogleAnalytics";
11136        if self._scopes.is_empty() {
11137            self._scopes
11138                .insert(Scope::CloudPlatform.as_ref().to_string());
11139        }
11140
11141        #[allow(clippy::single_element_loop)]
11142        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
11143            url = params.uri_replacement(url, param_name, find_this, true);
11144        }
11145        {
11146            let to_remove = ["parent"];
11147            params.remove_params(&to_remove);
11148        }
11149
11150        let url = params.parse_with_url(&url);
11151
11152        let mut json_mime_type = mime::APPLICATION_JSON;
11153        let mut request_value_reader = {
11154            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
11155            common::remove_json_null_values(&mut value);
11156            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
11157            serde_json::to_writer(&mut dst, &value).unwrap();
11158            dst
11159        };
11160        let request_size = request_value_reader
11161            .seek(std::io::SeekFrom::End(0))
11162            .unwrap();
11163        request_value_reader
11164            .seek(std::io::SeekFrom::Start(0))
11165            .unwrap();
11166
11167        loop {
11168            let token = match self
11169                .hub
11170                .auth
11171                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11172                .await
11173            {
11174                Ok(token) => token,
11175                Err(e) => match dlg.token(e) {
11176                    Ok(token) => token,
11177                    Err(e) => {
11178                        dlg.finished(false);
11179                        return Err(common::Error::MissingToken(e));
11180                    }
11181                },
11182            };
11183            request_value_reader
11184                .seek(std::io::SeekFrom::Start(0))
11185                .unwrap();
11186            let mut req_result = {
11187                let client = &self.hub.client;
11188                dlg.pre_request();
11189                let mut req_builder = hyper::Request::builder()
11190                    .method(hyper::Method::POST)
11191                    .uri(url.as_str())
11192                    .header(USER_AGENT, self.hub._user_agent.clone());
11193
11194                if let Some(token) = token.as_ref() {
11195                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11196                }
11197
11198                let request = req_builder
11199                    .header(CONTENT_TYPE, json_mime_type.to_string())
11200                    .header(CONTENT_LENGTH, request_size as u64)
11201                    .body(common::to_body(
11202                        request_value_reader.get_ref().clone().into(),
11203                    ));
11204
11205                client.request(request.unwrap()).await
11206            };
11207
11208            match req_result {
11209                Err(err) => {
11210                    if let common::Retry::After(d) = dlg.http_error(&err) {
11211                        sleep(d).await;
11212                        continue;
11213                    }
11214                    dlg.finished(false);
11215                    return Err(common::Error::HttpError(err));
11216                }
11217                Ok(res) => {
11218                    let (mut parts, body) = res.into_parts();
11219                    let mut body = common::Body::new(body);
11220                    if !parts.status.is_success() {
11221                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11222                        let error = serde_json::from_str(&common::to_string(&bytes));
11223                        let response = common::to_response(parts, bytes.into());
11224
11225                        if let common::Retry::After(d) =
11226                            dlg.http_failure(&response, error.as_ref().ok())
11227                        {
11228                            sleep(d).await;
11229                            continue;
11230                        }
11231
11232                        dlg.finished(false);
11233
11234                        return Err(match error {
11235                            Ok(value) => common::Error::BadRequest(value),
11236                            _ => common::Error::Failure(response),
11237                        });
11238                    }
11239                    let response = {
11240                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11241                        let encoded = common::to_string(&bytes);
11242                        match serde_json::from_str(&encoded) {
11243                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11244                            Err(error) => {
11245                                dlg.response_json_decode_error(&encoded, &error);
11246                                return Err(common::Error::JsonDecodeError(
11247                                    encoded.to_string(),
11248                                    error,
11249                                ));
11250                            }
11251                        }
11252                    };
11253
11254                    dlg.finished(true);
11255                    return Ok(response);
11256                }
11257            }
11258        }
11259    }
11260
11261    ///
11262    /// Sets the *request* property to the given value.
11263    ///
11264    /// Even though the property as already been set when instantiating this call,
11265    /// we provide this method for API completeness.
11266    pub fn request(
11267        mut self,
11268        new_value: AddGoogleAnalyticsRequest,
11269    ) -> ProjectAddGoogleAnalyticCall<'a, C> {
11270        self._request = new_value;
11271        self
11272    }
11273    /// The resource name of the FirebaseProject to link to an existing Google Analytics account, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
11274    ///
11275    /// Sets the *parent* path property to the given value.
11276    ///
11277    /// Even though the property as already been set when instantiating this call,
11278    /// we provide this method for API completeness.
11279    pub fn parent(mut self, new_value: &str) -> ProjectAddGoogleAnalyticCall<'a, C> {
11280        self._parent = new_value.to_string();
11281        self
11282    }
11283    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11284    /// while executing the actual API request.
11285    ///
11286    /// ````text
11287    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
11288    /// ````
11289    ///
11290    /// Sets the *delegate* property to the given value.
11291    pub fn delegate(
11292        mut self,
11293        new_value: &'a mut dyn common::Delegate,
11294    ) -> ProjectAddGoogleAnalyticCall<'a, C> {
11295        self._delegate = Some(new_value);
11296        self
11297    }
11298
11299    /// Set any additional parameter of the query string used in the request.
11300    /// It should be used to set parameters which are not yet available through their own
11301    /// setters.
11302    ///
11303    /// Please note that this method must not be used to set any of the known parameters
11304    /// which have their own setter method. If done anyway, the request will fail.
11305    ///
11306    /// # Additional Parameters
11307    ///
11308    /// * *$.xgafv* (query-string) - V1 error format.
11309    /// * *access_token* (query-string) - OAuth access token.
11310    /// * *alt* (query-string) - Data format for response.
11311    /// * *callback* (query-string) - JSONP
11312    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11313    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11314    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11315    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11316    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11317    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11318    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11319    pub fn param<T>(mut self, name: T, value: T) -> ProjectAddGoogleAnalyticCall<'a, C>
11320    where
11321        T: AsRef<str>,
11322    {
11323        self._additional_params
11324            .insert(name.as_ref().to_string(), value.as_ref().to_string());
11325        self
11326    }
11327
11328    /// Identifies the authorization scope for the method you are building.
11329    ///
11330    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11331    /// [`Scope::CloudPlatform`].
11332    ///
11333    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11334    /// tokens for more than one scope.
11335    ///
11336    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11337    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11338    /// sufficient, a read-write scope will do as well.
11339    pub fn add_scope<St>(mut self, scope: St) -> ProjectAddGoogleAnalyticCall<'a, C>
11340    where
11341        St: AsRef<str>,
11342    {
11343        self._scopes.insert(String::from(scope.as_ref()));
11344        self
11345    }
11346    /// Identifies the authorization scope(s) for the method you are building.
11347    ///
11348    /// See [`Self::add_scope()`] for details.
11349    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAddGoogleAnalyticCall<'a, C>
11350    where
11351        I: IntoIterator<Item = St>,
11352        St: AsRef<str>,
11353    {
11354        self._scopes
11355            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11356        self
11357    }
11358
11359    /// Removes all scopes, and no default scope will be used either.
11360    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11361    /// for details).
11362    pub fn clear_scopes(mut self) -> ProjectAddGoogleAnalyticCall<'a, C> {
11363        self._scopes.clear();
11364        self
11365    }
11366}
11367
11368/// Gets the specified FirebaseProject.
11369///
11370/// A builder for the *get* method supported by a *project* resource.
11371/// It is not used directly, but through a [`ProjectMethods`] instance.
11372///
11373/// # Example
11374///
11375/// Instantiate a resource method builder
11376///
11377/// ```test_harness,no_run
11378/// # extern crate hyper;
11379/// # extern crate hyper_rustls;
11380/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11381/// # async fn dox() {
11382/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11383///
11384/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11385/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11386/// #     secret,
11387/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11388/// # ).build().await.unwrap();
11389///
11390/// # let client = hyper_util::client::legacy::Client::builder(
11391/// #     hyper_util::rt::TokioExecutor::new()
11392/// # )
11393/// # .build(
11394/// #     hyper_rustls::HttpsConnectorBuilder::new()
11395/// #         .with_native_roots()
11396/// #         .unwrap()
11397/// #         .https_or_http()
11398/// #         .enable_http1()
11399/// #         .build()
11400/// # );
11401/// # let mut hub = FirebaseManagement::new(client, auth);
11402/// // You can configure optional parameters by calling the respective setters at will, and
11403/// // execute the final call using `doit()`.
11404/// // Values shown here are possibly random and not representative !
11405/// let result = hub.projects().get("name")
11406///              .doit().await;
11407/// # }
11408/// ```
11409pub struct ProjectGetCall<'a, C>
11410where
11411    C: 'a,
11412{
11413    hub: &'a FirebaseManagement<C>,
11414    _name: String,
11415    _delegate: Option<&'a mut dyn common::Delegate>,
11416    _additional_params: HashMap<String, String>,
11417    _scopes: BTreeSet<String>,
11418}
11419
11420impl<'a, C> common::CallBuilder for ProjectGetCall<'a, C> {}
11421
11422impl<'a, C> ProjectGetCall<'a, C>
11423where
11424    C: common::Connector,
11425{
11426    /// Perform the operation you have build so far.
11427    pub async fn doit(mut self) -> common::Result<(common::Response, FirebaseProject)> {
11428        use std::borrow::Cow;
11429        use std::io::{Read, Seek};
11430
11431        use common::{url::Params, ToParts};
11432        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11433
11434        let mut dd = common::DefaultDelegate;
11435        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11436        dlg.begin(common::MethodInfo {
11437            id: "firebase.projects.get",
11438            http_method: hyper::Method::GET,
11439        });
11440
11441        for &field in ["alt", "name"].iter() {
11442            if self._additional_params.contains_key(field) {
11443                dlg.finished(false);
11444                return Err(common::Error::FieldClash(field));
11445            }
11446        }
11447
11448        let mut params = Params::with_capacity(3 + self._additional_params.len());
11449        params.push("name", self._name);
11450
11451        params.extend(self._additional_params.iter());
11452
11453        params.push("alt", "json");
11454        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
11455        if self._scopes.is_empty() {
11456            self._scopes.insert(Scope::Readonly.as_ref().to_string());
11457        }
11458
11459        #[allow(clippy::single_element_loop)]
11460        for &(find_this, param_name) in [("{+name}", "name")].iter() {
11461            url = params.uri_replacement(url, param_name, find_this, true);
11462        }
11463        {
11464            let to_remove = ["name"];
11465            params.remove_params(&to_remove);
11466        }
11467
11468        let url = params.parse_with_url(&url);
11469
11470        loop {
11471            let token = match self
11472                .hub
11473                .auth
11474                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11475                .await
11476            {
11477                Ok(token) => token,
11478                Err(e) => match dlg.token(e) {
11479                    Ok(token) => token,
11480                    Err(e) => {
11481                        dlg.finished(false);
11482                        return Err(common::Error::MissingToken(e));
11483                    }
11484                },
11485            };
11486            let mut req_result = {
11487                let client = &self.hub.client;
11488                dlg.pre_request();
11489                let mut req_builder = hyper::Request::builder()
11490                    .method(hyper::Method::GET)
11491                    .uri(url.as_str())
11492                    .header(USER_AGENT, self.hub._user_agent.clone());
11493
11494                if let Some(token) = token.as_ref() {
11495                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11496                }
11497
11498                let request = req_builder
11499                    .header(CONTENT_LENGTH, 0_u64)
11500                    .body(common::to_body::<String>(None));
11501
11502                client.request(request.unwrap()).await
11503            };
11504
11505            match req_result {
11506                Err(err) => {
11507                    if let common::Retry::After(d) = dlg.http_error(&err) {
11508                        sleep(d).await;
11509                        continue;
11510                    }
11511                    dlg.finished(false);
11512                    return Err(common::Error::HttpError(err));
11513                }
11514                Ok(res) => {
11515                    let (mut parts, body) = res.into_parts();
11516                    let mut body = common::Body::new(body);
11517                    if !parts.status.is_success() {
11518                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11519                        let error = serde_json::from_str(&common::to_string(&bytes));
11520                        let response = common::to_response(parts, bytes.into());
11521
11522                        if let common::Retry::After(d) =
11523                            dlg.http_failure(&response, error.as_ref().ok())
11524                        {
11525                            sleep(d).await;
11526                            continue;
11527                        }
11528
11529                        dlg.finished(false);
11530
11531                        return Err(match error {
11532                            Ok(value) => common::Error::BadRequest(value),
11533                            _ => common::Error::Failure(response),
11534                        });
11535                    }
11536                    let response = {
11537                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11538                        let encoded = common::to_string(&bytes);
11539                        match serde_json::from_str(&encoded) {
11540                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11541                            Err(error) => {
11542                                dlg.response_json_decode_error(&encoded, &error);
11543                                return Err(common::Error::JsonDecodeError(
11544                                    encoded.to_string(),
11545                                    error,
11546                                ));
11547                            }
11548                        }
11549                    };
11550
11551                    dlg.finished(true);
11552                    return Ok(response);
11553                }
11554            }
11555        }
11556    }
11557
11558    /// The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
11559    ///
11560    /// Sets the *name* path property to the given value.
11561    ///
11562    /// Even though the property as already been set when instantiating this call,
11563    /// we provide this method for API completeness.
11564    pub fn name(mut self, new_value: &str) -> ProjectGetCall<'a, C> {
11565        self._name = new_value.to_string();
11566        self
11567    }
11568    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11569    /// while executing the actual API request.
11570    ///
11571    /// ````text
11572    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
11573    /// ````
11574    ///
11575    /// Sets the *delegate* property to the given value.
11576    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ProjectGetCall<'a, C> {
11577        self._delegate = Some(new_value);
11578        self
11579    }
11580
11581    /// Set any additional parameter of the query string used in the request.
11582    /// It should be used to set parameters which are not yet available through their own
11583    /// setters.
11584    ///
11585    /// Please note that this method must not be used to set any of the known parameters
11586    /// which have their own setter method. If done anyway, the request will fail.
11587    ///
11588    /// # Additional Parameters
11589    ///
11590    /// * *$.xgafv* (query-string) - V1 error format.
11591    /// * *access_token* (query-string) - OAuth access token.
11592    /// * *alt* (query-string) - Data format for response.
11593    /// * *callback* (query-string) - JSONP
11594    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11595    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11596    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11597    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11598    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11599    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11600    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11601    pub fn param<T>(mut self, name: T, value: T) -> ProjectGetCall<'a, C>
11602    where
11603        T: AsRef<str>,
11604    {
11605        self._additional_params
11606            .insert(name.as_ref().to_string(), value.as_ref().to_string());
11607        self
11608    }
11609
11610    /// Identifies the authorization scope for the method you are building.
11611    ///
11612    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11613    /// [`Scope::Readonly`].
11614    ///
11615    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11616    /// tokens for more than one scope.
11617    ///
11618    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11619    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11620    /// sufficient, a read-write scope will do as well.
11621    pub fn add_scope<St>(mut self, scope: St) -> ProjectGetCall<'a, C>
11622    where
11623        St: AsRef<str>,
11624    {
11625        self._scopes.insert(String::from(scope.as_ref()));
11626        self
11627    }
11628    /// Identifies the authorization scope(s) for the method you are building.
11629    ///
11630    /// See [`Self::add_scope()`] for details.
11631    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectGetCall<'a, C>
11632    where
11633        I: IntoIterator<Item = St>,
11634        St: AsRef<str>,
11635    {
11636        self._scopes
11637            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11638        self
11639    }
11640
11641    /// Removes all scopes, and no default scope will be used either.
11642    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11643    /// for details).
11644    pub fn clear_scopes(mut self) -> ProjectGetCall<'a, C> {
11645        self._scopes.clear();
11646        self
11647    }
11648}
11649
11650/// Gets the configuration artifact associated with the specified FirebaseProject, which can be used by servers to simplify initialization. Typically, this configuration is used with the Firebase Admin SDK [initializeApp](https://firebase.google.com/docs/admin/setup#initialize_the_sdk) command.
11651///
11652/// A builder for the *getAdminSdkConfig* method supported by a *project* resource.
11653/// It is not used directly, but through a [`ProjectMethods`] instance.
11654///
11655/// # Example
11656///
11657/// Instantiate a resource method builder
11658///
11659/// ```test_harness,no_run
11660/// # extern crate hyper;
11661/// # extern crate hyper_rustls;
11662/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11663/// # async fn dox() {
11664/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11665///
11666/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11667/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11668/// #     secret,
11669/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11670/// # ).build().await.unwrap();
11671///
11672/// # let client = hyper_util::client::legacy::Client::builder(
11673/// #     hyper_util::rt::TokioExecutor::new()
11674/// # )
11675/// # .build(
11676/// #     hyper_rustls::HttpsConnectorBuilder::new()
11677/// #         .with_native_roots()
11678/// #         .unwrap()
11679/// #         .https_or_http()
11680/// #         .enable_http1()
11681/// #         .build()
11682/// # );
11683/// # let mut hub = FirebaseManagement::new(client, auth);
11684/// // You can configure optional parameters by calling the respective setters at will, and
11685/// // execute the final call using `doit()`.
11686/// // Values shown here are possibly random and not representative !
11687/// let result = hub.projects().get_admin_sdk_config("name")
11688///              .doit().await;
11689/// # }
11690/// ```
11691pub struct ProjectGetAdminSdkConfigCall<'a, C>
11692where
11693    C: 'a,
11694{
11695    hub: &'a FirebaseManagement<C>,
11696    _name: String,
11697    _delegate: Option<&'a mut dyn common::Delegate>,
11698    _additional_params: HashMap<String, String>,
11699    _scopes: BTreeSet<String>,
11700}
11701
11702impl<'a, C> common::CallBuilder for ProjectGetAdminSdkConfigCall<'a, C> {}
11703
11704impl<'a, C> ProjectGetAdminSdkConfigCall<'a, C>
11705where
11706    C: common::Connector,
11707{
11708    /// Perform the operation you have build so far.
11709    pub async fn doit(mut self) -> common::Result<(common::Response, AdminSdkConfig)> {
11710        use std::borrow::Cow;
11711        use std::io::{Read, Seek};
11712
11713        use common::{url::Params, ToParts};
11714        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11715
11716        let mut dd = common::DefaultDelegate;
11717        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11718        dlg.begin(common::MethodInfo {
11719            id: "firebase.projects.getAdminSdkConfig",
11720            http_method: hyper::Method::GET,
11721        });
11722
11723        for &field in ["alt", "name"].iter() {
11724            if self._additional_params.contains_key(field) {
11725                dlg.finished(false);
11726                return Err(common::Error::FieldClash(field));
11727            }
11728        }
11729
11730        let mut params = Params::with_capacity(3 + self._additional_params.len());
11731        params.push("name", self._name);
11732
11733        params.extend(self._additional_params.iter());
11734
11735        params.push("alt", "json");
11736        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
11737        if self._scopes.is_empty() {
11738            self._scopes.insert(Scope::Readonly.as_ref().to_string());
11739        }
11740
11741        #[allow(clippy::single_element_loop)]
11742        for &(find_this, param_name) in [("{+name}", "name")].iter() {
11743            url = params.uri_replacement(url, param_name, find_this, true);
11744        }
11745        {
11746            let to_remove = ["name"];
11747            params.remove_params(&to_remove);
11748        }
11749
11750        let url = params.parse_with_url(&url);
11751
11752        loop {
11753            let token = match self
11754                .hub
11755                .auth
11756                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11757                .await
11758            {
11759                Ok(token) => token,
11760                Err(e) => match dlg.token(e) {
11761                    Ok(token) => token,
11762                    Err(e) => {
11763                        dlg.finished(false);
11764                        return Err(common::Error::MissingToken(e));
11765                    }
11766                },
11767            };
11768            let mut req_result = {
11769                let client = &self.hub.client;
11770                dlg.pre_request();
11771                let mut req_builder = hyper::Request::builder()
11772                    .method(hyper::Method::GET)
11773                    .uri(url.as_str())
11774                    .header(USER_AGENT, self.hub._user_agent.clone());
11775
11776                if let Some(token) = token.as_ref() {
11777                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11778                }
11779
11780                let request = req_builder
11781                    .header(CONTENT_LENGTH, 0_u64)
11782                    .body(common::to_body::<String>(None));
11783
11784                client.request(request.unwrap()).await
11785            };
11786
11787            match req_result {
11788                Err(err) => {
11789                    if let common::Retry::After(d) = dlg.http_error(&err) {
11790                        sleep(d).await;
11791                        continue;
11792                    }
11793                    dlg.finished(false);
11794                    return Err(common::Error::HttpError(err));
11795                }
11796                Ok(res) => {
11797                    let (mut parts, body) = res.into_parts();
11798                    let mut body = common::Body::new(body);
11799                    if !parts.status.is_success() {
11800                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11801                        let error = serde_json::from_str(&common::to_string(&bytes));
11802                        let response = common::to_response(parts, bytes.into());
11803
11804                        if let common::Retry::After(d) =
11805                            dlg.http_failure(&response, error.as_ref().ok())
11806                        {
11807                            sleep(d).await;
11808                            continue;
11809                        }
11810
11811                        dlg.finished(false);
11812
11813                        return Err(match error {
11814                            Ok(value) => common::Error::BadRequest(value),
11815                            _ => common::Error::Failure(response),
11816                        });
11817                    }
11818                    let response = {
11819                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11820                        let encoded = common::to_string(&bytes);
11821                        match serde_json::from_str(&encoded) {
11822                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11823                            Err(error) => {
11824                                dlg.response_json_decode_error(&encoded, &error);
11825                                return Err(common::Error::JsonDecodeError(
11826                                    encoded.to_string(),
11827                                    error,
11828                                ));
11829                            }
11830                        }
11831                    };
11832
11833                    dlg.finished(true);
11834                    return Ok(response);
11835                }
11836            }
11837        }
11838    }
11839
11840    /// The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER/adminSdkConfig Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
11841    ///
11842    /// Sets the *name* path property to the given value.
11843    ///
11844    /// Even though the property as already been set when instantiating this call,
11845    /// we provide this method for API completeness.
11846    pub fn name(mut self, new_value: &str) -> ProjectGetAdminSdkConfigCall<'a, C> {
11847        self._name = new_value.to_string();
11848        self
11849    }
11850    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11851    /// while executing the actual API request.
11852    ///
11853    /// ````text
11854    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
11855    /// ````
11856    ///
11857    /// Sets the *delegate* property to the given value.
11858    pub fn delegate(
11859        mut self,
11860        new_value: &'a mut dyn common::Delegate,
11861    ) -> ProjectGetAdminSdkConfigCall<'a, C> {
11862        self._delegate = Some(new_value);
11863        self
11864    }
11865
11866    /// Set any additional parameter of the query string used in the request.
11867    /// It should be used to set parameters which are not yet available through their own
11868    /// setters.
11869    ///
11870    /// Please note that this method must not be used to set any of the known parameters
11871    /// which have their own setter method. If done anyway, the request will fail.
11872    ///
11873    /// # Additional Parameters
11874    ///
11875    /// * *$.xgafv* (query-string) - V1 error format.
11876    /// * *access_token* (query-string) - OAuth access token.
11877    /// * *alt* (query-string) - Data format for response.
11878    /// * *callback* (query-string) - JSONP
11879    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11880    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11881    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11882    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11883    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11884    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11885    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11886    pub fn param<T>(mut self, name: T, value: T) -> ProjectGetAdminSdkConfigCall<'a, C>
11887    where
11888        T: AsRef<str>,
11889    {
11890        self._additional_params
11891            .insert(name.as_ref().to_string(), value.as_ref().to_string());
11892        self
11893    }
11894
11895    /// Identifies the authorization scope for the method you are building.
11896    ///
11897    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11898    /// [`Scope::Readonly`].
11899    ///
11900    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11901    /// tokens for more than one scope.
11902    ///
11903    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11904    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11905    /// sufficient, a read-write scope will do as well.
11906    pub fn add_scope<St>(mut self, scope: St) -> ProjectGetAdminSdkConfigCall<'a, C>
11907    where
11908        St: AsRef<str>,
11909    {
11910        self._scopes.insert(String::from(scope.as_ref()));
11911        self
11912    }
11913    /// Identifies the authorization scope(s) for the method you are building.
11914    ///
11915    /// See [`Self::add_scope()`] for details.
11916    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectGetAdminSdkConfigCall<'a, C>
11917    where
11918        I: IntoIterator<Item = St>,
11919        St: AsRef<str>,
11920    {
11921        self._scopes
11922            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11923        self
11924    }
11925
11926    /// Removes all scopes, and no default scope will be used either.
11927    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11928    /// for details).
11929    pub fn clear_scopes(mut self) -> ProjectGetAdminSdkConfigCall<'a, C> {
11930        self._scopes.clear();
11931        self
11932    }
11933}
11934
11935/// Gets the Google Analytics details currently associated with the specified FirebaseProject. If the `FirebaseProject` is not yet linked to Google Analytics, then the response to `GetAnalyticsDetails` is `NOT_FOUND`.
11936///
11937/// A builder for the *getAnalyticsDetails* method supported by a *project* resource.
11938/// It is not used directly, but through a [`ProjectMethods`] instance.
11939///
11940/// # Example
11941///
11942/// Instantiate a resource method builder
11943///
11944/// ```test_harness,no_run
11945/// # extern crate hyper;
11946/// # extern crate hyper_rustls;
11947/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11948/// # async fn dox() {
11949/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11950///
11951/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11952/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
11953/// #     secret,
11954/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11955/// # ).build().await.unwrap();
11956///
11957/// # let client = hyper_util::client::legacy::Client::builder(
11958/// #     hyper_util::rt::TokioExecutor::new()
11959/// # )
11960/// # .build(
11961/// #     hyper_rustls::HttpsConnectorBuilder::new()
11962/// #         .with_native_roots()
11963/// #         .unwrap()
11964/// #         .https_or_http()
11965/// #         .enable_http1()
11966/// #         .build()
11967/// # );
11968/// # let mut hub = FirebaseManagement::new(client, auth);
11969/// // You can configure optional parameters by calling the respective setters at will, and
11970/// // execute the final call using `doit()`.
11971/// // Values shown here are possibly random and not representative !
11972/// let result = hub.projects().get_analytics_details("name")
11973///              .doit().await;
11974/// # }
11975/// ```
11976pub struct ProjectGetAnalyticsDetailCall<'a, C>
11977where
11978    C: 'a,
11979{
11980    hub: &'a FirebaseManagement<C>,
11981    _name: String,
11982    _delegate: Option<&'a mut dyn common::Delegate>,
11983    _additional_params: HashMap<String, String>,
11984    _scopes: BTreeSet<String>,
11985}
11986
11987impl<'a, C> common::CallBuilder for ProjectGetAnalyticsDetailCall<'a, C> {}
11988
11989impl<'a, C> ProjectGetAnalyticsDetailCall<'a, C>
11990where
11991    C: common::Connector,
11992{
11993    /// Perform the operation you have build so far.
11994    pub async fn doit(mut self) -> common::Result<(common::Response, AnalyticsDetails)> {
11995        use std::borrow::Cow;
11996        use std::io::{Read, Seek};
11997
11998        use common::{url::Params, ToParts};
11999        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12000
12001        let mut dd = common::DefaultDelegate;
12002        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12003        dlg.begin(common::MethodInfo {
12004            id: "firebase.projects.getAnalyticsDetails",
12005            http_method: hyper::Method::GET,
12006        });
12007
12008        for &field in ["alt", "name"].iter() {
12009            if self._additional_params.contains_key(field) {
12010                dlg.finished(false);
12011                return Err(common::Error::FieldClash(field));
12012            }
12013        }
12014
12015        let mut params = Params::with_capacity(3 + self._additional_params.len());
12016        params.push("name", self._name);
12017
12018        params.extend(self._additional_params.iter());
12019
12020        params.push("alt", "json");
12021        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
12022        if self._scopes.is_empty() {
12023            self._scopes.insert(Scope::Readonly.as_ref().to_string());
12024        }
12025
12026        #[allow(clippy::single_element_loop)]
12027        for &(find_this, param_name) in [("{+name}", "name")].iter() {
12028            url = params.uri_replacement(url, param_name, find_this, true);
12029        }
12030        {
12031            let to_remove = ["name"];
12032            params.remove_params(&to_remove);
12033        }
12034
12035        let url = params.parse_with_url(&url);
12036
12037        loop {
12038            let token = match self
12039                .hub
12040                .auth
12041                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12042                .await
12043            {
12044                Ok(token) => token,
12045                Err(e) => match dlg.token(e) {
12046                    Ok(token) => token,
12047                    Err(e) => {
12048                        dlg.finished(false);
12049                        return Err(common::Error::MissingToken(e));
12050                    }
12051                },
12052            };
12053            let mut req_result = {
12054                let client = &self.hub.client;
12055                dlg.pre_request();
12056                let mut req_builder = hyper::Request::builder()
12057                    .method(hyper::Method::GET)
12058                    .uri(url.as_str())
12059                    .header(USER_AGENT, self.hub._user_agent.clone());
12060
12061                if let Some(token) = token.as_ref() {
12062                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12063                }
12064
12065                let request = req_builder
12066                    .header(CONTENT_LENGTH, 0_u64)
12067                    .body(common::to_body::<String>(None));
12068
12069                client.request(request.unwrap()).await
12070            };
12071
12072            match req_result {
12073                Err(err) => {
12074                    if let common::Retry::After(d) = dlg.http_error(&err) {
12075                        sleep(d).await;
12076                        continue;
12077                    }
12078                    dlg.finished(false);
12079                    return Err(common::Error::HttpError(err));
12080                }
12081                Ok(res) => {
12082                    let (mut parts, body) = res.into_parts();
12083                    let mut body = common::Body::new(body);
12084                    if !parts.status.is_success() {
12085                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12086                        let error = serde_json::from_str(&common::to_string(&bytes));
12087                        let response = common::to_response(parts, bytes.into());
12088
12089                        if let common::Retry::After(d) =
12090                            dlg.http_failure(&response, error.as_ref().ok())
12091                        {
12092                            sleep(d).await;
12093                            continue;
12094                        }
12095
12096                        dlg.finished(false);
12097
12098                        return Err(match error {
12099                            Ok(value) => common::Error::BadRequest(value),
12100                            _ => common::Error::Failure(response),
12101                        });
12102                    }
12103                    let response = {
12104                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12105                        let encoded = common::to_string(&bytes);
12106                        match serde_json::from_str(&encoded) {
12107                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12108                            Err(error) => {
12109                                dlg.response_json_decode_error(&encoded, &error);
12110                                return Err(common::Error::JsonDecodeError(
12111                                    encoded.to_string(),
12112                                    error,
12113                                ));
12114                            }
12115                        }
12116                    };
12117
12118                    dlg.finished(true);
12119                    return Ok(response);
12120                }
12121            }
12122        }
12123    }
12124
12125    /// The resource name of the FirebaseProject, in the format: projects/ PROJECT_IDENTIFIER/analyticsDetails Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
12126    ///
12127    /// Sets the *name* path property to the given value.
12128    ///
12129    /// Even though the property as already been set when instantiating this call,
12130    /// we provide this method for API completeness.
12131    pub fn name(mut self, new_value: &str) -> ProjectGetAnalyticsDetailCall<'a, C> {
12132        self._name = new_value.to_string();
12133        self
12134    }
12135    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12136    /// while executing the actual API request.
12137    ///
12138    /// ````text
12139    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
12140    /// ````
12141    ///
12142    /// Sets the *delegate* property to the given value.
12143    pub fn delegate(
12144        mut self,
12145        new_value: &'a mut dyn common::Delegate,
12146    ) -> ProjectGetAnalyticsDetailCall<'a, C> {
12147        self._delegate = Some(new_value);
12148        self
12149    }
12150
12151    /// Set any additional parameter of the query string used in the request.
12152    /// It should be used to set parameters which are not yet available through their own
12153    /// setters.
12154    ///
12155    /// Please note that this method must not be used to set any of the known parameters
12156    /// which have their own setter method. If done anyway, the request will fail.
12157    ///
12158    /// # Additional Parameters
12159    ///
12160    /// * *$.xgafv* (query-string) - V1 error format.
12161    /// * *access_token* (query-string) - OAuth access token.
12162    /// * *alt* (query-string) - Data format for response.
12163    /// * *callback* (query-string) - JSONP
12164    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12165    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12166    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12167    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12168    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12169    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12170    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12171    pub fn param<T>(mut self, name: T, value: T) -> ProjectGetAnalyticsDetailCall<'a, C>
12172    where
12173        T: AsRef<str>,
12174    {
12175        self._additional_params
12176            .insert(name.as_ref().to_string(), value.as_ref().to_string());
12177        self
12178    }
12179
12180    /// Identifies the authorization scope for the method you are building.
12181    ///
12182    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12183    /// [`Scope::Readonly`].
12184    ///
12185    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12186    /// tokens for more than one scope.
12187    ///
12188    /// Usually there is more than one suitable scope to authorize an operation, some of which may
12189    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12190    /// sufficient, a read-write scope will do as well.
12191    pub fn add_scope<St>(mut self, scope: St) -> ProjectGetAnalyticsDetailCall<'a, C>
12192    where
12193        St: AsRef<str>,
12194    {
12195        self._scopes.insert(String::from(scope.as_ref()));
12196        self
12197    }
12198    /// Identifies the authorization scope(s) for the method you are building.
12199    ///
12200    /// See [`Self::add_scope()`] for details.
12201    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectGetAnalyticsDetailCall<'a, C>
12202    where
12203        I: IntoIterator<Item = St>,
12204        St: AsRef<str>,
12205    {
12206        self._scopes
12207            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12208        self
12209    }
12210
12211    /// Removes all scopes, and no default scope will be used either.
12212    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12213    /// for details).
12214    pub fn clear_scopes(mut self) -> ProjectGetAnalyticsDetailCall<'a, C> {
12215        self._scopes.clear();
12216        self
12217    }
12218}
12219
12220/// Lists each FirebaseProject accessible to the caller. The elements are returned in no particular order, but they will be a consistent view of the Projects when additional requests are made with a `pageToken`. This method is eventually consistent with Project mutations, which means newly provisioned Projects and recent modifications to existing Projects might not be reflected in the set of Projects. The list will include only ACTIVE Projects. Use GetFirebaseProject for consistent reads as well as for additional Project details.
12221///
12222/// A builder for the *list* method supported by a *project* resource.
12223/// It is not used directly, but through a [`ProjectMethods`] instance.
12224///
12225/// # Example
12226///
12227/// Instantiate a resource method builder
12228///
12229/// ```test_harness,no_run
12230/// # extern crate hyper;
12231/// # extern crate hyper_rustls;
12232/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12233/// # async fn dox() {
12234/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12235///
12236/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12237/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
12238/// #     secret,
12239/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12240/// # ).build().await.unwrap();
12241///
12242/// # let client = hyper_util::client::legacy::Client::builder(
12243/// #     hyper_util::rt::TokioExecutor::new()
12244/// # )
12245/// # .build(
12246/// #     hyper_rustls::HttpsConnectorBuilder::new()
12247/// #         .with_native_roots()
12248/// #         .unwrap()
12249/// #         .https_or_http()
12250/// #         .enable_http1()
12251/// #         .build()
12252/// # );
12253/// # let mut hub = FirebaseManagement::new(client, auth);
12254/// // You can configure optional parameters by calling the respective setters at will, and
12255/// // execute the final call using `doit()`.
12256/// // Values shown here are possibly random and not representative !
12257/// let result = hub.projects().list()
12258///              .show_deleted(false)
12259///              .page_token("duo")
12260///              .page_size(-34)
12261///              .doit().await;
12262/// # }
12263/// ```
12264pub struct ProjectListCall<'a, C>
12265where
12266    C: 'a,
12267{
12268    hub: &'a FirebaseManagement<C>,
12269    _show_deleted: Option<bool>,
12270    _page_token: Option<String>,
12271    _page_size: Option<i32>,
12272    _delegate: Option<&'a mut dyn common::Delegate>,
12273    _additional_params: HashMap<String, String>,
12274    _scopes: BTreeSet<String>,
12275}
12276
12277impl<'a, C> common::CallBuilder for ProjectListCall<'a, C> {}
12278
12279impl<'a, C> ProjectListCall<'a, C>
12280where
12281    C: common::Connector,
12282{
12283    /// Perform the operation you have build so far.
12284    pub async fn doit(
12285        mut self,
12286    ) -> common::Result<(common::Response, ListFirebaseProjectsResponse)> {
12287        use std::borrow::Cow;
12288        use std::io::{Read, Seek};
12289
12290        use common::{url::Params, ToParts};
12291        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12292
12293        let mut dd = common::DefaultDelegate;
12294        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12295        dlg.begin(common::MethodInfo {
12296            id: "firebase.projects.list",
12297            http_method: hyper::Method::GET,
12298        });
12299
12300        for &field in ["alt", "showDeleted", "pageToken", "pageSize"].iter() {
12301            if self._additional_params.contains_key(field) {
12302                dlg.finished(false);
12303                return Err(common::Error::FieldClash(field));
12304            }
12305        }
12306
12307        let mut params = Params::with_capacity(5 + self._additional_params.len());
12308        if let Some(value) = self._show_deleted.as_ref() {
12309            params.push("showDeleted", value.to_string());
12310        }
12311        if let Some(value) = self._page_token.as_ref() {
12312            params.push("pageToken", value);
12313        }
12314        if let Some(value) = self._page_size.as_ref() {
12315            params.push("pageSize", value.to_string());
12316        }
12317
12318        params.extend(self._additional_params.iter());
12319
12320        params.push("alt", "json");
12321        let mut url = self.hub._base_url.clone() + "v1beta1/projects";
12322        if self._scopes.is_empty() {
12323            self._scopes.insert(Scope::Readonly.as_ref().to_string());
12324        }
12325
12326        let url = params.parse_with_url(&url);
12327
12328        loop {
12329            let token = match self
12330                .hub
12331                .auth
12332                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12333                .await
12334            {
12335                Ok(token) => token,
12336                Err(e) => match dlg.token(e) {
12337                    Ok(token) => token,
12338                    Err(e) => {
12339                        dlg.finished(false);
12340                        return Err(common::Error::MissingToken(e));
12341                    }
12342                },
12343            };
12344            let mut req_result = {
12345                let client = &self.hub.client;
12346                dlg.pre_request();
12347                let mut req_builder = hyper::Request::builder()
12348                    .method(hyper::Method::GET)
12349                    .uri(url.as_str())
12350                    .header(USER_AGENT, self.hub._user_agent.clone());
12351
12352                if let Some(token) = token.as_ref() {
12353                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12354                }
12355
12356                let request = req_builder
12357                    .header(CONTENT_LENGTH, 0_u64)
12358                    .body(common::to_body::<String>(None));
12359
12360                client.request(request.unwrap()).await
12361            };
12362
12363            match req_result {
12364                Err(err) => {
12365                    if let common::Retry::After(d) = dlg.http_error(&err) {
12366                        sleep(d).await;
12367                        continue;
12368                    }
12369                    dlg.finished(false);
12370                    return Err(common::Error::HttpError(err));
12371                }
12372                Ok(res) => {
12373                    let (mut parts, body) = res.into_parts();
12374                    let mut body = common::Body::new(body);
12375                    if !parts.status.is_success() {
12376                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12377                        let error = serde_json::from_str(&common::to_string(&bytes));
12378                        let response = common::to_response(parts, bytes.into());
12379
12380                        if let common::Retry::After(d) =
12381                            dlg.http_failure(&response, error.as_ref().ok())
12382                        {
12383                            sleep(d).await;
12384                            continue;
12385                        }
12386
12387                        dlg.finished(false);
12388
12389                        return Err(match error {
12390                            Ok(value) => common::Error::BadRequest(value),
12391                            _ => common::Error::Failure(response),
12392                        });
12393                    }
12394                    let response = {
12395                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12396                        let encoded = common::to_string(&bytes);
12397                        match serde_json::from_str(&encoded) {
12398                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12399                            Err(error) => {
12400                                dlg.response_json_decode_error(&encoded, &error);
12401                                return Err(common::Error::JsonDecodeError(
12402                                    encoded.to_string(),
12403                                    error,
12404                                ));
12405                            }
12406                        }
12407                    };
12408
12409                    dlg.finished(true);
12410                    return Ok(response);
12411                }
12412            }
12413        }
12414    }
12415
12416    /// Optional. Controls whether Projects in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Projects will be returned.
12417    ///
12418    /// Sets the *show deleted* query property to the given value.
12419    pub fn show_deleted(mut self, new_value: bool) -> ProjectListCall<'a, C> {
12420        self._show_deleted = Some(new_value);
12421        self
12422    }
12423    /// Token returned from a previous call to `ListFirebaseProjects` indicating where in the set of Projects to resume listing.
12424    ///
12425    /// Sets the *page token* query property to the given value.
12426    pub fn page_token(mut self, new_value: &str) -> ProjectListCall<'a, C> {
12427        self._page_token = Some(new_value.to_string());
12428        self
12429    }
12430    /// The maximum number of Projects to return in the response. The server may return fewer than this at its discretion. If no value is specified (or too large a value is specified), the server will impose its own limit. This value cannot be negative.
12431    ///
12432    /// Sets the *page size* query property to the given value.
12433    pub fn page_size(mut self, new_value: i32) -> ProjectListCall<'a, C> {
12434        self._page_size = Some(new_value);
12435        self
12436    }
12437    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12438    /// while executing the actual API request.
12439    ///
12440    /// ````text
12441    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
12442    /// ````
12443    ///
12444    /// Sets the *delegate* property to the given value.
12445    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ProjectListCall<'a, C> {
12446        self._delegate = Some(new_value);
12447        self
12448    }
12449
12450    /// Set any additional parameter of the query string used in the request.
12451    /// It should be used to set parameters which are not yet available through their own
12452    /// setters.
12453    ///
12454    /// Please note that this method must not be used to set any of the known parameters
12455    /// which have their own setter method. If done anyway, the request will fail.
12456    ///
12457    /// # Additional Parameters
12458    ///
12459    /// * *$.xgafv* (query-string) - V1 error format.
12460    /// * *access_token* (query-string) - OAuth access token.
12461    /// * *alt* (query-string) - Data format for response.
12462    /// * *callback* (query-string) - JSONP
12463    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12464    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12465    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12466    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12467    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12468    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12469    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12470    pub fn param<T>(mut self, name: T, value: T) -> ProjectListCall<'a, C>
12471    where
12472        T: AsRef<str>,
12473    {
12474        self._additional_params
12475            .insert(name.as_ref().to_string(), value.as_ref().to_string());
12476        self
12477    }
12478
12479    /// Identifies the authorization scope for the method you are building.
12480    ///
12481    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12482    /// [`Scope::Readonly`].
12483    ///
12484    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12485    /// tokens for more than one scope.
12486    ///
12487    /// Usually there is more than one suitable scope to authorize an operation, some of which may
12488    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12489    /// sufficient, a read-write scope will do as well.
12490    pub fn add_scope<St>(mut self, scope: St) -> ProjectListCall<'a, C>
12491    where
12492        St: AsRef<str>,
12493    {
12494        self._scopes.insert(String::from(scope.as_ref()));
12495        self
12496    }
12497    /// Identifies the authorization scope(s) for the method you are building.
12498    ///
12499    /// See [`Self::add_scope()`] for details.
12500    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectListCall<'a, C>
12501    where
12502        I: IntoIterator<Item = St>,
12503        St: AsRef<str>,
12504    {
12505        self._scopes
12506            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12507        self
12508    }
12509
12510    /// Removes all scopes, and no default scope will be used either.
12511    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12512    /// for details).
12513    pub fn clear_scopes(mut self) -> ProjectListCall<'a, C> {
12514        self._scopes.clear();
12515        self
12516    }
12517}
12518
12519/// Updates the attributes of the specified FirebaseProject. All [query parameters](#query-parameters) are required.
12520///
12521/// A builder for the *patch* method supported by a *project* resource.
12522/// It is not used directly, but through a [`ProjectMethods`] instance.
12523///
12524/// # Example
12525///
12526/// Instantiate a resource method builder
12527///
12528/// ```test_harness,no_run
12529/// # extern crate hyper;
12530/// # extern crate hyper_rustls;
12531/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12532/// use firebase1_beta1::api::FirebaseProject;
12533/// # async fn dox() {
12534/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12535///
12536/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12537/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
12538/// #     secret,
12539/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12540/// # ).build().await.unwrap();
12541///
12542/// # let client = hyper_util::client::legacy::Client::builder(
12543/// #     hyper_util::rt::TokioExecutor::new()
12544/// # )
12545/// # .build(
12546/// #     hyper_rustls::HttpsConnectorBuilder::new()
12547/// #         .with_native_roots()
12548/// #         .unwrap()
12549/// #         .https_or_http()
12550/// #         .enable_http1()
12551/// #         .build()
12552/// # );
12553/// # let mut hub = FirebaseManagement::new(client, auth);
12554/// // As the method needs a request, you would usually fill it with the desired information
12555/// // into the respective structure. Some of the parts shown here might not be applicable !
12556/// // Values shown here are possibly random and not representative !
12557/// let mut req = FirebaseProject::default();
12558///
12559/// // You can configure optional parameters by calling the respective setters at will, and
12560/// // execute the final call using `doit()`.
12561/// // Values shown here are possibly random and not representative !
12562/// let result = hub.projects().patch(req, "name")
12563///              .update_mask(FieldMask::new::<&str>(&[]))
12564///              .doit().await;
12565/// # }
12566/// ```
12567pub struct ProjectPatchCall<'a, C>
12568where
12569    C: 'a,
12570{
12571    hub: &'a FirebaseManagement<C>,
12572    _request: FirebaseProject,
12573    _name: String,
12574    _update_mask: Option<common::FieldMask>,
12575    _delegate: Option<&'a mut dyn common::Delegate>,
12576    _additional_params: HashMap<String, String>,
12577    _scopes: BTreeSet<String>,
12578}
12579
12580impl<'a, C> common::CallBuilder for ProjectPatchCall<'a, C> {}
12581
12582impl<'a, C> ProjectPatchCall<'a, C>
12583where
12584    C: common::Connector,
12585{
12586    /// Perform the operation you have build so far.
12587    pub async fn doit(mut self) -> common::Result<(common::Response, FirebaseProject)> {
12588        use std::borrow::Cow;
12589        use std::io::{Read, Seek};
12590
12591        use common::{url::Params, ToParts};
12592        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12593
12594        let mut dd = common::DefaultDelegate;
12595        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12596        dlg.begin(common::MethodInfo {
12597            id: "firebase.projects.patch",
12598            http_method: hyper::Method::PATCH,
12599        });
12600
12601        for &field in ["alt", "name", "updateMask"].iter() {
12602            if self._additional_params.contains_key(field) {
12603                dlg.finished(false);
12604                return Err(common::Error::FieldClash(field));
12605            }
12606        }
12607
12608        let mut params = Params::with_capacity(5 + self._additional_params.len());
12609        params.push("name", self._name);
12610        if let Some(value) = self._update_mask.as_ref() {
12611            params.push("updateMask", value.to_string());
12612        }
12613
12614        params.extend(self._additional_params.iter());
12615
12616        params.push("alt", "json");
12617        let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
12618        if self._scopes.is_empty() {
12619            self._scopes
12620                .insert(Scope::CloudPlatform.as_ref().to_string());
12621        }
12622
12623        #[allow(clippy::single_element_loop)]
12624        for &(find_this, param_name) in [("{+name}", "name")].iter() {
12625            url = params.uri_replacement(url, param_name, find_this, true);
12626        }
12627        {
12628            let to_remove = ["name"];
12629            params.remove_params(&to_remove);
12630        }
12631
12632        let url = params.parse_with_url(&url);
12633
12634        let mut json_mime_type = mime::APPLICATION_JSON;
12635        let mut request_value_reader = {
12636            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
12637            common::remove_json_null_values(&mut value);
12638            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
12639            serde_json::to_writer(&mut dst, &value).unwrap();
12640            dst
12641        };
12642        let request_size = request_value_reader
12643            .seek(std::io::SeekFrom::End(0))
12644            .unwrap();
12645        request_value_reader
12646            .seek(std::io::SeekFrom::Start(0))
12647            .unwrap();
12648
12649        loop {
12650            let token = match self
12651                .hub
12652                .auth
12653                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12654                .await
12655            {
12656                Ok(token) => token,
12657                Err(e) => match dlg.token(e) {
12658                    Ok(token) => token,
12659                    Err(e) => {
12660                        dlg.finished(false);
12661                        return Err(common::Error::MissingToken(e));
12662                    }
12663                },
12664            };
12665            request_value_reader
12666                .seek(std::io::SeekFrom::Start(0))
12667                .unwrap();
12668            let mut req_result = {
12669                let client = &self.hub.client;
12670                dlg.pre_request();
12671                let mut req_builder = hyper::Request::builder()
12672                    .method(hyper::Method::PATCH)
12673                    .uri(url.as_str())
12674                    .header(USER_AGENT, self.hub._user_agent.clone());
12675
12676                if let Some(token) = token.as_ref() {
12677                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12678                }
12679
12680                let request = req_builder
12681                    .header(CONTENT_TYPE, json_mime_type.to_string())
12682                    .header(CONTENT_LENGTH, request_size as u64)
12683                    .body(common::to_body(
12684                        request_value_reader.get_ref().clone().into(),
12685                    ));
12686
12687                client.request(request.unwrap()).await
12688            };
12689
12690            match req_result {
12691                Err(err) => {
12692                    if let common::Retry::After(d) = dlg.http_error(&err) {
12693                        sleep(d).await;
12694                        continue;
12695                    }
12696                    dlg.finished(false);
12697                    return Err(common::Error::HttpError(err));
12698                }
12699                Ok(res) => {
12700                    let (mut parts, body) = res.into_parts();
12701                    let mut body = common::Body::new(body);
12702                    if !parts.status.is_success() {
12703                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12704                        let error = serde_json::from_str(&common::to_string(&bytes));
12705                        let response = common::to_response(parts, bytes.into());
12706
12707                        if let common::Retry::After(d) =
12708                            dlg.http_failure(&response, error.as_ref().ok())
12709                        {
12710                            sleep(d).await;
12711                            continue;
12712                        }
12713
12714                        dlg.finished(false);
12715
12716                        return Err(match error {
12717                            Ok(value) => common::Error::BadRequest(value),
12718                            _ => common::Error::Failure(response),
12719                        });
12720                    }
12721                    let response = {
12722                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12723                        let encoded = common::to_string(&bytes);
12724                        match serde_json::from_str(&encoded) {
12725                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12726                            Err(error) => {
12727                                dlg.response_json_decode_error(&encoded, &error);
12728                                return Err(common::Error::JsonDecodeError(
12729                                    encoded.to_string(),
12730                                    error,
12731                                ));
12732                            }
12733                        }
12734                    };
12735
12736                    dlg.finished(true);
12737                    return Ok(response);
12738                }
12739            }
12740        }
12741    }
12742
12743    ///
12744    /// Sets the *request* property to the given value.
12745    ///
12746    /// Even though the property as already been set when instantiating this call,
12747    /// we provide this method for API completeness.
12748    pub fn request(mut self, new_value: FirebaseProject) -> ProjectPatchCall<'a, C> {
12749        self._request = new_value;
12750        self
12751    }
12752    /// The resource name of the Project, in the format: projects/PROJECT_IDENTIFIER PROJECT_IDENTIFIER: the Project’s [`ProjectNumber`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_number) ***(recommended)*** or its [`ProjectId`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.project_id). Learn more about using project identifiers in Google’s [AIP 2510 standard](https://google.aip.dev/cloud/2510). Note that the value for PROJECT_IDENTIFIER in any response body will be the `ProjectId`.
12753    ///
12754    /// Sets the *name* path property to the given value.
12755    ///
12756    /// Even though the property as already been set when instantiating this call,
12757    /// we provide this method for API completeness.
12758    pub fn name(mut self, new_value: &str) -> ProjectPatchCall<'a, C> {
12759        self._name = new_value.to_string();
12760        self
12761    }
12762    /// Specifies which fields of the FirebaseProject to update. Note that the following fields are immutable: `name`, `project_id`, and `project_number`. To update `state`, use any of the following Google Cloud endpoints: [`projects.delete`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/delete) or [`projects.undelete`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/undelete)
12763    ///
12764    /// Sets the *update mask* query property to the given value.
12765    pub fn update_mask(mut self, new_value: common::FieldMask) -> ProjectPatchCall<'a, C> {
12766        self._update_mask = Some(new_value);
12767        self
12768    }
12769    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12770    /// while executing the actual API request.
12771    ///
12772    /// ````text
12773    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
12774    /// ````
12775    ///
12776    /// Sets the *delegate* property to the given value.
12777    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ProjectPatchCall<'a, C> {
12778        self._delegate = Some(new_value);
12779        self
12780    }
12781
12782    /// Set any additional parameter of the query string used in the request.
12783    /// It should be used to set parameters which are not yet available through their own
12784    /// setters.
12785    ///
12786    /// Please note that this method must not be used to set any of the known parameters
12787    /// which have their own setter method. If done anyway, the request will fail.
12788    ///
12789    /// # Additional Parameters
12790    ///
12791    /// * *$.xgafv* (query-string) - V1 error format.
12792    /// * *access_token* (query-string) - OAuth access token.
12793    /// * *alt* (query-string) - Data format for response.
12794    /// * *callback* (query-string) - JSONP
12795    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12796    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12797    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12798    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12799    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12800    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12801    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12802    pub fn param<T>(mut self, name: T, value: T) -> ProjectPatchCall<'a, C>
12803    where
12804        T: AsRef<str>,
12805    {
12806        self._additional_params
12807            .insert(name.as_ref().to_string(), value.as_ref().to_string());
12808        self
12809    }
12810
12811    /// Identifies the authorization scope for the method you are building.
12812    ///
12813    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12814    /// [`Scope::CloudPlatform`].
12815    ///
12816    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12817    /// tokens for more than one scope.
12818    ///
12819    /// Usually there is more than one suitable scope to authorize an operation, some of which may
12820    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12821    /// sufficient, a read-write scope will do as well.
12822    pub fn add_scope<St>(mut self, scope: St) -> ProjectPatchCall<'a, C>
12823    where
12824        St: AsRef<str>,
12825    {
12826        self._scopes.insert(String::from(scope.as_ref()));
12827        self
12828    }
12829    /// Identifies the authorization scope(s) for the method you are building.
12830    ///
12831    /// See [`Self::add_scope()`] for details.
12832    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectPatchCall<'a, C>
12833    where
12834        I: IntoIterator<Item = St>,
12835        St: AsRef<str>,
12836    {
12837        self._scopes
12838            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12839        self
12840    }
12841
12842    /// Removes all scopes, and no default scope will be used either.
12843    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12844    /// for details).
12845    pub fn clear_scopes(mut self) -> ProjectPatchCall<'a, C> {
12846        self._scopes.clear();
12847        self
12848    }
12849}
12850
12851/// Unlinks the specified FirebaseProject from its Google Analytics account. This call removes the association of the specified `FirebaseProject` with its current Google Analytics property. However, this call does not delete the Google Analytics resources, such as the Google Analytics property or any data streams. These resources may be re-associated later to the `FirebaseProject` by calling [`AddGoogleAnalytics`](https://firebase.google.com/../../v1beta1/projects/addGoogleAnalytics) and specifying the same `analyticsPropertyId`. For Android Apps and iOS Apps, this call re-links data streams with their corresponding apps. However, for Web Apps, this call provisions a *new* data stream for each Web App. To call `RemoveAnalytics`, a project member must be an Owner for the `FirebaseProject`.
12852///
12853/// A builder for the *removeAnalytics* method supported by a *project* resource.
12854/// It is not used directly, but through a [`ProjectMethods`] instance.
12855///
12856/// # Example
12857///
12858/// Instantiate a resource method builder
12859///
12860/// ```test_harness,no_run
12861/// # extern crate hyper;
12862/// # extern crate hyper_rustls;
12863/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12864/// use firebase1_beta1::api::RemoveAnalyticsRequest;
12865/// # async fn dox() {
12866/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12867///
12868/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12869/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
12870/// #     secret,
12871/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12872/// # ).build().await.unwrap();
12873///
12874/// # let client = hyper_util::client::legacy::Client::builder(
12875/// #     hyper_util::rt::TokioExecutor::new()
12876/// # )
12877/// # .build(
12878/// #     hyper_rustls::HttpsConnectorBuilder::new()
12879/// #         .with_native_roots()
12880/// #         .unwrap()
12881/// #         .https_or_http()
12882/// #         .enable_http1()
12883/// #         .build()
12884/// # );
12885/// # let mut hub = FirebaseManagement::new(client, auth);
12886/// // As the method needs a request, you would usually fill it with the desired information
12887/// // into the respective structure. Some of the parts shown here might not be applicable !
12888/// // Values shown here are possibly random and not representative !
12889/// let mut req = RemoveAnalyticsRequest::default();
12890///
12891/// // You can configure optional parameters by calling the respective setters at will, and
12892/// // execute the final call using `doit()`.
12893/// // Values shown here are possibly random and not representative !
12894/// let result = hub.projects().remove_analytics(req, "parent")
12895///              .doit().await;
12896/// # }
12897/// ```
12898pub struct ProjectRemoveAnalyticCall<'a, C>
12899where
12900    C: 'a,
12901{
12902    hub: &'a FirebaseManagement<C>,
12903    _request: RemoveAnalyticsRequest,
12904    _parent: String,
12905    _delegate: Option<&'a mut dyn common::Delegate>,
12906    _additional_params: HashMap<String, String>,
12907    _scopes: BTreeSet<String>,
12908}
12909
12910impl<'a, C> common::CallBuilder for ProjectRemoveAnalyticCall<'a, C> {}
12911
12912impl<'a, C> ProjectRemoveAnalyticCall<'a, C>
12913where
12914    C: common::Connector,
12915{
12916    /// Perform the operation you have build so far.
12917    pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
12918        use std::borrow::Cow;
12919        use std::io::{Read, Seek};
12920
12921        use common::{url::Params, ToParts};
12922        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12923
12924        let mut dd = common::DefaultDelegate;
12925        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12926        dlg.begin(common::MethodInfo {
12927            id: "firebase.projects.removeAnalytics",
12928            http_method: hyper::Method::POST,
12929        });
12930
12931        for &field in ["alt", "parent"].iter() {
12932            if self._additional_params.contains_key(field) {
12933                dlg.finished(false);
12934                return Err(common::Error::FieldClash(field));
12935            }
12936        }
12937
12938        let mut params = Params::with_capacity(4 + self._additional_params.len());
12939        params.push("parent", self._parent);
12940
12941        params.extend(self._additional_params.iter());
12942
12943        params.push("alt", "json");
12944        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:removeAnalytics";
12945        if self._scopes.is_empty() {
12946            self._scopes
12947                .insert(Scope::CloudPlatform.as_ref().to_string());
12948        }
12949
12950        #[allow(clippy::single_element_loop)]
12951        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
12952            url = params.uri_replacement(url, param_name, find_this, true);
12953        }
12954        {
12955            let to_remove = ["parent"];
12956            params.remove_params(&to_remove);
12957        }
12958
12959        let url = params.parse_with_url(&url);
12960
12961        let mut json_mime_type = mime::APPLICATION_JSON;
12962        let mut request_value_reader = {
12963            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
12964            common::remove_json_null_values(&mut value);
12965            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
12966            serde_json::to_writer(&mut dst, &value).unwrap();
12967            dst
12968        };
12969        let request_size = request_value_reader
12970            .seek(std::io::SeekFrom::End(0))
12971            .unwrap();
12972        request_value_reader
12973            .seek(std::io::SeekFrom::Start(0))
12974            .unwrap();
12975
12976        loop {
12977            let token = match self
12978                .hub
12979                .auth
12980                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12981                .await
12982            {
12983                Ok(token) => token,
12984                Err(e) => match dlg.token(e) {
12985                    Ok(token) => token,
12986                    Err(e) => {
12987                        dlg.finished(false);
12988                        return Err(common::Error::MissingToken(e));
12989                    }
12990                },
12991            };
12992            request_value_reader
12993                .seek(std::io::SeekFrom::Start(0))
12994                .unwrap();
12995            let mut req_result = {
12996                let client = &self.hub.client;
12997                dlg.pre_request();
12998                let mut req_builder = hyper::Request::builder()
12999                    .method(hyper::Method::POST)
13000                    .uri(url.as_str())
13001                    .header(USER_AGENT, self.hub._user_agent.clone());
13002
13003                if let Some(token) = token.as_ref() {
13004                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13005                }
13006
13007                let request = req_builder
13008                    .header(CONTENT_TYPE, json_mime_type.to_string())
13009                    .header(CONTENT_LENGTH, request_size as u64)
13010                    .body(common::to_body(
13011                        request_value_reader.get_ref().clone().into(),
13012                    ));
13013
13014                client.request(request.unwrap()).await
13015            };
13016
13017            match req_result {
13018                Err(err) => {
13019                    if let common::Retry::After(d) = dlg.http_error(&err) {
13020                        sleep(d).await;
13021                        continue;
13022                    }
13023                    dlg.finished(false);
13024                    return Err(common::Error::HttpError(err));
13025                }
13026                Ok(res) => {
13027                    let (mut parts, body) = res.into_parts();
13028                    let mut body = common::Body::new(body);
13029                    if !parts.status.is_success() {
13030                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13031                        let error = serde_json::from_str(&common::to_string(&bytes));
13032                        let response = common::to_response(parts, bytes.into());
13033
13034                        if let common::Retry::After(d) =
13035                            dlg.http_failure(&response, error.as_ref().ok())
13036                        {
13037                            sleep(d).await;
13038                            continue;
13039                        }
13040
13041                        dlg.finished(false);
13042
13043                        return Err(match error {
13044                            Ok(value) => common::Error::BadRequest(value),
13045                            _ => common::Error::Failure(response),
13046                        });
13047                    }
13048                    let response = {
13049                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13050                        let encoded = common::to_string(&bytes);
13051                        match serde_json::from_str(&encoded) {
13052                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13053                            Err(error) => {
13054                                dlg.response_json_decode_error(&encoded, &error);
13055                                return Err(common::Error::JsonDecodeError(
13056                                    encoded.to_string(),
13057                                    error,
13058                                ));
13059                            }
13060                        }
13061                    };
13062
13063                    dlg.finished(true);
13064                    return Ok(response);
13065                }
13066            }
13067        }
13068    }
13069
13070    ///
13071    /// Sets the *request* property to the given value.
13072    ///
13073    /// Even though the property as already been set when instantiating this call,
13074    /// we provide this method for API completeness.
13075    pub fn request(
13076        mut self,
13077        new_value: RemoveAnalyticsRequest,
13078    ) -> ProjectRemoveAnalyticCall<'a, C> {
13079        self._request = new_value;
13080        self
13081    }
13082    /// The resource name of the FirebaseProject to unlink from its Google Analytics account, in the format: projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
13083    ///
13084    /// Sets the *parent* path property to the given value.
13085    ///
13086    /// Even though the property as already been set when instantiating this call,
13087    /// we provide this method for API completeness.
13088    pub fn parent(mut self, new_value: &str) -> ProjectRemoveAnalyticCall<'a, C> {
13089        self._parent = new_value.to_string();
13090        self
13091    }
13092    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13093    /// while executing the actual API request.
13094    ///
13095    /// ````text
13096    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
13097    /// ````
13098    ///
13099    /// Sets the *delegate* property to the given value.
13100    pub fn delegate(
13101        mut self,
13102        new_value: &'a mut dyn common::Delegate,
13103    ) -> ProjectRemoveAnalyticCall<'a, C> {
13104        self._delegate = Some(new_value);
13105        self
13106    }
13107
13108    /// Set any additional parameter of the query string used in the request.
13109    /// It should be used to set parameters which are not yet available through their own
13110    /// setters.
13111    ///
13112    /// Please note that this method must not be used to set any of the known parameters
13113    /// which have their own setter method. If done anyway, the request will fail.
13114    ///
13115    /// # Additional Parameters
13116    ///
13117    /// * *$.xgafv* (query-string) - V1 error format.
13118    /// * *access_token* (query-string) - OAuth access token.
13119    /// * *alt* (query-string) - Data format for response.
13120    /// * *callback* (query-string) - JSONP
13121    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13122    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13123    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13124    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13125    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13126    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13127    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13128    pub fn param<T>(mut self, name: T, value: T) -> ProjectRemoveAnalyticCall<'a, C>
13129    where
13130        T: AsRef<str>,
13131    {
13132        self._additional_params
13133            .insert(name.as_ref().to_string(), value.as_ref().to_string());
13134        self
13135    }
13136
13137    /// Identifies the authorization scope for the method you are building.
13138    ///
13139    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13140    /// [`Scope::CloudPlatform`].
13141    ///
13142    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13143    /// tokens for more than one scope.
13144    ///
13145    /// Usually there is more than one suitable scope to authorize an operation, some of which may
13146    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13147    /// sufficient, a read-write scope will do as well.
13148    pub fn add_scope<St>(mut self, scope: St) -> ProjectRemoveAnalyticCall<'a, C>
13149    where
13150        St: AsRef<str>,
13151    {
13152        self._scopes.insert(String::from(scope.as_ref()));
13153        self
13154    }
13155    /// Identifies the authorization scope(s) for the method you are building.
13156    ///
13157    /// See [`Self::add_scope()`] for details.
13158    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectRemoveAnalyticCall<'a, C>
13159    where
13160        I: IntoIterator<Item = St>,
13161        St: AsRef<str>,
13162    {
13163        self._scopes
13164            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13165        self
13166    }
13167
13168    /// Removes all scopes, and no default scope will be used either.
13169    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13170    /// for details).
13171    pub fn clear_scopes(mut self) -> ProjectRemoveAnalyticCall<'a, C> {
13172        self._scopes.clear();
13173        self
13174    }
13175}
13176
13177/// Lists all available Apps for the specified FirebaseProject. This is a convenience method. Typically, interaction with an App should be done using the platform-specific service, but some tool use-cases require a summary of all known Apps (such as for App selector interfaces).
13178///
13179/// A builder for the *searchApps* method supported by a *project* resource.
13180/// It is not used directly, but through a [`ProjectMethods`] instance.
13181///
13182/// # Example
13183///
13184/// Instantiate a resource method builder
13185///
13186/// ```test_harness,no_run
13187/// # extern crate hyper;
13188/// # extern crate hyper_rustls;
13189/// # extern crate google_firebase1_beta1 as firebase1_beta1;
13190/// # async fn dox() {
13191/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
13192///
13193/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
13194/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
13195/// #     secret,
13196/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13197/// # ).build().await.unwrap();
13198///
13199/// # let client = hyper_util::client::legacy::Client::builder(
13200/// #     hyper_util::rt::TokioExecutor::new()
13201/// # )
13202/// # .build(
13203/// #     hyper_rustls::HttpsConnectorBuilder::new()
13204/// #         .with_native_roots()
13205/// #         .unwrap()
13206/// #         .https_or_http()
13207/// #         .enable_http1()
13208/// #         .build()
13209/// # );
13210/// # let mut hub = FirebaseManagement::new(client, auth);
13211/// // You can configure optional parameters by calling the respective setters at will, and
13212/// // execute the final call using `doit()`.
13213/// // Values shown here are possibly random and not representative !
13214/// let result = hub.projects().search_apps("parent")
13215///              .show_deleted(false)
13216///              .page_token("diam")
13217///              .page_size(-49)
13218///              .filter("et")
13219///              .doit().await;
13220/// # }
13221/// ```
13222pub struct ProjectSearchAppCall<'a, C>
13223where
13224    C: 'a,
13225{
13226    hub: &'a FirebaseManagement<C>,
13227    _parent: String,
13228    _show_deleted: Option<bool>,
13229    _page_token: Option<String>,
13230    _page_size: Option<i32>,
13231    _filter: Option<String>,
13232    _delegate: Option<&'a mut dyn common::Delegate>,
13233    _additional_params: HashMap<String, String>,
13234    _scopes: BTreeSet<String>,
13235}
13236
13237impl<'a, C> common::CallBuilder for ProjectSearchAppCall<'a, C> {}
13238
13239impl<'a, C> ProjectSearchAppCall<'a, C>
13240where
13241    C: common::Connector,
13242{
13243    /// Perform the operation you have build so far.
13244    pub async fn doit(mut self) -> common::Result<(common::Response, SearchFirebaseAppsResponse)> {
13245        use std::borrow::Cow;
13246        use std::io::{Read, Seek};
13247
13248        use common::{url::Params, ToParts};
13249        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
13250
13251        let mut dd = common::DefaultDelegate;
13252        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
13253        dlg.begin(common::MethodInfo {
13254            id: "firebase.projects.searchApps",
13255            http_method: hyper::Method::GET,
13256        });
13257
13258        for &field in [
13259            "alt",
13260            "parent",
13261            "showDeleted",
13262            "pageToken",
13263            "pageSize",
13264            "filter",
13265        ]
13266        .iter()
13267        {
13268            if self._additional_params.contains_key(field) {
13269                dlg.finished(false);
13270                return Err(common::Error::FieldClash(field));
13271            }
13272        }
13273
13274        let mut params = Params::with_capacity(7 + self._additional_params.len());
13275        params.push("parent", self._parent);
13276        if let Some(value) = self._show_deleted.as_ref() {
13277            params.push("showDeleted", value.to_string());
13278        }
13279        if let Some(value) = self._page_token.as_ref() {
13280            params.push("pageToken", value);
13281        }
13282        if let Some(value) = self._page_size.as_ref() {
13283            params.push("pageSize", value.to_string());
13284        }
13285        if let Some(value) = self._filter.as_ref() {
13286            params.push("filter", value);
13287        }
13288
13289        params.extend(self._additional_params.iter());
13290
13291        params.push("alt", "json");
13292        let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:searchApps";
13293        if self._scopes.is_empty() {
13294            self._scopes.insert(Scope::Readonly.as_ref().to_string());
13295        }
13296
13297        #[allow(clippy::single_element_loop)]
13298        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
13299            url = params.uri_replacement(url, param_name, find_this, true);
13300        }
13301        {
13302            let to_remove = ["parent"];
13303            params.remove_params(&to_remove);
13304        }
13305
13306        let url = params.parse_with_url(&url);
13307
13308        loop {
13309            let token = match self
13310                .hub
13311                .auth
13312                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13313                .await
13314            {
13315                Ok(token) => token,
13316                Err(e) => match dlg.token(e) {
13317                    Ok(token) => token,
13318                    Err(e) => {
13319                        dlg.finished(false);
13320                        return Err(common::Error::MissingToken(e));
13321                    }
13322                },
13323            };
13324            let mut req_result = {
13325                let client = &self.hub.client;
13326                dlg.pre_request();
13327                let mut req_builder = hyper::Request::builder()
13328                    .method(hyper::Method::GET)
13329                    .uri(url.as_str())
13330                    .header(USER_AGENT, self.hub._user_agent.clone());
13331
13332                if let Some(token) = token.as_ref() {
13333                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13334                }
13335
13336                let request = req_builder
13337                    .header(CONTENT_LENGTH, 0_u64)
13338                    .body(common::to_body::<String>(None));
13339
13340                client.request(request.unwrap()).await
13341            };
13342
13343            match req_result {
13344                Err(err) => {
13345                    if let common::Retry::After(d) = dlg.http_error(&err) {
13346                        sleep(d).await;
13347                        continue;
13348                    }
13349                    dlg.finished(false);
13350                    return Err(common::Error::HttpError(err));
13351                }
13352                Ok(res) => {
13353                    let (mut parts, body) = res.into_parts();
13354                    let mut body = common::Body::new(body);
13355                    if !parts.status.is_success() {
13356                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13357                        let error = serde_json::from_str(&common::to_string(&bytes));
13358                        let response = common::to_response(parts, bytes.into());
13359
13360                        if let common::Retry::After(d) =
13361                            dlg.http_failure(&response, error.as_ref().ok())
13362                        {
13363                            sleep(d).await;
13364                            continue;
13365                        }
13366
13367                        dlg.finished(false);
13368
13369                        return Err(match error {
13370                            Ok(value) => common::Error::BadRequest(value),
13371                            _ => common::Error::Failure(response),
13372                        });
13373                    }
13374                    let response = {
13375                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13376                        let encoded = common::to_string(&bytes);
13377                        match serde_json::from_str(&encoded) {
13378                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13379                            Err(error) => {
13380                                dlg.response_json_decode_error(&encoded, &error);
13381                                return Err(common::Error::JsonDecodeError(
13382                                    encoded.to_string(),
13383                                    error,
13384                                ));
13385                            }
13386                        }
13387                    };
13388
13389                    dlg.finished(true);
13390                    return Ok(response);
13391                }
13392            }
13393        }
13394    }
13395
13396    /// The parent FirebaseProject for which to list Apps, in the format: projects/ PROJECT_IDENTIFIER Refer to the `FirebaseProject` [`name`](https://firebase.google.com/../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
13397    ///
13398    /// Sets the *parent* path property to the given value.
13399    ///
13400    /// Even though the property as already been set when instantiating this call,
13401    /// we provide this method for API completeness.
13402    pub fn parent(mut self, new_value: &str) -> ProjectSearchAppCall<'a, C> {
13403        self._parent = new_value.to_string();
13404        self
13405    }
13406    /// Controls whether Apps in the DELETED state should be returned. If not specified, only `ACTIVE` Apps will be returned.
13407    ///
13408    /// Sets the *show deleted* query property to the given value.
13409    pub fn show_deleted(mut self, new_value: bool) -> ProjectSearchAppCall<'a, C> {
13410        self._show_deleted = Some(new_value);
13411        self
13412    }
13413    /// Token returned from a previous call to `SearchFirebaseApps` indicating where in the set of Apps to resume listing.
13414    ///
13415    /// Sets the *page token* query property to the given value.
13416    pub fn page_token(mut self, new_value: &str) -> ProjectSearchAppCall<'a, C> {
13417        self._page_token = Some(new_value.to_string());
13418        self
13419    }
13420    /// The maximum number of Apps to return in the response. The server may return fewer than this value at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit. This value cannot be negative.
13421    ///
13422    /// Sets the *page size* query property to the given value.
13423    pub fn page_size(mut self, new_value: i32) -> ProjectSearchAppCall<'a, C> {
13424        self._page_size = Some(new_value);
13425        self
13426    }
13427    /// A query string compatible with Google’s [AIP-160 standard](https://google.aip.dev/160). Use any of the following fields in a query: * [`app_id`](https://firebase.google.com/../projects/searchApps#FirebaseAppInfo.FIELDS.app_id) * [`namespace`](https://firebase.google.com/../projects/searchApps#FirebaseAppInfo.FIELDS.namespace) * [`platform`](https://firebase.google.com/../projects/searchApps#FirebaseAppInfo.FIELDS.platform) This query also supports the following “virtual” fields. These are fields which are not actually part of the returned resource object, but they can be queried as if they are pre-populated with specific values. * `sha1_hash` or `sha1_hashes`: This field is considered to be a *repeated* `string` field, populated with the list of all SHA-1 certificate fingerprints registered with the AndroidApp. This list is empty if the App is not an `AndroidApp`. * `sha256_hash` or `sha256_hashes`: This field is considered to be a *repeated* `string` field, populated with the list of all SHA-256 certificate fingerprints registered with the AndroidApp. This list is empty if the App is not an `AndroidApp`. * `app_store_id`: This field is considered to be a *singular* `string` field, populated with the Apple App Store ID registered with the IosApp. This field is empty if the App is not an `IosApp`. * `team_id`: This field is considered to be a *singular* `string` field, populated with the Apple team ID registered with the IosApp. This field is empty if the App is not an `IosApp`.
13428    ///
13429    /// Sets the *filter* query property to the given value.
13430    pub fn filter(mut self, new_value: &str) -> ProjectSearchAppCall<'a, C> {
13431        self._filter = Some(new_value.to_string());
13432        self
13433    }
13434    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13435    /// while executing the actual API request.
13436    ///
13437    /// ````text
13438    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
13439    /// ````
13440    ///
13441    /// Sets the *delegate* property to the given value.
13442    pub fn delegate(
13443        mut self,
13444        new_value: &'a mut dyn common::Delegate,
13445    ) -> ProjectSearchAppCall<'a, C> {
13446        self._delegate = Some(new_value);
13447        self
13448    }
13449
13450    /// Set any additional parameter of the query string used in the request.
13451    /// It should be used to set parameters which are not yet available through their own
13452    /// setters.
13453    ///
13454    /// Please note that this method must not be used to set any of the known parameters
13455    /// which have their own setter method. If done anyway, the request will fail.
13456    ///
13457    /// # Additional Parameters
13458    ///
13459    /// * *$.xgafv* (query-string) - V1 error format.
13460    /// * *access_token* (query-string) - OAuth access token.
13461    /// * *alt* (query-string) - Data format for response.
13462    /// * *callback* (query-string) - JSONP
13463    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13464    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13465    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13466    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13467    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13468    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13469    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13470    pub fn param<T>(mut self, name: T, value: T) -> ProjectSearchAppCall<'a, C>
13471    where
13472        T: AsRef<str>,
13473    {
13474        self._additional_params
13475            .insert(name.as_ref().to_string(), value.as_ref().to_string());
13476        self
13477    }
13478
13479    /// Identifies the authorization scope for the method you are building.
13480    ///
13481    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13482    /// [`Scope::Readonly`].
13483    ///
13484    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13485    /// tokens for more than one scope.
13486    ///
13487    /// Usually there is more than one suitable scope to authorize an operation, some of which may
13488    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13489    /// sufficient, a read-write scope will do as well.
13490    pub fn add_scope<St>(mut self, scope: St) -> ProjectSearchAppCall<'a, C>
13491    where
13492        St: AsRef<str>,
13493    {
13494        self._scopes.insert(String::from(scope.as_ref()));
13495        self
13496    }
13497    /// Identifies the authorization scope(s) for the method you are building.
13498    ///
13499    /// See [`Self::add_scope()`] for details.
13500    pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectSearchAppCall<'a, C>
13501    where
13502        I: IntoIterator<Item = St>,
13503        St: AsRef<str>,
13504    {
13505        self._scopes
13506            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13507        self
13508    }
13509
13510    /// Removes all scopes, and no default scope will be used either.
13511    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13512    /// for details).
13513    pub fn clear_scopes(mut self) -> ProjectSearchAppCall<'a, C> {
13514        self._scopes.clear();
13515        self
13516    }
13517}