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 connector = hyper_rustls::HttpsConnectorBuilder::new()
77/// .with_native_roots()
78/// .unwrap()
79/// .https_only()
80/// .enable_http2()
81/// .build();
82///
83/// let executor = hyper_util::rt::TokioExecutor::new();
84/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
85/// secret,
86/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
87/// yup_oauth2::client::CustomHyperClientBuilder::from(
88/// hyper_util::client::legacy::Client::builder(executor).build(connector),
89/// ),
90/// ).build().await.unwrap();
91///
92/// let client = hyper_util::client::legacy::Client::builder(
93/// hyper_util::rt::TokioExecutor::new()
94/// )
95/// .build(
96/// hyper_rustls::HttpsConnectorBuilder::new()
97/// .with_native_roots()
98/// .unwrap()
99/// .https_or_http()
100/// .enable_http2()
101/// .build()
102/// );
103/// let mut hub = FirebaseManagement::new(client, auth);
104/// // As the method needs a request, you would usually fill it with the desired information
105/// // into the respective structure. Some of the parts shown here might not be applicable !
106/// // Values shown here are possibly random and not representative !
107/// let mut req = AndroidApp::default();
108///
109/// // You can configure optional parameters by calling the respective setters at will, and
110/// // execute the final call using `doit()`.
111/// // Values shown here are possibly random and not representative !
112/// let result = hub.projects().android_apps_create(req, "parent")
113/// .doit().await;
114///
115/// match result {
116/// Err(e) => match e {
117/// // The Error enum provides details about what exactly happened.
118/// // You can also just use its `Debug`, `Display` or `Error` traits
119/// Error::HttpError(_)
120/// |Error::Io(_)
121/// |Error::MissingAPIKey
122/// |Error::MissingToken(_)
123/// |Error::Cancelled
124/// |Error::UploadSizeLimitExceeded(_, _)
125/// |Error::Failure(_)
126/// |Error::BadRequest(_)
127/// |Error::FieldClash(_)
128/// |Error::JsonDecodeError(_, _) => println!("{}", e),
129/// },
130/// Ok(res) => println!("Success: {:?}", res),
131/// }
132/// # }
133/// ```
134#[derive(Clone)]
135pub struct FirebaseManagement<C> {
136 pub client: common::Client<C>,
137 pub auth: Box<dyn common::GetToken>,
138 _user_agent: String,
139 _base_url: String,
140 _root_url: String,
141}
142
143impl<C> common::Hub for FirebaseManagement<C> {}
144
145impl<'a, C> FirebaseManagement<C> {
146 pub fn new<A: 'static + common::GetToken>(
147 client: common::Client<C>,
148 auth: A,
149 ) -> FirebaseManagement<C> {
150 FirebaseManagement {
151 client,
152 auth: Box::new(auth),
153 _user_agent: "google-api-rust-client/7.0.0".to_string(),
154 _base_url: "https://firebase.googleapis.com/".to_string(),
155 _root_url: "https://firebase.googleapis.com/".to_string(),
156 }
157 }
158
159 pub fn available_projects(&'a self) -> AvailableProjectMethods<'a, C> {
160 AvailableProjectMethods { hub: self }
161 }
162 pub fn operations(&'a self) -> OperationMethods<'a, C> {
163 OperationMethods { hub: self }
164 }
165 pub fn projects(&'a self) -> ProjectMethods<'a, C> {
166 ProjectMethods { hub: self }
167 }
168
169 /// Set the user-agent header field to use in all requests to the server.
170 /// It defaults to `google-api-rust-client/7.0.0`.
171 ///
172 /// Returns the previously set user-agent.
173 pub fn user_agent(&mut self, agent_name: String) -> String {
174 std::mem::replace(&mut self._user_agent, agent_name)
175 }
176
177 /// Set the base url to use in all requests to the server.
178 /// It defaults to `https://firebase.googleapis.com/`.
179 ///
180 /// Returns the previously set base url.
181 pub fn base_url(&mut self, new_base_url: String) -> String {
182 std::mem::replace(&mut self._base_url, new_base_url)
183 }
184
185 /// Set the root url to use in all requests to the server.
186 /// It defaults to `https://firebase.googleapis.com/`.
187 ///
188 /// Returns the previously set root url.
189 pub fn root_url(&mut self, new_root_url: String) -> String {
190 std::mem::replace(&mut self._root_url, new_root_url)
191 }
192}
193
194// ############
195// SCHEMAS ###
196// ##########
197/// All fields are required.
198///
199/// # Activities
200///
201/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
202/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
203///
204/// * [add firebase projects](ProjectAddFirebaseCall) (request)
205#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
206#[serde_with::serde_as]
207#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
208pub struct AddFirebaseRequest {
209 /// **DEPRECATED.** _Instead, use product-specific REST APIs to work with the location of each resource in a Project. This field may be ignored, especially for newly provisioned projects after October 30, 2024._ The ID of the Project's ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location), which are resources associated with Google App Engine. The location must be one of the available [Google App Engine locations](https://cloud.google.com/about/locations#region).
210 #[serde(rename = "locationId")]
211 pub location_id: Option<String>,
212}
213
214impl common::RequestValue for AddFirebaseRequest {}
215
216/// There is no detailed description.
217///
218/// # Activities
219///
220/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
221/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
222///
223/// * [add google analytics projects](ProjectAddGoogleAnalyticCall) (request)
224#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
225#[serde_with::serde_as]
226#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
227pub struct AddGoogleAnalyticsRequest {
228 /// 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`.
229 #[serde(rename = "analyticsAccountId")]
230 pub analytics_account_id: Option<String>,
231 /// The ID for the existing Google Analytics property that you want to associate with the `FirebaseProject`.
232 #[serde(rename = "analyticsPropertyId")]
233 pub analytics_property_id: Option<String>,
234}
235
236impl common::RequestValue for AddGoogleAnalyticsRequest {}
237
238/// There is no detailed description.
239///
240/// # Activities
241///
242/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
243/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
244///
245/// * [get admin sdk config projects](ProjectGetAdminSdkConfigCall) (response)
246#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
247#[serde_with::serde_as]
248#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
249pub struct AdminSdkConfig {
250 /// **DEPRECATED.** _Instead, find the URL of the default Realtime Database instance 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. If the default instance for the Project has not yet been provisioned, the return might not contain a default instance. Note that the config that's generated for the Firebase console or the Firebase CLI uses the Realtime Database endpoint to populate this value for that config._ The URL of the default Firebase Realtime Database instance.
251 #[serde(rename = "databaseURL")]
252 pub database_url: Option<String>,
253 /// **DEPRECATED.** _Instead, use product-specific REST APIs to find the location of each resource in a Project. This field may not be populated, especially for newly provisioned projects after October 30, 2024._ The ID of the Project's ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location), which are resources associated with Google App Engine. The location is one of the available [App Engine locations](https://cloud.google.com/about/locations#region). This field is omitted if the location for default Google Cloud resources has not been set.
254 #[serde(rename = "locationId")]
255 pub location_id: Option<String>,
256 /// 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.
257 #[serde(rename = "projectId")]
258 pub project_id: Option<String>,
259 /// **DEPRECATED.** _Instead, find the name of 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. If the default bucket for the Project has not yet been provisioned, the return might not contain a default bucket. Note that the config that's generated for the Firebase console or the Firebase CLI uses the Cloud Storage for Firebase endpoint to populate this value for that config._ The name of the default Cloud Storage for Firebase bucket.
260 #[serde(rename = "storageBucket")]
261 pub storage_bucket: Option<String>,
262}
263
264impl common::ResponseResult for AdminSdkConfig {}
265
266/// There is no detailed description.
267///
268/// # Activities
269///
270/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
271/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
272///
273/// * [get analytics details projects](ProjectGetAnalyticsDetailCall) (response)
274#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
275#[serde_with::serde_as]
276#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
277pub struct AnalyticsDetails {
278 /// The Analytics Property object associated with the specified `FirebaseProject`. This object contains the details of the Google Analytics property associated with the Project.
279 #[serde(rename = "analyticsProperty")]
280 pub analytics_property: Option<AnalyticsProperty>,
281 /// - 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.
282 #[serde(rename = "streamMappings")]
283 pub stream_mappings: Option<Vec<StreamMapping>>,
284}
285
286impl common::ResponseResult for AnalyticsDetails {}
287
288/// Details of a Google Analytics property
289///
290/// This type is not used in any activity, and only used as *part* of another schema.
291///
292#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
293#[serde_with::serde_as]
294#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
295pub struct AnalyticsProperty {
296 /// Output only. The ID of the [Google Analytics account](https://www.google.com/analytics/) for the Google Analytics property associated with the specified FirebaseProject.
297 #[serde(rename = "analyticsAccountId")]
298 pub analytics_account_id: Option<String>,
299 /// The display name of the Google Analytics property associated with the specified `FirebaseProject`.
300 #[serde(rename = "displayName")]
301 pub display_name: Option<String>,
302 /// 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`.
303 pub id: Option<String>,
304}
305
306impl common::Part for AnalyticsProperty {}
307
308/// Details of a Firebase App for Android.
309///
310/// # Activities
311///
312/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
313/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
314///
315/// * [android apps create projects](ProjectAndroidAppCreateCall) (request)
316/// * [android apps get projects](ProjectAndroidAppGetCall) (response)
317/// * [android apps patch projects](ProjectAndroidAppPatchCall) (request|response)
318#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
319#[serde_with::serde_as]
320#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
321pub struct AndroidApp {
322 /// 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.
323 #[serde(rename = "apiKeyId")]
324 pub api_key_id: Option<String>,
325 /// 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.
326 #[serde(rename = "appId")]
327 pub app_id: Option<String>,
328 /// The user-assigned display name for the `AndroidApp`.
329 #[serde(rename = "displayName")]
330 pub display_name: Option<String>,
331 /// 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.
332 pub etag: Option<String>,
333 /// Output only. If the App has been removed from the Project, this is the timestamp of when the App is considered expired and will be permanently deleted. After this time, the App cannot be undeleted (that is, restored to the Project). This value is only provided if the App is in the `DELETED` state.
334 #[serde(rename = "expireTime")]
335 pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
336 /// 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)).
337 pub name: Option<String>,
338 /// Immutable. The canonical package name of the Android app as would appear in the Google Play Developer Console.
339 #[serde(rename = "packageName")]
340 pub package_name: Option<String>,
341 /// Output only. Immutable. A user-assigned unique identifier of the parent FirebaseProject for the `AndroidApp`.
342 #[serde(rename = "projectId")]
343 pub project_id: Option<String>,
344 /// The SHA1 certificate hashes for the AndroidApp.
345 #[serde(rename = "sha1Hashes")]
346 pub sha1_hashes: Option<Vec<String>>,
347 /// The SHA256 certificate hashes for the AndroidApp.
348 #[serde(rename = "sha256Hashes")]
349 pub sha256_hashes: Option<Vec<String>>,
350 /// Output only. The lifecycle state of the App.
351 pub state: Option<String>,
352}
353
354impl common::RequestValue for AndroidApp {}
355impl common::ResponseResult for AndroidApp {}
356
357/// Configuration metadata of a single Firebase App for Android.
358///
359/// # Activities
360///
361/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
362/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
363///
364/// * [android apps get config projects](ProjectAndroidAppGetConfigCall) (response)
365#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
366#[serde_with::serde_as]
367#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
368pub struct AndroidAppConfig {
369 /// The contents of the JSON configuration file.
370 #[serde(rename = "configFileContents")]
371 #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
372 pub config_file_contents: Option<Vec<u8>>,
373 /// The filename that the configuration artifact for the `AndroidApp` is typically saved as. For example: `google-services.json`
374 #[serde(rename = "configFilename")]
375 pub config_filename: Option<String>,
376}
377
378impl common::ResponseResult for AndroidAppConfig {}
379
380/// **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.
381///
382/// This type is not used in any activity, and only used as *part* of another schema.
383///
384#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
385#[serde_with::serde_as]
386#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
387pub struct DefaultResources {
388 /// Output only. **DEPRECATED.** _Instead, find the name of the default Firebase Hosting site using [ListSites](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/projects.sites/list) within the Firebase Hosting REST API. If the default Hosting site for the Project has not yet been provisioned, the return might not contain a default site._ The name of the default Firebase Hosting site, 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`
389 #[serde(rename = "hostingSite")]
390 pub hosting_site: Option<String>,
391 /// Output only. **DEPRECATED.** _Instead, use product-specific REST APIs to find the location of each resource in a Project. This field may not be populated, especially for newly provisioned projects after October 30, 2024._ The ID of the Project's ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location), which are resources associated with Google App Engine. The location is one of the available [Google App Engine locations](https://cloud.google.com/about/locations#region). This field is omitted if the location for default Google Cloud resources has not been set.
392 #[serde(rename = "locationId")]
393 pub location_id: Option<String>,
394 /// Output only. **DEPRECATED.** _Instead, find the name of the default Realtime Database instance 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. If the default Realtime Database instance for a Project has not yet been provisioned, 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`
395 #[serde(rename = "realtimeDatabaseInstance")]
396 pub realtime_database_instance: Option<String>,
397 /// Output only. **DEPRECATED.** _Instead, find the name of 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. If the default bucket for the Project has not yet been provisioned, the return might not contain a default bucket._ The name of the default Cloud Storage for Firebase bucket, in one of the following formats: * If provisioned _before_ October 30, 2024: PROJECT_ID.firebasestorage.app * If provisioned _on or after_ October 30, 2024: PROJECT_ID.firebasestorage.app
398 #[serde(rename = "storageBucket")]
399 pub storage_bucket: Option<String>,
400}
401
402impl common::Part for DefaultResources {}
403
404/// 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); }
405///
406/// # Activities
407///
408/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
409/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
410///
411/// * [android apps sha delete projects](ProjectAndroidAppShaDeleteCall) (response)
412/// * [remove analytics projects](ProjectRemoveAnalyticCall) (response)
413#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
414#[serde_with::serde_as]
415#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
416pub struct Empty {
417 _never_set: Option<bool>,
418}
419
420impl common::ResponseResult for Empty {}
421
422/// There is no detailed description.
423///
424/// # Activities
425///
426/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
427/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
428///
429/// * [default location finalize projects](ProjectDefaultLocationFinalizeCall) (request)
430#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
431#[serde_with::serde_as]
432#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
433pub struct FinalizeDefaultLocationRequest {
434 /// **DEPRECATED** The ID of the Project's ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location), which are resources associated with Google App Engine. The location must be one of the available [Google App Engine locations](https://cloud.google.com/about/locations#region).
435 #[serde(rename = "locationId")]
436 pub location_id: Option<String>,
437}
438
439impl common::RequestValue for FinalizeDefaultLocationRequest {}
440
441/// A high-level summary of an App.
442///
443/// This type is not used in any activity, and only used as *part* of another schema.
444///
445#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
446#[serde_with::serde_as]
447#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
448pub struct FirebaseAppInfo {
449 /// 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.
450 #[serde(rename = "apiKeyId")]
451 pub api_key_id: Option<String>,
452 /// 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.
453 #[serde(rename = "appId")]
454 pub app_id: Option<String>,
455 /// The user-assigned display name of the Firebase App.
456 #[serde(rename = "displayName")]
457 pub display_name: Option<String>,
458 /// Output only. If the App has been removed from the Project, this is the timestamp of when the App is considered expired and will be permanently deleted. After this time, the App cannot be undeleted (that is, restored to the Project). This value is only provided if the App is in the `DELETED` state.
459 #[serde(rename = "expireTime")]
460 pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
461 /// 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
462 pub name: Option<String>,
463 /// 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.
464 pub namespace: Option<String>,
465 /// The platform of the Firebase App.
466 pub platform: Option<String>,
467 /// Output only. The lifecycle state of the App.
468 pub state: Option<String>,
469}
470
471impl common::Part for FirebaseAppInfo {}
472
473/// 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 resources. You create a `FirebaseProject` by calling AddFirebase and specifying an *existing* [Google Cloud `Project`](https://cloud.google.com/resource-manager/reference/rest/v1/projects). This adds Firebase resources to the existing Google Cloud `Project`. Since a FirebaseProject is actually also a Google Cloud `Project`, a `FirebaseProject` has the same underlying Google Cloud identifiers (`projectNumber` and `projectId`). This allows for easy interop with Google APIs.
474///
475/// # Activities
476///
477/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
478/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
479///
480/// * [get projects](ProjectGetCall) (response)
481/// * [patch projects](ProjectPatchCall) (request|response)
482#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
483#[serde_with::serde_as]
484#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
485pub struct FirebaseProject {
486 /// 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.
487 pub annotations: Option<HashMap<String, String>>,
488 /// The user-assigned display name of the Project.
489 #[serde(rename = "displayName")]
490 pub display_name: Option<String>,
491 /// 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.
492 pub etag: Option<String>,
493 /// 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`.
494 pub name: Option<String>,
495 /// 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.
496 #[serde(rename = "projectId")]
497 pub project_id: Option<String>,
498 /// 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.
499 #[serde(rename = "projectNumber")]
500 #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
501 pub project_number: Option<i64>,
502 /// 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.
503 pub resources: Option<DefaultResources>,
504 /// Output only. The lifecycle state of the Project.
505 pub state: Option<String>,
506}
507
508impl common::RequestValue for FirebaseProject {}
509impl common::ResponseResult for FirebaseProject {}
510
511/// Details of a Firebase App for iOS.
512///
513/// # Activities
514///
515/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
516/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
517///
518/// * [ios apps create projects](ProjectIosAppCreateCall) (request)
519/// * [ios apps get projects](ProjectIosAppGetCall) (response)
520/// * [ios apps patch projects](ProjectIosAppPatchCall) (request|response)
521#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
522#[serde_with::serde_as]
523#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
524pub struct IosApp {
525 /// 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.
526 #[serde(rename = "apiKeyId")]
527 pub api_key_id: Option<String>,
528 /// 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.
529 #[serde(rename = "appId")]
530 pub app_id: Option<String>,
531 /// The automatically generated Apple ID assigned to the iOS app by Apple in the iOS App Store.
532 #[serde(rename = "appStoreId")]
533 pub app_store_id: Option<String>,
534 /// Immutable. The canonical bundle ID of the iOS app as it would appear in the iOS AppStore.
535 #[serde(rename = "bundleId")]
536 pub bundle_id: Option<String>,
537 /// The user-assigned display name for the `IosApp`.
538 #[serde(rename = "displayName")]
539 pub display_name: Option<String>,
540 /// 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.
541 pub etag: Option<String>,
542 /// Output only. If the App has been removed from the Project, this is the timestamp of when the App is considered expired and will be permanently deleted. After this time, the App cannot be undeleted (that is, restored to the Project). This value is only provided if the App is in the `DELETED` state.
543 #[serde(rename = "expireTime")]
544 pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
545 /// 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)).
546 pub name: Option<String>,
547 /// Output only. Immutable. A user-assigned unique identifier of the parent FirebaseProject for the `IosApp`.
548 #[serde(rename = "projectId")]
549 pub project_id: Option<String>,
550 /// Output only. The lifecycle state of the App.
551 pub state: Option<String>,
552 /// The Apple Developer Team ID associated with the App in the App Store.
553 #[serde(rename = "teamId")]
554 pub team_id: Option<String>,
555}
556
557impl common::RequestValue for IosApp {}
558impl common::ResponseResult for IosApp {}
559
560/// Configuration metadata of a single Firebase App for iOS.
561///
562/// # Activities
563///
564/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
565/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
566///
567/// * [ios apps get config projects](ProjectIosAppGetConfigCall) (response)
568#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
569#[serde_with::serde_as]
570#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
571pub struct IosAppConfig {
572 /// The content of the XML configuration file.
573 #[serde(rename = "configFileContents")]
574 #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
575 pub config_file_contents: Option<Vec<u8>>,
576 /// The filename that the configuration artifact for the `IosApp` is typically saved as. For example: `GoogleService-Info.plist`
577 #[serde(rename = "configFilename")]
578 pub config_filename: Option<String>,
579}
580
581impl common::ResponseResult for IosAppConfig {}
582
583/// There is no detailed description.
584///
585/// # Activities
586///
587/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
588/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
589///
590/// * [android apps list projects](ProjectAndroidAppListCall) (response)
591#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
592#[serde_with::serde_as]
593#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
594pub struct ListAndroidAppsResponse {
595 /// List of each `AndroidApp` associated with the specified `FirebaseProject`.
596 pub apps: Option<Vec<AndroidApp>>,
597 /// 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.
598 #[serde(rename = "nextPageToken")]
599 pub next_page_token: Option<String>,
600}
601
602impl common::ResponseResult for ListAndroidAppsResponse {}
603
604/// There is no detailed description.
605///
606/// # Activities
607///
608/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
609/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
610///
611/// * [available locations list projects](ProjectAvailableLocationListCall) (response)
612#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
613#[serde_with::serde_as]
614#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
615pub struct ListAvailableLocationsResponse {
616 /// One page of results from a call to `ListAvailableLocations`.
617 pub locations: Option<Vec<Location>>,
618 /// 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.
619 #[serde(rename = "nextPageToken")]
620 pub next_page_token: Option<String>,
621}
622
623impl common::ResponseResult for ListAvailableLocationsResponse {}
624
625/// There is no detailed description.
626///
627/// # Activities
628///
629/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
630/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
631///
632/// * [list available projects](AvailableProjectListCall) (response)
633#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
634#[serde_with::serde_as]
635#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
636pub struct ListAvailableProjectsResponse {
637 /// 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.
638 #[serde(rename = "nextPageToken")]
639 pub next_page_token: Option<String>,
640 /// The list of Google Cloud `Projects` which can have Firebase resources added to them.
641 #[serde(rename = "projectInfo")]
642 pub project_info: Option<Vec<ProjectInfo>>,
643}
644
645impl common::ResponseResult for ListAvailableProjectsResponse {}
646
647/// There is no detailed description.
648///
649/// # Activities
650///
651/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
652/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
653///
654/// * [list projects](ProjectListCall) (response)
655#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
656#[serde_with::serde_as]
657#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
658pub struct ListFirebaseProjectsResponse {
659 /// 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.
660 #[serde(rename = "nextPageToken")]
661 pub next_page_token: Option<String>,
662 /// One page of the list of Projects that are accessible to the caller.
663 pub results: Option<Vec<FirebaseProject>>,
664}
665
666impl common::ResponseResult for ListFirebaseProjectsResponse {}
667
668/// There is no detailed description.
669///
670/// # Activities
671///
672/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
673/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
674///
675/// * [ios apps list projects](ProjectIosAppListCall) (response)
676#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
677#[serde_with::serde_as]
678#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
679pub struct ListIosAppsResponse {
680 /// List of each `IosApp` associated with the specified `FirebaseProject`.
681 pub apps: Option<Vec<IosApp>>,
682 /// 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.
683 #[serde(rename = "nextPageToken")]
684 pub next_page_token: Option<String>,
685}
686
687impl common::ResponseResult for ListIosAppsResponse {}
688
689/// There is no detailed description.
690///
691/// # Activities
692///
693/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
694/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
695///
696/// * [android apps sha list projects](ProjectAndroidAppShaListCall) (response)
697#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
698#[serde_with::serde_as]
699#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
700pub struct ListShaCertificatesResponse {
701 /// The list of each `ShaCertificate` associated with the `AndroidApp`.
702 pub certificates: Option<Vec<ShaCertificate>>,
703}
704
705impl common::ResponseResult for ListShaCertificatesResponse {}
706
707/// There is no detailed description.
708///
709/// # Activities
710///
711/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
712/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
713///
714/// * [web apps list projects](ProjectWebAppListCall) (response)
715#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
716#[serde_with::serde_as]
717#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
718pub struct ListWebAppsResponse {
719 /// List of each `WebApp` associated with the specified `FirebaseProject`.
720 pub apps: Option<Vec<WebApp>>,
721 /// 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.
722 #[serde(rename = "nextPageToken")]
723 pub next_page_token: Option<String>,
724}
725
726impl common::ResponseResult for ListWebAppsResponse {}
727
728/// **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 ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location) that can be selected for a FirebaseProject. These are resources associated with Google App Engine.
729///
730/// This type is not used in any activity, and only used as *part* of another schema.
731///
732#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
733#[serde_with::serde_as]
734#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
735pub struct Location {
736 /// Products and services that are available in the location for default Google Cloud resources.
737 pub features: Option<Vec<String>>,
738 /// The ID of the Project's location for default Google Cloud resources. It will be one of the available [Google App Engine locations](https://cloud.google.com/about/locations#region).
739 #[serde(rename = "locationId")]
740 pub location_id: Option<String>,
741 /// Indicates whether the location for default Google Cloud resources is a [regional or multi-regional location](https://firebase.google.com/docs/projects/locations#types) for data replication.
742 #[serde(rename = "type")]
743 pub type_: Option<String>,
744}
745
746impl common::Part for Location {}
747
748/// This resource represents a long-running operation that is the result of a network API call.
749///
750/// # Activities
751///
752/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
753/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
754///
755/// * [get operations](OperationGetCall) (response)
756/// * [android apps create projects](ProjectAndroidAppCreateCall) (response)
757/// * [android apps remove projects](ProjectAndroidAppRemoveCall) (response)
758/// * [android apps undelete projects](ProjectAndroidAppUndeleteCall) (response)
759/// * [default location finalize projects](ProjectDefaultLocationFinalizeCall) (response)
760/// * [ios apps create projects](ProjectIosAppCreateCall) (response)
761/// * [ios apps remove projects](ProjectIosAppRemoveCall) (response)
762/// * [ios apps undelete projects](ProjectIosAppUndeleteCall) (response)
763/// * [web apps create projects](ProjectWebAppCreateCall) (response)
764/// * [web apps remove projects](ProjectWebAppRemoveCall) (response)
765/// * [web apps undelete projects](ProjectWebAppUndeleteCall) (response)
766/// * [add firebase projects](ProjectAddFirebaseCall) (response)
767/// * [add google analytics projects](ProjectAddGoogleAnalyticCall) (response)
768#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
769#[serde_with::serde_as]
770#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
771pub struct Operation {
772 /// 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.
773 pub done: Option<bool>,
774 /// The error result of the operation in case of failure or cancellation.
775 pub error: Option<Status>,
776 /// 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.
777 pub metadata: Option<HashMap<String, serde_json::Value>>,
778 /// 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}`.
779 pub name: Option<String>,
780 /// 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`.
781 pub response: Option<HashMap<String, serde_json::Value>>,
782}
783
784impl common::Resource for Operation {}
785impl common::ResponseResult for Operation {}
786
787/// A reference to a Google Cloud `Project`.
788///
789/// This type is not used in any activity, and only used as *part* of another schema.
790///
791#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
792#[serde_with::serde_as]
793#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
794pub struct ProjectInfo {
795 /// The user-assigned display name of the Google Cloud `Project`, for example: `My App`.
796 #[serde(rename = "displayName")]
797 pub display_name: Option<String>,
798 /// **DEPRECATED** _Instead, use product-specific REST APIs to work with the location of each resource in a Project. This field may not be populated, especially for newly provisioned projects after October 30, 2024._ The ID of the Project's ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location). The location is one of the available [Google App Engine locations](https://cloud.google.com/about/locations#region). Not all Projects will have this field populated. If it is not populated, it means that the Project does not yet have a location for default Google Cloud resources.
799 #[serde(rename = "locationId")]
800 pub location_id: Option<String>,
801 /// The resource name of the Google Cloud `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.
802 pub project: Option<String>,
803}
804
805impl common::Part for ProjectInfo {}
806
807/// There is no detailed description.
808///
809/// # Activities
810///
811/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
812/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
813///
814/// * [remove analytics projects](ProjectRemoveAnalyticCall) (request)
815#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
816#[serde_with::serde_as]
817#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
818pub struct RemoveAnalyticsRequest {
819 /// 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.
820 #[serde(rename = "analyticsPropertyId")]
821 pub analytics_property_id: Option<String>,
822}
823
824impl common::RequestValue for RemoveAnalyticsRequest {}
825
826/// There is no detailed description.
827///
828/// # Activities
829///
830/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
831/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
832///
833/// * [android apps remove projects](ProjectAndroidAppRemoveCall) (request)
834#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
835#[serde_with::serde_as]
836#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
837pub struct RemoveAndroidAppRequest {
838 /// If set to true, and the App is not found, the request will succeed but no action will be taken on the server.
839 #[serde(rename = "allowMissing")]
840 pub allow_missing: Option<bool>,
841 /// Checksum provided in the AndroidApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
842 pub etag: Option<String>,
843 /// Determines whether to _immediately_ delete the AndroidApp. If set to true, the App is immediately deleted from the Project and cannot be undeleted (that is, 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.
844 pub immediate: Option<bool>,
845 /// If set to true, the request is only validated. The App will _not_ be removed.
846 #[serde(rename = "validateOnly")]
847 pub validate_only: Option<bool>,
848}
849
850impl common::RequestValue for RemoveAndroidAppRequest {}
851
852/// There is no detailed description.
853///
854/// # Activities
855///
856/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
857/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
858///
859/// * [ios apps remove projects](ProjectIosAppRemoveCall) (request)
860#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
861#[serde_with::serde_as]
862#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
863pub struct RemoveIosAppRequest {
864 /// If set to true, and the App is not found, the request will succeed but no action will be taken on the server.
865 #[serde(rename = "allowMissing")]
866 pub allow_missing: Option<bool>,
867 /// Checksum provided in the IosApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
868 pub etag: Option<String>,
869 /// Determines whether to _immediately_ delete the IosApp. If set to true, the App is immediately deleted from the Project and cannot be undeleted (that is, 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
870 pub immediate: Option<bool>,
871 /// If set to true, the request is only validated. The App will _not_ be removed.
872 #[serde(rename = "validateOnly")]
873 pub validate_only: Option<bool>,
874}
875
876impl common::RequestValue for RemoveIosAppRequest {}
877
878/// There is no detailed description.
879///
880/// # Activities
881///
882/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
883/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
884///
885/// * [web apps remove projects](ProjectWebAppRemoveCall) (request)
886#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
887#[serde_with::serde_as]
888#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
889pub struct RemoveWebAppRequest {
890 /// If set to true, and the App is not found, the request will succeed but no action will be taken on the server.
891 #[serde(rename = "allowMissing")]
892 pub allow_missing: Option<bool>,
893 /// Checksum provided in the WebApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
894 pub etag: Option<String>,
895 /// Determines whether to _immediately_ delete the WebApp. If set to true, the App is immediately deleted from the Project and cannot be undeleted (that is, 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
896 pub immediate: Option<bool>,
897 /// If set to true, the request is only validated. The App will _not_ be removed.
898 #[serde(rename = "validateOnly")]
899 pub validate_only: Option<bool>,
900}
901
902impl common::RequestValue for RemoveWebAppRequest {}
903
904/// There is no detailed description.
905///
906/// # Activities
907///
908/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
909/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
910///
911/// * [search apps projects](ProjectSearchAppCall) (response)
912#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
913#[serde_with::serde_as]
914#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
915pub struct SearchFirebaseAppsResponse {
916 /// One page of results from a call to `SearchFirebaseApps`.
917 pub apps: Option<Vec<FirebaseAppInfo>>,
918 /// 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.
919 #[serde(rename = "nextPageToken")]
920 pub next_page_token: Option<String>,
921}
922
923impl common::ResponseResult for SearchFirebaseAppsResponse {}
924
925/// A SHA-1 or SHA-256 certificate associated with the AndroidApp.
926///
927/// # Activities
928///
929/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
930/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
931///
932/// * [android apps sha create projects](ProjectAndroidAppShaCreateCall) (request|response)
933#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
934#[serde_with::serde_as]
935#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
936pub struct ShaCertificate {
937 /// The type of SHA certificate encoded in the hash.
938 #[serde(rename = "certType")]
939 pub cert_type: Option<String>,
940 /// 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)).
941 pub name: Option<String>,
942 /// The certificate hash for the `AndroidApp`.
943 #[serde(rename = "shaHash")]
944 pub sha_hash: Option<String>,
945}
946
947impl common::RequestValue for ShaCertificate {}
948impl common::ResponseResult for ShaCertificate {}
949
950/// 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).
951///
952/// This type is not used in any activity, and only used as *part* of another schema.
953///
954#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
955#[serde_with::serde_as]
956#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
957pub struct Status {
958 /// The status code, which should be an enum value of google.rpc.Code.
959 pub code: Option<i32>,
960 /// A list of messages that carry the error details. There is a common set of message types for APIs to use.
961 pub details: Option<Vec<HashMap<String, serde_json::Value>>>,
962 /// 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.
963 pub message: Option<String>,
964}
965
966impl common::Part for Status {}
967
968/// A mapping of a Firebase App to a Google Analytics data stream
969///
970/// This type is not used in any activity, and only used as *part* of another schema.
971///
972#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
973#[serde_with::serde_as]
974#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
975pub struct StreamMapping {
976 /// 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.
977 pub app: Option<String>,
978 /// 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).
979 #[serde(rename = "measurementId")]
980 pub measurement_id: Option<String>,
981 /// 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).
982 #[serde(rename = "streamId")]
983 #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
984 pub stream_id: Option<i64>,
985}
986
987impl common::Part for StreamMapping {}
988
989/// There is no detailed description.
990///
991/// # Activities
992///
993/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
994/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
995///
996/// * [android apps undelete projects](ProjectAndroidAppUndeleteCall) (request)
997#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
998#[serde_with::serde_as]
999#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1000pub struct UndeleteAndroidAppRequest {
1001 /// Checksum provided in the AndroidApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
1002 pub etag: Option<String>,
1003 /// If set to true, the request is only validated. The App will _not_ be undeleted.
1004 #[serde(rename = "validateOnly")]
1005 pub validate_only: Option<bool>,
1006}
1007
1008impl common::RequestValue for UndeleteAndroidAppRequest {}
1009
1010/// There is no detailed description.
1011///
1012/// # Activities
1013///
1014/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1015/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1016///
1017/// * [ios apps undelete projects](ProjectIosAppUndeleteCall) (request)
1018#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1019#[serde_with::serde_as]
1020#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1021pub struct UndeleteIosAppRequest {
1022 /// Checksum provided in the IosApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
1023 pub etag: Option<String>,
1024 /// If set to true, the request is only validated. The App will _not_ be undeleted.
1025 #[serde(rename = "validateOnly")]
1026 pub validate_only: Option<bool>,
1027}
1028
1029impl common::RequestValue for UndeleteIosAppRequest {}
1030
1031/// There is no detailed description.
1032///
1033/// # Activities
1034///
1035/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1036/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1037///
1038/// * [web apps undelete projects](ProjectWebAppUndeleteCall) (request)
1039#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1040#[serde_with::serde_as]
1041#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1042pub struct UndeleteWebAppRequest {
1043 /// Checksum provided in the WebApp resource. If provided, this checksum ensures that the client has an up-to-date value before proceeding.
1044 pub etag: Option<String>,
1045 /// If set to true, the request is only validated. The App will _not_ be undeleted.
1046 #[serde(rename = "validateOnly")]
1047 pub validate_only: Option<bool>,
1048}
1049
1050impl common::RequestValue for UndeleteWebAppRequest {}
1051
1052/// Details of a Firebase App for the web.
1053///
1054/// # Activities
1055///
1056/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1057/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1058///
1059/// * [web apps create projects](ProjectWebAppCreateCall) (request)
1060/// * [web apps get projects](ProjectWebAppGetCall) (response)
1061/// * [web apps patch projects](ProjectWebAppPatchCall) (request|response)
1062#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1063#[serde_with::serde_as]
1064#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1065pub struct WebApp {
1066 /// 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.
1067 #[serde(rename = "apiKeyId")]
1068 pub api_key_id: Option<String>,
1069 /// 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.
1070 #[serde(rename = "appId")]
1071 pub app_id: Option<String>,
1072 /// The URLs where the `WebApp` is hosted.
1073 #[serde(rename = "appUrls")]
1074 pub app_urls: Option<Vec<String>>,
1075 /// The user-assigned display name for the `WebApp`.
1076 #[serde(rename = "displayName")]
1077 pub display_name: Option<String>,
1078 /// 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.
1079 pub etag: Option<String>,
1080 /// Output only. If the App has been removed from the Project, this is the timestamp of when the App is considered expired and will be permanently deleted. After this time, the App cannot be undeleted (that is, restored to the Project). This value is only provided if the App is in the `DELETED` state.
1081 #[serde(rename = "expireTime")]
1082 pub expire_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1083 /// 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)).
1084 pub name: Option<String>,
1085 /// Output only. Immutable. A user-assigned unique identifier of the parent FirebaseProject for the `WebApp`.
1086 #[serde(rename = "projectId")]
1087 pub project_id: Option<String>,
1088 /// Output only. The lifecycle state of the App.
1089 pub state: Option<String>,
1090 /// 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.
1091 #[serde(rename = "webId")]
1092 pub web_id: Option<String>,
1093}
1094
1095impl common::RequestValue for WebApp {}
1096impl common::ResponseResult for WebApp {}
1097
1098/// Configuration metadata of a single Firebase App for the web.
1099///
1100/// # Activities
1101///
1102/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1103/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1104///
1105/// * [web apps get config projects](ProjectWebAppGetConfigCall) (response)
1106#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1107#[serde_with::serde_as]
1108#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1109pub struct WebAppConfig {
1110 /// 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`.
1111 #[serde(rename = "apiKey")]
1112 pub api_key: Option<String>,
1113 /// Immutable. The globally unique, Firebase-assigned identifier for the `WebApp`.
1114 #[serde(rename = "appId")]
1115 pub app_id: Option<String>,
1116 /// The domain Firebase Auth configures for OAuth redirects, in the format: PROJECT_ID.firebaseapp.com
1117 #[serde(rename = "authDomain")]
1118 pub auth_domain: Option<String>,
1119 /// **DEPRECATED.** _Instead, find the URL of the default Realtime Database instance 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. If the default instance for the Project has not yet been provisioned, the return might not contain a default instance. Note that the config that's generated for the Firebase console or the Firebase CLI uses the Realtime Database endpoint to populate this value for that config._ The URL of the default Firebase Realtime Database instance.
1120 #[serde(rename = "databaseURL")]
1121 pub database_url: Option<String>,
1122 /// **DEPRECATED.** _Instead, use product-specific REST APIs to find the location of each resource in a Project. This field may not be populated, especially for newly provisioned projects after October 30, 2024._ The ID of the Project's ["location for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location), which are resources associated with Google App Engine. The location is one of the available [App Engine locations](https://cloud.google.com/about/locations#region). This field is omitted if the location for default Google Cloud resources has not been set.
1123 #[serde(rename = "locationId")]
1124 pub location_id: Option<String>,
1125 /// 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.
1126 #[serde(rename = "measurementId")]
1127 pub measurement_id: Option<String>,
1128 /// The sender ID for use with Firebase Cloud Messaging.
1129 #[serde(rename = "messagingSenderId")]
1130 pub messaging_sender_id: Option<String>,
1131 /// Immutable. A user-assigned unique identifier for the `FirebaseProject`.
1132 #[serde(rename = "projectId")]
1133 pub project_id: Option<String>,
1134 /// 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 Google Cloud or third-party services.
1135 #[serde(rename = "projectNumber")]
1136 pub project_number: Option<String>,
1137 /// Optional. Duplicate field for the URL of the default Realtime Database instances (if the default instance has been provisioned). If the request asks for the V2 config format, this field will be populated instead of `realtime_database_instance_uri`.
1138 #[serde(rename = "realtimeDatabaseUrl")]
1139 pub realtime_database_url: Option<String>,
1140 /// **DEPRECATED.** _Instead, find the name of 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. If the default bucket for the Project has not yet been provisioned, the return might not contain a default bucket. Note that the config that's generated for the Firebase console or the Firebase CLI uses the Cloud Storage for Firebase endpoint to populate this value for that config._ The name of the default Cloud Storage for Firebase bucket.
1141 #[serde(rename = "storageBucket")]
1142 pub storage_bucket: Option<String>,
1143 /// Version of the config specification.
1144 pub version: Option<String>,
1145}
1146
1147impl common::ResponseResult for WebAppConfig {}
1148
1149// ###################
1150// MethodBuilders ###
1151// #################
1152
1153/// A builder providing access to all methods supported on *availableProject* resources.
1154/// It is not used directly, but through the [`FirebaseManagement`] hub.
1155///
1156/// # Example
1157///
1158/// Instantiate a resource builder
1159///
1160/// ```test_harness,no_run
1161/// extern crate hyper;
1162/// extern crate hyper_rustls;
1163/// extern crate google_firebase1_beta1 as firebase1_beta1;
1164///
1165/// # async fn dox() {
1166/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1167///
1168/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1169/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
1170/// .with_native_roots()
1171/// .unwrap()
1172/// .https_only()
1173/// .enable_http2()
1174/// .build();
1175///
1176/// let executor = hyper_util::rt::TokioExecutor::new();
1177/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1178/// secret,
1179/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1180/// yup_oauth2::client::CustomHyperClientBuilder::from(
1181/// hyper_util::client::legacy::Client::builder(executor).build(connector),
1182/// ),
1183/// ).build().await.unwrap();
1184///
1185/// let client = hyper_util::client::legacy::Client::builder(
1186/// hyper_util::rt::TokioExecutor::new()
1187/// )
1188/// .build(
1189/// hyper_rustls::HttpsConnectorBuilder::new()
1190/// .with_native_roots()
1191/// .unwrap()
1192/// .https_or_http()
1193/// .enable_http2()
1194/// .build()
1195/// );
1196/// let mut hub = FirebaseManagement::new(client, auth);
1197/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1198/// // like `list(...)`
1199/// // to build up your call.
1200/// let rb = hub.available_projects();
1201/// # }
1202/// ```
1203pub struct AvailableProjectMethods<'a, C>
1204where
1205 C: 'a,
1206{
1207 hub: &'a FirebaseManagement<C>,
1208}
1209
1210impl<'a, C> common::MethodsBuilder for AvailableProjectMethods<'a, C> {}
1211
1212impl<'a, C> AvailableProjectMethods<'a, C> {
1213 /// Create a builder to help you perform the following task:
1214 ///
1215 /// Lists each [Google Cloud `Project`](https://cloud.google.com/resource-manager/reference/rest/v1/projects) that can have Firebase resources added and Firebase services enabled. 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.
1216 pub fn list(&self) -> AvailableProjectListCall<'a, C> {
1217 AvailableProjectListCall {
1218 hub: self.hub,
1219 _page_token: Default::default(),
1220 _page_size: Default::default(),
1221 _delegate: Default::default(),
1222 _additional_params: Default::default(),
1223 _scopes: Default::default(),
1224 }
1225 }
1226}
1227
1228/// A builder providing access to all methods supported on *operation* resources.
1229/// It is not used directly, but through the [`FirebaseManagement`] hub.
1230///
1231/// # Example
1232///
1233/// Instantiate a resource builder
1234///
1235/// ```test_harness,no_run
1236/// extern crate hyper;
1237/// extern crate hyper_rustls;
1238/// extern crate google_firebase1_beta1 as firebase1_beta1;
1239///
1240/// # async fn dox() {
1241/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1242///
1243/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1244/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
1245/// .with_native_roots()
1246/// .unwrap()
1247/// .https_only()
1248/// .enable_http2()
1249/// .build();
1250///
1251/// let executor = hyper_util::rt::TokioExecutor::new();
1252/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1253/// secret,
1254/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1255/// yup_oauth2::client::CustomHyperClientBuilder::from(
1256/// hyper_util::client::legacy::Client::builder(executor).build(connector),
1257/// ),
1258/// ).build().await.unwrap();
1259///
1260/// let client = hyper_util::client::legacy::Client::builder(
1261/// hyper_util::rt::TokioExecutor::new()
1262/// )
1263/// .build(
1264/// hyper_rustls::HttpsConnectorBuilder::new()
1265/// .with_native_roots()
1266/// .unwrap()
1267/// .https_or_http()
1268/// .enable_http2()
1269/// .build()
1270/// );
1271/// let mut hub = FirebaseManagement::new(client, auth);
1272/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1273/// // like `get(...)`
1274/// // to build up your call.
1275/// let rb = hub.operations();
1276/// # }
1277/// ```
1278pub struct OperationMethods<'a, C>
1279where
1280 C: 'a,
1281{
1282 hub: &'a FirebaseManagement<C>,
1283}
1284
1285impl<'a, C> common::MethodsBuilder for OperationMethods<'a, C> {}
1286
1287impl<'a, C> OperationMethods<'a, C> {
1288 /// Create a builder to help you perform the following task:
1289 ///
1290 /// 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.
1291 ///
1292 /// # Arguments
1293 ///
1294 /// * `name` - The name of the operation resource.
1295 pub fn get(&self, name: &str) -> OperationGetCall<'a, C> {
1296 OperationGetCall {
1297 hub: self.hub,
1298 _name: name.to_string(),
1299 _delegate: Default::default(),
1300 _additional_params: Default::default(),
1301 _scopes: Default::default(),
1302 }
1303 }
1304}
1305
1306/// A builder providing access to all methods supported on *project* resources.
1307/// It is not used directly, but through the [`FirebaseManagement`] hub.
1308///
1309/// # Example
1310///
1311/// Instantiate a resource builder
1312///
1313/// ```test_harness,no_run
1314/// extern crate hyper;
1315/// extern crate hyper_rustls;
1316/// extern crate google_firebase1_beta1 as firebase1_beta1;
1317///
1318/// # async fn dox() {
1319/// use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1320///
1321/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1322/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
1323/// .with_native_roots()
1324/// .unwrap()
1325/// .https_only()
1326/// .enable_http2()
1327/// .build();
1328///
1329/// let executor = hyper_util::rt::TokioExecutor::new();
1330/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1331/// secret,
1332/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1333/// yup_oauth2::client::CustomHyperClientBuilder::from(
1334/// hyper_util::client::legacy::Client::builder(executor).build(connector),
1335/// ),
1336/// ).build().await.unwrap();
1337///
1338/// let client = hyper_util::client::legacy::Client::builder(
1339/// hyper_util::rt::TokioExecutor::new()
1340/// )
1341/// .build(
1342/// hyper_rustls::HttpsConnectorBuilder::new()
1343/// .with_native_roots()
1344/// .unwrap()
1345/// .https_or_http()
1346/// .enable_http2()
1347/// .build()
1348/// );
1349/// let mut hub = FirebaseManagement::new(client, auth);
1350/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1351/// // 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(...)`
1352/// // to build up your call.
1353/// let rb = hub.projects();
1354/// # }
1355/// ```
1356pub struct ProjectMethods<'a, C>
1357where
1358 C: 'a,
1359{
1360 hub: &'a FirebaseManagement<C>,
1361}
1362
1363impl<'a, C> common::MethodsBuilder for ProjectMethods<'a, C> {}
1364
1365impl<'a, C> ProjectMethods<'a, C> {
1366 /// Create a builder to help you perform the following task:
1367 ///
1368 /// Adds a ShaCertificate to the specified AndroidApp.
1369 ///
1370 /// # Arguments
1371 ///
1372 /// * `request` - No description provided.
1373 /// * `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.
1374 pub fn android_apps_sha_create(
1375 &self,
1376 request: ShaCertificate,
1377 parent: &str,
1378 ) -> ProjectAndroidAppShaCreateCall<'a, C> {
1379 ProjectAndroidAppShaCreateCall {
1380 hub: self.hub,
1381 _request: request,
1382 _parent: parent.to_string(),
1383 _delegate: Default::default(),
1384 _additional_params: Default::default(),
1385 _scopes: Default::default(),
1386 }
1387 }
1388
1389 /// Create a builder to help you perform the following task:
1390 ///
1391 /// Removes a ShaCertificate from the specified AndroidApp.
1392 ///
1393 /// # Arguments
1394 ///
1395 /// * `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).
1396 pub fn android_apps_sha_delete(&self, name: &str) -> ProjectAndroidAppShaDeleteCall<'a, C> {
1397 ProjectAndroidAppShaDeleteCall {
1398 hub: self.hub,
1399 _name: name.to_string(),
1400 _delegate: Default::default(),
1401 _additional_params: Default::default(),
1402 _scopes: Default::default(),
1403 }
1404 }
1405
1406 /// Create a builder to help you perform the following task:
1407 ///
1408 /// Lists the SHA-1 and SHA-256 certificates for the specified AndroidApp.
1409 ///
1410 /// # Arguments
1411 ///
1412 /// * `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.
1413 pub fn android_apps_sha_list(&self, parent: &str) -> ProjectAndroidAppShaListCall<'a, C> {
1414 ProjectAndroidAppShaListCall {
1415 hub: self.hub,
1416 _parent: parent.to_string(),
1417 _delegate: Default::default(),
1418 _additional_params: Default::default(),
1419 _scopes: Default::default(),
1420 }
1421 }
1422
1423 /// Create a builder to help you perform the following task:
1424 ///
1425 /// 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`.
1426 ///
1427 /// # Arguments
1428 ///
1429 /// * `request` - No description provided.
1430 /// * `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.
1431 pub fn android_apps_create(
1432 &self,
1433 request: AndroidApp,
1434 parent: &str,
1435 ) -> ProjectAndroidAppCreateCall<'a, C> {
1436 ProjectAndroidAppCreateCall {
1437 hub: self.hub,
1438 _request: request,
1439 _parent: parent.to_string(),
1440 _delegate: Default::default(),
1441 _additional_params: Default::default(),
1442 _scopes: Default::default(),
1443 }
1444 }
1445
1446 /// Create a builder to help you perform the following task:
1447 ///
1448 /// Gets the specified AndroidApp.
1449 ///
1450 /// # Arguments
1451 ///
1452 /// * `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.
1453 pub fn android_apps_get(&self, name: &str) -> ProjectAndroidAppGetCall<'a, C> {
1454 ProjectAndroidAppGetCall {
1455 hub: self.hub,
1456 _name: name.to_string(),
1457 _delegate: Default::default(),
1458 _additional_params: Default::default(),
1459 _scopes: Default::default(),
1460 }
1461 }
1462
1463 /// Create a builder to help you perform the following task:
1464 ///
1465 /// Gets the configuration artifact associated with the specified AndroidApp.
1466 ///
1467 /// # Arguments
1468 ///
1469 /// * `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.
1470 pub fn android_apps_get_config(&self, name: &str) -> ProjectAndroidAppGetConfigCall<'a, C> {
1471 ProjectAndroidAppGetConfigCall {
1472 hub: self.hub,
1473 _name: name.to_string(),
1474 _delegate: Default::default(),
1475 _additional_params: Default::default(),
1476 _scopes: Default::default(),
1477 }
1478 }
1479
1480 /// Create a builder to help you perform the following task:
1481 ///
1482 /// 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`.
1483 ///
1484 /// # Arguments
1485 ///
1486 /// * `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.
1487 pub fn android_apps_list(&self, parent: &str) -> ProjectAndroidAppListCall<'a, C> {
1488 ProjectAndroidAppListCall {
1489 hub: self.hub,
1490 _parent: parent.to_string(),
1491 _show_deleted: Default::default(),
1492 _page_token: Default::default(),
1493 _page_size: Default::default(),
1494 _delegate: Default::default(),
1495 _additional_params: Default::default(),
1496 _scopes: Default::default(),
1497 }
1498 }
1499
1500 /// Create a builder to help you perform the following task:
1501 ///
1502 /// Updates the attributes of the specified AndroidApp.
1503 ///
1504 /// # Arguments
1505 ///
1506 /// * `request` - No description provided.
1507 /// * `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)).
1508 pub fn android_apps_patch(
1509 &self,
1510 request: AndroidApp,
1511 name: &str,
1512 ) -> ProjectAndroidAppPatchCall<'a, C> {
1513 ProjectAndroidAppPatchCall {
1514 hub: self.hub,
1515 _request: request,
1516 _name: name.to_string(),
1517 _update_mask: Default::default(),
1518 _delegate: Default::default(),
1519 _additional_params: Default::default(),
1520 _scopes: Default::default(),
1521 }
1522 }
1523
1524 /// Create a builder to help you perform the following task:
1525 ///
1526 /// Removes the specified AndroidApp from the FirebaseProject.
1527 ///
1528 /// # Arguments
1529 ///
1530 /// * `request` - No description provided.
1531 /// * `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.
1532 pub fn android_apps_remove(
1533 &self,
1534 request: RemoveAndroidAppRequest,
1535 name: &str,
1536 ) -> ProjectAndroidAppRemoveCall<'a, C> {
1537 ProjectAndroidAppRemoveCall {
1538 hub: self.hub,
1539 _request: request,
1540 _name: name.to_string(),
1541 _delegate: Default::default(),
1542 _additional_params: Default::default(),
1543 _scopes: Default::default(),
1544 }
1545 }
1546
1547 /// Create a builder to help you perform the following task:
1548 ///
1549 /// Restores the specified AndroidApp to the FirebaseProject.
1550 ///
1551 /// # Arguments
1552 ///
1553 /// * `request` - No description provided.
1554 /// * `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.
1555 pub fn android_apps_undelete(
1556 &self,
1557 request: UndeleteAndroidAppRequest,
1558 name: &str,
1559 ) -> ProjectAndroidAppUndeleteCall<'a, C> {
1560 ProjectAndroidAppUndeleteCall {
1561 hub: self.hub,
1562 _request: request,
1563 _name: name.to_string(),
1564 _delegate: Default::default(),
1565 _additional_params: Default::default(),
1566 _scopes: Default::default(),
1567 }
1568 }
1569
1570 /// Create a builder to help you perform the following task:
1571 ///
1572 /// **DECOMMISSIONED.** **If called, this endpoint will return a 404 error.** _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 ["locations for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location) for the specified Project (including a FirebaseProject). One of these locations can be selected as the Project's location for default Google Cloud resources, which is the geographical location where the Project's resources associated with Google App Engine (such as the default Cloud Firestore instance) will be provisioned by default. However, if the location for default Google Cloud resources 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 locations. To list all 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.
1573 ///
1574 /// # Arguments
1575 ///
1576 /// * `parent` - The FirebaseProject for which to list [locations for default Google Cloud resources](https://firebase.google.com/docs/projects/locations#default-cloud-location), 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.
1577 pub fn available_locations_list(
1578 &self,
1579 parent: &str,
1580 ) -> ProjectAvailableLocationListCall<'a, C> {
1581 ProjectAvailableLocationListCall {
1582 hub: self.hub,
1583 _parent: parent.to_string(),
1584 _page_token: Default::default(),
1585 _page_size: Default::default(),
1586 _delegate: Default::default(),
1587 _additional_params: Default::default(),
1588 _scopes: Default::default(),
1589 }
1590 }
1591
1592 /// Create a builder to help you perform the following task:
1593 ///
1594 /// **DECOMMISSIONED.** **If called, this endpoint will return a 404 error.** *Instead, use the applicable resource-specific REST API to set the location for each resource used in your Project.* Sets the [“location for default Google Cloud resources”](https://firebase.google.com/docs/projects/locations#default-cloud-location) for the specified FirebaseProject. This method creates a Google 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 [App Engine locations](https://cloud.google.com/about/locations#region). After the location for default Google Cloud resources is finalized, or if it was already set, it cannot be changed. The location for default Google Cloud resources for the specified `FirebaseProject` might already be set because either the underlying Google Cloud `Project` already has an App Engine application or `FinalizeDefaultLocation` was previously called with a specified `locationId`. 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.
1595 ///
1596 /// # Arguments
1597 ///
1598 /// * `request` - No description provided.
1599 /// * `parent` - The resource name of the FirebaseProject for which the [“location for default Google Cloud resources”](https://firebase.google.com/docs/projects/locations#default-cloud-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.
1600 pub fn default_location_finalize(
1601 &self,
1602 request: FinalizeDefaultLocationRequest,
1603 parent: &str,
1604 ) -> ProjectDefaultLocationFinalizeCall<'a, C> {
1605 ProjectDefaultLocationFinalizeCall {
1606 hub: self.hub,
1607 _request: request,
1608 _parent: parent.to_string(),
1609 _delegate: Default::default(),
1610 _additional_params: Default::default(),
1611 _scopes: Default::default(),
1612 }
1613 }
1614
1615 /// Create a builder to help you perform the following task:
1616 ///
1617 /// 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`.
1618 ///
1619 /// # Arguments
1620 ///
1621 /// * `request` - No description provided.
1622 /// * `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.
1623 pub fn ios_apps_create(&self, request: IosApp, parent: &str) -> ProjectIosAppCreateCall<'a, C> {
1624 ProjectIosAppCreateCall {
1625 hub: self.hub,
1626 _request: request,
1627 _parent: parent.to_string(),
1628 _delegate: Default::default(),
1629 _additional_params: Default::default(),
1630 _scopes: Default::default(),
1631 }
1632 }
1633
1634 /// Create a builder to help you perform the following task:
1635 ///
1636 /// Gets the specified IosApp.
1637 ///
1638 /// # Arguments
1639 ///
1640 /// * `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.
1641 pub fn ios_apps_get(&self, name: &str) -> ProjectIosAppGetCall<'a, C> {
1642 ProjectIosAppGetCall {
1643 hub: self.hub,
1644 _name: name.to_string(),
1645 _delegate: Default::default(),
1646 _additional_params: Default::default(),
1647 _scopes: Default::default(),
1648 }
1649 }
1650
1651 /// Create a builder to help you perform the following task:
1652 ///
1653 /// Gets the configuration artifact associated with the specified IosApp.
1654 ///
1655 /// # Arguments
1656 ///
1657 /// * `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.
1658 pub fn ios_apps_get_config(&self, name: &str) -> ProjectIosAppGetConfigCall<'a, C> {
1659 ProjectIosAppGetConfigCall {
1660 hub: self.hub,
1661 _name: name.to_string(),
1662 _delegate: Default::default(),
1663 _additional_params: Default::default(),
1664 _scopes: Default::default(),
1665 }
1666 }
1667
1668 /// Create a builder to help you perform the following task:
1669 ///
1670 /// 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`.
1671 ///
1672 /// # Arguments
1673 ///
1674 /// * `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.
1675 pub fn ios_apps_list(&self, parent: &str) -> ProjectIosAppListCall<'a, C> {
1676 ProjectIosAppListCall {
1677 hub: self.hub,
1678 _parent: parent.to_string(),
1679 _show_deleted: Default::default(),
1680 _page_token: Default::default(),
1681 _page_size: Default::default(),
1682 _delegate: Default::default(),
1683 _additional_params: Default::default(),
1684 _scopes: Default::default(),
1685 }
1686 }
1687
1688 /// Create a builder to help you perform the following task:
1689 ///
1690 /// Updates the attributes of the specified IosApp.
1691 ///
1692 /// # Arguments
1693 ///
1694 /// * `request` - No description provided.
1695 /// * `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)).
1696 pub fn ios_apps_patch(&self, request: IosApp, name: &str) -> ProjectIosAppPatchCall<'a, C> {
1697 ProjectIosAppPatchCall {
1698 hub: self.hub,
1699 _request: request,
1700 _name: name.to_string(),
1701 _update_mask: Default::default(),
1702 _delegate: Default::default(),
1703 _additional_params: Default::default(),
1704 _scopes: Default::default(),
1705 }
1706 }
1707
1708 /// Create a builder to help you perform the following task:
1709 ///
1710 /// Removes the specified IosApp from the FirebaseProject.
1711 ///
1712 /// # Arguments
1713 ///
1714 /// * `request` - No description provided.
1715 /// * `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.
1716 pub fn ios_apps_remove(
1717 &self,
1718 request: RemoveIosAppRequest,
1719 name: &str,
1720 ) -> ProjectIosAppRemoveCall<'a, C> {
1721 ProjectIosAppRemoveCall {
1722 hub: self.hub,
1723 _request: request,
1724 _name: name.to_string(),
1725 _delegate: Default::default(),
1726 _additional_params: Default::default(),
1727 _scopes: Default::default(),
1728 }
1729 }
1730
1731 /// Create a builder to help you perform the following task:
1732 ///
1733 /// Restores the specified IosApp to the FirebaseProject.
1734 ///
1735 /// # Arguments
1736 ///
1737 /// * `request` - No description provided.
1738 /// * `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.
1739 pub fn ios_apps_undelete(
1740 &self,
1741 request: UndeleteIosAppRequest,
1742 name: &str,
1743 ) -> ProjectIosAppUndeleteCall<'a, C> {
1744 ProjectIosAppUndeleteCall {
1745 hub: self.hub,
1746 _request: request,
1747 _name: name.to_string(),
1748 _delegate: Default::default(),
1749 _additional_params: Default::default(),
1750 _scopes: Default::default(),
1751 }
1752 }
1753
1754 /// Create a builder to help you perform the following task:
1755 ///
1756 /// 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`.
1757 ///
1758 /// # Arguments
1759 ///
1760 /// * `request` - No description provided.
1761 /// * `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.
1762 pub fn web_apps_create(&self, request: WebApp, parent: &str) -> ProjectWebAppCreateCall<'a, C> {
1763 ProjectWebAppCreateCall {
1764 hub: self.hub,
1765 _request: request,
1766 _parent: parent.to_string(),
1767 _delegate: Default::default(),
1768 _additional_params: Default::default(),
1769 _scopes: Default::default(),
1770 }
1771 }
1772
1773 /// Create a builder to help you perform the following task:
1774 ///
1775 /// Gets the specified WebApp.
1776 ///
1777 /// # Arguments
1778 ///
1779 /// * `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.
1780 pub fn web_apps_get(&self, name: &str) -> ProjectWebAppGetCall<'a, C> {
1781 ProjectWebAppGetCall {
1782 hub: self.hub,
1783 _name: name.to_string(),
1784 _delegate: Default::default(),
1785 _additional_params: Default::default(),
1786 _scopes: Default::default(),
1787 }
1788 }
1789
1790 /// Create a builder to help you perform the following task:
1791 ///
1792 /// Gets the configuration artifact associated with the specified WebApp.
1793 ///
1794 /// # Arguments
1795 ///
1796 /// * `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.
1797 pub fn web_apps_get_config(&self, name: &str) -> ProjectWebAppGetConfigCall<'a, C> {
1798 ProjectWebAppGetConfigCall {
1799 hub: self.hub,
1800 _name: name.to_string(),
1801 _delegate: Default::default(),
1802 _additional_params: Default::default(),
1803 _scopes: Default::default(),
1804 }
1805 }
1806
1807 /// Create a builder to help you perform the following task:
1808 ///
1809 /// 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`.
1810 ///
1811 /// # Arguments
1812 ///
1813 /// * `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.
1814 pub fn web_apps_list(&self, parent: &str) -> ProjectWebAppListCall<'a, C> {
1815 ProjectWebAppListCall {
1816 hub: self.hub,
1817 _parent: parent.to_string(),
1818 _show_deleted: Default::default(),
1819 _page_token: Default::default(),
1820 _page_size: Default::default(),
1821 _delegate: Default::default(),
1822 _additional_params: Default::default(),
1823 _scopes: Default::default(),
1824 }
1825 }
1826
1827 /// Create a builder to help you perform the following task:
1828 ///
1829 /// Updates the attributes of the specified WebApp.
1830 ///
1831 /// # Arguments
1832 ///
1833 /// * `request` - No description provided.
1834 /// * `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)).
1835 pub fn web_apps_patch(&self, request: WebApp, name: &str) -> ProjectWebAppPatchCall<'a, C> {
1836 ProjectWebAppPatchCall {
1837 hub: self.hub,
1838 _request: request,
1839 _name: name.to_string(),
1840 _update_mask: Default::default(),
1841 _delegate: Default::default(),
1842 _additional_params: Default::default(),
1843 _scopes: Default::default(),
1844 }
1845 }
1846
1847 /// Create a builder to help you perform the following task:
1848 ///
1849 /// Removes the specified WebApp from the FirebaseProject.
1850 ///
1851 /// # Arguments
1852 ///
1853 /// * `request` - No description provided.
1854 /// * `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.
1855 pub fn web_apps_remove(
1856 &self,
1857 request: RemoveWebAppRequest,
1858 name: &str,
1859 ) -> ProjectWebAppRemoveCall<'a, C> {
1860 ProjectWebAppRemoveCall {
1861 hub: self.hub,
1862 _request: request,
1863 _name: name.to_string(),
1864 _delegate: Default::default(),
1865 _additional_params: Default::default(),
1866 _scopes: Default::default(),
1867 }
1868 }
1869
1870 /// Create a builder to help you perform the following task:
1871 ///
1872 /// Restores the specified WebApp to the FirebaseProject.
1873 ///
1874 /// # Arguments
1875 ///
1876 /// * `request` - No description provided.
1877 /// * `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.
1878 pub fn web_apps_undelete(
1879 &self,
1880 request: UndeleteWebAppRequest,
1881 name: &str,
1882 ) -> ProjectWebAppUndeleteCall<'a, C> {
1883 ProjectWebAppUndeleteCall {
1884 hub: self.hub,
1885 _request: request,
1886 _name: name.to_string(),
1887 _delegate: Default::default(),
1888 _additional_params: Default::default(),
1889 _scopes: Default::default(),
1890 }
1891 }
1892
1893 /// Create a builder to help you perform the following task:
1894 ///
1895 /// Adds Firebase resources and enables Firebase services in the specified existing [Google Cloud `Project`](https://cloud.google.com/resource-manager/reference/rest/v1/projects). Since a FirebaseProject is actually also a Google Cloud `Project`, a `FirebaseProject` has the same underlying Google Cloud 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 Google Cloud `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`.
1896 ///
1897 /// # Arguments
1898 ///
1899 /// * `request` - No description provided.
1900 /// * `project` - The resource name of the Google Cloud `Project` in which Firebase resources will be added and Firebase services enabled, 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 Google Cloud `Project` are also the identifiers of the FirebaseProject.
1901 pub fn add_firebase(
1902 &self,
1903 request: AddFirebaseRequest,
1904 project: &str,
1905 ) -> ProjectAddFirebaseCall<'a, C> {
1906 ProjectAddFirebaseCall {
1907 hub: self.hub,
1908 _request: request,
1909 _project: project.to_string(),
1910 _delegate: Default::default(),
1911 _additional_params: Default::default(),
1912 _scopes: Default::default(),
1913 }
1914 }
1915
1916 /// Create a builder to help you perform the following task:
1917 ///
1918 /// 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).
1919 ///
1920 /// # Arguments
1921 ///
1922 /// * `request` - No description provided.
1923 /// * `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.
1924 pub fn add_google_analytics(
1925 &self,
1926 request: AddGoogleAnalyticsRequest,
1927 parent: &str,
1928 ) -> ProjectAddGoogleAnalyticCall<'a, C> {
1929 ProjectAddGoogleAnalyticCall {
1930 hub: self.hub,
1931 _request: request,
1932 _parent: parent.to_string(),
1933 _delegate: Default::default(),
1934 _additional_params: Default::default(),
1935 _scopes: Default::default(),
1936 }
1937 }
1938
1939 /// Create a builder to help you perform the following task:
1940 ///
1941 /// Gets the specified FirebaseProject.
1942 ///
1943 /// # Arguments
1944 ///
1945 /// * `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.
1946 pub fn get(&self, name: &str) -> ProjectGetCall<'a, C> {
1947 ProjectGetCall {
1948 hub: self.hub,
1949 _name: name.to_string(),
1950 _delegate: Default::default(),
1951 _additional_params: Default::default(),
1952 _scopes: Default::default(),
1953 }
1954 }
1955
1956 /// Create a builder to help you perform the following task:
1957 ///
1958 /// 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.
1959 ///
1960 /// # Arguments
1961 ///
1962 /// * `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.
1963 pub fn get_admin_sdk_config(&self, name: &str) -> ProjectGetAdminSdkConfigCall<'a, C> {
1964 ProjectGetAdminSdkConfigCall {
1965 hub: self.hub,
1966 _name: name.to_string(),
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 /// 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`.
1976 ///
1977 /// # Arguments
1978 ///
1979 /// * `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.
1980 pub fn get_analytics_details(&self, name: &str) -> ProjectGetAnalyticsDetailCall<'a, C> {
1981 ProjectGetAnalyticsDetailCall {
1982 hub: self.hub,
1983 _name: name.to_string(),
1984 _delegate: Default::default(),
1985 _additional_params: Default::default(),
1986 _scopes: Default::default(),
1987 }
1988 }
1989
1990 /// Create a builder to help you perform the following task:
1991 ///
1992 /// 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.
1993 pub fn list(&self) -> ProjectListCall<'a, C> {
1994 ProjectListCall {
1995 hub: self.hub,
1996 _show_deleted: Default::default(),
1997 _page_token: Default::default(),
1998 _page_size: Default::default(),
1999 _delegate: Default::default(),
2000 _additional_params: Default::default(),
2001 _scopes: Default::default(),
2002 }
2003 }
2004
2005 /// Create a builder to help you perform the following task:
2006 ///
2007 /// Updates the attributes of the specified FirebaseProject. All [query parameters](#query-parameters) are required.
2008 ///
2009 /// # Arguments
2010 ///
2011 /// * `request` - No description provided.
2012 /// * `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`.
2013 pub fn patch(&self, request: FirebaseProject, name: &str) -> ProjectPatchCall<'a, C> {
2014 ProjectPatchCall {
2015 hub: self.hub,
2016 _request: request,
2017 _name: name.to_string(),
2018 _update_mask: Default::default(),
2019 _delegate: Default::default(),
2020 _additional_params: Default::default(),
2021 _scopes: Default::default(),
2022 }
2023 }
2024
2025 /// Create a builder to help you perform the following task:
2026 ///
2027 /// 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`.
2028 ///
2029 /// # Arguments
2030 ///
2031 /// * `request` - No description provided.
2032 /// * `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.
2033 pub fn remove_analytics(
2034 &self,
2035 request: RemoveAnalyticsRequest,
2036 parent: &str,
2037 ) -> ProjectRemoveAnalyticCall<'a, C> {
2038 ProjectRemoveAnalyticCall {
2039 hub: self.hub,
2040 _request: request,
2041 _parent: parent.to_string(),
2042 _delegate: Default::default(),
2043 _additional_params: Default::default(),
2044 _scopes: Default::default(),
2045 }
2046 }
2047
2048 /// Create a builder to help you perform the following task:
2049 ///
2050 /// 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).
2051 ///
2052 /// # Arguments
2053 ///
2054 /// * `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.
2055 pub fn search_apps(&self, parent: &str) -> ProjectSearchAppCall<'a, C> {
2056 ProjectSearchAppCall {
2057 hub: self.hub,
2058 _parent: parent.to_string(),
2059 _show_deleted: Default::default(),
2060 _page_token: Default::default(),
2061 _page_size: Default::default(),
2062 _filter: Default::default(),
2063 _delegate: Default::default(),
2064 _additional_params: Default::default(),
2065 _scopes: Default::default(),
2066 }
2067 }
2068}
2069
2070// ###################
2071// CallBuilders ###
2072// #################
2073
2074/// Lists each [Google Cloud `Project`](https://cloud.google.com/resource-manager/reference/rest/v1/projects) that can have Firebase resources added and Firebase services enabled. 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.
2075///
2076/// A builder for the *list* method supported by a *availableProject* resource.
2077/// It is not used directly, but through a [`AvailableProjectMethods`] instance.
2078///
2079/// # Example
2080///
2081/// Instantiate a resource method builder
2082///
2083/// ```test_harness,no_run
2084/// # extern crate hyper;
2085/// # extern crate hyper_rustls;
2086/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2087/// # async fn dox() {
2088/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2089///
2090/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2091/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2092/// # .with_native_roots()
2093/// # .unwrap()
2094/// # .https_only()
2095/// # .enable_http2()
2096/// # .build();
2097///
2098/// # let executor = hyper_util::rt::TokioExecutor::new();
2099/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2100/// # secret,
2101/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2102/// # yup_oauth2::client::CustomHyperClientBuilder::from(
2103/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
2104/// # ),
2105/// # ).build().await.unwrap();
2106///
2107/// # let client = hyper_util::client::legacy::Client::builder(
2108/// # hyper_util::rt::TokioExecutor::new()
2109/// # )
2110/// # .build(
2111/// # hyper_rustls::HttpsConnectorBuilder::new()
2112/// # .with_native_roots()
2113/// # .unwrap()
2114/// # .https_or_http()
2115/// # .enable_http2()
2116/// # .build()
2117/// # );
2118/// # let mut hub = FirebaseManagement::new(client, auth);
2119/// // You can configure optional parameters by calling the respective setters at will, and
2120/// // execute the final call using `doit()`.
2121/// // Values shown here are possibly random and not representative !
2122/// let result = hub.available_projects().list()
2123/// .page_token("ipsum")
2124/// .page_size(-28)
2125/// .doit().await;
2126/// # }
2127/// ```
2128pub struct AvailableProjectListCall<'a, C>
2129where
2130 C: 'a,
2131{
2132 hub: &'a FirebaseManagement<C>,
2133 _page_token: Option<String>,
2134 _page_size: Option<i32>,
2135 _delegate: Option<&'a mut dyn common::Delegate>,
2136 _additional_params: HashMap<String, String>,
2137 _scopes: BTreeSet<String>,
2138}
2139
2140impl<'a, C> common::CallBuilder for AvailableProjectListCall<'a, C> {}
2141
2142impl<'a, C> AvailableProjectListCall<'a, C>
2143where
2144 C: common::Connector,
2145{
2146 /// Perform the operation you have build so far.
2147 pub async fn doit(
2148 mut self,
2149 ) -> common::Result<(common::Response, ListAvailableProjectsResponse)> {
2150 use std::borrow::Cow;
2151 use std::io::{Read, Seek};
2152
2153 use common::{url::Params, ToParts};
2154 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2155
2156 let mut dd = common::DefaultDelegate;
2157 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2158 dlg.begin(common::MethodInfo {
2159 id: "firebase.availableProjects.list",
2160 http_method: hyper::Method::GET,
2161 });
2162
2163 for &field in ["alt", "pageToken", "pageSize"].iter() {
2164 if self._additional_params.contains_key(field) {
2165 dlg.finished(false);
2166 return Err(common::Error::FieldClash(field));
2167 }
2168 }
2169
2170 let mut params = Params::with_capacity(4 + self._additional_params.len());
2171 if let Some(value) = self._page_token.as_ref() {
2172 params.push("pageToken", value);
2173 }
2174 if let Some(value) = self._page_size.as_ref() {
2175 params.push("pageSize", value.to_string());
2176 }
2177
2178 params.extend(self._additional_params.iter());
2179
2180 params.push("alt", "json");
2181 let mut url = self.hub._base_url.clone() + "v1beta1/availableProjects";
2182 if self._scopes.is_empty() {
2183 self._scopes.insert(Scope::Readonly.as_ref().to_string());
2184 }
2185
2186 let url = params.parse_with_url(&url);
2187
2188 loop {
2189 let token = match self
2190 .hub
2191 .auth
2192 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2193 .await
2194 {
2195 Ok(token) => token,
2196 Err(e) => match dlg.token(e) {
2197 Ok(token) => token,
2198 Err(e) => {
2199 dlg.finished(false);
2200 return Err(common::Error::MissingToken(e));
2201 }
2202 },
2203 };
2204 let mut req_result = {
2205 let client = &self.hub.client;
2206 dlg.pre_request();
2207 let mut req_builder = hyper::Request::builder()
2208 .method(hyper::Method::GET)
2209 .uri(url.as_str())
2210 .header(USER_AGENT, self.hub._user_agent.clone());
2211
2212 if let Some(token) = token.as_ref() {
2213 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2214 }
2215
2216 let request = req_builder
2217 .header(CONTENT_LENGTH, 0_u64)
2218 .body(common::to_body::<String>(None));
2219
2220 client.request(request.unwrap()).await
2221 };
2222
2223 match req_result {
2224 Err(err) => {
2225 if let common::Retry::After(d) = dlg.http_error(&err) {
2226 sleep(d).await;
2227 continue;
2228 }
2229 dlg.finished(false);
2230 return Err(common::Error::HttpError(err));
2231 }
2232 Ok(res) => {
2233 let (mut parts, body) = res.into_parts();
2234 let mut body = common::Body::new(body);
2235 if !parts.status.is_success() {
2236 let bytes = common::to_bytes(body).await.unwrap_or_default();
2237 let error = serde_json::from_str(&common::to_string(&bytes));
2238 let response = common::to_response(parts, bytes.into());
2239
2240 if let common::Retry::After(d) =
2241 dlg.http_failure(&response, error.as_ref().ok())
2242 {
2243 sleep(d).await;
2244 continue;
2245 }
2246
2247 dlg.finished(false);
2248
2249 return Err(match error {
2250 Ok(value) => common::Error::BadRequest(value),
2251 _ => common::Error::Failure(response),
2252 });
2253 }
2254 let response = {
2255 let bytes = common::to_bytes(body).await.unwrap_or_default();
2256 let encoded = common::to_string(&bytes);
2257 match serde_json::from_str(&encoded) {
2258 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2259 Err(error) => {
2260 dlg.response_json_decode_error(&encoded, &error);
2261 return Err(common::Error::JsonDecodeError(
2262 encoded.to_string(),
2263 error,
2264 ));
2265 }
2266 }
2267 };
2268
2269 dlg.finished(true);
2270 return Ok(response);
2271 }
2272 }
2273 }
2274 }
2275
2276 /// Token returned from a previous call to `ListAvailableProjects` indicating where in the set of Projects to resume listing.
2277 ///
2278 /// Sets the *page token* query property to the given value.
2279 pub fn page_token(mut self, new_value: &str) -> AvailableProjectListCall<'a, C> {
2280 self._page_token = Some(new_value.to_string());
2281 self
2282 }
2283 /// 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.
2284 ///
2285 /// Sets the *page size* query property to the given value.
2286 pub fn page_size(mut self, new_value: i32) -> AvailableProjectListCall<'a, C> {
2287 self._page_size = Some(new_value);
2288 self
2289 }
2290 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2291 /// while executing the actual API request.
2292 ///
2293 /// ````text
2294 /// It should be used to handle progress information, and to implement a certain level of resilience.
2295 /// ````
2296 ///
2297 /// Sets the *delegate* property to the given value.
2298 pub fn delegate(
2299 mut self,
2300 new_value: &'a mut dyn common::Delegate,
2301 ) -> AvailableProjectListCall<'a, C> {
2302 self._delegate = Some(new_value);
2303 self
2304 }
2305
2306 /// Set any additional parameter of the query string used in the request.
2307 /// It should be used to set parameters which are not yet available through their own
2308 /// setters.
2309 ///
2310 /// Please note that this method must not be used to set any of the known parameters
2311 /// which have their own setter method. If done anyway, the request will fail.
2312 ///
2313 /// # Additional Parameters
2314 ///
2315 /// * *$.xgafv* (query-string) - V1 error format.
2316 /// * *access_token* (query-string) - OAuth access token.
2317 /// * *alt* (query-string) - Data format for response.
2318 /// * *callback* (query-string) - JSONP
2319 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2320 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2321 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2322 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2323 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2324 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2325 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2326 pub fn param<T>(mut self, name: T, value: T) -> AvailableProjectListCall<'a, C>
2327 where
2328 T: AsRef<str>,
2329 {
2330 self._additional_params
2331 .insert(name.as_ref().to_string(), value.as_ref().to_string());
2332 self
2333 }
2334
2335 /// Identifies the authorization scope for the method you are building.
2336 ///
2337 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2338 /// [`Scope::Readonly`].
2339 ///
2340 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2341 /// tokens for more than one scope.
2342 ///
2343 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2344 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2345 /// sufficient, a read-write scope will do as well.
2346 pub fn add_scope<St>(mut self, scope: St) -> AvailableProjectListCall<'a, C>
2347 where
2348 St: AsRef<str>,
2349 {
2350 self._scopes.insert(String::from(scope.as_ref()));
2351 self
2352 }
2353 /// Identifies the authorization scope(s) for the method you are building.
2354 ///
2355 /// See [`Self::add_scope()`] for details.
2356 pub fn add_scopes<I, St>(mut self, scopes: I) -> AvailableProjectListCall<'a, C>
2357 where
2358 I: IntoIterator<Item = St>,
2359 St: AsRef<str>,
2360 {
2361 self._scopes
2362 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2363 self
2364 }
2365
2366 /// Removes all scopes, and no default scope will be used either.
2367 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2368 /// for details).
2369 pub fn clear_scopes(mut self) -> AvailableProjectListCall<'a, C> {
2370 self._scopes.clear();
2371 self
2372 }
2373}
2374
2375/// 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.
2376///
2377/// A builder for the *get* method supported by a *operation* resource.
2378/// It is not used directly, but through a [`OperationMethods`] instance.
2379///
2380/// # Example
2381///
2382/// Instantiate a resource method builder
2383///
2384/// ```test_harness,no_run
2385/// # extern crate hyper;
2386/// # extern crate hyper_rustls;
2387/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2388/// # async fn dox() {
2389/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2390///
2391/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2392/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2393/// # .with_native_roots()
2394/// # .unwrap()
2395/// # .https_only()
2396/// # .enable_http2()
2397/// # .build();
2398///
2399/// # let executor = hyper_util::rt::TokioExecutor::new();
2400/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2401/// # secret,
2402/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2403/// # yup_oauth2::client::CustomHyperClientBuilder::from(
2404/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
2405/// # ),
2406/// # ).build().await.unwrap();
2407///
2408/// # let client = hyper_util::client::legacy::Client::builder(
2409/// # hyper_util::rt::TokioExecutor::new()
2410/// # )
2411/// # .build(
2412/// # hyper_rustls::HttpsConnectorBuilder::new()
2413/// # .with_native_roots()
2414/// # .unwrap()
2415/// # .https_or_http()
2416/// # .enable_http2()
2417/// # .build()
2418/// # );
2419/// # let mut hub = FirebaseManagement::new(client, auth);
2420/// // You can configure optional parameters by calling the respective setters at will, and
2421/// // execute the final call using `doit()`.
2422/// // Values shown here are possibly random and not representative !
2423/// let result = hub.operations().get("name")
2424/// .doit().await;
2425/// # }
2426/// ```
2427pub struct OperationGetCall<'a, C>
2428where
2429 C: 'a,
2430{
2431 hub: &'a FirebaseManagement<C>,
2432 _name: String,
2433 _delegate: Option<&'a mut dyn common::Delegate>,
2434 _additional_params: HashMap<String, String>,
2435 _scopes: BTreeSet<String>,
2436}
2437
2438impl<'a, C> common::CallBuilder for OperationGetCall<'a, C> {}
2439
2440impl<'a, C> OperationGetCall<'a, C>
2441where
2442 C: common::Connector,
2443{
2444 /// Perform the operation you have build so far.
2445 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
2446 use std::borrow::Cow;
2447 use std::io::{Read, Seek};
2448
2449 use common::{url::Params, ToParts};
2450 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2451
2452 let mut dd = common::DefaultDelegate;
2453 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2454 dlg.begin(common::MethodInfo {
2455 id: "firebase.operations.get",
2456 http_method: hyper::Method::GET,
2457 });
2458
2459 for &field in ["alt", "name"].iter() {
2460 if self._additional_params.contains_key(field) {
2461 dlg.finished(false);
2462 return Err(common::Error::FieldClash(field));
2463 }
2464 }
2465
2466 let mut params = Params::with_capacity(3 + self._additional_params.len());
2467 params.push("name", self._name);
2468
2469 params.extend(self._additional_params.iter());
2470
2471 params.push("alt", "json");
2472 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
2473 if self._scopes.is_empty() {
2474 self._scopes.insert(Scope::Readonly.as_ref().to_string());
2475 }
2476
2477 #[allow(clippy::single_element_loop)]
2478 for &(find_this, param_name) in [("{+name}", "name")].iter() {
2479 url = params.uri_replacement(url, param_name, find_this, true);
2480 }
2481 {
2482 let to_remove = ["name"];
2483 params.remove_params(&to_remove);
2484 }
2485
2486 let url = params.parse_with_url(&url);
2487
2488 loop {
2489 let token = match self
2490 .hub
2491 .auth
2492 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2493 .await
2494 {
2495 Ok(token) => token,
2496 Err(e) => match dlg.token(e) {
2497 Ok(token) => token,
2498 Err(e) => {
2499 dlg.finished(false);
2500 return Err(common::Error::MissingToken(e));
2501 }
2502 },
2503 };
2504 let mut req_result = {
2505 let client = &self.hub.client;
2506 dlg.pre_request();
2507 let mut req_builder = hyper::Request::builder()
2508 .method(hyper::Method::GET)
2509 .uri(url.as_str())
2510 .header(USER_AGENT, self.hub._user_agent.clone());
2511
2512 if let Some(token) = token.as_ref() {
2513 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2514 }
2515
2516 let request = req_builder
2517 .header(CONTENT_LENGTH, 0_u64)
2518 .body(common::to_body::<String>(None));
2519
2520 client.request(request.unwrap()).await
2521 };
2522
2523 match req_result {
2524 Err(err) => {
2525 if let common::Retry::After(d) = dlg.http_error(&err) {
2526 sleep(d).await;
2527 continue;
2528 }
2529 dlg.finished(false);
2530 return Err(common::Error::HttpError(err));
2531 }
2532 Ok(res) => {
2533 let (mut parts, body) = res.into_parts();
2534 let mut body = common::Body::new(body);
2535 if !parts.status.is_success() {
2536 let bytes = common::to_bytes(body).await.unwrap_or_default();
2537 let error = serde_json::from_str(&common::to_string(&bytes));
2538 let response = common::to_response(parts, bytes.into());
2539
2540 if let common::Retry::After(d) =
2541 dlg.http_failure(&response, error.as_ref().ok())
2542 {
2543 sleep(d).await;
2544 continue;
2545 }
2546
2547 dlg.finished(false);
2548
2549 return Err(match error {
2550 Ok(value) => common::Error::BadRequest(value),
2551 _ => common::Error::Failure(response),
2552 });
2553 }
2554 let response = {
2555 let bytes = common::to_bytes(body).await.unwrap_or_default();
2556 let encoded = common::to_string(&bytes);
2557 match serde_json::from_str(&encoded) {
2558 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2559 Err(error) => {
2560 dlg.response_json_decode_error(&encoded, &error);
2561 return Err(common::Error::JsonDecodeError(
2562 encoded.to_string(),
2563 error,
2564 ));
2565 }
2566 }
2567 };
2568
2569 dlg.finished(true);
2570 return Ok(response);
2571 }
2572 }
2573 }
2574 }
2575
2576 /// The name of the operation resource.
2577 ///
2578 /// Sets the *name* path property to the given value.
2579 ///
2580 /// Even though the property as already been set when instantiating this call,
2581 /// we provide this method for API completeness.
2582 pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C> {
2583 self._name = new_value.to_string();
2584 self
2585 }
2586 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2587 /// while executing the actual API request.
2588 ///
2589 /// ````text
2590 /// It should be used to handle progress information, and to implement a certain level of resilience.
2591 /// ````
2592 ///
2593 /// Sets the *delegate* property to the given value.
2594 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> OperationGetCall<'a, C> {
2595 self._delegate = Some(new_value);
2596 self
2597 }
2598
2599 /// Set any additional parameter of the query string used in the request.
2600 /// It should be used to set parameters which are not yet available through their own
2601 /// setters.
2602 ///
2603 /// Please note that this method must not be used to set any of the known parameters
2604 /// which have their own setter method. If done anyway, the request will fail.
2605 ///
2606 /// # Additional Parameters
2607 ///
2608 /// * *$.xgafv* (query-string) - V1 error format.
2609 /// * *access_token* (query-string) - OAuth access token.
2610 /// * *alt* (query-string) - Data format for response.
2611 /// * *callback* (query-string) - JSONP
2612 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2613 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2614 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2615 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2616 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2617 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2618 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2619 pub fn param<T>(mut self, name: T, value: T) -> OperationGetCall<'a, C>
2620 where
2621 T: AsRef<str>,
2622 {
2623 self._additional_params
2624 .insert(name.as_ref().to_string(), value.as_ref().to_string());
2625 self
2626 }
2627
2628 /// Identifies the authorization scope for the method you are building.
2629 ///
2630 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2631 /// [`Scope::Readonly`].
2632 ///
2633 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2634 /// tokens for more than one scope.
2635 ///
2636 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2637 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2638 /// sufficient, a read-write scope will do as well.
2639 pub fn add_scope<St>(mut self, scope: St) -> OperationGetCall<'a, C>
2640 where
2641 St: AsRef<str>,
2642 {
2643 self._scopes.insert(String::from(scope.as_ref()));
2644 self
2645 }
2646 /// Identifies the authorization scope(s) for the method you are building.
2647 ///
2648 /// See [`Self::add_scope()`] for details.
2649 pub fn add_scopes<I, St>(mut self, scopes: I) -> OperationGetCall<'a, C>
2650 where
2651 I: IntoIterator<Item = St>,
2652 St: AsRef<str>,
2653 {
2654 self._scopes
2655 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2656 self
2657 }
2658
2659 /// Removes all scopes, and no default scope will be used either.
2660 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2661 /// for details).
2662 pub fn clear_scopes(mut self) -> OperationGetCall<'a, C> {
2663 self._scopes.clear();
2664 self
2665 }
2666}
2667
2668/// Adds a ShaCertificate to the specified AndroidApp.
2669///
2670/// A builder for the *androidApps.sha.create* method supported by a *project* resource.
2671/// It is not used directly, but through a [`ProjectMethods`] instance.
2672///
2673/// # Example
2674///
2675/// Instantiate a resource method builder
2676///
2677/// ```test_harness,no_run
2678/// # extern crate hyper;
2679/// # extern crate hyper_rustls;
2680/// # extern crate google_firebase1_beta1 as firebase1_beta1;
2681/// use firebase1_beta1::api::ShaCertificate;
2682/// # async fn dox() {
2683/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2684///
2685/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2686/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2687/// # .with_native_roots()
2688/// # .unwrap()
2689/// # .https_only()
2690/// # .enable_http2()
2691/// # .build();
2692///
2693/// # let executor = hyper_util::rt::TokioExecutor::new();
2694/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2695/// # secret,
2696/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2697/// # yup_oauth2::client::CustomHyperClientBuilder::from(
2698/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
2699/// # ),
2700/// # ).build().await.unwrap();
2701///
2702/// # let client = hyper_util::client::legacy::Client::builder(
2703/// # hyper_util::rt::TokioExecutor::new()
2704/// # )
2705/// # .build(
2706/// # hyper_rustls::HttpsConnectorBuilder::new()
2707/// # .with_native_roots()
2708/// # .unwrap()
2709/// # .https_or_http()
2710/// # .enable_http2()
2711/// # .build()
2712/// # );
2713/// # let mut hub = FirebaseManagement::new(client, auth);
2714/// // As the method needs a request, you would usually fill it with the desired information
2715/// // into the respective structure. Some of the parts shown here might not be applicable !
2716/// // Values shown here are possibly random and not representative !
2717/// let mut req = ShaCertificate::default();
2718///
2719/// // You can configure optional parameters by calling the respective setters at will, and
2720/// // execute the final call using `doit()`.
2721/// // Values shown here are possibly random and not representative !
2722/// let result = hub.projects().android_apps_sha_create(req, "parent")
2723/// .doit().await;
2724/// # }
2725/// ```
2726pub struct ProjectAndroidAppShaCreateCall<'a, C>
2727where
2728 C: 'a,
2729{
2730 hub: &'a FirebaseManagement<C>,
2731 _request: ShaCertificate,
2732 _parent: String,
2733 _delegate: Option<&'a mut dyn common::Delegate>,
2734 _additional_params: HashMap<String, String>,
2735 _scopes: BTreeSet<String>,
2736}
2737
2738impl<'a, C> common::CallBuilder for ProjectAndroidAppShaCreateCall<'a, C> {}
2739
2740impl<'a, C> ProjectAndroidAppShaCreateCall<'a, C>
2741where
2742 C: common::Connector,
2743{
2744 /// Perform the operation you have build so far.
2745 pub async fn doit(mut self) -> common::Result<(common::Response, ShaCertificate)> {
2746 use std::borrow::Cow;
2747 use std::io::{Read, Seek};
2748
2749 use common::{url::Params, ToParts};
2750 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2751
2752 let mut dd = common::DefaultDelegate;
2753 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2754 dlg.begin(common::MethodInfo {
2755 id: "firebase.projects.androidApps.sha.create",
2756 http_method: hyper::Method::POST,
2757 });
2758
2759 for &field in ["alt", "parent"].iter() {
2760 if self._additional_params.contains_key(field) {
2761 dlg.finished(false);
2762 return Err(common::Error::FieldClash(field));
2763 }
2764 }
2765
2766 let mut params = Params::with_capacity(4 + self._additional_params.len());
2767 params.push("parent", self._parent);
2768
2769 params.extend(self._additional_params.iter());
2770
2771 params.push("alt", "json");
2772 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/sha";
2773 if self._scopes.is_empty() {
2774 self._scopes
2775 .insert(Scope::CloudPlatform.as_ref().to_string());
2776 }
2777
2778 #[allow(clippy::single_element_loop)]
2779 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
2780 url = params.uri_replacement(url, param_name, find_this, true);
2781 }
2782 {
2783 let to_remove = ["parent"];
2784 params.remove_params(&to_remove);
2785 }
2786
2787 let url = params.parse_with_url(&url);
2788
2789 let mut json_mime_type = mime::APPLICATION_JSON;
2790 let mut request_value_reader = {
2791 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
2792 common::remove_json_null_values(&mut value);
2793 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
2794 serde_json::to_writer(&mut dst, &value).unwrap();
2795 dst
2796 };
2797 let request_size = request_value_reader
2798 .seek(std::io::SeekFrom::End(0))
2799 .unwrap();
2800 request_value_reader
2801 .seek(std::io::SeekFrom::Start(0))
2802 .unwrap();
2803
2804 loop {
2805 let token = match self
2806 .hub
2807 .auth
2808 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2809 .await
2810 {
2811 Ok(token) => token,
2812 Err(e) => match dlg.token(e) {
2813 Ok(token) => token,
2814 Err(e) => {
2815 dlg.finished(false);
2816 return Err(common::Error::MissingToken(e));
2817 }
2818 },
2819 };
2820 request_value_reader
2821 .seek(std::io::SeekFrom::Start(0))
2822 .unwrap();
2823 let mut req_result = {
2824 let client = &self.hub.client;
2825 dlg.pre_request();
2826 let mut req_builder = hyper::Request::builder()
2827 .method(hyper::Method::POST)
2828 .uri(url.as_str())
2829 .header(USER_AGENT, self.hub._user_agent.clone());
2830
2831 if let Some(token) = token.as_ref() {
2832 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2833 }
2834
2835 let request = req_builder
2836 .header(CONTENT_TYPE, json_mime_type.to_string())
2837 .header(CONTENT_LENGTH, request_size as u64)
2838 .body(common::to_body(
2839 request_value_reader.get_ref().clone().into(),
2840 ));
2841
2842 client.request(request.unwrap()).await
2843 };
2844
2845 match req_result {
2846 Err(err) => {
2847 if let common::Retry::After(d) = dlg.http_error(&err) {
2848 sleep(d).await;
2849 continue;
2850 }
2851 dlg.finished(false);
2852 return Err(common::Error::HttpError(err));
2853 }
2854 Ok(res) => {
2855 let (mut parts, body) = res.into_parts();
2856 let mut body = common::Body::new(body);
2857 if !parts.status.is_success() {
2858 let bytes = common::to_bytes(body).await.unwrap_or_default();
2859 let error = serde_json::from_str(&common::to_string(&bytes));
2860 let response = common::to_response(parts, bytes.into());
2861
2862 if let common::Retry::After(d) =
2863 dlg.http_failure(&response, error.as_ref().ok())
2864 {
2865 sleep(d).await;
2866 continue;
2867 }
2868
2869 dlg.finished(false);
2870
2871 return Err(match error {
2872 Ok(value) => common::Error::BadRequest(value),
2873 _ => common::Error::Failure(response),
2874 });
2875 }
2876 let response = {
2877 let bytes = common::to_bytes(body).await.unwrap_or_default();
2878 let encoded = common::to_string(&bytes);
2879 match serde_json::from_str(&encoded) {
2880 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2881 Err(error) => {
2882 dlg.response_json_decode_error(&encoded, &error);
2883 return Err(common::Error::JsonDecodeError(
2884 encoded.to_string(),
2885 error,
2886 ));
2887 }
2888 }
2889 };
2890
2891 dlg.finished(true);
2892 return Ok(response);
2893 }
2894 }
2895 }
2896 }
2897
2898 ///
2899 /// Sets the *request* property to the given value.
2900 ///
2901 /// Even though the property as already been set when instantiating this call,
2902 /// we provide this method for API completeness.
2903 pub fn request(mut self, new_value: ShaCertificate) -> ProjectAndroidAppShaCreateCall<'a, C> {
2904 self._request = new_value;
2905 self
2906 }
2907 /// 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.
2908 ///
2909 /// Sets the *parent* path property to the given value.
2910 ///
2911 /// Even though the property as already been set when instantiating this call,
2912 /// we provide this method for API completeness.
2913 pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppShaCreateCall<'a, C> {
2914 self._parent = new_value.to_string();
2915 self
2916 }
2917 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2918 /// while executing the actual API request.
2919 ///
2920 /// ````text
2921 /// It should be used to handle progress information, and to implement a certain level of resilience.
2922 /// ````
2923 ///
2924 /// Sets the *delegate* property to the given value.
2925 pub fn delegate(
2926 mut self,
2927 new_value: &'a mut dyn common::Delegate,
2928 ) -> ProjectAndroidAppShaCreateCall<'a, C> {
2929 self._delegate = Some(new_value);
2930 self
2931 }
2932
2933 /// Set any additional parameter of the query string used in the request.
2934 /// It should be used to set parameters which are not yet available through their own
2935 /// setters.
2936 ///
2937 /// Please note that this method must not be used to set any of the known parameters
2938 /// which have their own setter method. If done anyway, the request will fail.
2939 ///
2940 /// # Additional Parameters
2941 ///
2942 /// * *$.xgafv* (query-string) - V1 error format.
2943 /// * *access_token* (query-string) - OAuth access token.
2944 /// * *alt* (query-string) - Data format for response.
2945 /// * *callback* (query-string) - JSONP
2946 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2947 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2948 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2949 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2950 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2951 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2952 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2953 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppShaCreateCall<'a, C>
2954 where
2955 T: AsRef<str>,
2956 {
2957 self._additional_params
2958 .insert(name.as_ref().to_string(), value.as_ref().to_string());
2959 self
2960 }
2961
2962 /// Identifies the authorization scope for the method you are building.
2963 ///
2964 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2965 /// [`Scope::CloudPlatform`].
2966 ///
2967 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2968 /// tokens for more than one scope.
2969 ///
2970 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2971 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2972 /// sufficient, a read-write scope will do as well.
2973 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppShaCreateCall<'a, C>
2974 where
2975 St: AsRef<str>,
2976 {
2977 self._scopes.insert(String::from(scope.as_ref()));
2978 self
2979 }
2980 /// Identifies the authorization scope(s) for the method you are building.
2981 ///
2982 /// See [`Self::add_scope()`] for details.
2983 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppShaCreateCall<'a, C>
2984 where
2985 I: IntoIterator<Item = St>,
2986 St: AsRef<str>,
2987 {
2988 self._scopes
2989 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2990 self
2991 }
2992
2993 /// Removes all scopes, and no default scope will be used either.
2994 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2995 /// for details).
2996 pub fn clear_scopes(mut self) -> ProjectAndroidAppShaCreateCall<'a, C> {
2997 self._scopes.clear();
2998 self
2999 }
3000}
3001
3002/// Removes a ShaCertificate from the specified AndroidApp.
3003///
3004/// A builder for the *androidApps.sha.delete* method supported by a *project* resource.
3005/// It is not used directly, but through a [`ProjectMethods`] instance.
3006///
3007/// # Example
3008///
3009/// Instantiate a resource method builder
3010///
3011/// ```test_harness,no_run
3012/// # extern crate hyper;
3013/// # extern crate hyper_rustls;
3014/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3015/// # async fn dox() {
3016/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3017///
3018/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3019/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
3020/// # .with_native_roots()
3021/// # .unwrap()
3022/// # .https_only()
3023/// # .enable_http2()
3024/// # .build();
3025///
3026/// # let executor = hyper_util::rt::TokioExecutor::new();
3027/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
3028/// # secret,
3029/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3030/// # yup_oauth2::client::CustomHyperClientBuilder::from(
3031/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
3032/// # ),
3033/// # ).build().await.unwrap();
3034///
3035/// # let client = hyper_util::client::legacy::Client::builder(
3036/// # hyper_util::rt::TokioExecutor::new()
3037/// # )
3038/// # .build(
3039/// # hyper_rustls::HttpsConnectorBuilder::new()
3040/// # .with_native_roots()
3041/// # .unwrap()
3042/// # .https_or_http()
3043/// # .enable_http2()
3044/// # .build()
3045/// # );
3046/// # let mut hub = FirebaseManagement::new(client, auth);
3047/// // You can configure optional parameters by calling the respective setters at will, and
3048/// // execute the final call using `doit()`.
3049/// // Values shown here are possibly random and not representative !
3050/// let result = hub.projects().android_apps_sha_delete("name")
3051/// .doit().await;
3052/// # }
3053/// ```
3054pub struct ProjectAndroidAppShaDeleteCall<'a, C>
3055where
3056 C: 'a,
3057{
3058 hub: &'a FirebaseManagement<C>,
3059 _name: String,
3060 _delegate: Option<&'a mut dyn common::Delegate>,
3061 _additional_params: HashMap<String, String>,
3062 _scopes: BTreeSet<String>,
3063}
3064
3065impl<'a, C> common::CallBuilder for ProjectAndroidAppShaDeleteCall<'a, C> {}
3066
3067impl<'a, C> ProjectAndroidAppShaDeleteCall<'a, C>
3068where
3069 C: common::Connector,
3070{
3071 /// Perform the operation you have build so far.
3072 pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
3073 use std::borrow::Cow;
3074 use std::io::{Read, Seek};
3075
3076 use common::{url::Params, ToParts};
3077 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3078
3079 let mut dd = common::DefaultDelegate;
3080 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3081 dlg.begin(common::MethodInfo {
3082 id: "firebase.projects.androidApps.sha.delete",
3083 http_method: hyper::Method::DELETE,
3084 });
3085
3086 for &field in ["alt", "name"].iter() {
3087 if self._additional_params.contains_key(field) {
3088 dlg.finished(false);
3089 return Err(common::Error::FieldClash(field));
3090 }
3091 }
3092
3093 let mut params = Params::with_capacity(3 + self._additional_params.len());
3094 params.push("name", self._name);
3095
3096 params.extend(self._additional_params.iter());
3097
3098 params.push("alt", "json");
3099 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
3100 if self._scopes.is_empty() {
3101 self._scopes
3102 .insert(Scope::CloudPlatform.as_ref().to_string());
3103 }
3104
3105 #[allow(clippy::single_element_loop)]
3106 for &(find_this, param_name) in [("{+name}", "name")].iter() {
3107 url = params.uri_replacement(url, param_name, find_this, true);
3108 }
3109 {
3110 let to_remove = ["name"];
3111 params.remove_params(&to_remove);
3112 }
3113
3114 let url = params.parse_with_url(&url);
3115
3116 loop {
3117 let token = match self
3118 .hub
3119 .auth
3120 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3121 .await
3122 {
3123 Ok(token) => token,
3124 Err(e) => match dlg.token(e) {
3125 Ok(token) => token,
3126 Err(e) => {
3127 dlg.finished(false);
3128 return Err(common::Error::MissingToken(e));
3129 }
3130 },
3131 };
3132 let mut req_result = {
3133 let client = &self.hub.client;
3134 dlg.pre_request();
3135 let mut req_builder = hyper::Request::builder()
3136 .method(hyper::Method::DELETE)
3137 .uri(url.as_str())
3138 .header(USER_AGENT, self.hub._user_agent.clone());
3139
3140 if let Some(token) = token.as_ref() {
3141 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3142 }
3143
3144 let request = req_builder
3145 .header(CONTENT_LENGTH, 0_u64)
3146 .body(common::to_body::<String>(None));
3147
3148 client.request(request.unwrap()).await
3149 };
3150
3151 match req_result {
3152 Err(err) => {
3153 if let common::Retry::After(d) = dlg.http_error(&err) {
3154 sleep(d).await;
3155 continue;
3156 }
3157 dlg.finished(false);
3158 return Err(common::Error::HttpError(err));
3159 }
3160 Ok(res) => {
3161 let (mut parts, body) = res.into_parts();
3162 let mut body = common::Body::new(body);
3163 if !parts.status.is_success() {
3164 let bytes = common::to_bytes(body).await.unwrap_or_default();
3165 let error = serde_json::from_str(&common::to_string(&bytes));
3166 let response = common::to_response(parts, bytes.into());
3167
3168 if let common::Retry::After(d) =
3169 dlg.http_failure(&response, error.as_ref().ok())
3170 {
3171 sleep(d).await;
3172 continue;
3173 }
3174
3175 dlg.finished(false);
3176
3177 return Err(match error {
3178 Ok(value) => common::Error::BadRequest(value),
3179 _ => common::Error::Failure(response),
3180 });
3181 }
3182 let response = {
3183 let bytes = common::to_bytes(body).await.unwrap_or_default();
3184 let encoded = common::to_string(&bytes);
3185 match serde_json::from_str(&encoded) {
3186 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3187 Err(error) => {
3188 dlg.response_json_decode_error(&encoded, &error);
3189 return Err(common::Error::JsonDecodeError(
3190 encoded.to_string(),
3191 error,
3192 ));
3193 }
3194 }
3195 };
3196
3197 dlg.finished(true);
3198 return Ok(response);
3199 }
3200 }
3201 }
3202 }
3203
3204 /// 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).
3205 ///
3206 /// Sets the *name* path property to the given value.
3207 ///
3208 /// Even though the property as already been set when instantiating this call,
3209 /// we provide this method for API completeness.
3210 pub fn name(mut self, new_value: &str) -> ProjectAndroidAppShaDeleteCall<'a, C> {
3211 self._name = new_value.to_string();
3212 self
3213 }
3214 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3215 /// while executing the actual API request.
3216 ///
3217 /// ````text
3218 /// It should be used to handle progress information, and to implement a certain level of resilience.
3219 /// ````
3220 ///
3221 /// Sets the *delegate* property to the given value.
3222 pub fn delegate(
3223 mut self,
3224 new_value: &'a mut dyn common::Delegate,
3225 ) -> ProjectAndroidAppShaDeleteCall<'a, C> {
3226 self._delegate = Some(new_value);
3227 self
3228 }
3229
3230 /// Set any additional parameter of the query string used in the request.
3231 /// It should be used to set parameters which are not yet available through their own
3232 /// setters.
3233 ///
3234 /// Please note that this method must not be used to set any of the known parameters
3235 /// which have their own setter method. If done anyway, the request will fail.
3236 ///
3237 /// # Additional Parameters
3238 ///
3239 /// * *$.xgafv* (query-string) - V1 error format.
3240 /// * *access_token* (query-string) - OAuth access token.
3241 /// * *alt* (query-string) - Data format for response.
3242 /// * *callback* (query-string) - JSONP
3243 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3244 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3245 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3246 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3247 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3248 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3249 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3250 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppShaDeleteCall<'a, C>
3251 where
3252 T: AsRef<str>,
3253 {
3254 self._additional_params
3255 .insert(name.as_ref().to_string(), value.as_ref().to_string());
3256 self
3257 }
3258
3259 /// Identifies the authorization scope for the method you are building.
3260 ///
3261 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3262 /// [`Scope::CloudPlatform`].
3263 ///
3264 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3265 /// tokens for more than one scope.
3266 ///
3267 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3268 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3269 /// sufficient, a read-write scope will do as well.
3270 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppShaDeleteCall<'a, C>
3271 where
3272 St: AsRef<str>,
3273 {
3274 self._scopes.insert(String::from(scope.as_ref()));
3275 self
3276 }
3277 /// Identifies the authorization scope(s) for the method you are building.
3278 ///
3279 /// See [`Self::add_scope()`] for details.
3280 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppShaDeleteCall<'a, C>
3281 where
3282 I: IntoIterator<Item = St>,
3283 St: AsRef<str>,
3284 {
3285 self._scopes
3286 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3287 self
3288 }
3289
3290 /// Removes all scopes, and no default scope will be used either.
3291 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3292 /// for details).
3293 pub fn clear_scopes(mut self) -> ProjectAndroidAppShaDeleteCall<'a, C> {
3294 self._scopes.clear();
3295 self
3296 }
3297}
3298
3299/// Lists the SHA-1 and SHA-256 certificates for the specified AndroidApp.
3300///
3301/// A builder for the *androidApps.sha.list* method supported by a *project* resource.
3302/// It is not used directly, but through a [`ProjectMethods`] instance.
3303///
3304/// # Example
3305///
3306/// Instantiate a resource method builder
3307///
3308/// ```test_harness,no_run
3309/// # extern crate hyper;
3310/// # extern crate hyper_rustls;
3311/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3312/// # async fn dox() {
3313/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3314///
3315/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3316/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
3317/// # .with_native_roots()
3318/// # .unwrap()
3319/// # .https_only()
3320/// # .enable_http2()
3321/// # .build();
3322///
3323/// # let executor = hyper_util::rt::TokioExecutor::new();
3324/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
3325/// # secret,
3326/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3327/// # yup_oauth2::client::CustomHyperClientBuilder::from(
3328/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
3329/// # ),
3330/// # ).build().await.unwrap();
3331///
3332/// # let client = hyper_util::client::legacy::Client::builder(
3333/// # hyper_util::rt::TokioExecutor::new()
3334/// # )
3335/// # .build(
3336/// # hyper_rustls::HttpsConnectorBuilder::new()
3337/// # .with_native_roots()
3338/// # .unwrap()
3339/// # .https_or_http()
3340/// # .enable_http2()
3341/// # .build()
3342/// # );
3343/// # let mut hub = FirebaseManagement::new(client, auth);
3344/// // You can configure optional parameters by calling the respective setters at will, and
3345/// // execute the final call using `doit()`.
3346/// // Values shown here are possibly random and not representative !
3347/// let result = hub.projects().android_apps_sha_list("parent")
3348/// .doit().await;
3349/// # }
3350/// ```
3351pub struct ProjectAndroidAppShaListCall<'a, C>
3352where
3353 C: 'a,
3354{
3355 hub: &'a FirebaseManagement<C>,
3356 _parent: String,
3357 _delegate: Option<&'a mut dyn common::Delegate>,
3358 _additional_params: HashMap<String, String>,
3359 _scopes: BTreeSet<String>,
3360}
3361
3362impl<'a, C> common::CallBuilder for ProjectAndroidAppShaListCall<'a, C> {}
3363
3364impl<'a, C> ProjectAndroidAppShaListCall<'a, C>
3365where
3366 C: common::Connector,
3367{
3368 /// Perform the operation you have build so far.
3369 pub async fn doit(mut self) -> common::Result<(common::Response, ListShaCertificatesResponse)> {
3370 use std::borrow::Cow;
3371 use std::io::{Read, Seek};
3372
3373 use common::{url::Params, ToParts};
3374 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3375
3376 let mut dd = common::DefaultDelegate;
3377 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3378 dlg.begin(common::MethodInfo {
3379 id: "firebase.projects.androidApps.sha.list",
3380 http_method: hyper::Method::GET,
3381 });
3382
3383 for &field in ["alt", "parent"].iter() {
3384 if self._additional_params.contains_key(field) {
3385 dlg.finished(false);
3386 return Err(common::Error::FieldClash(field));
3387 }
3388 }
3389
3390 let mut params = Params::with_capacity(3 + self._additional_params.len());
3391 params.push("parent", self._parent);
3392
3393 params.extend(self._additional_params.iter());
3394
3395 params.push("alt", "json");
3396 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/sha";
3397 if self._scopes.is_empty() {
3398 self._scopes.insert(Scope::Readonly.as_ref().to_string());
3399 }
3400
3401 #[allow(clippy::single_element_loop)]
3402 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
3403 url = params.uri_replacement(url, param_name, find_this, true);
3404 }
3405 {
3406 let to_remove = ["parent"];
3407 params.remove_params(&to_remove);
3408 }
3409
3410 let url = params.parse_with_url(&url);
3411
3412 loop {
3413 let token = match self
3414 .hub
3415 .auth
3416 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3417 .await
3418 {
3419 Ok(token) => token,
3420 Err(e) => match dlg.token(e) {
3421 Ok(token) => token,
3422 Err(e) => {
3423 dlg.finished(false);
3424 return Err(common::Error::MissingToken(e));
3425 }
3426 },
3427 };
3428 let mut req_result = {
3429 let client = &self.hub.client;
3430 dlg.pre_request();
3431 let mut req_builder = hyper::Request::builder()
3432 .method(hyper::Method::GET)
3433 .uri(url.as_str())
3434 .header(USER_AGENT, self.hub._user_agent.clone());
3435
3436 if let Some(token) = token.as_ref() {
3437 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3438 }
3439
3440 let request = req_builder
3441 .header(CONTENT_LENGTH, 0_u64)
3442 .body(common::to_body::<String>(None));
3443
3444 client.request(request.unwrap()).await
3445 };
3446
3447 match req_result {
3448 Err(err) => {
3449 if let common::Retry::After(d) = dlg.http_error(&err) {
3450 sleep(d).await;
3451 continue;
3452 }
3453 dlg.finished(false);
3454 return Err(common::Error::HttpError(err));
3455 }
3456 Ok(res) => {
3457 let (mut parts, body) = res.into_parts();
3458 let mut body = common::Body::new(body);
3459 if !parts.status.is_success() {
3460 let bytes = common::to_bytes(body).await.unwrap_or_default();
3461 let error = serde_json::from_str(&common::to_string(&bytes));
3462 let response = common::to_response(parts, bytes.into());
3463
3464 if let common::Retry::After(d) =
3465 dlg.http_failure(&response, error.as_ref().ok())
3466 {
3467 sleep(d).await;
3468 continue;
3469 }
3470
3471 dlg.finished(false);
3472
3473 return Err(match error {
3474 Ok(value) => common::Error::BadRequest(value),
3475 _ => common::Error::Failure(response),
3476 });
3477 }
3478 let response = {
3479 let bytes = common::to_bytes(body).await.unwrap_or_default();
3480 let encoded = common::to_string(&bytes);
3481 match serde_json::from_str(&encoded) {
3482 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3483 Err(error) => {
3484 dlg.response_json_decode_error(&encoded, &error);
3485 return Err(common::Error::JsonDecodeError(
3486 encoded.to_string(),
3487 error,
3488 ));
3489 }
3490 }
3491 };
3492
3493 dlg.finished(true);
3494 return Ok(response);
3495 }
3496 }
3497 }
3498 }
3499
3500 /// 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.
3501 ///
3502 /// Sets the *parent* path property to the given value.
3503 ///
3504 /// Even though the property as already been set when instantiating this call,
3505 /// we provide this method for API completeness.
3506 pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppShaListCall<'a, C> {
3507 self._parent = new_value.to_string();
3508 self
3509 }
3510 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3511 /// while executing the actual API request.
3512 ///
3513 /// ````text
3514 /// It should be used to handle progress information, and to implement a certain level of resilience.
3515 /// ````
3516 ///
3517 /// Sets the *delegate* property to the given value.
3518 pub fn delegate(
3519 mut self,
3520 new_value: &'a mut dyn common::Delegate,
3521 ) -> ProjectAndroidAppShaListCall<'a, C> {
3522 self._delegate = Some(new_value);
3523 self
3524 }
3525
3526 /// Set any additional parameter of the query string used in the request.
3527 /// It should be used to set parameters which are not yet available through their own
3528 /// setters.
3529 ///
3530 /// Please note that this method must not be used to set any of the known parameters
3531 /// which have their own setter method. If done anyway, the request will fail.
3532 ///
3533 /// # Additional Parameters
3534 ///
3535 /// * *$.xgafv* (query-string) - V1 error format.
3536 /// * *access_token* (query-string) - OAuth access token.
3537 /// * *alt* (query-string) - Data format for response.
3538 /// * *callback* (query-string) - JSONP
3539 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3540 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3541 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3542 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3543 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3544 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3545 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3546 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppShaListCall<'a, C>
3547 where
3548 T: AsRef<str>,
3549 {
3550 self._additional_params
3551 .insert(name.as_ref().to_string(), value.as_ref().to_string());
3552 self
3553 }
3554
3555 /// Identifies the authorization scope for the method you are building.
3556 ///
3557 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3558 /// [`Scope::Readonly`].
3559 ///
3560 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3561 /// tokens for more than one scope.
3562 ///
3563 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3564 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3565 /// sufficient, a read-write scope will do as well.
3566 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppShaListCall<'a, C>
3567 where
3568 St: AsRef<str>,
3569 {
3570 self._scopes.insert(String::from(scope.as_ref()));
3571 self
3572 }
3573 /// Identifies the authorization scope(s) for the method you are building.
3574 ///
3575 /// See [`Self::add_scope()`] for details.
3576 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppShaListCall<'a, C>
3577 where
3578 I: IntoIterator<Item = St>,
3579 St: AsRef<str>,
3580 {
3581 self._scopes
3582 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3583 self
3584 }
3585
3586 /// Removes all scopes, and no default scope will be used either.
3587 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3588 /// for details).
3589 pub fn clear_scopes(mut self) -> ProjectAndroidAppShaListCall<'a, C> {
3590 self._scopes.clear();
3591 self
3592 }
3593}
3594
3595/// 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`.
3596///
3597/// A builder for the *androidApps.create* method supported by a *project* resource.
3598/// It is not used directly, but through a [`ProjectMethods`] instance.
3599///
3600/// # Example
3601///
3602/// Instantiate a resource method builder
3603///
3604/// ```test_harness,no_run
3605/// # extern crate hyper;
3606/// # extern crate hyper_rustls;
3607/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3608/// use firebase1_beta1::api::AndroidApp;
3609/// # async fn dox() {
3610/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3611///
3612/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3613/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
3614/// # .with_native_roots()
3615/// # .unwrap()
3616/// # .https_only()
3617/// # .enable_http2()
3618/// # .build();
3619///
3620/// # let executor = hyper_util::rt::TokioExecutor::new();
3621/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
3622/// # secret,
3623/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3624/// # yup_oauth2::client::CustomHyperClientBuilder::from(
3625/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
3626/// # ),
3627/// # ).build().await.unwrap();
3628///
3629/// # let client = hyper_util::client::legacy::Client::builder(
3630/// # hyper_util::rt::TokioExecutor::new()
3631/// # )
3632/// # .build(
3633/// # hyper_rustls::HttpsConnectorBuilder::new()
3634/// # .with_native_roots()
3635/// # .unwrap()
3636/// # .https_or_http()
3637/// # .enable_http2()
3638/// # .build()
3639/// # );
3640/// # let mut hub = FirebaseManagement::new(client, auth);
3641/// // As the method needs a request, you would usually fill it with the desired information
3642/// // into the respective structure. Some of the parts shown here might not be applicable !
3643/// // Values shown here are possibly random and not representative !
3644/// let mut req = AndroidApp::default();
3645///
3646/// // You can configure optional parameters by calling the respective setters at will, and
3647/// // execute the final call using `doit()`.
3648/// // Values shown here are possibly random and not representative !
3649/// let result = hub.projects().android_apps_create(req, "parent")
3650/// .doit().await;
3651/// # }
3652/// ```
3653pub struct ProjectAndroidAppCreateCall<'a, C>
3654where
3655 C: 'a,
3656{
3657 hub: &'a FirebaseManagement<C>,
3658 _request: AndroidApp,
3659 _parent: String,
3660 _delegate: Option<&'a mut dyn common::Delegate>,
3661 _additional_params: HashMap<String, String>,
3662 _scopes: BTreeSet<String>,
3663}
3664
3665impl<'a, C> common::CallBuilder for ProjectAndroidAppCreateCall<'a, C> {}
3666
3667impl<'a, C> ProjectAndroidAppCreateCall<'a, C>
3668where
3669 C: common::Connector,
3670{
3671 /// Perform the operation you have build so far.
3672 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
3673 use std::borrow::Cow;
3674 use std::io::{Read, Seek};
3675
3676 use common::{url::Params, ToParts};
3677 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3678
3679 let mut dd = common::DefaultDelegate;
3680 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3681 dlg.begin(common::MethodInfo {
3682 id: "firebase.projects.androidApps.create",
3683 http_method: hyper::Method::POST,
3684 });
3685
3686 for &field in ["alt", "parent"].iter() {
3687 if self._additional_params.contains_key(field) {
3688 dlg.finished(false);
3689 return Err(common::Error::FieldClash(field));
3690 }
3691 }
3692
3693 let mut params = Params::with_capacity(4 + self._additional_params.len());
3694 params.push("parent", self._parent);
3695
3696 params.extend(self._additional_params.iter());
3697
3698 params.push("alt", "json");
3699 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/androidApps";
3700 if self._scopes.is_empty() {
3701 self._scopes
3702 .insert(Scope::CloudPlatform.as_ref().to_string());
3703 }
3704
3705 #[allow(clippy::single_element_loop)]
3706 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
3707 url = params.uri_replacement(url, param_name, find_this, true);
3708 }
3709 {
3710 let to_remove = ["parent"];
3711 params.remove_params(&to_remove);
3712 }
3713
3714 let url = params.parse_with_url(&url);
3715
3716 let mut json_mime_type = mime::APPLICATION_JSON;
3717 let mut request_value_reader = {
3718 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
3719 common::remove_json_null_values(&mut value);
3720 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
3721 serde_json::to_writer(&mut dst, &value).unwrap();
3722 dst
3723 };
3724 let request_size = request_value_reader
3725 .seek(std::io::SeekFrom::End(0))
3726 .unwrap();
3727 request_value_reader
3728 .seek(std::io::SeekFrom::Start(0))
3729 .unwrap();
3730
3731 loop {
3732 let token = match self
3733 .hub
3734 .auth
3735 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3736 .await
3737 {
3738 Ok(token) => token,
3739 Err(e) => match dlg.token(e) {
3740 Ok(token) => token,
3741 Err(e) => {
3742 dlg.finished(false);
3743 return Err(common::Error::MissingToken(e));
3744 }
3745 },
3746 };
3747 request_value_reader
3748 .seek(std::io::SeekFrom::Start(0))
3749 .unwrap();
3750 let mut req_result = {
3751 let client = &self.hub.client;
3752 dlg.pre_request();
3753 let mut req_builder = hyper::Request::builder()
3754 .method(hyper::Method::POST)
3755 .uri(url.as_str())
3756 .header(USER_AGENT, self.hub._user_agent.clone());
3757
3758 if let Some(token) = token.as_ref() {
3759 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3760 }
3761
3762 let request = req_builder
3763 .header(CONTENT_TYPE, json_mime_type.to_string())
3764 .header(CONTENT_LENGTH, request_size as u64)
3765 .body(common::to_body(
3766 request_value_reader.get_ref().clone().into(),
3767 ));
3768
3769 client.request(request.unwrap()).await
3770 };
3771
3772 match req_result {
3773 Err(err) => {
3774 if let common::Retry::After(d) = dlg.http_error(&err) {
3775 sleep(d).await;
3776 continue;
3777 }
3778 dlg.finished(false);
3779 return Err(common::Error::HttpError(err));
3780 }
3781 Ok(res) => {
3782 let (mut parts, body) = res.into_parts();
3783 let mut body = common::Body::new(body);
3784 if !parts.status.is_success() {
3785 let bytes = common::to_bytes(body).await.unwrap_or_default();
3786 let error = serde_json::from_str(&common::to_string(&bytes));
3787 let response = common::to_response(parts, bytes.into());
3788
3789 if let common::Retry::After(d) =
3790 dlg.http_failure(&response, error.as_ref().ok())
3791 {
3792 sleep(d).await;
3793 continue;
3794 }
3795
3796 dlg.finished(false);
3797
3798 return Err(match error {
3799 Ok(value) => common::Error::BadRequest(value),
3800 _ => common::Error::Failure(response),
3801 });
3802 }
3803 let response = {
3804 let bytes = common::to_bytes(body).await.unwrap_or_default();
3805 let encoded = common::to_string(&bytes);
3806 match serde_json::from_str(&encoded) {
3807 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3808 Err(error) => {
3809 dlg.response_json_decode_error(&encoded, &error);
3810 return Err(common::Error::JsonDecodeError(
3811 encoded.to_string(),
3812 error,
3813 ));
3814 }
3815 }
3816 };
3817
3818 dlg.finished(true);
3819 return Ok(response);
3820 }
3821 }
3822 }
3823 }
3824
3825 ///
3826 /// Sets the *request* property to the given value.
3827 ///
3828 /// Even though the property as already been set when instantiating this call,
3829 /// we provide this method for API completeness.
3830 pub fn request(mut self, new_value: AndroidApp) -> ProjectAndroidAppCreateCall<'a, C> {
3831 self._request = new_value;
3832 self
3833 }
3834 /// 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.
3835 ///
3836 /// Sets the *parent* path property to the given value.
3837 ///
3838 /// Even though the property as already been set when instantiating this call,
3839 /// we provide this method for API completeness.
3840 pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppCreateCall<'a, C> {
3841 self._parent = new_value.to_string();
3842 self
3843 }
3844 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3845 /// while executing the actual API request.
3846 ///
3847 /// ````text
3848 /// It should be used to handle progress information, and to implement a certain level of resilience.
3849 /// ````
3850 ///
3851 /// Sets the *delegate* property to the given value.
3852 pub fn delegate(
3853 mut self,
3854 new_value: &'a mut dyn common::Delegate,
3855 ) -> ProjectAndroidAppCreateCall<'a, C> {
3856 self._delegate = Some(new_value);
3857 self
3858 }
3859
3860 /// Set any additional parameter of the query string used in the request.
3861 /// It should be used to set parameters which are not yet available through their own
3862 /// setters.
3863 ///
3864 /// Please note that this method must not be used to set any of the known parameters
3865 /// which have their own setter method. If done anyway, the request will fail.
3866 ///
3867 /// # Additional Parameters
3868 ///
3869 /// * *$.xgafv* (query-string) - V1 error format.
3870 /// * *access_token* (query-string) - OAuth access token.
3871 /// * *alt* (query-string) - Data format for response.
3872 /// * *callback* (query-string) - JSONP
3873 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3874 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3875 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3876 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3877 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3878 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3879 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3880 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppCreateCall<'a, C>
3881 where
3882 T: AsRef<str>,
3883 {
3884 self._additional_params
3885 .insert(name.as_ref().to_string(), value.as_ref().to_string());
3886 self
3887 }
3888
3889 /// Identifies the authorization scope for the method you are building.
3890 ///
3891 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3892 /// [`Scope::CloudPlatform`].
3893 ///
3894 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3895 /// tokens for more than one scope.
3896 ///
3897 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3898 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3899 /// sufficient, a read-write scope will do as well.
3900 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppCreateCall<'a, C>
3901 where
3902 St: AsRef<str>,
3903 {
3904 self._scopes.insert(String::from(scope.as_ref()));
3905 self
3906 }
3907 /// Identifies the authorization scope(s) for the method you are building.
3908 ///
3909 /// See [`Self::add_scope()`] for details.
3910 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppCreateCall<'a, C>
3911 where
3912 I: IntoIterator<Item = St>,
3913 St: AsRef<str>,
3914 {
3915 self._scopes
3916 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3917 self
3918 }
3919
3920 /// Removes all scopes, and no default scope will be used either.
3921 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3922 /// for details).
3923 pub fn clear_scopes(mut self) -> ProjectAndroidAppCreateCall<'a, C> {
3924 self._scopes.clear();
3925 self
3926 }
3927}
3928
3929/// Gets the specified AndroidApp.
3930///
3931/// A builder for the *androidApps.get* method supported by a *project* resource.
3932/// It is not used directly, but through a [`ProjectMethods`] instance.
3933///
3934/// # Example
3935///
3936/// Instantiate a resource method builder
3937///
3938/// ```test_harness,no_run
3939/// # extern crate hyper;
3940/// # extern crate hyper_rustls;
3941/// # extern crate google_firebase1_beta1 as firebase1_beta1;
3942/// # async fn dox() {
3943/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3944///
3945/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3946/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
3947/// # .with_native_roots()
3948/// # .unwrap()
3949/// # .https_only()
3950/// # .enable_http2()
3951/// # .build();
3952///
3953/// # let executor = hyper_util::rt::TokioExecutor::new();
3954/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
3955/// # secret,
3956/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3957/// # yup_oauth2::client::CustomHyperClientBuilder::from(
3958/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
3959/// # ),
3960/// # ).build().await.unwrap();
3961///
3962/// # let client = hyper_util::client::legacy::Client::builder(
3963/// # hyper_util::rt::TokioExecutor::new()
3964/// # )
3965/// # .build(
3966/// # hyper_rustls::HttpsConnectorBuilder::new()
3967/// # .with_native_roots()
3968/// # .unwrap()
3969/// # .https_or_http()
3970/// # .enable_http2()
3971/// # .build()
3972/// # );
3973/// # let mut hub = FirebaseManagement::new(client, auth);
3974/// // You can configure optional parameters by calling the respective setters at will, and
3975/// // execute the final call using `doit()`.
3976/// // Values shown here are possibly random and not representative !
3977/// let result = hub.projects().android_apps_get("name")
3978/// .doit().await;
3979/// # }
3980/// ```
3981pub struct ProjectAndroidAppGetCall<'a, C>
3982where
3983 C: 'a,
3984{
3985 hub: &'a FirebaseManagement<C>,
3986 _name: String,
3987 _delegate: Option<&'a mut dyn common::Delegate>,
3988 _additional_params: HashMap<String, String>,
3989 _scopes: BTreeSet<String>,
3990}
3991
3992impl<'a, C> common::CallBuilder for ProjectAndroidAppGetCall<'a, C> {}
3993
3994impl<'a, C> ProjectAndroidAppGetCall<'a, C>
3995where
3996 C: common::Connector,
3997{
3998 /// Perform the operation you have build so far.
3999 pub async fn doit(mut self) -> common::Result<(common::Response, AndroidApp)> {
4000 use std::borrow::Cow;
4001 use std::io::{Read, Seek};
4002
4003 use common::{url::Params, ToParts};
4004 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4005
4006 let mut dd = common::DefaultDelegate;
4007 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4008 dlg.begin(common::MethodInfo {
4009 id: "firebase.projects.androidApps.get",
4010 http_method: hyper::Method::GET,
4011 });
4012
4013 for &field in ["alt", "name"].iter() {
4014 if self._additional_params.contains_key(field) {
4015 dlg.finished(false);
4016 return Err(common::Error::FieldClash(field));
4017 }
4018 }
4019
4020 let mut params = Params::with_capacity(3 + self._additional_params.len());
4021 params.push("name", self._name);
4022
4023 params.extend(self._additional_params.iter());
4024
4025 params.push("alt", "json");
4026 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
4027 if self._scopes.is_empty() {
4028 self._scopes.insert(Scope::Readonly.as_ref().to_string());
4029 }
4030
4031 #[allow(clippy::single_element_loop)]
4032 for &(find_this, param_name) in [("{+name}", "name")].iter() {
4033 url = params.uri_replacement(url, param_name, find_this, true);
4034 }
4035 {
4036 let to_remove = ["name"];
4037 params.remove_params(&to_remove);
4038 }
4039
4040 let url = params.parse_with_url(&url);
4041
4042 loop {
4043 let token = match self
4044 .hub
4045 .auth
4046 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4047 .await
4048 {
4049 Ok(token) => token,
4050 Err(e) => match dlg.token(e) {
4051 Ok(token) => token,
4052 Err(e) => {
4053 dlg.finished(false);
4054 return Err(common::Error::MissingToken(e));
4055 }
4056 },
4057 };
4058 let mut req_result = {
4059 let client = &self.hub.client;
4060 dlg.pre_request();
4061 let mut req_builder = hyper::Request::builder()
4062 .method(hyper::Method::GET)
4063 .uri(url.as_str())
4064 .header(USER_AGENT, self.hub._user_agent.clone());
4065
4066 if let Some(token) = token.as_ref() {
4067 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4068 }
4069
4070 let request = req_builder
4071 .header(CONTENT_LENGTH, 0_u64)
4072 .body(common::to_body::<String>(None));
4073
4074 client.request(request.unwrap()).await
4075 };
4076
4077 match req_result {
4078 Err(err) => {
4079 if let common::Retry::After(d) = dlg.http_error(&err) {
4080 sleep(d).await;
4081 continue;
4082 }
4083 dlg.finished(false);
4084 return Err(common::Error::HttpError(err));
4085 }
4086 Ok(res) => {
4087 let (mut parts, body) = res.into_parts();
4088 let mut body = common::Body::new(body);
4089 if !parts.status.is_success() {
4090 let bytes = common::to_bytes(body).await.unwrap_or_default();
4091 let error = serde_json::from_str(&common::to_string(&bytes));
4092 let response = common::to_response(parts, bytes.into());
4093
4094 if let common::Retry::After(d) =
4095 dlg.http_failure(&response, error.as_ref().ok())
4096 {
4097 sleep(d).await;
4098 continue;
4099 }
4100
4101 dlg.finished(false);
4102
4103 return Err(match error {
4104 Ok(value) => common::Error::BadRequest(value),
4105 _ => common::Error::Failure(response),
4106 });
4107 }
4108 let response = {
4109 let bytes = common::to_bytes(body).await.unwrap_or_default();
4110 let encoded = common::to_string(&bytes);
4111 match serde_json::from_str(&encoded) {
4112 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4113 Err(error) => {
4114 dlg.response_json_decode_error(&encoded, &error);
4115 return Err(common::Error::JsonDecodeError(
4116 encoded.to_string(),
4117 error,
4118 ));
4119 }
4120 }
4121 };
4122
4123 dlg.finished(true);
4124 return Ok(response);
4125 }
4126 }
4127 }
4128 }
4129
4130 /// 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.
4131 ///
4132 /// Sets the *name* path property to the given value.
4133 ///
4134 /// Even though the property as already been set when instantiating this call,
4135 /// we provide this method for API completeness.
4136 pub fn name(mut self, new_value: &str) -> ProjectAndroidAppGetCall<'a, C> {
4137 self._name = new_value.to_string();
4138 self
4139 }
4140 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4141 /// while executing the actual API request.
4142 ///
4143 /// ````text
4144 /// It should be used to handle progress information, and to implement a certain level of resilience.
4145 /// ````
4146 ///
4147 /// Sets the *delegate* property to the given value.
4148 pub fn delegate(
4149 mut self,
4150 new_value: &'a mut dyn common::Delegate,
4151 ) -> ProjectAndroidAppGetCall<'a, C> {
4152 self._delegate = Some(new_value);
4153 self
4154 }
4155
4156 /// Set any additional parameter of the query string used in the request.
4157 /// It should be used to set parameters which are not yet available through their own
4158 /// setters.
4159 ///
4160 /// Please note that this method must not be used to set any of the known parameters
4161 /// which have their own setter method. If done anyway, the request will fail.
4162 ///
4163 /// # Additional Parameters
4164 ///
4165 /// * *$.xgafv* (query-string) - V1 error format.
4166 /// * *access_token* (query-string) - OAuth access token.
4167 /// * *alt* (query-string) - Data format for response.
4168 /// * *callback* (query-string) - JSONP
4169 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4170 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4171 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4172 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4173 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4174 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4175 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4176 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppGetCall<'a, C>
4177 where
4178 T: AsRef<str>,
4179 {
4180 self._additional_params
4181 .insert(name.as_ref().to_string(), value.as_ref().to_string());
4182 self
4183 }
4184
4185 /// Identifies the authorization scope for the method you are building.
4186 ///
4187 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4188 /// [`Scope::Readonly`].
4189 ///
4190 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4191 /// tokens for more than one scope.
4192 ///
4193 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4194 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4195 /// sufficient, a read-write scope will do as well.
4196 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppGetCall<'a, C>
4197 where
4198 St: AsRef<str>,
4199 {
4200 self._scopes.insert(String::from(scope.as_ref()));
4201 self
4202 }
4203 /// Identifies the authorization scope(s) for the method you are building.
4204 ///
4205 /// See [`Self::add_scope()`] for details.
4206 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppGetCall<'a, C>
4207 where
4208 I: IntoIterator<Item = St>,
4209 St: AsRef<str>,
4210 {
4211 self._scopes
4212 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4213 self
4214 }
4215
4216 /// Removes all scopes, and no default scope will be used either.
4217 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4218 /// for details).
4219 pub fn clear_scopes(mut self) -> ProjectAndroidAppGetCall<'a, C> {
4220 self._scopes.clear();
4221 self
4222 }
4223}
4224
4225/// Gets the configuration artifact associated with the specified AndroidApp.
4226///
4227/// A builder for the *androidApps.getConfig* method supported by a *project* resource.
4228/// It is not used directly, but through a [`ProjectMethods`] instance.
4229///
4230/// # Example
4231///
4232/// Instantiate a resource method builder
4233///
4234/// ```test_harness,no_run
4235/// # extern crate hyper;
4236/// # extern crate hyper_rustls;
4237/// # extern crate google_firebase1_beta1 as firebase1_beta1;
4238/// # async fn dox() {
4239/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4240///
4241/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4242/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
4243/// # .with_native_roots()
4244/// # .unwrap()
4245/// # .https_only()
4246/// # .enable_http2()
4247/// # .build();
4248///
4249/// # let executor = hyper_util::rt::TokioExecutor::new();
4250/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
4251/// # secret,
4252/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4253/// # yup_oauth2::client::CustomHyperClientBuilder::from(
4254/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
4255/// # ),
4256/// # ).build().await.unwrap();
4257///
4258/// # let client = hyper_util::client::legacy::Client::builder(
4259/// # hyper_util::rt::TokioExecutor::new()
4260/// # )
4261/// # .build(
4262/// # hyper_rustls::HttpsConnectorBuilder::new()
4263/// # .with_native_roots()
4264/// # .unwrap()
4265/// # .https_or_http()
4266/// # .enable_http2()
4267/// # .build()
4268/// # );
4269/// # let mut hub = FirebaseManagement::new(client, auth);
4270/// // You can configure optional parameters by calling the respective setters at will, and
4271/// // execute the final call using `doit()`.
4272/// // Values shown here are possibly random and not representative !
4273/// let result = hub.projects().android_apps_get_config("name")
4274/// .doit().await;
4275/// # }
4276/// ```
4277pub struct ProjectAndroidAppGetConfigCall<'a, C>
4278where
4279 C: 'a,
4280{
4281 hub: &'a FirebaseManagement<C>,
4282 _name: String,
4283 _delegate: Option<&'a mut dyn common::Delegate>,
4284 _additional_params: HashMap<String, String>,
4285 _scopes: BTreeSet<String>,
4286}
4287
4288impl<'a, C> common::CallBuilder for ProjectAndroidAppGetConfigCall<'a, C> {}
4289
4290impl<'a, C> ProjectAndroidAppGetConfigCall<'a, C>
4291where
4292 C: common::Connector,
4293{
4294 /// Perform the operation you have build so far.
4295 pub async fn doit(mut self) -> common::Result<(common::Response, AndroidAppConfig)> {
4296 use std::borrow::Cow;
4297 use std::io::{Read, Seek};
4298
4299 use common::{url::Params, ToParts};
4300 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4301
4302 let mut dd = common::DefaultDelegate;
4303 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4304 dlg.begin(common::MethodInfo {
4305 id: "firebase.projects.androidApps.getConfig",
4306 http_method: hyper::Method::GET,
4307 });
4308
4309 for &field in ["alt", "name"].iter() {
4310 if self._additional_params.contains_key(field) {
4311 dlg.finished(false);
4312 return Err(common::Error::FieldClash(field));
4313 }
4314 }
4315
4316 let mut params = Params::with_capacity(3 + self._additional_params.len());
4317 params.push("name", self._name);
4318
4319 params.extend(self._additional_params.iter());
4320
4321 params.push("alt", "json");
4322 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
4323 if self._scopes.is_empty() {
4324 self._scopes.insert(Scope::Readonly.as_ref().to_string());
4325 }
4326
4327 #[allow(clippy::single_element_loop)]
4328 for &(find_this, param_name) in [("{+name}", "name")].iter() {
4329 url = params.uri_replacement(url, param_name, find_this, true);
4330 }
4331 {
4332 let to_remove = ["name"];
4333 params.remove_params(&to_remove);
4334 }
4335
4336 let url = params.parse_with_url(&url);
4337
4338 loop {
4339 let token = match self
4340 .hub
4341 .auth
4342 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4343 .await
4344 {
4345 Ok(token) => token,
4346 Err(e) => match dlg.token(e) {
4347 Ok(token) => token,
4348 Err(e) => {
4349 dlg.finished(false);
4350 return Err(common::Error::MissingToken(e));
4351 }
4352 },
4353 };
4354 let mut req_result = {
4355 let client = &self.hub.client;
4356 dlg.pre_request();
4357 let mut req_builder = hyper::Request::builder()
4358 .method(hyper::Method::GET)
4359 .uri(url.as_str())
4360 .header(USER_AGENT, self.hub._user_agent.clone());
4361
4362 if let Some(token) = token.as_ref() {
4363 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4364 }
4365
4366 let request = req_builder
4367 .header(CONTENT_LENGTH, 0_u64)
4368 .body(common::to_body::<String>(None));
4369
4370 client.request(request.unwrap()).await
4371 };
4372
4373 match req_result {
4374 Err(err) => {
4375 if let common::Retry::After(d) = dlg.http_error(&err) {
4376 sleep(d).await;
4377 continue;
4378 }
4379 dlg.finished(false);
4380 return Err(common::Error::HttpError(err));
4381 }
4382 Ok(res) => {
4383 let (mut parts, body) = res.into_parts();
4384 let mut body = common::Body::new(body);
4385 if !parts.status.is_success() {
4386 let bytes = common::to_bytes(body).await.unwrap_or_default();
4387 let error = serde_json::from_str(&common::to_string(&bytes));
4388 let response = common::to_response(parts, bytes.into());
4389
4390 if let common::Retry::After(d) =
4391 dlg.http_failure(&response, error.as_ref().ok())
4392 {
4393 sleep(d).await;
4394 continue;
4395 }
4396
4397 dlg.finished(false);
4398
4399 return Err(match error {
4400 Ok(value) => common::Error::BadRequest(value),
4401 _ => common::Error::Failure(response),
4402 });
4403 }
4404 let response = {
4405 let bytes = common::to_bytes(body).await.unwrap_or_default();
4406 let encoded = common::to_string(&bytes);
4407 match serde_json::from_str(&encoded) {
4408 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4409 Err(error) => {
4410 dlg.response_json_decode_error(&encoded, &error);
4411 return Err(common::Error::JsonDecodeError(
4412 encoded.to_string(),
4413 error,
4414 ));
4415 }
4416 }
4417 };
4418
4419 dlg.finished(true);
4420 return Ok(response);
4421 }
4422 }
4423 }
4424 }
4425
4426 /// 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.
4427 ///
4428 /// Sets the *name* path property to the given value.
4429 ///
4430 /// Even though the property as already been set when instantiating this call,
4431 /// we provide this method for API completeness.
4432 pub fn name(mut self, new_value: &str) -> ProjectAndroidAppGetConfigCall<'a, C> {
4433 self._name = new_value.to_string();
4434 self
4435 }
4436 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4437 /// while executing the actual API request.
4438 ///
4439 /// ````text
4440 /// It should be used to handle progress information, and to implement a certain level of resilience.
4441 /// ````
4442 ///
4443 /// Sets the *delegate* property to the given value.
4444 pub fn delegate(
4445 mut self,
4446 new_value: &'a mut dyn common::Delegate,
4447 ) -> ProjectAndroidAppGetConfigCall<'a, C> {
4448 self._delegate = Some(new_value);
4449 self
4450 }
4451
4452 /// Set any additional parameter of the query string used in the request.
4453 /// It should be used to set parameters which are not yet available through their own
4454 /// setters.
4455 ///
4456 /// Please note that this method must not be used to set any of the known parameters
4457 /// which have their own setter method. If done anyway, the request will fail.
4458 ///
4459 /// # Additional Parameters
4460 ///
4461 /// * *$.xgafv* (query-string) - V1 error format.
4462 /// * *access_token* (query-string) - OAuth access token.
4463 /// * *alt* (query-string) - Data format for response.
4464 /// * *callback* (query-string) - JSONP
4465 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4466 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4467 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4468 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4469 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4470 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4471 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4472 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppGetConfigCall<'a, C>
4473 where
4474 T: AsRef<str>,
4475 {
4476 self._additional_params
4477 .insert(name.as_ref().to_string(), value.as_ref().to_string());
4478 self
4479 }
4480
4481 /// Identifies the authorization scope for the method you are building.
4482 ///
4483 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4484 /// [`Scope::Readonly`].
4485 ///
4486 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4487 /// tokens for more than one scope.
4488 ///
4489 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4490 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4491 /// sufficient, a read-write scope will do as well.
4492 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppGetConfigCall<'a, C>
4493 where
4494 St: AsRef<str>,
4495 {
4496 self._scopes.insert(String::from(scope.as_ref()));
4497 self
4498 }
4499 /// Identifies the authorization scope(s) for the method you are building.
4500 ///
4501 /// See [`Self::add_scope()`] for details.
4502 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppGetConfigCall<'a, C>
4503 where
4504 I: IntoIterator<Item = St>,
4505 St: AsRef<str>,
4506 {
4507 self._scopes
4508 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4509 self
4510 }
4511
4512 /// Removes all scopes, and no default scope will be used either.
4513 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4514 /// for details).
4515 pub fn clear_scopes(mut self) -> ProjectAndroidAppGetConfigCall<'a, C> {
4516 self._scopes.clear();
4517 self
4518 }
4519}
4520
4521/// 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`.
4522///
4523/// A builder for the *androidApps.list* method supported by a *project* resource.
4524/// It is not used directly, but through a [`ProjectMethods`] instance.
4525///
4526/// # Example
4527///
4528/// Instantiate a resource method builder
4529///
4530/// ```test_harness,no_run
4531/// # extern crate hyper;
4532/// # extern crate hyper_rustls;
4533/// # extern crate google_firebase1_beta1 as firebase1_beta1;
4534/// # async fn dox() {
4535/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4536///
4537/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4538/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
4539/// # .with_native_roots()
4540/// # .unwrap()
4541/// # .https_only()
4542/// # .enable_http2()
4543/// # .build();
4544///
4545/// # let executor = hyper_util::rt::TokioExecutor::new();
4546/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
4547/// # secret,
4548/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4549/// # yup_oauth2::client::CustomHyperClientBuilder::from(
4550/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
4551/// # ),
4552/// # ).build().await.unwrap();
4553///
4554/// # let client = hyper_util::client::legacy::Client::builder(
4555/// # hyper_util::rt::TokioExecutor::new()
4556/// # )
4557/// # .build(
4558/// # hyper_rustls::HttpsConnectorBuilder::new()
4559/// # .with_native_roots()
4560/// # .unwrap()
4561/// # .https_or_http()
4562/// # .enable_http2()
4563/// # .build()
4564/// # );
4565/// # let mut hub = FirebaseManagement::new(client, auth);
4566/// // You can configure optional parameters by calling the respective setters at will, and
4567/// // execute the final call using `doit()`.
4568/// // Values shown here are possibly random and not representative !
4569/// let result = hub.projects().android_apps_list("parent")
4570/// .show_deleted(true)
4571/// .page_token("Lorem")
4572/// .page_size(-12)
4573/// .doit().await;
4574/// # }
4575/// ```
4576pub struct ProjectAndroidAppListCall<'a, C>
4577where
4578 C: 'a,
4579{
4580 hub: &'a FirebaseManagement<C>,
4581 _parent: String,
4582 _show_deleted: Option<bool>,
4583 _page_token: Option<String>,
4584 _page_size: Option<i32>,
4585 _delegate: Option<&'a mut dyn common::Delegate>,
4586 _additional_params: HashMap<String, String>,
4587 _scopes: BTreeSet<String>,
4588}
4589
4590impl<'a, C> common::CallBuilder for ProjectAndroidAppListCall<'a, C> {}
4591
4592impl<'a, C> ProjectAndroidAppListCall<'a, C>
4593where
4594 C: common::Connector,
4595{
4596 /// Perform the operation you have build so far.
4597 pub async fn doit(mut self) -> common::Result<(common::Response, ListAndroidAppsResponse)> {
4598 use std::borrow::Cow;
4599 use std::io::{Read, Seek};
4600
4601 use common::{url::Params, ToParts};
4602 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4603
4604 let mut dd = common::DefaultDelegate;
4605 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4606 dlg.begin(common::MethodInfo {
4607 id: "firebase.projects.androidApps.list",
4608 http_method: hyper::Method::GET,
4609 });
4610
4611 for &field in ["alt", "parent", "showDeleted", "pageToken", "pageSize"].iter() {
4612 if self._additional_params.contains_key(field) {
4613 dlg.finished(false);
4614 return Err(common::Error::FieldClash(field));
4615 }
4616 }
4617
4618 let mut params = Params::with_capacity(6 + self._additional_params.len());
4619 params.push("parent", self._parent);
4620 if let Some(value) = self._show_deleted.as_ref() {
4621 params.push("showDeleted", value.to_string());
4622 }
4623 if let Some(value) = self._page_token.as_ref() {
4624 params.push("pageToken", value);
4625 }
4626 if let Some(value) = self._page_size.as_ref() {
4627 params.push("pageSize", value.to_string());
4628 }
4629
4630 params.extend(self._additional_params.iter());
4631
4632 params.push("alt", "json");
4633 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/androidApps";
4634 if self._scopes.is_empty() {
4635 self._scopes.insert(Scope::Readonly.as_ref().to_string());
4636 }
4637
4638 #[allow(clippy::single_element_loop)]
4639 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
4640 url = params.uri_replacement(url, param_name, find_this, true);
4641 }
4642 {
4643 let to_remove = ["parent"];
4644 params.remove_params(&to_remove);
4645 }
4646
4647 let url = params.parse_with_url(&url);
4648
4649 loop {
4650 let token = match self
4651 .hub
4652 .auth
4653 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4654 .await
4655 {
4656 Ok(token) => token,
4657 Err(e) => match dlg.token(e) {
4658 Ok(token) => token,
4659 Err(e) => {
4660 dlg.finished(false);
4661 return Err(common::Error::MissingToken(e));
4662 }
4663 },
4664 };
4665 let mut req_result = {
4666 let client = &self.hub.client;
4667 dlg.pre_request();
4668 let mut req_builder = hyper::Request::builder()
4669 .method(hyper::Method::GET)
4670 .uri(url.as_str())
4671 .header(USER_AGENT, self.hub._user_agent.clone());
4672
4673 if let Some(token) = token.as_ref() {
4674 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4675 }
4676
4677 let request = req_builder
4678 .header(CONTENT_LENGTH, 0_u64)
4679 .body(common::to_body::<String>(None));
4680
4681 client.request(request.unwrap()).await
4682 };
4683
4684 match req_result {
4685 Err(err) => {
4686 if let common::Retry::After(d) = dlg.http_error(&err) {
4687 sleep(d).await;
4688 continue;
4689 }
4690 dlg.finished(false);
4691 return Err(common::Error::HttpError(err));
4692 }
4693 Ok(res) => {
4694 let (mut parts, body) = res.into_parts();
4695 let mut body = common::Body::new(body);
4696 if !parts.status.is_success() {
4697 let bytes = common::to_bytes(body).await.unwrap_or_default();
4698 let error = serde_json::from_str(&common::to_string(&bytes));
4699 let response = common::to_response(parts, bytes.into());
4700
4701 if let common::Retry::After(d) =
4702 dlg.http_failure(&response, error.as_ref().ok())
4703 {
4704 sleep(d).await;
4705 continue;
4706 }
4707
4708 dlg.finished(false);
4709
4710 return Err(match error {
4711 Ok(value) => common::Error::BadRequest(value),
4712 _ => common::Error::Failure(response),
4713 });
4714 }
4715 let response = {
4716 let bytes = common::to_bytes(body).await.unwrap_or_default();
4717 let encoded = common::to_string(&bytes);
4718 match serde_json::from_str(&encoded) {
4719 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4720 Err(error) => {
4721 dlg.response_json_decode_error(&encoded, &error);
4722 return Err(common::Error::JsonDecodeError(
4723 encoded.to_string(),
4724 error,
4725 ));
4726 }
4727 }
4728 };
4729
4730 dlg.finished(true);
4731 return Ok(response);
4732 }
4733 }
4734 }
4735 }
4736
4737 /// 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.
4738 ///
4739 /// Sets the *parent* path property to the given value.
4740 ///
4741 /// Even though the property as already been set when instantiating this call,
4742 /// we provide this method for API completeness.
4743 pub fn parent(mut self, new_value: &str) -> ProjectAndroidAppListCall<'a, C> {
4744 self._parent = new_value.to_string();
4745 self
4746 }
4747 /// Controls whether Apps in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Apps will be returned.
4748 ///
4749 /// Sets the *show deleted* query property to the given value.
4750 pub fn show_deleted(mut self, new_value: bool) -> ProjectAndroidAppListCall<'a, C> {
4751 self._show_deleted = Some(new_value);
4752 self
4753 }
4754 /// Token returned from a previous call to `ListAndroidApps` indicating where in the set of Apps to resume listing.
4755 ///
4756 /// Sets the *page token* query property to the given value.
4757 pub fn page_token(mut self, new_value: &str) -> ProjectAndroidAppListCall<'a, C> {
4758 self._page_token = Some(new_value.to_string());
4759 self
4760 }
4761 /// 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.
4762 ///
4763 /// Sets the *page size* query property to the given value.
4764 pub fn page_size(mut self, new_value: i32) -> ProjectAndroidAppListCall<'a, C> {
4765 self._page_size = Some(new_value);
4766 self
4767 }
4768 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4769 /// while executing the actual API request.
4770 ///
4771 /// ````text
4772 /// It should be used to handle progress information, and to implement a certain level of resilience.
4773 /// ````
4774 ///
4775 /// Sets the *delegate* property to the given value.
4776 pub fn delegate(
4777 mut self,
4778 new_value: &'a mut dyn common::Delegate,
4779 ) -> ProjectAndroidAppListCall<'a, C> {
4780 self._delegate = Some(new_value);
4781 self
4782 }
4783
4784 /// Set any additional parameter of the query string used in the request.
4785 /// It should be used to set parameters which are not yet available through their own
4786 /// setters.
4787 ///
4788 /// Please note that this method must not be used to set any of the known parameters
4789 /// which have their own setter method. If done anyway, the request will fail.
4790 ///
4791 /// # Additional Parameters
4792 ///
4793 /// * *$.xgafv* (query-string) - V1 error format.
4794 /// * *access_token* (query-string) - OAuth access token.
4795 /// * *alt* (query-string) - Data format for response.
4796 /// * *callback* (query-string) - JSONP
4797 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4798 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
4799 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4800 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4801 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
4802 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
4803 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
4804 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppListCall<'a, C>
4805 where
4806 T: AsRef<str>,
4807 {
4808 self._additional_params
4809 .insert(name.as_ref().to_string(), value.as_ref().to_string());
4810 self
4811 }
4812
4813 /// Identifies the authorization scope for the method you are building.
4814 ///
4815 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4816 /// [`Scope::Readonly`].
4817 ///
4818 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4819 /// tokens for more than one scope.
4820 ///
4821 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4822 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4823 /// sufficient, a read-write scope will do as well.
4824 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppListCall<'a, C>
4825 where
4826 St: AsRef<str>,
4827 {
4828 self._scopes.insert(String::from(scope.as_ref()));
4829 self
4830 }
4831 /// Identifies the authorization scope(s) for the method you are building.
4832 ///
4833 /// See [`Self::add_scope()`] for details.
4834 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppListCall<'a, C>
4835 where
4836 I: IntoIterator<Item = St>,
4837 St: AsRef<str>,
4838 {
4839 self._scopes
4840 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4841 self
4842 }
4843
4844 /// Removes all scopes, and no default scope will be used either.
4845 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4846 /// for details).
4847 pub fn clear_scopes(mut self) -> ProjectAndroidAppListCall<'a, C> {
4848 self._scopes.clear();
4849 self
4850 }
4851}
4852
4853/// Updates the attributes of the specified AndroidApp.
4854///
4855/// A builder for the *androidApps.patch* method supported by a *project* resource.
4856/// It is not used directly, but through a [`ProjectMethods`] instance.
4857///
4858/// # Example
4859///
4860/// Instantiate a resource method builder
4861///
4862/// ```test_harness,no_run
4863/// # extern crate hyper;
4864/// # extern crate hyper_rustls;
4865/// # extern crate google_firebase1_beta1 as firebase1_beta1;
4866/// use firebase1_beta1::api::AndroidApp;
4867/// # async fn dox() {
4868/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4869///
4870/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4871/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
4872/// # .with_native_roots()
4873/// # .unwrap()
4874/// # .https_only()
4875/// # .enable_http2()
4876/// # .build();
4877///
4878/// # let executor = hyper_util::rt::TokioExecutor::new();
4879/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
4880/// # secret,
4881/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4882/// # yup_oauth2::client::CustomHyperClientBuilder::from(
4883/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
4884/// # ),
4885/// # ).build().await.unwrap();
4886///
4887/// # let client = hyper_util::client::legacy::Client::builder(
4888/// # hyper_util::rt::TokioExecutor::new()
4889/// # )
4890/// # .build(
4891/// # hyper_rustls::HttpsConnectorBuilder::new()
4892/// # .with_native_roots()
4893/// # .unwrap()
4894/// # .https_or_http()
4895/// # .enable_http2()
4896/// # .build()
4897/// # );
4898/// # let mut hub = FirebaseManagement::new(client, auth);
4899/// // As the method needs a request, you would usually fill it with the desired information
4900/// // into the respective structure. Some of the parts shown here might not be applicable !
4901/// // Values shown here are possibly random and not representative !
4902/// let mut req = AndroidApp::default();
4903///
4904/// // You can configure optional parameters by calling the respective setters at will, and
4905/// // execute the final call using `doit()`.
4906/// // Values shown here are possibly random and not representative !
4907/// let result = hub.projects().android_apps_patch(req, "name")
4908/// .update_mask(FieldMask::new::<&str>(&[]))
4909/// .doit().await;
4910/// # }
4911/// ```
4912pub struct ProjectAndroidAppPatchCall<'a, C>
4913where
4914 C: 'a,
4915{
4916 hub: &'a FirebaseManagement<C>,
4917 _request: AndroidApp,
4918 _name: String,
4919 _update_mask: Option<common::FieldMask>,
4920 _delegate: Option<&'a mut dyn common::Delegate>,
4921 _additional_params: HashMap<String, String>,
4922 _scopes: BTreeSet<String>,
4923}
4924
4925impl<'a, C> common::CallBuilder for ProjectAndroidAppPatchCall<'a, C> {}
4926
4927impl<'a, C> ProjectAndroidAppPatchCall<'a, C>
4928where
4929 C: common::Connector,
4930{
4931 /// Perform the operation you have build so far.
4932 pub async fn doit(mut self) -> common::Result<(common::Response, AndroidApp)> {
4933 use std::borrow::Cow;
4934 use std::io::{Read, Seek};
4935
4936 use common::{url::Params, ToParts};
4937 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4938
4939 let mut dd = common::DefaultDelegate;
4940 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4941 dlg.begin(common::MethodInfo {
4942 id: "firebase.projects.androidApps.patch",
4943 http_method: hyper::Method::PATCH,
4944 });
4945
4946 for &field in ["alt", "name", "updateMask"].iter() {
4947 if self._additional_params.contains_key(field) {
4948 dlg.finished(false);
4949 return Err(common::Error::FieldClash(field));
4950 }
4951 }
4952
4953 let mut params = Params::with_capacity(5 + self._additional_params.len());
4954 params.push("name", self._name);
4955 if let Some(value) = self._update_mask.as_ref() {
4956 params.push("updateMask", value.to_string());
4957 }
4958
4959 params.extend(self._additional_params.iter());
4960
4961 params.push("alt", "json");
4962 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
4963 if self._scopes.is_empty() {
4964 self._scopes
4965 .insert(Scope::CloudPlatform.as_ref().to_string());
4966 }
4967
4968 #[allow(clippy::single_element_loop)]
4969 for &(find_this, param_name) in [("{+name}", "name")].iter() {
4970 url = params.uri_replacement(url, param_name, find_this, true);
4971 }
4972 {
4973 let to_remove = ["name"];
4974 params.remove_params(&to_remove);
4975 }
4976
4977 let url = params.parse_with_url(&url);
4978
4979 let mut json_mime_type = mime::APPLICATION_JSON;
4980 let mut request_value_reader = {
4981 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
4982 common::remove_json_null_values(&mut value);
4983 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
4984 serde_json::to_writer(&mut dst, &value).unwrap();
4985 dst
4986 };
4987 let request_size = request_value_reader
4988 .seek(std::io::SeekFrom::End(0))
4989 .unwrap();
4990 request_value_reader
4991 .seek(std::io::SeekFrom::Start(0))
4992 .unwrap();
4993
4994 loop {
4995 let token = match self
4996 .hub
4997 .auth
4998 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4999 .await
5000 {
5001 Ok(token) => token,
5002 Err(e) => match dlg.token(e) {
5003 Ok(token) => token,
5004 Err(e) => {
5005 dlg.finished(false);
5006 return Err(common::Error::MissingToken(e));
5007 }
5008 },
5009 };
5010 request_value_reader
5011 .seek(std::io::SeekFrom::Start(0))
5012 .unwrap();
5013 let mut req_result = {
5014 let client = &self.hub.client;
5015 dlg.pre_request();
5016 let mut req_builder = hyper::Request::builder()
5017 .method(hyper::Method::PATCH)
5018 .uri(url.as_str())
5019 .header(USER_AGENT, self.hub._user_agent.clone());
5020
5021 if let Some(token) = token.as_ref() {
5022 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5023 }
5024
5025 let request = req_builder
5026 .header(CONTENT_TYPE, json_mime_type.to_string())
5027 .header(CONTENT_LENGTH, request_size as u64)
5028 .body(common::to_body(
5029 request_value_reader.get_ref().clone().into(),
5030 ));
5031
5032 client.request(request.unwrap()).await
5033 };
5034
5035 match req_result {
5036 Err(err) => {
5037 if let common::Retry::After(d) = dlg.http_error(&err) {
5038 sleep(d).await;
5039 continue;
5040 }
5041 dlg.finished(false);
5042 return Err(common::Error::HttpError(err));
5043 }
5044 Ok(res) => {
5045 let (mut parts, body) = res.into_parts();
5046 let mut body = common::Body::new(body);
5047 if !parts.status.is_success() {
5048 let bytes = common::to_bytes(body).await.unwrap_or_default();
5049 let error = serde_json::from_str(&common::to_string(&bytes));
5050 let response = common::to_response(parts, bytes.into());
5051
5052 if let common::Retry::After(d) =
5053 dlg.http_failure(&response, error.as_ref().ok())
5054 {
5055 sleep(d).await;
5056 continue;
5057 }
5058
5059 dlg.finished(false);
5060
5061 return Err(match error {
5062 Ok(value) => common::Error::BadRequest(value),
5063 _ => common::Error::Failure(response),
5064 });
5065 }
5066 let response = {
5067 let bytes = common::to_bytes(body).await.unwrap_or_default();
5068 let encoded = common::to_string(&bytes);
5069 match serde_json::from_str(&encoded) {
5070 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5071 Err(error) => {
5072 dlg.response_json_decode_error(&encoded, &error);
5073 return Err(common::Error::JsonDecodeError(
5074 encoded.to_string(),
5075 error,
5076 ));
5077 }
5078 }
5079 };
5080
5081 dlg.finished(true);
5082 return Ok(response);
5083 }
5084 }
5085 }
5086 }
5087
5088 ///
5089 /// Sets the *request* property to the given value.
5090 ///
5091 /// Even though the property as already been set when instantiating this call,
5092 /// we provide this method for API completeness.
5093 pub fn request(mut self, new_value: AndroidApp) -> ProjectAndroidAppPatchCall<'a, C> {
5094 self._request = new_value;
5095 self
5096 }
5097 /// 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)).
5098 ///
5099 /// Sets the *name* path property to the given value.
5100 ///
5101 /// Even though the property as already been set when instantiating this call,
5102 /// we provide this method for API completeness.
5103 pub fn name(mut self, new_value: &str) -> ProjectAndroidAppPatchCall<'a, C> {
5104 self._name = new_value.to_string();
5105 self
5106 }
5107 /// 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.
5108 ///
5109 /// Sets the *update mask* query property to the given value.
5110 pub fn update_mask(
5111 mut self,
5112 new_value: common::FieldMask,
5113 ) -> ProjectAndroidAppPatchCall<'a, C> {
5114 self._update_mask = Some(new_value);
5115 self
5116 }
5117 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5118 /// while executing the actual API request.
5119 ///
5120 /// ````text
5121 /// It should be used to handle progress information, and to implement a certain level of resilience.
5122 /// ````
5123 ///
5124 /// Sets the *delegate* property to the given value.
5125 pub fn delegate(
5126 mut self,
5127 new_value: &'a mut dyn common::Delegate,
5128 ) -> ProjectAndroidAppPatchCall<'a, C> {
5129 self._delegate = Some(new_value);
5130 self
5131 }
5132
5133 /// Set any additional parameter of the query string used in the request.
5134 /// It should be used to set parameters which are not yet available through their own
5135 /// setters.
5136 ///
5137 /// Please note that this method must not be used to set any of the known parameters
5138 /// which have their own setter method. If done anyway, the request will fail.
5139 ///
5140 /// # Additional Parameters
5141 ///
5142 /// * *$.xgafv* (query-string) - V1 error format.
5143 /// * *access_token* (query-string) - OAuth access token.
5144 /// * *alt* (query-string) - Data format for response.
5145 /// * *callback* (query-string) - JSONP
5146 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5147 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5148 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5149 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5150 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5151 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5152 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5153 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppPatchCall<'a, C>
5154 where
5155 T: AsRef<str>,
5156 {
5157 self._additional_params
5158 .insert(name.as_ref().to_string(), value.as_ref().to_string());
5159 self
5160 }
5161
5162 /// Identifies the authorization scope for the method you are building.
5163 ///
5164 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5165 /// [`Scope::CloudPlatform`].
5166 ///
5167 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5168 /// tokens for more than one scope.
5169 ///
5170 /// Usually there is more than one suitable scope to authorize an operation, some of which may
5171 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5172 /// sufficient, a read-write scope will do as well.
5173 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppPatchCall<'a, C>
5174 where
5175 St: AsRef<str>,
5176 {
5177 self._scopes.insert(String::from(scope.as_ref()));
5178 self
5179 }
5180 /// Identifies the authorization scope(s) for the method you are building.
5181 ///
5182 /// See [`Self::add_scope()`] for details.
5183 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppPatchCall<'a, C>
5184 where
5185 I: IntoIterator<Item = St>,
5186 St: AsRef<str>,
5187 {
5188 self._scopes
5189 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5190 self
5191 }
5192
5193 /// Removes all scopes, and no default scope will be used either.
5194 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5195 /// for details).
5196 pub fn clear_scopes(mut self) -> ProjectAndroidAppPatchCall<'a, C> {
5197 self._scopes.clear();
5198 self
5199 }
5200}
5201
5202/// Removes the specified AndroidApp from the FirebaseProject.
5203///
5204/// A builder for the *androidApps.remove* method supported by a *project* resource.
5205/// It is not used directly, but through a [`ProjectMethods`] instance.
5206///
5207/// # Example
5208///
5209/// Instantiate a resource method builder
5210///
5211/// ```test_harness,no_run
5212/// # extern crate hyper;
5213/// # extern crate hyper_rustls;
5214/// # extern crate google_firebase1_beta1 as firebase1_beta1;
5215/// use firebase1_beta1::api::RemoveAndroidAppRequest;
5216/// # async fn dox() {
5217/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5218///
5219/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5220/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
5221/// # .with_native_roots()
5222/// # .unwrap()
5223/// # .https_only()
5224/// # .enable_http2()
5225/// # .build();
5226///
5227/// # let executor = hyper_util::rt::TokioExecutor::new();
5228/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
5229/// # secret,
5230/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5231/// # yup_oauth2::client::CustomHyperClientBuilder::from(
5232/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
5233/// # ),
5234/// # ).build().await.unwrap();
5235///
5236/// # let client = hyper_util::client::legacy::Client::builder(
5237/// # hyper_util::rt::TokioExecutor::new()
5238/// # )
5239/// # .build(
5240/// # hyper_rustls::HttpsConnectorBuilder::new()
5241/// # .with_native_roots()
5242/// # .unwrap()
5243/// # .https_or_http()
5244/// # .enable_http2()
5245/// # .build()
5246/// # );
5247/// # let mut hub = FirebaseManagement::new(client, auth);
5248/// // As the method needs a request, you would usually fill it with the desired information
5249/// // into the respective structure. Some of the parts shown here might not be applicable !
5250/// // Values shown here are possibly random and not representative !
5251/// let mut req = RemoveAndroidAppRequest::default();
5252///
5253/// // You can configure optional parameters by calling the respective setters at will, and
5254/// // execute the final call using `doit()`.
5255/// // Values shown here are possibly random and not representative !
5256/// let result = hub.projects().android_apps_remove(req, "name")
5257/// .doit().await;
5258/// # }
5259/// ```
5260pub struct ProjectAndroidAppRemoveCall<'a, C>
5261where
5262 C: 'a,
5263{
5264 hub: &'a FirebaseManagement<C>,
5265 _request: RemoveAndroidAppRequest,
5266 _name: String,
5267 _delegate: Option<&'a mut dyn common::Delegate>,
5268 _additional_params: HashMap<String, String>,
5269 _scopes: BTreeSet<String>,
5270}
5271
5272impl<'a, C> common::CallBuilder for ProjectAndroidAppRemoveCall<'a, C> {}
5273
5274impl<'a, C> ProjectAndroidAppRemoveCall<'a, C>
5275where
5276 C: common::Connector,
5277{
5278 /// Perform the operation you have build so far.
5279 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
5280 use std::borrow::Cow;
5281 use std::io::{Read, Seek};
5282
5283 use common::{url::Params, ToParts};
5284 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5285
5286 let mut dd = common::DefaultDelegate;
5287 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5288 dlg.begin(common::MethodInfo {
5289 id: "firebase.projects.androidApps.remove",
5290 http_method: hyper::Method::POST,
5291 });
5292
5293 for &field in ["alt", "name"].iter() {
5294 if self._additional_params.contains_key(field) {
5295 dlg.finished(false);
5296 return Err(common::Error::FieldClash(field));
5297 }
5298 }
5299
5300 let mut params = Params::with_capacity(4 + self._additional_params.len());
5301 params.push("name", self._name);
5302
5303 params.extend(self._additional_params.iter());
5304
5305 params.push("alt", "json");
5306 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:remove";
5307 if self._scopes.is_empty() {
5308 self._scopes
5309 .insert(Scope::CloudPlatform.as_ref().to_string());
5310 }
5311
5312 #[allow(clippy::single_element_loop)]
5313 for &(find_this, param_name) in [("{+name}", "name")].iter() {
5314 url = params.uri_replacement(url, param_name, find_this, true);
5315 }
5316 {
5317 let to_remove = ["name"];
5318 params.remove_params(&to_remove);
5319 }
5320
5321 let url = params.parse_with_url(&url);
5322
5323 let mut json_mime_type = mime::APPLICATION_JSON;
5324 let mut request_value_reader = {
5325 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
5326 common::remove_json_null_values(&mut value);
5327 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
5328 serde_json::to_writer(&mut dst, &value).unwrap();
5329 dst
5330 };
5331 let request_size = request_value_reader
5332 .seek(std::io::SeekFrom::End(0))
5333 .unwrap();
5334 request_value_reader
5335 .seek(std::io::SeekFrom::Start(0))
5336 .unwrap();
5337
5338 loop {
5339 let token = match self
5340 .hub
5341 .auth
5342 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5343 .await
5344 {
5345 Ok(token) => token,
5346 Err(e) => match dlg.token(e) {
5347 Ok(token) => token,
5348 Err(e) => {
5349 dlg.finished(false);
5350 return Err(common::Error::MissingToken(e));
5351 }
5352 },
5353 };
5354 request_value_reader
5355 .seek(std::io::SeekFrom::Start(0))
5356 .unwrap();
5357 let mut req_result = {
5358 let client = &self.hub.client;
5359 dlg.pre_request();
5360 let mut req_builder = hyper::Request::builder()
5361 .method(hyper::Method::POST)
5362 .uri(url.as_str())
5363 .header(USER_AGENT, self.hub._user_agent.clone());
5364
5365 if let Some(token) = token.as_ref() {
5366 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5367 }
5368
5369 let request = req_builder
5370 .header(CONTENT_TYPE, json_mime_type.to_string())
5371 .header(CONTENT_LENGTH, request_size as u64)
5372 .body(common::to_body(
5373 request_value_reader.get_ref().clone().into(),
5374 ));
5375
5376 client.request(request.unwrap()).await
5377 };
5378
5379 match req_result {
5380 Err(err) => {
5381 if let common::Retry::After(d) = dlg.http_error(&err) {
5382 sleep(d).await;
5383 continue;
5384 }
5385 dlg.finished(false);
5386 return Err(common::Error::HttpError(err));
5387 }
5388 Ok(res) => {
5389 let (mut parts, body) = res.into_parts();
5390 let mut body = common::Body::new(body);
5391 if !parts.status.is_success() {
5392 let bytes = common::to_bytes(body).await.unwrap_or_default();
5393 let error = serde_json::from_str(&common::to_string(&bytes));
5394 let response = common::to_response(parts, bytes.into());
5395
5396 if let common::Retry::After(d) =
5397 dlg.http_failure(&response, error.as_ref().ok())
5398 {
5399 sleep(d).await;
5400 continue;
5401 }
5402
5403 dlg.finished(false);
5404
5405 return Err(match error {
5406 Ok(value) => common::Error::BadRequest(value),
5407 _ => common::Error::Failure(response),
5408 });
5409 }
5410 let response = {
5411 let bytes = common::to_bytes(body).await.unwrap_or_default();
5412 let encoded = common::to_string(&bytes);
5413 match serde_json::from_str(&encoded) {
5414 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5415 Err(error) => {
5416 dlg.response_json_decode_error(&encoded, &error);
5417 return Err(common::Error::JsonDecodeError(
5418 encoded.to_string(),
5419 error,
5420 ));
5421 }
5422 }
5423 };
5424
5425 dlg.finished(true);
5426 return Ok(response);
5427 }
5428 }
5429 }
5430 }
5431
5432 ///
5433 /// Sets the *request* property to the given value.
5434 ///
5435 /// Even though the property as already been set when instantiating this call,
5436 /// we provide this method for API completeness.
5437 pub fn request(
5438 mut self,
5439 new_value: RemoveAndroidAppRequest,
5440 ) -> ProjectAndroidAppRemoveCall<'a, C> {
5441 self._request = new_value;
5442 self
5443 }
5444 /// 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.
5445 ///
5446 /// Sets the *name* path property to the given value.
5447 ///
5448 /// Even though the property as already been set when instantiating this call,
5449 /// we provide this method for API completeness.
5450 pub fn name(mut self, new_value: &str) -> ProjectAndroidAppRemoveCall<'a, C> {
5451 self._name = new_value.to_string();
5452 self
5453 }
5454 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5455 /// while executing the actual API request.
5456 ///
5457 /// ````text
5458 /// It should be used to handle progress information, and to implement a certain level of resilience.
5459 /// ````
5460 ///
5461 /// Sets the *delegate* property to the given value.
5462 pub fn delegate(
5463 mut self,
5464 new_value: &'a mut dyn common::Delegate,
5465 ) -> ProjectAndroidAppRemoveCall<'a, C> {
5466 self._delegate = Some(new_value);
5467 self
5468 }
5469
5470 /// Set any additional parameter of the query string used in the request.
5471 /// It should be used to set parameters which are not yet available through their own
5472 /// setters.
5473 ///
5474 /// Please note that this method must not be used to set any of the known parameters
5475 /// which have their own setter method. If done anyway, the request will fail.
5476 ///
5477 /// # Additional Parameters
5478 ///
5479 /// * *$.xgafv* (query-string) - V1 error format.
5480 /// * *access_token* (query-string) - OAuth access token.
5481 /// * *alt* (query-string) - Data format for response.
5482 /// * *callback* (query-string) - JSONP
5483 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5484 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5485 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5486 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5487 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5488 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5489 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5490 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppRemoveCall<'a, C>
5491 where
5492 T: AsRef<str>,
5493 {
5494 self._additional_params
5495 .insert(name.as_ref().to_string(), value.as_ref().to_string());
5496 self
5497 }
5498
5499 /// Identifies the authorization scope for the method you are building.
5500 ///
5501 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5502 /// [`Scope::CloudPlatform`].
5503 ///
5504 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5505 /// tokens for more than one scope.
5506 ///
5507 /// Usually there is more than one suitable scope to authorize an operation, some of which may
5508 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5509 /// sufficient, a read-write scope will do as well.
5510 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppRemoveCall<'a, C>
5511 where
5512 St: AsRef<str>,
5513 {
5514 self._scopes.insert(String::from(scope.as_ref()));
5515 self
5516 }
5517 /// Identifies the authorization scope(s) for the method you are building.
5518 ///
5519 /// See [`Self::add_scope()`] for details.
5520 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppRemoveCall<'a, C>
5521 where
5522 I: IntoIterator<Item = St>,
5523 St: AsRef<str>,
5524 {
5525 self._scopes
5526 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5527 self
5528 }
5529
5530 /// Removes all scopes, and no default scope will be used either.
5531 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5532 /// for details).
5533 pub fn clear_scopes(mut self) -> ProjectAndroidAppRemoveCall<'a, C> {
5534 self._scopes.clear();
5535 self
5536 }
5537}
5538
5539/// Restores the specified AndroidApp to the FirebaseProject.
5540///
5541/// A builder for the *androidApps.undelete* method supported by a *project* resource.
5542/// It is not used directly, but through a [`ProjectMethods`] instance.
5543///
5544/// # Example
5545///
5546/// Instantiate a resource method builder
5547///
5548/// ```test_harness,no_run
5549/// # extern crate hyper;
5550/// # extern crate hyper_rustls;
5551/// # extern crate google_firebase1_beta1 as firebase1_beta1;
5552/// use firebase1_beta1::api::UndeleteAndroidAppRequest;
5553/// # async fn dox() {
5554/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5555///
5556/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5557/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
5558/// # .with_native_roots()
5559/// # .unwrap()
5560/// # .https_only()
5561/// # .enable_http2()
5562/// # .build();
5563///
5564/// # let executor = hyper_util::rt::TokioExecutor::new();
5565/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
5566/// # secret,
5567/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5568/// # yup_oauth2::client::CustomHyperClientBuilder::from(
5569/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
5570/// # ),
5571/// # ).build().await.unwrap();
5572///
5573/// # let client = hyper_util::client::legacy::Client::builder(
5574/// # hyper_util::rt::TokioExecutor::new()
5575/// # )
5576/// # .build(
5577/// # hyper_rustls::HttpsConnectorBuilder::new()
5578/// # .with_native_roots()
5579/// # .unwrap()
5580/// # .https_or_http()
5581/// # .enable_http2()
5582/// # .build()
5583/// # );
5584/// # let mut hub = FirebaseManagement::new(client, auth);
5585/// // As the method needs a request, you would usually fill it with the desired information
5586/// // into the respective structure. Some of the parts shown here might not be applicable !
5587/// // Values shown here are possibly random and not representative !
5588/// let mut req = UndeleteAndroidAppRequest::default();
5589///
5590/// // You can configure optional parameters by calling the respective setters at will, and
5591/// // execute the final call using `doit()`.
5592/// // Values shown here are possibly random and not representative !
5593/// let result = hub.projects().android_apps_undelete(req, "name")
5594/// .doit().await;
5595/// # }
5596/// ```
5597pub struct ProjectAndroidAppUndeleteCall<'a, C>
5598where
5599 C: 'a,
5600{
5601 hub: &'a FirebaseManagement<C>,
5602 _request: UndeleteAndroidAppRequest,
5603 _name: String,
5604 _delegate: Option<&'a mut dyn common::Delegate>,
5605 _additional_params: HashMap<String, String>,
5606 _scopes: BTreeSet<String>,
5607}
5608
5609impl<'a, C> common::CallBuilder for ProjectAndroidAppUndeleteCall<'a, C> {}
5610
5611impl<'a, C> ProjectAndroidAppUndeleteCall<'a, C>
5612where
5613 C: common::Connector,
5614{
5615 /// Perform the operation you have build so far.
5616 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
5617 use std::borrow::Cow;
5618 use std::io::{Read, Seek};
5619
5620 use common::{url::Params, ToParts};
5621 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5622
5623 let mut dd = common::DefaultDelegate;
5624 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5625 dlg.begin(common::MethodInfo {
5626 id: "firebase.projects.androidApps.undelete",
5627 http_method: hyper::Method::POST,
5628 });
5629
5630 for &field in ["alt", "name"].iter() {
5631 if self._additional_params.contains_key(field) {
5632 dlg.finished(false);
5633 return Err(common::Error::FieldClash(field));
5634 }
5635 }
5636
5637 let mut params = Params::with_capacity(4 + self._additional_params.len());
5638 params.push("name", self._name);
5639
5640 params.extend(self._additional_params.iter());
5641
5642 params.push("alt", "json");
5643 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:undelete";
5644 if self._scopes.is_empty() {
5645 self._scopes
5646 .insert(Scope::CloudPlatform.as_ref().to_string());
5647 }
5648
5649 #[allow(clippy::single_element_loop)]
5650 for &(find_this, param_name) in [("{+name}", "name")].iter() {
5651 url = params.uri_replacement(url, param_name, find_this, true);
5652 }
5653 {
5654 let to_remove = ["name"];
5655 params.remove_params(&to_remove);
5656 }
5657
5658 let url = params.parse_with_url(&url);
5659
5660 let mut json_mime_type = mime::APPLICATION_JSON;
5661 let mut request_value_reader = {
5662 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
5663 common::remove_json_null_values(&mut value);
5664 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
5665 serde_json::to_writer(&mut dst, &value).unwrap();
5666 dst
5667 };
5668 let request_size = request_value_reader
5669 .seek(std::io::SeekFrom::End(0))
5670 .unwrap();
5671 request_value_reader
5672 .seek(std::io::SeekFrom::Start(0))
5673 .unwrap();
5674
5675 loop {
5676 let token = match self
5677 .hub
5678 .auth
5679 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5680 .await
5681 {
5682 Ok(token) => token,
5683 Err(e) => match dlg.token(e) {
5684 Ok(token) => token,
5685 Err(e) => {
5686 dlg.finished(false);
5687 return Err(common::Error::MissingToken(e));
5688 }
5689 },
5690 };
5691 request_value_reader
5692 .seek(std::io::SeekFrom::Start(0))
5693 .unwrap();
5694 let mut req_result = {
5695 let client = &self.hub.client;
5696 dlg.pre_request();
5697 let mut req_builder = hyper::Request::builder()
5698 .method(hyper::Method::POST)
5699 .uri(url.as_str())
5700 .header(USER_AGENT, self.hub._user_agent.clone());
5701
5702 if let Some(token) = token.as_ref() {
5703 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5704 }
5705
5706 let request = req_builder
5707 .header(CONTENT_TYPE, json_mime_type.to_string())
5708 .header(CONTENT_LENGTH, request_size as u64)
5709 .body(common::to_body(
5710 request_value_reader.get_ref().clone().into(),
5711 ));
5712
5713 client.request(request.unwrap()).await
5714 };
5715
5716 match req_result {
5717 Err(err) => {
5718 if let common::Retry::After(d) = dlg.http_error(&err) {
5719 sleep(d).await;
5720 continue;
5721 }
5722 dlg.finished(false);
5723 return Err(common::Error::HttpError(err));
5724 }
5725 Ok(res) => {
5726 let (mut parts, body) = res.into_parts();
5727 let mut body = common::Body::new(body);
5728 if !parts.status.is_success() {
5729 let bytes = common::to_bytes(body).await.unwrap_or_default();
5730 let error = serde_json::from_str(&common::to_string(&bytes));
5731 let response = common::to_response(parts, bytes.into());
5732
5733 if let common::Retry::After(d) =
5734 dlg.http_failure(&response, error.as_ref().ok())
5735 {
5736 sleep(d).await;
5737 continue;
5738 }
5739
5740 dlg.finished(false);
5741
5742 return Err(match error {
5743 Ok(value) => common::Error::BadRequest(value),
5744 _ => common::Error::Failure(response),
5745 });
5746 }
5747 let response = {
5748 let bytes = common::to_bytes(body).await.unwrap_or_default();
5749 let encoded = common::to_string(&bytes);
5750 match serde_json::from_str(&encoded) {
5751 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5752 Err(error) => {
5753 dlg.response_json_decode_error(&encoded, &error);
5754 return Err(common::Error::JsonDecodeError(
5755 encoded.to_string(),
5756 error,
5757 ));
5758 }
5759 }
5760 };
5761
5762 dlg.finished(true);
5763 return Ok(response);
5764 }
5765 }
5766 }
5767 }
5768
5769 ///
5770 /// Sets the *request* property to the given value.
5771 ///
5772 /// Even though the property as already been set when instantiating this call,
5773 /// we provide this method for API completeness.
5774 pub fn request(
5775 mut self,
5776 new_value: UndeleteAndroidAppRequest,
5777 ) -> ProjectAndroidAppUndeleteCall<'a, C> {
5778 self._request = new_value;
5779 self
5780 }
5781 /// 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.
5782 ///
5783 /// Sets the *name* path property to the given value.
5784 ///
5785 /// Even though the property as already been set when instantiating this call,
5786 /// we provide this method for API completeness.
5787 pub fn name(mut self, new_value: &str) -> ProjectAndroidAppUndeleteCall<'a, C> {
5788 self._name = new_value.to_string();
5789 self
5790 }
5791 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5792 /// while executing the actual API request.
5793 ///
5794 /// ````text
5795 /// It should be used to handle progress information, and to implement a certain level of resilience.
5796 /// ````
5797 ///
5798 /// Sets the *delegate* property to the given value.
5799 pub fn delegate(
5800 mut self,
5801 new_value: &'a mut dyn common::Delegate,
5802 ) -> ProjectAndroidAppUndeleteCall<'a, C> {
5803 self._delegate = Some(new_value);
5804 self
5805 }
5806
5807 /// Set any additional parameter of the query string used in the request.
5808 /// It should be used to set parameters which are not yet available through their own
5809 /// setters.
5810 ///
5811 /// Please note that this method must not be used to set any of the known parameters
5812 /// which have their own setter method. If done anyway, the request will fail.
5813 ///
5814 /// # Additional Parameters
5815 ///
5816 /// * *$.xgafv* (query-string) - V1 error format.
5817 /// * *access_token* (query-string) - OAuth access token.
5818 /// * *alt* (query-string) - Data format for response.
5819 /// * *callback* (query-string) - JSONP
5820 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5821 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
5822 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5823 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5824 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
5825 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5826 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5827 pub fn param<T>(mut self, name: T, value: T) -> ProjectAndroidAppUndeleteCall<'a, C>
5828 where
5829 T: AsRef<str>,
5830 {
5831 self._additional_params
5832 .insert(name.as_ref().to_string(), value.as_ref().to_string());
5833 self
5834 }
5835
5836 /// Identifies the authorization scope for the method you are building.
5837 ///
5838 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5839 /// [`Scope::CloudPlatform`].
5840 ///
5841 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5842 /// tokens for more than one scope.
5843 ///
5844 /// Usually there is more than one suitable scope to authorize an operation, some of which may
5845 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5846 /// sufficient, a read-write scope will do as well.
5847 pub fn add_scope<St>(mut self, scope: St) -> ProjectAndroidAppUndeleteCall<'a, C>
5848 where
5849 St: AsRef<str>,
5850 {
5851 self._scopes.insert(String::from(scope.as_ref()));
5852 self
5853 }
5854 /// Identifies the authorization scope(s) for the method you are building.
5855 ///
5856 /// See [`Self::add_scope()`] for details.
5857 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAndroidAppUndeleteCall<'a, C>
5858 where
5859 I: IntoIterator<Item = St>,
5860 St: AsRef<str>,
5861 {
5862 self._scopes
5863 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5864 self
5865 }
5866
5867 /// Removes all scopes, and no default scope will be used either.
5868 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5869 /// for details).
5870 pub fn clear_scopes(mut self) -> ProjectAndroidAppUndeleteCall<'a, C> {
5871 self._scopes.clear();
5872 self
5873 }
5874}
5875
5876/// **DECOMMISSIONED.** **If called, this endpoint will return a 404 error.** _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 ["locations for default Google Cloud resources"](https://firebase.google.com/docs/projects/locations#default-cloud-location) for the specified Project (including a FirebaseProject). One of these locations can be selected as the Project's location for default Google Cloud resources, which is the geographical location where the Project's resources associated with Google App Engine (such as the default Cloud Firestore instance) will be provisioned by default. However, if the location for default Google Cloud resources 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 locations. To list all 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.
5877///
5878/// A builder for the *availableLocations.list* method supported by a *project* resource.
5879/// It is not used directly, but through a [`ProjectMethods`] instance.
5880///
5881/// # Example
5882///
5883/// Instantiate a resource method builder
5884///
5885/// ```test_harness,no_run
5886/// # extern crate hyper;
5887/// # extern crate hyper_rustls;
5888/// # extern crate google_firebase1_beta1 as firebase1_beta1;
5889/// # async fn dox() {
5890/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5891///
5892/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5893/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
5894/// # .with_native_roots()
5895/// # .unwrap()
5896/// # .https_only()
5897/// # .enable_http2()
5898/// # .build();
5899///
5900/// # let executor = hyper_util::rt::TokioExecutor::new();
5901/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
5902/// # secret,
5903/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5904/// # yup_oauth2::client::CustomHyperClientBuilder::from(
5905/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
5906/// # ),
5907/// # ).build().await.unwrap();
5908///
5909/// # let client = hyper_util::client::legacy::Client::builder(
5910/// # hyper_util::rt::TokioExecutor::new()
5911/// # )
5912/// # .build(
5913/// # hyper_rustls::HttpsConnectorBuilder::new()
5914/// # .with_native_roots()
5915/// # .unwrap()
5916/// # .https_or_http()
5917/// # .enable_http2()
5918/// # .build()
5919/// # );
5920/// # let mut hub = FirebaseManagement::new(client, auth);
5921/// // You can configure optional parameters by calling the respective setters at will, and
5922/// // execute the final call using `doit()`.
5923/// // Values shown here are possibly random and not representative !
5924/// let result = hub.projects().available_locations_list("parent")
5925/// .page_token("invidunt")
5926/// .page_size(-47)
5927/// .doit().await;
5928/// # }
5929/// ```
5930pub struct ProjectAvailableLocationListCall<'a, C>
5931where
5932 C: 'a,
5933{
5934 hub: &'a FirebaseManagement<C>,
5935 _parent: String,
5936 _page_token: Option<String>,
5937 _page_size: Option<i32>,
5938 _delegate: Option<&'a mut dyn common::Delegate>,
5939 _additional_params: HashMap<String, String>,
5940 _scopes: BTreeSet<String>,
5941}
5942
5943impl<'a, C> common::CallBuilder for ProjectAvailableLocationListCall<'a, C> {}
5944
5945impl<'a, C> ProjectAvailableLocationListCall<'a, C>
5946where
5947 C: common::Connector,
5948{
5949 /// Perform the operation you have build so far.
5950 pub async fn doit(
5951 mut self,
5952 ) -> common::Result<(common::Response, ListAvailableLocationsResponse)> {
5953 use std::borrow::Cow;
5954 use std::io::{Read, Seek};
5955
5956 use common::{url::Params, ToParts};
5957 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5958
5959 let mut dd = common::DefaultDelegate;
5960 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5961 dlg.begin(common::MethodInfo {
5962 id: "firebase.projects.availableLocations.list",
5963 http_method: hyper::Method::GET,
5964 });
5965
5966 for &field in ["alt", "parent", "pageToken", "pageSize"].iter() {
5967 if self._additional_params.contains_key(field) {
5968 dlg.finished(false);
5969 return Err(common::Error::FieldClash(field));
5970 }
5971 }
5972
5973 let mut params = Params::with_capacity(5 + self._additional_params.len());
5974 params.push("parent", self._parent);
5975 if let Some(value) = self._page_token.as_ref() {
5976 params.push("pageToken", value);
5977 }
5978 if let Some(value) = self._page_size.as_ref() {
5979 params.push("pageSize", value.to_string());
5980 }
5981
5982 params.extend(self._additional_params.iter());
5983
5984 params.push("alt", "json");
5985 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/availableLocations";
5986 if self._scopes.is_empty() {
5987 self._scopes.insert(Scope::Readonly.as_ref().to_string());
5988 }
5989
5990 #[allow(clippy::single_element_loop)]
5991 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
5992 url = params.uri_replacement(url, param_name, find_this, true);
5993 }
5994 {
5995 let to_remove = ["parent"];
5996 params.remove_params(&to_remove);
5997 }
5998
5999 let url = params.parse_with_url(&url);
6000
6001 loop {
6002 let token = match self
6003 .hub
6004 .auth
6005 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6006 .await
6007 {
6008 Ok(token) => token,
6009 Err(e) => match dlg.token(e) {
6010 Ok(token) => token,
6011 Err(e) => {
6012 dlg.finished(false);
6013 return Err(common::Error::MissingToken(e));
6014 }
6015 },
6016 };
6017 let mut req_result = {
6018 let client = &self.hub.client;
6019 dlg.pre_request();
6020 let mut req_builder = hyper::Request::builder()
6021 .method(hyper::Method::GET)
6022 .uri(url.as_str())
6023 .header(USER_AGENT, self.hub._user_agent.clone());
6024
6025 if let Some(token) = token.as_ref() {
6026 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6027 }
6028
6029 let request = req_builder
6030 .header(CONTENT_LENGTH, 0_u64)
6031 .body(common::to_body::<String>(None));
6032
6033 client.request(request.unwrap()).await
6034 };
6035
6036 match req_result {
6037 Err(err) => {
6038 if let common::Retry::After(d) = dlg.http_error(&err) {
6039 sleep(d).await;
6040 continue;
6041 }
6042 dlg.finished(false);
6043 return Err(common::Error::HttpError(err));
6044 }
6045 Ok(res) => {
6046 let (mut parts, body) = res.into_parts();
6047 let mut body = common::Body::new(body);
6048 if !parts.status.is_success() {
6049 let bytes = common::to_bytes(body).await.unwrap_or_default();
6050 let error = serde_json::from_str(&common::to_string(&bytes));
6051 let response = common::to_response(parts, bytes.into());
6052
6053 if let common::Retry::After(d) =
6054 dlg.http_failure(&response, error.as_ref().ok())
6055 {
6056 sleep(d).await;
6057 continue;
6058 }
6059
6060 dlg.finished(false);
6061
6062 return Err(match error {
6063 Ok(value) => common::Error::BadRequest(value),
6064 _ => common::Error::Failure(response),
6065 });
6066 }
6067 let response = {
6068 let bytes = common::to_bytes(body).await.unwrap_or_default();
6069 let encoded = common::to_string(&bytes);
6070 match serde_json::from_str(&encoded) {
6071 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6072 Err(error) => {
6073 dlg.response_json_decode_error(&encoded, &error);
6074 return Err(common::Error::JsonDecodeError(
6075 encoded.to_string(),
6076 error,
6077 ));
6078 }
6079 }
6080 };
6081
6082 dlg.finished(true);
6083 return Ok(response);
6084 }
6085 }
6086 }
6087 }
6088
6089 /// The FirebaseProject for which to list [locations for default Google Cloud resources](https://firebase.google.com/docs/projects/locations#default-cloud-location), 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.
6090 ///
6091 /// Sets the *parent* path property to the given value.
6092 ///
6093 /// Even though the property as already been set when instantiating this call,
6094 /// we provide this method for API completeness.
6095 pub fn parent(mut self, new_value: &str) -> ProjectAvailableLocationListCall<'a, C> {
6096 self._parent = new_value.to_string();
6097 self
6098 }
6099 /// Token returned from a previous call to `ListAvailableLocations` indicating where in the list of locations to resume listing.
6100 ///
6101 /// Sets the *page token* query property to the given value.
6102 pub fn page_token(mut self, new_value: &str) -> ProjectAvailableLocationListCall<'a, C> {
6103 self._page_token = Some(new_value.to_string());
6104 self
6105 }
6106 /// 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.
6107 ///
6108 /// Sets the *page size* query property to the given value.
6109 pub fn page_size(mut self, new_value: i32) -> ProjectAvailableLocationListCall<'a, C> {
6110 self._page_size = Some(new_value);
6111 self
6112 }
6113 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6114 /// while executing the actual API request.
6115 ///
6116 /// ````text
6117 /// It should be used to handle progress information, and to implement a certain level of resilience.
6118 /// ````
6119 ///
6120 /// Sets the *delegate* property to the given value.
6121 pub fn delegate(
6122 mut self,
6123 new_value: &'a mut dyn common::Delegate,
6124 ) -> ProjectAvailableLocationListCall<'a, C> {
6125 self._delegate = Some(new_value);
6126 self
6127 }
6128
6129 /// Set any additional parameter of the query string used in the request.
6130 /// It should be used to set parameters which are not yet available through their own
6131 /// setters.
6132 ///
6133 /// Please note that this method must not be used to set any of the known parameters
6134 /// which have their own setter method. If done anyway, the request will fail.
6135 ///
6136 /// # Additional Parameters
6137 ///
6138 /// * *$.xgafv* (query-string) - V1 error format.
6139 /// * *access_token* (query-string) - OAuth access token.
6140 /// * *alt* (query-string) - Data format for response.
6141 /// * *callback* (query-string) - JSONP
6142 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6143 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6144 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6145 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6146 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6147 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6148 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6149 pub fn param<T>(mut self, name: T, value: T) -> ProjectAvailableLocationListCall<'a, C>
6150 where
6151 T: AsRef<str>,
6152 {
6153 self._additional_params
6154 .insert(name.as_ref().to_string(), value.as_ref().to_string());
6155 self
6156 }
6157
6158 /// Identifies the authorization scope for the method you are building.
6159 ///
6160 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6161 /// [`Scope::Readonly`].
6162 ///
6163 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6164 /// tokens for more than one scope.
6165 ///
6166 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6167 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6168 /// sufficient, a read-write scope will do as well.
6169 pub fn add_scope<St>(mut self, scope: St) -> ProjectAvailableLocationListCall<'a, C>
6170 where
6171 St: AsRef<str>,
6172 {
6173 self._scopes.insert(String::from(scope.as_ref()));
6174 self
6175 }
6176 /// Identifies the authorization scope(s) for the method you are building.
6177 ///
6178 /// See [`Self::add_scope()`] for details.
6179 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAvailableLocationListCall<'a, C>
6180 where
6181 I: IntoIterator<Item = St>,
6182 St: AsRef<str>,
6183 {
6184 self._scopes
6185 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6186 self
6187 }
6188
6189 /// Removes all scopes, and no default scope will be used either.
6190 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6191 /// for details).
6192 pub fn clear_scopes(mut self) -> ProjectAvailableLocationListCall<'a, C> {
6193 self._scopes.clear();
6194 self
6195 }
6196}
6197
6198/// **DECOMMISSIONED.** **If called, this endpoint will return a 404 error.** *Instead, use the applicable resource-specific REST API to set the location for each resource used in your Project.* Sets the [“location for default Google Cloud resources”](https://firebase.google.com/docs/projects/locations#default-cloud-location) for the specified FirebaseProject. This method creates a Google 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 [App Engine locations](https://cloud.google.com/about/locations#region). After the location for default Google Cloud resources is finalized, or if it was already set, it cannot be changed. The location for default Google Cloud resources for the specified `FirebaseProject` might already be set because either the underlying Google Cloud `Project` already has an App Engine application or `FinalizeDefaultLocation` was previously called with a specified `locationId`. 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.
6199///
6200/// A builder for the *defaultLocation.finalize* method supported by a *project* resource.
6201/// It is not used directly, but through a [`ProjectMethods`] instance.
6202///
6203/// # Example
6204///
6205/// Instantiate a resource method builder
6206///
6207/// ```test_harness,no_run
6208/// # extern crate hyper;
6209/// # extern crate hyper_rustls;
6210/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6211/// use firebase1_beta1::api::FinalizeDefaultLocationRequest;
6212/// # async fn dox() {
6213/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6214///
6215/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6216/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
6217/// # .with_native_roots()
6218/// # .unwrap()
6219/// # .https_only()
6220/// # .enable_http2()
6221/// # .build();
6222///
6223/// # let executor = hyper_util::rt::TokioExecutor::new();
6224/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
6225/// # secret,
6226/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6227/// # yup_oauth2::client::CustomHyperClientBuilder::from(
6228/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
6229/// # ),
6230/// # ).build().await.unwrap();
6231///
6232/// # let client = hyper_util::client::legacy::Client::builder(
6233/// # hyper_util::rt::TokioExecutor::new()
6234/// # )
6235/// # .build(
6236/// # hyper_rustls::HttpsConnectorBuilder::new()
6237/// # .with_native_roots()
6238/// # .unwrap()
6239/// # .https_or_http()
6240/// # .enable_http2()
6241/// # .build()
6242/// # );
6243/// # let mut hub = FirebaseManagement::new(client, auth);
6244/// // As the method needs a request, you would usually fill it with the desired information
6245/// // into the respective structure. Some of the parts shown here might not be applicable !
6246/// // Values shown here are possibly random and not representative !
6247/// let mut req = FinalizeDefaultLocationRequest::default();
6248///
6249/// // You can configure optional parameters by calling the respective setters at will, and
6250/// // execute the final call using `doit()`.
6251/// // Values shown here are possibly random and not representative !
6252/// let result = hub.projects().default_location_finalize(req, "parent")
6253/// .doit().await;
6254/// # }
6255/// ```
6256pub struct ProjectDefaultLocationFinalizeCall<'a, C>
6257where
6258 C: 'a,
6259{
6260 hub: &'a FirebaseManagement<C>,
6261 _request: FinalizeDefaultLocationRequest,
6262 _parent: String,
6263 _delegate: Option<&'a mut dyn common::Delegate>,
6264 _additional_params: HashMap<String, String>,
6265 _scopes: BTreeSet<String>,
6266}
6267
6268impl<'a, C> common::CallBuilder for ProjectDefaultLocationFinalizeCall<'a, C> {}
6269
6270impl<'a, C> ProjectDefaultLocationFinalizeCall<'a, C>
6271where
6272 C: common::Connector,
6273{
6274 /// Perform the operation you have build so far.
6275 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
6276 use std::borrow::Cow;
6277 use std::io::{Read, Seek};
6278
6279 use common::{url::Params, ToParts};
6280 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6281
6282 let mut dd = common::DefaultDelegate;
6283 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6284 dlg.begin(common::MethodInfo {
6285 id: "firebase.projects.defaultLocation.finalize",
6286 http_method: hyper::Method::POST,
6287 });
6288
6289 for &field in ["alt", "parent"].iter() {
6290 if self._additional_params.contains_key(field) {
6291 dlg.finished(false);
6292 return Err(common::Error::FieldClash(field));
6293 }
6294 }
6295
6296 let mut params = Params::with_capacity(4 + self._additional_params.len());
6297 params.push("parent", self._parent);
6298
6299 params.extend(self._additional_params.iter());
6300
6301 params.push("alt", "json");
6302 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/defaultLocation:finalize";
6303 if self._scopes.is_empty() {
6304 self._scopes
6305 .insert(Scope::CloudPlatform.as_ref().to_string());
6306 }
6307
6308 #[allow(clippy::single_element_loop)]
6309 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
6310 url = params.uri_replacement(url, param_name, find_this, true);
6311 }
6312 {
6313 let to_remove = ["parent"];
6314 params.remove_params(&to_remove);
6315 }
6316
6317 let url = params.parse_with_url(&url);
6318
6319 let mut json_mime_type = mime::APPLICATION_JSON;
6320 let mut request_value_reader = {
6321 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
6322 common::remove_json_null_values(&mut value);
6323 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
6324 serde_json::to_writer(&mut dst, &value).unwrap();
6325 dst
6326 };
6327 let request_size = request_value_reader
6328 .seek(std::io::SeekFrom::End(0))
6329 .unwrap();
6330 request_value_reader
6331 .seek(std::io::SeekFrom::Start(0))
6332 .unwrap();
6333
6334 loop {
6335 let token = match self
6336 .hub
6337 .auth
6338 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6339 .await
6340 {
6341 Ok(token) => token,
6342 Err(e) => match dlg.token(e) {
6343 Ok(token) => token,
6344 Err(e) => {
6345 dlg.finished(false);
6346 return Err(common::Error::MissingToken(e));
6347 }
6348 },
6349 };
6350 request_value_reader
6351 .seek(std::io::SeekFrom::Start(0))
6352 .unwrap();
6353 let mut req_result = {
6354 let client = &self.hub.client;
6355 dlg.pre_request();
6356 let mut req_builder = hyper::Request::builder()
6357 .method(hyper::Method::POST)
6358 .uri(url.as_str())
6359 .header(USER_AGENT, self.hub._user_agent.clone());
6360
6361 if let Some(token) = token.as_ref() {
6362 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6363 }
6364
6365 let request = req_builder
6366 .header(CONTENT_TYPE, json_mime_type.to_string())
6367 .header(CONTENT_LENGTH, request_size as u64)
6368 .body(common::to_body(
6369 request_value_reader.get_ref().clone().into(),
6370 ));
6371
6372 client.request(request.unwrap()).await
6373 };
6374
6375 match req_result {
6376 Err(err) => {
6377 if let common::Retry::After(d) = dlg.http_error(&err) {
6378 sleep(d).await;
6379 continue;
6380 }
6381 dlg.finished(false);
6382 return Err(common::Error::HttpError(err));
6383 }
6384 Ok(res) => {
6385 let (mut parts, body) = res.into_parts();
6386 let mut body = common::Body::new(body);
6387 if !parts.status.is_success() {
6388 let bytes = common::to_bytes(body).await.unwrap_or_default();
6389 let error = serde_json::from_str(&common::to_string(&bytes));
6390 let response = common::to_response(parts, bytes.into());
6391
6392 if let common::Retry::After(d) =
6393 dlg.http_failure(&response, error.as_ref().ok())
6394 {
6395 sleep(d).await;
6396 continue;
6397 }
6398
6399 dlg.finished(false);
6400
6401 return Err(match error {
6402 Ok(value) => common::Error::BadRequest(value),
6403 _ => common::Error::Failure(response),
6404 });
6405 }
6406 let response = {
6407 let bytes = common::to_bytes(body).await.unwrap_or_default();
6408 let encoded = common::to_string(&bytes);
6409 match serde_json::from_str(&encoded) {
6410 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6411 Err(error) => {
6412 dlg.response_json_decode_error(&encoded, &error);
6413 return Err(common::Error::JsonDecodeError(
6414 encoded.to_string(),
6415 error,
6416 ));
6417 }
6418 }
6419 };
6420
6421 dlg.finished(true);
6422 return Ok(response);
6423 }
6424 }
6425 }
6426 }
6427
6428 ///
6429 /// Sets the *request* property to the given value.
6430 ///
6431 /// Even though the property as already been set when instantiating this call,
6432 /// we provide this method for API completeness.
6433 pub fn request(
6434 mut self,
6435 new_value: FinalizeDefaultLocationRequest,
6436 ) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6437 self._request = new_value;
6438 self
6439 }
6440 /// The resource name of the FirebaseProject for which the [“location for default Google Cloud resources”](https://firebase.google.com/docs/projects/locations#default-cloud-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.
6441 ///
6442 /// Sets the *parent* path property to the given value.
6443 ///
6444 /// Even though the property as already been set when instantiating this call,
6445 /// we provide this method for API completeness.
6446 pub fn parent(mut self, new_value: &str) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6447 self._parent = new_value.to_string();
6448 self
6449 }
6450 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6451 /// while executing the actual API request.
6452 ///
6453 /// ````text
6454 /// It should be used to handle progress information, and to implement a certain level of resilience.
6455 /// ````
6456 ///
6457 /// Sets the *delegate* property to the given value.
6458 pub fn delegate(
6459 mut self,
6460 new_value: &'a mut dyn common::Delegate,
6461 ) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6462 self._delegate = Some(new_value);
6463 self
6464 }
6465
6466 /// Set any additional parameter of the query string used in the request.
6467 /// It should be used to set parameters which are not yet available through their own
6468 /// setters.
6469 ///
6470 /// Please note that this method must not be used to set any of the known parameters
6471 /// which have their own setter method. If done anyway, the request will fail.
6472 ///
6473 /// # Additional Parameters
6474 ///
6475 /// * *$.xgafv* (query-string) - V1 error format.
6476 /// * *access_token* (query-string) - OAuth access token.
6477 /// * *alt* (query-string) - Data format for response.
6478 /// * *callback* (query-string) - JSONP
6479 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6480 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6481 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6482 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6483 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6484 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6485 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6486 pub fn param<T>(mut self, name: T, value: T) -> ProjectDefaultLocationFinalizeCall<'a, C>
6487 where
6488 T: AsRef<str>,
6489 {
6490 self._additional_params
6491 .insert(name.as_ref().to_string(), value.as_ref().to_string());
6492 self
6493 }
6494
6495 /// Identifies the authorization scope for the method you are building.
6496 ///
6497 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6498 /// [`Scope::CloudPlatform`].
6499 ///
6500 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6501 /// tokens for more than one scope.
6502 ///
6503 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6504 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6505 /// sufficient, a read-write scope will do as well.
6506 pub fn add_scope<St>(mut self, scope: St) -> ProjectDefaultLocationFinalizeCall<'a, C>
6507 where
6508 St: AsRef<str>,
6509 {
6510 self._scopes.insert(String::from(scope.as_ref()));
6511 self
6512 }
6513 /// Identifies the authorization scope(s) for the method you are building.
6514 ///
6515 /// See [`Self::add_scope()`] for details.
6516 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectDefaultLocationFinalizeCall<'a, C>
6517 where
6518 I: IntoIterator<Item = St>,
6519 St: AsRef<str>,
6520 {
6521 self._scopes
6522 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6523 self
6524 }
6525
6526 /// Removes all scopes, and no default scope will be used either.
6527 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6528 /// for details).
6529 pub fn clear_scopes(mut self) -> ProjectDefaultLocationFinalizeCall<'a, C> {
6530 self._scopes.clear();
6531 self
6532 }
6533}
6534
6535/// 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`.
6536///
6537/// A builder for the *iosApps.create* method supported by a *project* resource.
6538/// It is not used directly, but through a [`ProjectMethods`] instance.
6539///
6540/// # Example
6541///
6542/// Instantiate a resource method builder
6543///
6544/// ```test_harness,no_run
6545/// # extern crate hyper;
6546/// # extern crate hyper_rustls;
6547/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6548/// use firebase1_beta1::api::IosApp;
6549/// # async fn dox() {
6550/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6551///
6552/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6553/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
6554/// # .with_native_roots()
6555/// # .unwrap()
6556/// # .https_only()
6557/// # .enable_http2()
6558/// # .build();
6559///
6560/// # let executor = hyper_util::rt::TokioExecutor::new();
6561/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
6562/// # secret,
6563/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6564/// # yup_oauth2::client::CustomHyperClientBuilder::from(
6565/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
6566/// # ),
6567/// # ).build().await.unwrap();
6568///
6569/// # let client = hyper_util::client::legacy::Client::builder(
6570/// # hyper_util::rt::TokioExecutor::new()
6571/// # )
6572/// # .build(
6573/// # hyper_rustls::HttpsConnectorBuilder::new()
6574/// # .with_native_roots()
6575/// # .unwrap()
6576/// # .https_or_http()
6577/// # .enable_http2()
6578/// # .build()
6579/// # );
6580/// # let mut hub = FirebaseManagement::new(client, auth);
6581/// // As the method needs a request, you would usually fill it with the desired information
6582/// // into the respective structure. Some of the parts shown here might not be applicable !
6583/// // Values shown here are possibly random and not representative !
6584/// let mut req = IosApp::default();
6585///
6586/// // You can configure optional parameters by calling the respective setters at will, and
6587/// // execute the final call using `doit()`.
6588/// // Values shown here are possibly random and not representative !
6589/// let result = hub.projects().ios_apps_create(req, "parent")
6590/// .doit().await;
6591/// # }
6592/// ```
6593pub struct ProjectIosAppCreateCall<'a, C>
6594where
6595 C: 'a,
6596{
6597 hub: &'a FirebaseManagement<C>,
6598 _request: IosApp,
6599 _parent: String,
6600 _delegate: Option<&'a mut dyn common::Delegate>,
6601 _additional_params: HashMap<String, String>,
6602 _scopes: BTreeSet<String>,
6603}
6604
6605impl<'a, C> common::CallBuilder for ProjectIosAppCreateCall<'a, C> {}
6606
6607impl<'a, C> ProjectIosAppCreateCall<'a, C>
6608where
6609 C: common::Connector,
6610{
6611 /// Perform the operation you have build so far.
6612 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
6613 use std::borrow::Cow;
6614 use std::io::{Read, Seek};
6615
6616 use common::{url::Params, ToParts};
6617 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6618
6619 let mut dd = common::DefaultDelegate;
6620 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6621 dlg.begin(common::MethodInfo {
6622 id: "firebase.projects.iosApps.create",
6623 http_method: hyper::Method::POST,
6624 });
6625
6626 for &field in ["alt", "parent"].iter() {
6627 if self._additional_params.contains_key(field) {
6628 dlg.finished(false);
6629 return Err(common::Error::FieldClash(field));
6630 }
6631 }
6632
6633 let mut params = Params::with_capacity(4 + self._additional_params.len());
6634 params.push("parent", self._parent);
6635
6636 params.extend(self._additional_params.iter());
6637
6638 params.push("alt", "json");
6639 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/iosApps";
6640 if self._scopes.is_empty() {
6641 self._scopes
6642 .insert(Scope::CloudPlatform.as_ref().to_string());
6643 }
6644
6645 #[allow(clippy::single_element_loop)]
6646 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
6647 url = params.uri_replacement(url, param_name, find_this, true);
6648 }
6649 {
6650 let to_remove = ["parent"];
6651 params.remove_params(&to_remove);
6652 }
6653
6654 let url = params.parse_with_url(&url);
6655
6656 let mut json_mime_type = mime::APPLICATION_JSON;
6657 let mut request_value_reader = {
6658 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
6659 common::remove_json_null_values(&mut value);
6660 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
6661 serde_json::to_writer(&mut dst, &value).unwrap();
6662 dst
6663 };
6664 let request_size = request_value_reader
6665 .seek(std::io::SeekFrom::End(0))
6666 .unwrap();
6667 request_value_reader
6668 .seek(std::io::SeekFrom::Start(0))
6669 .unwrap();
6670
6671 loop {
6672 let token = match self
6673 .hub
6674 .auth
6675 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6676 .await
6677 {
6678 Ok(token) => token,
6679 Err(e) => match dlg.token(e) {
6680 Ok(token) => token,
6681 Err(e) => {
6682 dlg.finished(false);
6683 return Err(common::Error::MissingToken(e));
6684 }
6685 },
6686 };
6687 request_value_reader
6688 .seek(std::io::SeekFrom::Start(0))
6689 .unwrap();
6690 let mut req_result = {
6691 let client = &self.hub.client;
6692 dlg.pre_request();
6693 let mut req_builder = hyper::Request::builder()
6694 .method(hyper::Method::POST)
6695 .uri(url.as_str())
6696 .header(USER_AGENT, self.hub._user_agent.clone());
6697
6698 if let Some(token) = token.as_ref() {
6699 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6700 }
6701
6702 let request = req_builder
6703 .header(CONTENT_TYPE, json_mime_type.to_string())
6704 .header(CONTENT_LENGTH, request_size as u64)
6705 .body(common::to_body(
6706 request_value_reader.get_ref().clone().into(),
6707 ));
6708
6709 client.request(request.unwrap()).await
6710 };
6711
6712 match req_result {
6713 Err(err) => {
6714 if let common::Retry::After(d) = dlg.http_error(&err) {
6715 sleep(d).await;
6716 continue;
6717 }
6718 dlg.finished(false);
6719 return Err(common::Error::HttpError(err));
6720 }
6721 Ok(res) => {
6722 let (mut parts, body) = res.into_parts();
6723 let mut body = common::Body::new(body);
6724 if !parts.status.is_success() {
6725 let bytes = common::to_bytes(body).await.unwrap_or_default();
6726 let error = serde_json::from_str(&common::to_string(&bytes));
6727 let response = common::to_response(parts, bytes.into());
6728
6729 if let common::Retry::After(d) =
6730 dlg.http_failure(&response, error.as_ref().ok())
6731 {
6732 sleep(d).await;
6733 continue;
6734 }
6735
6736 dlg.finished(false);
6737
6738 return Err(match error {
6739 Ok(value) => common::Error::BadRequest(value),
6740 _ => common::Error::Failure(response),
6741 });
6742 }
6743 let response = {
6744 let bytes = common::to_bytes(body).await.unwrap_or_default();
6745 let encoded = common::to_string(&bytes);
6746 match serde_json::from_str(&encoded) {
6747 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6748 Err(error) => {
6749 dlg.response_json_decode_error(&encoded, &error);
6750 return Err(common::Error::JsonDecodeError(
6751 encoded.to_string(),
6752 error,
6753 ));
6754 }
6755 }
6756 };
6757
6758 dlg.finished(true);
6759 return Ok(response);
6760 }
6761 }
6762 }
6763 }
6764
6765 ///
6766 /// Sets the *request* property to the given value.
6767 ///
6768 /// Even though the property as already been set when instantiating this call,
6769 /// we provide this method for API completeness.
6770 pub fn request(mut self, new_value: IosApp) -> ProjectIosAppCreateCall<'a, C> {
6771 self._request = new_value;
6772 self
6773 }
6774 /// 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.
6775 ///
6776 /// Sets the *parent* path property to the given value.
6777 ///
6778 /// Even though the property as already been set when instantiating this call,
6779 /// we provide this method for API completeness.
6780 pub fn parent(mut self, new_value: &str) -> ProjectIosAppCreateCall<'a, C> {
6781 self._parent = new_value.to_string();
6782 self
6783 }
6784 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6785 /// while executing the actual API request.
6786 ///
6787 /// ````text
6788 /// It should be used to handle progress information, and to implement a certain level of resilience.
6789 /// ````
6790 ///
6791 /// Sets the *delegate* property to the given value.
6792 pub fn delegate(
6793 mut self,
6794 new_value: &'a mut dyn common::Delegate,
6795 ) -> ProjectIosAppCreateCall<'a, C> {
6796 self._delegate = Some(new_value);
6797 self
6798 }
6799
6800 /// Set any additional parameter of the query string used in the request.
6801 /// It should be used to set parameters which are not yet available through their own
6802 /// setters.
6803 ///
6804 /// Please note that this method must not be used to set any of the known parameters
6805 /// which have their own setter method. If done anyway, the request will fail.
6806 ///
6807 /// # Additional Parameters
6808 ///
6809 /// * *$.xgafv* (query-string) - V1 error format.
6810 /// * *access_token* (query-string) - OAuth access token.
6811 /// * *alt* (query-string) - Data format for response.
6812 /// * *callback* (query-string) - JSONP
6813 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6814 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
6815 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6816 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6817 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
6818 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6819 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6820 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppCreateCall<'a, C>
6821 where
6822 T: AsRef<str>,
6823 {
6824 self._additional_params
6825 .insert(name.as_ref().to_string(), value.as_ref().to_string());
6826 self
6827 }
6828
6829 /// Identifies the authorization scope for the method you are building.
6830 ///
6831 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6832 /// [`Scope::CloudPlatform`].
6833 ///
6834 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6835 /// tokens for more than one scope.
6836 ///
6837 /// Usually there is more than one suitable scope to authorize an operation, some of which may
6838 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6839 /// sufficient, a read-write scope will do as well.
6840 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppCreateCall<'a, C>
6841 where
6842 St: AsRef<str>,
6843 {
6844 self._scopes.insert(String::from(scope.as_ref()));
6845 self
6846 }
6847 /// Identifies the authorization scope(s) for the method you are building.
6848 ///
6849 /// See [`Self::add_scope()`] for details.
6850 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppCreateCall<'a, C>
6851 where
6852 I: IntoIterator<Item = St>,
6853 St: AsRef<str>,
6854 {
6855 self._scopes
6856 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6857 self
6858 }
6859
6860 /// Removes all scopes, and no default scope will be used either.
6861 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6862 /// for details).
6863 pub fn clear_scopes(mut self) -> ProjectIosAppCreateCall<'a, C> {
6864 self._scopes.clear();
6865 self
6866 }
6867}
6868
6869/// Gets the specified IosApp.
6870///
6871/// A builder for the *iosApps.get* method supported by a *project* resource.
6872/// It is not used directly, but through a [`ProjectMethods`] instance.
6873///
6874/// # Example
6875///
6876/// Instantiate a resource method builder
6877///
6878/// ```test_harness,no_run
6879/// # extern crate hyper;
6880/// # extern crate hyper_rustls;
6881/// # extern crate google_firebase1_beta1 as firebase1_beta1;
6882/// # async fn dox() {
6883/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6884///
6885/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6886/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
6887/// # .with_native_roots()
6888/// # .unwrap()
6889/// # .https_only()
6890/// # .enable_http2()
6891/// # .build();
6892///
6893/// # let executor = hyper_util::rt::TokioExecutor::new();
6894/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
6895/// # secret,
6896/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6897/// # yup_oauth2::client::CustomHyperClientBuilder::from(
6898/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
6899/// # ),
6900/// # ).build().await.unwrap();
6901///
6902/// # let client = hyper_util::client::legacy::Client::builder(
6903/// # hyper_util::rt::TokioExecutor::new()
6904/// # )
6905/// # .build(
6906/// # hyper_rustls::HttpsConnectorBuilder::new()
6907/// # .with_native_roots()
6908/// # .unwrap()
6909/// # .https_or_http()
6910/// # .enable_http2()
6911/// # .build()
6912/// # );
6913/// # let mut hub = FirebaseManagement::new(client, auth);
6914/// // You can configure optional parameters by calling the respective setters at will, and
6915/// // execute the final call using `doit()`.
6916/// // Values shown here are possibly random and not representative !
6917/// let result = hub.projects().ios_apps_get("name")
6918/// .doit().await;
6919/// # }
6920/// ```
6921pub struct ProjectIosAppGetCall<'a, C>
6922where
6923 C: 'a,
6924{
6925 hub: &'a FirebaseManagement<C>,
6926 _name: String,
6927 _delegate: Option<&'a mut dyn common::Delegate>,
6928 _additional_params: HashMap<String, String>,
6929 _scopes: BTreeSet<String>,
6930}
6931
6932impl<'a, C> common::CallBuilder for ProjectIosAppGetCall<'a, C> {}
6933
6934impl<'a, C> ProjectIosAppGetCall<'a, C>
6935where
6936 C: common::Connector,
6937{
6938 /// Perform the operation you have build so far.
6939 pub async fn doit(mut self) -> common::Result<(common::Response, IosApp)> {
6940 use std::borrow::Cow;
6941 use std::io::{Read, Seek};
6942
6943 use common::{url::Params, ToParts};
6944 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6945
6946 let mut dd = common::DefaultDelegate;
6947 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6948 dlg.begin(common::MethodInfo {
6949 id: "firebase.projects.iosApps.get",
6950 http_method: hyper::Method::GET,
6951 });
6952
6953 for &field in ["alt", "name"].iter() {
6954 if self._additional_params.contains_key(field) {
6955 dlg.finished(false);
6956 return Err(common::Error::FieldClash(field));
6957 }
6958 }
6959
6960 let mut params = Params::with_capacity(3 + self._additional_params.len());
6961 params.push("name", self._name);
6962
6963 params.extend(self._additional_params.iter());
6964
6965 params.push("alt", "json");
6966 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
6967 if self._scopes.is_empty() {
6968 self._scopes.insert(Scope::Readonly.as_ref().to_string());
6969 }
6970
6971 #[allow(clippy::single_element_loop)]
6972 for &(find_this, param_name) in [("{+name}", "name")].iter() {
6973 url = params.uri_replacement(url, param_name, find_this, true);
6974 }
6975 {
6976 let to_remove = ["name"];
6977 params.remove_params(&to_remove);
6978 }
6979
6980 let url = params.parse_with_url(&url);
6981
6982 loop {
6983 let token = match self
6984 .hub
6985 .auth
6986 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6987 .await
6988 {
6989 Ok(token) => token,
6990 Err(e) => match dlg.token(e) {
6991 Ok(token) => token,
6992 Err(e) => {
6993 dlg.finished(false);
6994 return Err(common::Error::MissingToken(e));
6995 }
6996 },
6997 };
6998 let mut req_result = {
6999 let client = &self.hub.client;
7000 dlg.pre_request();
7001 let mut req_builder = hyper::Request::builder()
7002 .method(hyper::Method::GET)
7003 .uri(url.as_str())
7004 .header(USER_AGENT, self.hub._user_agent.clone());
7005
7006 if let Some(token) = token.as_ref() {
7007 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7008 }
7009
7010 let request = req_builder
7011 .header(CONTENT_LENGTH, 0_u64)
7012 .body(common::to_body::<String>(None));
7013
7014 client.request(request.unwrap()).await
7015 };
7016
7017 match req_result {
7018 Err(err) => {
7019 if let common::Retry::After(d) = dlg.http_error(&err) {
7020 sleep(d).await;
7021 continue;
7022 }
7023 dlg.finished(false);
7024 return Err(common::Error::HttpError(err));
7025 }
7026 Ok(res) => {
7027 let (mut parts, body) = res.into_parts();
7028 let mut body = common::Body::new(body);
7029 if !parts.status.is_success() {
7030 let bytes = common::to_bytes(body).await.unwrap_or_default();
7031 let error = serde_json::from_str(&common::to_string(&bytes));
7032 let response = common::to_response(parts, bytes.into());
7033
7034 if let common::Retry::After(d) =
7035 dlg.http_failure(&response, error.as_ref().ok())
7036 {
7037 sleep(d).await;
7038 continue;
7039 }
7040
7041 dlg.finished(false);
7042
7043 return Err(match error {
7044 Ok(value) => common::Error::BadRequest(value),
7045 _ => common::Error::Failure(response),
7046 });
7047 }
7048 let response = {
7049 let bytes = common::to_bytes(body).await.unwrap_or_default();
7050 let encoded = common::to_string(&bytes);
7051 match serde_json::from_str(&encoded) {
7052 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7053 Err(error) => {
7054 dlg.response_json_decode_error(&encoded, &error);
7055 return Err(common::Error::JsonDecodeError(
7056 encoded.to_string(),
7057 error,
7058 ));
7059 }
7060 }
7061 };
7062
7063 dlg.finished(true);
7064 return Ok(response);
7065 }
7066 }
7067 }
7068 }
7069
7070 /// 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.
7071 ///
7072 /// Sets the *name* path property to the given value.
7073 ///
7074 /// Even though the property as already been set when instantiating this call,
7075 /// we provide this method for API completeness.
7076 pub fn name(mut self, new_value: &str) -> ProjectIosAppGetCall<'a, C> {
7077 self._name = new_value.to_string();
7078 self
7079 }
7080 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7081 /// while executing the actual API request.
7082 ///
7083 /// ````text
7084 /// It should be used to handle progress information, and to implement a certain level of resilience.
7085 /// ````
7086 ///
7087 /// Sets the *delegate* property to the given value.
7088 pub fn delegate(
7089 mut self,
7090 new_value: &'a mut dyn common::Delegate,
7091 ) -> ProjectIosAppGetCall<'a, C> {
7092 self._delegate = Some(new_value);
7093 self
7094 }
7095
7096 /// Set any additional parameter of the query string used in the request.
7097 /// It should be used to set parameters which are not yet available through their own
7098 /// setters.
7099 ///
7100 /// Please note that this method must not be used to set any of the known parameters
7101 /// which have their own setter method. If done anyway, the request will fail.
7102 ///
7103 /// # Additional Parameters
7104 ///
7105 /// * *$.xgafv* (query-string) - V1 error format.
7106 /// * *access_token* (query-string) - OAuth access token.
7107 /// * *alt* (query-string) - Data format for response.
7108 /// * *callback* (query-string) - JSONP
7109 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7110 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7111 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7112 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7113 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7114 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7115 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7116 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppGetCall<'a, C>
7117 where
7118 T: AsRef<str>,
7119 {
7120 self._additional_params
7121 .insert(name.as_ref().to_string(), value.as_ref().to_string());
7122 self
7123 }
7124
7125 /// Identifies the authorization scope for the method you are building.
7126 ///
7127 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7128 /// [`Scope::Readonly`].
7129 ///
7130 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7131 /// tokens for more than one scope.
7132 ///
7133 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7134 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7135 /// sufficient, a read-write scope will do as well.
7136 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppGetCall<'a, C>
7137 where
7138 St: AsRef<str>,
7139 {
7140 self._scopes.insert(String::from(scope.as_ref()));
7141 self
7142 }
7143 /// Identifies the authorization scope(s) for the method you are building.
7144 ///
7145 /// See [`Self::add_scope()`] for details.
7146 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppGetCall<'a, C>
7147 where
7148 I: IntoIterator<Item = St>,
7149 St: AsRef<str>,
7150 {
7151 self._scopes
7152 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7153 self
7154 }
7155
7156 /// Removes all scopes, and no default scope will be used either.
7157 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7158 /// for details).
7159 pub fn clear_scopes(mut self) -> ProjectIosAppGetCall<'a, C> {
7160 self._scopes.clear();
7161 self
7162 }
7163}
7164
7165/// Gets the configuration artifact associated with the specified IosApp.
7166///
7167/// A builder for the *iosApps.getConfig* method supported by a *project* resource.
7168/// It is not used directly, but through a [`ProjectMethods`] instance.
7169///
7170/// # Example
7171///
7172/// Instantiate a resource method builder
7173///
7174/// ```test_harness,no_run
7175/// # extern crate hyper;
7176/// # extern crate hyper_rustls;
7177/// # extern crate google_firebase1_beta1 as firebase1_beta1;
7178/// # async fn dox() {
7179/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7180///
7181/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7182/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7183/// # .with_native_roots()
7184/// # .unwrap()
7185/// # .https_only()
7186/// # .enable_http2()
7187/// # .build();
7188///
7189/// # let executor = hyper_util::rt::TokioExecutor::new();
7190/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7191/// # secret,
7192/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7193/// # yup_oauth2::client::CustomHyperClientBuilder::from(
7194/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
7195/// # ),
7196/// # ).build().await.unwrap();
7197///
7198/// # let client = hyper_util::client::legacy::Client::builder(
7199/// # hyper_util::rt::TokioExecutor::new()
7200/// # )
7201/// # .build(
7202/// # hyper_rustls::HttpsConnectorBuilder::new()
7203/// # .with_native_roots()
7204/// # .unwrap()
7205/// # .https_or_http()
7206/// # .enable_http2()
7207/// # .build()
7208/// # );
7209/// # let mut hub = FirebaseManagement::new(client, auth);
7210/// // You can configure optional parameters by calling the respective setters at will, and
7211/// // execute the final call using `doit()`.
7212/// // Values shown here are possibly random and not representative !
7213/// let result = hub.projects().ios_apps_get_config("name")
7214/// .doit().await;
7215/// # }
7216/// ```
7217pub struct ProjectIosAppGetConfigCall<'a, C>
7218where
7219 C: 'a,
7220{
7221 hub: &'a FirebaseManagement<C>,
7222 _name: String,
7223 _delegate: Option<&'a mut dyn common::Delegate>,
7224 _additional_params: HashMap<String, String>,
7225 _scopes: BTreeSet<String>,
7226}
7227
7228impl<'a, C> common::CallBuilder for ProjectIosAppGetConfigCall<'a, C> {}
7229
7230impl<'a, C> ProjectIosAppGetConfigCall<'a, C>
7231where
7232 C: common::Connector,
7233{
7234 /// Perform the operation you have build so far.
7235 pub async fn doit(mut self) -> common::Result<(common::Response, IosAppConfig)> {
7236 use std::borrow::Cow;
7237 use std::io::{Read, Seek};
7238
7239 use common::{url::Params, ToParts};
7240 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7241
7242 let mut dd = common::DefaultDelegate;
7243 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7244 dlg.begin(common::MethodInfo {
7245 id: "firebase.projects.iosApps.getConfig",
7246 http_method: hyper::Method::GET,
7247 });
7248
7249 for &field in ["alt", "name"].iter() {
7250 if self._additional_params.contains_key(field) {
7251 dlg.finished(false);
7252 return Err(common::Error::FieldClash(field));
7253 }
7254 }
7255
7256 let mut params = Params::with_capacity(3 + self._additional_params.len());
7257 params.push("name", self._name);
7258
7259 params.extend(self._additional_params.iter());
7260
7261 params.push("alt", "json");
7262 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
7263 if self._scopes.is_empty() {
7264 self._scopes.insert(Scope::Readonly.as_ref().to_string());
7265 }
7266
7267 #[allow(clippy::single_element_loop)]
7268 for &(find_this, param_name) in [("{+name}", "name")].iter() {
7269 url = params.uri_replacement(url, param_name, find_this, true);
7270 }
7271 {
7272 let to_remove = ["name"];
7273 params.remove_params(&to_remove);
7274 }
7275
7276 let url = params.parse_with_url(&url);
7277
7278 loop {
7279 let token = match self
7280 .hub
7281 .auth
7282 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7283 .await
7284 {
7285 Ok(token) => token,
7286 Err(e) => match dlg.token(e) {
7287 Ok(token) => token,
7288 Err(e) => {
7289 dlg.finished(false);
7290 return Err(common::Error::MissingToken(e));
7291 }
7292 },
7293 };
7294 let mut req_result = {
7295 let client = &self.hub.client;
7296 dlg.pre_request();
7297 let mut req_builder = hyper::Request::builder()
7298 .method(hyper::Method::GET)
7299 .uri(url.as_str())
7300 .header(USER_AGENT, self.hub._user_agent.clone());
7301
7302 if let Some(token) = token.as_ref() {
7303 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7304 }
7305
7306 let request = req_builder
7307 .header(CONTENT_LENGTH, 0_u64)
7308 .body(common::to_body::<String>(None));
7309
7310 client.request(request.unwrap()).await
7311 };
7312
7313 match req_result {
7314 Err(err) => {
7315 if let common::Retry::After(d) = dlg.http_error(&err) {
7316 sleep(d).await;
7317 continue;
7318 }
7319 dlg.finished(false);
7320 return Err(common::Error::HttpError(err));
7321 }
7322 Ok(res) => {
7323 let (mut parts, body) = res.into_parts();
7324 let mut body = common::Body::new(body);
7325 if !parts.status.is_success() {
7326 let bytes = common::to_bytes(body).await.unwrap_or_default();
7327 let error = serde_json::from_str(&common::to_string(&bytes));
7328 let response = common::to_response(parts, bytes.into());
7329
7330 if let common::Retry::After(d) =
7331 dlg.http_failure(&response, error.as_ref().ok())
7332 {
7333 sleep(d).await;
7334 continue;
7335 }
7336
7337 dlg.finished(false);
7338
7339 return Err(match error {
7340 Ok(value) => common::Error::BadRequest(value),
7341 _ => common::Error::Failure(response),
7342 });
7343 }
7344 let response = {
7345 let bytes = common::to_bytes(body).await.unwrap_or_default();
7346 let encoded = common::to_string(&bytes);
7347 match serde_json::from_str(&encoded) {
7348 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7349 Err(error) => {
7350 dlg.response_json_decode_error(&encoded, &error);
7351 return Err(common::Error::JsonDecodeError(
7352 encoded.to_string(),
7353 error,
7354 ));
7355 }
7356 }
7357 };
7358
7359 dlg.finished(true);
7360 return Ok(response);
7361 }
7362 }
7363 }
7364 }
7365
7366 /// 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.
7367 ///
7368 /// Sets the *name* path property to the given value.
7369 ///
7370 /// Even though the property as already been set when instantiating this call,
7371 /// we provide this method for API completeness.
7372 pub fn name(mut self, new_value: &str) -> ProjectIosAppGetConfigCall<'a, C> {
7373 self._name = new_value.to_string();
7374 self
7375 }
7376 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7377 /// while executing the actual API request.
7378 ///
7379 /// ````text
7380 /// It should be used to handle progress information, and to implement a certain level of resilience.
7381 /// ````
7382 ///
7383 /// Sets the *delegate* property to the given value.
7384 pub fn delegate(
7385 mut self,
7386 new_value: &'a mut dyn common::Delegate,
7387 ) -> ProjectIosAppGetConfigCall<'a, C> {
7388 self._delegate = Some(new_value);
7389 self
7390 }
7391
7392 /// Set any additional parameter of the query string used in the request.
7393 /// It should be used to set parameters which are not yet available through their own
7394 /// setters.
7395 ///
7396 /// Please note that this method must not be used to set any of the known parameters
7397 /// which have their own setter method. If done anyway, the request will fail.
7398 ///
7399 /// # Additional Parameters
7400 ///
7401 /// * *$.xgafv* (query-string) - V1 error format.
7402 /// * *access_token* (query-string) - OAuth access token.
7403 /// * *alt* (query-string) - Data format for response.
7404 /// * *callback* (query-string) - JSONP
7405 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7406 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7407 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7408 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7409 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7410 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7411 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7412 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppGetConfigCall<'a, C>
7413 where
7414 T: AsRef<str>,
7415 {
7416 self._additional_params
7417 .insert(name.as_ref().to_string(), value.as_ref().to_string());
7418 self
7419 }
7420
7421 /// Identifies the authorization scope for the method you are building.
7422 ///
7423 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7424 /// [`Scope::Readonly`].
7425 ///
7426 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7427 /// tokens for more than one scope.
7428 ///
7429 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7430 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7431 /// sufficient, a read-write scope will do as well.
7432 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppGetConfigCall<'a, C>
7433 where
7434 St: AsRef<str>,
7435 {
7436 self._scopes.insert(String::from(scope.as_ref()));
7437 self
7438 }
7439 /// Identifies the authorization scope(s) for the method you are building.
7440 ///
7441 /// See [`Self::add_scope()`] for details.
7442 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppGetConfigCall<'a, C>
7443 where
7444 I: IntoIterator<Item = St>,
7445 St: AsRef<str>,
7446 {
7447 self._scopes
7448 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7449 self
7450 }
7451
7452 /// Removes all scopes, and no default scope will be used either.
7453 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7454 /// for details).
7455 pub fn clear_scopes(mut self) -> ProjectIosAppGetConfigCall<'a, C> {
7456 self._scopes.clear();
7457 self
7458 }
7459}
7460
7461/// 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`.
7462///
7463/// A builder for the *iosApps.list* method supported by a *project* resource.
7464/// It is not used directly, but through a [`ProjectMethods`] instance.
7465///
7466/// # Example
7467///
7468/// Instantiate a resource method builder
7469///
7470/// ```test_harness,no_run
7471/// # extern crate hyper;
7472/// # extern crate hyper_rustls;
7473/// # extern crate google_firebase1_beta1 as firebase1_beta1;
7474/// # async fn dox() {
7475/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7476///
7477/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7478/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7479/// # .with_native_roots()
7480/// # .unwrap()
7481/// # .https_only()
7482/// # .enable_http2()
7483/// # .build();
7484///
7485/// # let executor = hyper_util::rt::TokioExecutor::new();
7486/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7487/// # secret,
7488/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7489/// # yup_oauth2::client::CustomHyperClientBuilder::from(
7490/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
7491/// # ),
7492/// # ).build().await.unwrap();
7493///
7494/// # let client = hyper_util::client::legacy::Client::builder(
7495/// # hyper_util::rt::TokioExecutor::new()
7496/// # )
7497/// # .build(
7498/// # hyper_rustls::HttpsConnectorBuilder::new()
7499/// # .with_native_roots()
7500/// # .unwrap()
7501/// # .https_or_http()
7502/// # .enable_http2()
7503/// # .build()
7504/// # );
7505/// # let mut hub = FirebaseManagement::new(client, auth);
7506/// // You can configure optional parameters by calling the respective setters at will, and
7507/// // execute the final call using `doit()`.
7508/// // Values shown here are possibly random and not representative !
7509/// let result = hub.projects().ios_apps_list("parent")
7510/// .show_deleted(true)
7511/// .page_token("ipsum")
7512/// .page_size(-50)
7513/// .doit().await;
7514/// # }
7515/// ```
7516pub struct ProjectIosAppListCall<'a, C>
7517where
7518 C: 'a,
7519{
7520 hub: &'a FirebaseManagement<C>,
7521 _parent: String,
7522 _show_deleted: Option<bool>,
7523 _page_token: Option<String>,
7524 _page_size: Option<i32>,
7525 _delegate: Option<&'a mut dyn common::Delegate>,
7526 _additional_params: HashMap<String, String>,
7527 _scopes: BTreeSet<String>,
7528}
7529
7530impl<'a, C> common::CallBuilder for ProjectIosAppListCall<'a, C> {}
7531
7532impl<'a, C> ProjectIosAppListCall<'a, C>
7533where
7534 C: common::Connector,
7535{
7536 /// Perform the operation you have build so far.
7537 pub async fn doit(mut self) -> common::Result<(common::Response, ListIosAppsResponse)> {
7538 use std::borrow::Cow;
7539 use std::io::{Read, Seek};
7540
7541 use common::{url::Params, ToParts};
7542 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7543
7544 let mut dd = common::DefaultDelegate;
7545 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7546 dlg.begin(common::MethodInfo {
7547 id: "firebase.projects.iosApps.list",
7548 http_method: hyper::Method::GET,
7549 });
7550
7551 for &field in ["alt", "parent", "showDeleted", "pageToken", "pageSize"].iter() {
7552 if self._additional_params.contains_key(field) {
7553 dlg.finished(false);
7554 return Err(common::Error::FieldClash(field));
7555 }
7556 }
7557
7558 let mut params = Params::with_capacity(6 + self._additional_params.len());
7559 params.push("parent", self._parent);
7560 if let Some(value) = self._show_deleted.as_ref() {
7561 params.push("showDeleted", value.to_string());
7562 }
7563 if let Some(value) = self._page_token.as_ref() {
7564 params.push("pageToken", value);
7565 }
7566 if let Some(value) = self._page_size.as_ref() {
7567 params.push("pageSize", value.to_string());
7568 }
7569
7570 params.extend(self._additional_params.iter());
7571
7572 params.push("alt", "json");
7573 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/iosApps";
7574 if self._scopes.is_empty() {
7575 self._scopes.insert(Scope::Readonly.as_ref().to_string());
7576 }
7577
7578 #[allow(clippy::single_element_loop)]
7579 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
7580 url = params.uri_replacement(url, param_name, find_this, true);
7581 }
7582 {
7583 let to_remove = ["parent"];
7584 params.remove_params(&to_remove);
7585 }
7586
7587 let url = params.parse_with_url(&url);
7588
7589 loop {
7590 let token = match self
7591 .hub
7592 .auth
7593 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7594 .await
7595 {
7596 Ok(token) => token,
7597 Err(e) => match dlg.token(e) {
7598 Ok(token) => token,
7599 Err(e) => {
7600 dlg.finished(false);
7601 return Err(common::Error::MissingToken(e));
7602 }
7603 },
7604 };
7605 let mut req_result = {
7606 let client = &self.hub.client;
7607 dlg.pre_request();
7608 let mut req_builder = hyper::Request::builder()
7609 .method(hyper::Method::GET)
7610 .uri(url.as_str())
7611 .header(USER_AGENT, self.hub._user_agent.clone());
7612
7613 if let Some(token) = token.as_ref() {
7614 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7615 }
7616
7617 let request = req_builder
7618 .header(CONTENT_LENGTH, 0_u64)
7619 .body(common::to_body::<String>(None));
7620
7621 client.request(request.unwrap()).await
7622 };
7623
7624 match req_result {
7625 Err(err) => {
7626 if let common::Retry::After(d) = dlg.http_error(&err) {
7627 sleep(d).await;
7628 continue;
7629 }
7630 dlg.finished(false);
7631 return Err(common::Error::HttpError(err));
7632 }
7633 Ok(res) => {
7634 let (mut parts, body) = res.into_parts();
7635 let mut body = common::Body::new(body);
7636 if !parts.status.is_success() {
7637 let bytes = common::to_bytes(body).await.unwrap_or_default();
7638 let error = serde_json::from_str(&common::to_string(&bytes));
7639 let response = common::to_response(parts, bytes.into());
7640
7641 if let common::Retry::After(d) =
7642 dlg.http_failure(&response, error.as_ref().ok())
7643 {
7644 sleep(d).await;
7645 continue;
7646 }
7647
7648 dlg.finished(false);
7649
7650 return Err(match error {
7651 Ok(value) => common::Error::BadRequest(value),
7652 _ => common::Error::Failure(response),
7653 });
7654 }
7655 let response = {
7656 let bytes = common::to_bytes(body).await.unwrap_or_default();
7657 let encoded = common::to_string(&bytes);
7658 match serde_json::from_str(&encoded) {
7659 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7660 Err(error) => {
7661 dlg.response_json_decode_error(&encoded, &error);
7662 return Err(common::Error::JsonDecodeError(
7663 encoded.to_string(),
7664 error,
7665 ));
7666 }
7667 }
7668 };
7669
7670 dlg.finished(true);
7671 return Ok(response);
7672 }
7673 }
7674 }
7675 }
7676
7677 /// 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.
7678 ///
7679 /// Sets the *parent* path property to the given value.
7680 ///
7681 /// Even though the property as already been set when instantiating this call,
7682 /// we provide this method for API completeness.
7683 pub fn parent(mut self, new_value: &str) -> ProjectIosAppListCall<'a, C> {
7684 self._parent = new_value.to_string();
7685 self
7686 }
7687 /// Controls whether Apps in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Apps will be returned.
7688 ///
7689 /// Sets the *show deleted* query property to the given value.
7690 pub fn show_deleted(mut self, new_value: bool) -> ProjectIosAppListCall<'a, C> {
7691 self._show_deleted = Some(new_value);
7692 self
7693 }
7694 /// Token returned from a previous call to `ListIosApps` indicating where in the set of Apps to resume listing.
7695 ///
7696 /// Sets the *page token* query property to the given value.
7697 pub fn page_token(mut self, new_value: &str) -> ProjectIosAppListCall<'a, C> {
7698 self._page_token = Some(new_value.to_string());
7699 self
7700 }
7701 /// 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.
7702 ///
7703 /// Sets the *page size* query property to the given value.
7704 pub fn page_size(mut self, new_value: i32) -> ProjectIosAppListCall<'a, C> {
7705 self._page_size = Some(new_value);
7706 self
7707 }
7708 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7709 /// while executing the actual API request.
7710 ///
7711 /// ````text
7712 /// It should be used to handle progress information, and to implement a certain level of resilience.
7713 /// ````
7714 ///
7715 /// Sets the *delegate* property to the given value.
7716 pub fn delegate(
7717 mut self,
7718 new_value: &'a mut dyn common::Delegate,
7719 ) -> ProjectIosAppListCall<'a, C> {
7720 self._delegate = Some(new_value);
7721 self
7722 }
7723
7724 /// Set any additional parameter of the query string used in the request.
7725 /// It should be used to set parameters which are not yet available through their own
7726 /// setters.
7727 ///
7728 /// Please note that this method must not be used to set any of the known parameters
7729 /// which have their own setter method. If done anyway, the request will fail.
7730 ///
7731 /// # Additional Parameters
7732 ///
7733 /// * *$.xgafv* (query-string) - V1 error format.
7734 /// * *access_token* (query-string) - OAuth access token.
7735 /// * *alt* (query-string) - Data format for response.
7736 /// * *callback* (query-string) - JSONP
7737 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7738 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
7739 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7740 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7741 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
7742 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7743 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7744 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppListCall<'a, C>
7745 where
7746 T: AsRef<str>,
7747 {
7748 self._additional_params
7749 .insert(name.as_ref().to_string(), value.as_ref().to_string());
7750 self
7751 }
7752
7753 /// Identifies the authorization scope for the method you are building.
7754 ///
7755 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
7756 /// [`Scope::Readonly`].
7757 ///
7758 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
7759 /// tokens for more than one scope.
7760 ///
7761 /// Usually there is more than one suitable scope to authorize an operation, some of which may
7762 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
7763 /// sufficient, a read-write scope will do as well.
7764 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppListCall<'a, C>
7765 where
7766 St: AsRef<str>,
7767 {
7768 self._scopes.insert(String::from(scope.as_ref()));
7769 self
7770 }
7771 /// Identifies the authorization scope(s) for the method you are building.
7772 ///
7773 /// See [`Self::add_scope()`] for details.
7774 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppListCall<'a, C>
7775 where
7776 I: IntoIterator<Item = St>,
7777 St: AsRef<str>,
7778 {
7779 self._scopes
7780 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
7781 self
7782 }
7783
7784 /// Removes all scopes, and no default scope will be used either.
7785 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
7786 /// for details).
7787 pub fn clear_scopes(mut self) -> ProjectIosAppListCall<'a, C> {
7788 self._scopes.clear();
7789 self
7790 }
7791}
7792
7793/// Updates the attributes of the specified IosApp.
7794///
7795/// A builder for the *iosApps.patch* method supported by a *project* resource.
7796/// It is not used directly, but through a [`ProjectMethods`] instance.
7797///
7798/// # Example
7799///
7800/// Instantiate a resource method builder
7801///
7802/// ```test_harness,no_run
7803/// # extern crate hyper;
7804/// # extern crate hyper_rustls;
7805/// # extern crate google_firebase1_beta1 as firebase1_beta1;
7806/// use firebase1_beta1::api::IosApp;
7807/// # async fn dox() {
7808/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7809///
7810/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7811/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7812/// # .with_native_roots()
7813/// # .unwrap()
7814/// # .https_only()
7815/// # .enable_http2()
7816/// # .build();
7817///
7818/// # let executor = hyper_util::rt::TokioExecutor::new();
7819/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7820/// # secret,
7821/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7822/// # yup_oauth2::client::CustomHyperClientBuilder::from(
7823/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
7824/// # ),
7825/// # ).build().await.unwrap();
7826///
7827/// # let client = hyper_util::client::legacy::Client::builder(
7828/// # hyper_util::rt::TokioExecutor::new()
7829/// # )
7830/// # .build(
7831/// # hyper_rustls::HttpsConnectorBuilder::new()
7832/// # .with_native_roots()
7833/// # .unwrap()
7834/// # .https_or_http()
7835/// # .enable_http2()
7836/// # .build()
7837/// # );
7838/// # let mut hub = FirebaseManagement::new(client, auth);
7839/// // As the method needs a request, you would usually fill it with the desired information
7840/// // into the respective structure. Some of the parts shown here might not be applicable !
7841/// // Values shown here are possibly random and not representative !
7842/// let mut req = IosApp::default();
7843///
7844/// // You can configure optional parameters by calling the respective setters at will, and
7845/// // execute the final call using `doit()`.
7846/// // Values shown here are possibly random and not representative !
7847/// let result = hub.projects().ios_apps_patch(req, "name")
7848/// .update_mask(FieldMask::new::<&str>(&[]))
7849/// .doit().await;
7850/// # }
7851/// ```
7852pub struct ProjectIosAppPatchCall<'a, C>
7853where
7854 C: 'a,
7855{
7856 hub: &'a FirebaseManagement<C>,
7857 _request: IosApp,
7858 _name: String,
7859 _update_mask: Option<common::FieldMask>,
7860 _delegate: Option<&'a mut dyn common::Delegate>,
7861 _additional_params: HashMap<String, String>,
7862 _scopes: BTreeSet<String>,
7863}
7864
7865impl<'a, C> common::CallBuilder for ProjectIosAppPatchCall<'a, C> {}
7866
7867impl<'a, C> ProjectIosAppPatchCall<'a, C>
7868where
7869 C: common::Connector,
7870{
7871 /// Perform the operation you have build so far.
7872 pub async fn doit(mut self) -> common::Result<(common::Response, IosApp)> {
7873 use std::borrow::Cow;
7874 use std::io::{Read, Seek};
7875
7876 use common::{url::Params, ToParts};
7877 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7878
7879 let mut dd = common::DefaultDelegate;
7880 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7881 dlg.begin(common::MethodInfo {
7882 id: "firebase.projects.iosApps.patch",
7883 http_method: hyper::Method::PATCH,
7884 });
7885
7886 for &field in ["alt", "name", "updateMask"].iter() {
7887 if self._additional_params.contains_key(field) {
7888 dlg.finished(false);
7889 return Err(common::Error::FieldClash(field));
7890 }
7891 }
7892
7893 let mut params = Params::with_capacity(5 + self._additional_params.len());
7894 params.push("name", self._name);
7895 if let Some(value) = self._update_mask.as_ref() {
7896 params.push("updateMask", value.to_string());
7897 }
7898
7899 params.extend(self._additional_params.iter());
7900
7901 params.push("alt", "json");
7902 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
7903 if self._scopes.is_empty() {
7904 self._scopes
7905 .insert(Scope::CloudPlatform.as_ref().to_string());
7906 }
7907
7908 #[allow(clippy::single_element_loop)]
7909 for &(find_this, param_name) in [("{+name}", "name")].iter() {
7910 url = params.uri_replacement(url, param_name, find_this, true);
7911 }
7912 {
7913 let to_remove = ["name"];
7914 params.remove_params(&to_remove);
7915 }
7916
7917 let url = params.parse_with_url(&url);
7918
7919 let mut json_mime_type = mime::APPLICATION_JSON;
7920 let mut request_value_reader = {
7921 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7922 common::remove_json_null_values(&mut value);
7923 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7924 serde_json::to_writer(&mut dst, &value).unwrap();
7925 dst
7926 };
7927 let request_size = request_value_reader
7928 .seek(std::io::SeekFrom::End(0))
7929 .unwrap();
7930 request_value_reader
7931 .seek(std::io::SeekFrom::Start(0))
7932 .unwrap();
7933
7934 loop {
7935 let token = match self
7936 .hub
7937 .auth
7938 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
7939 .await
7940 {
7941 Ok(token) => token,
7942 Err(e) => match dlg.token(e) {
7943 Ok(token) => token,
7944 Err(e) => {
7945 dlg.finished(false);
7946 return Err(common::Error::MissingToken(e));
7947 }
7948 },
7949 };
7950 request_value_reader
7951 .seek(std::io::SeekFrom::Start(0))
7952 .unwrap();
7953 let mut req_result = {
7954 let client = &self.hub.client;
7955 dlg.pre_request();
7956 let mut req_builder = hyper::Request::builder()
7957 .method(hyper::Method::PATCH)
7958 .uri(url.as_str())
7959 .header(USER_AGENT, self.hub._user_agent.clone());
7960
7961 if let Some(token) = token.as_ref() {
7962 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
7963 }
7964
7965 let request = req_builder
7966 .header(CONTENT_TYPE, json_mime_type.to_string())
7967 .header(CONTENT_LENGTH, request_size as u64)
7968 .body(common::to_body(
7969 request_value_reader.get_ref().clone().into(),
7970 ));
7971
7972 client.request(request.unwrap()).await
7973 };
7974
7975 match req_result {
7976 Err(err) => {
7977 if let common::Retry::After(d) = dlg.http_error(&err) {
7978 sleep(d).await;
7979 continue;
7980 }
7981 dlg.finished(false);
7982 return Err(common::Error::HttpError(err));
7983 }
7984 Ok(res) => {
7985 let (mut parts, body) = res.into_parts();
7986 let mut body = common::Body::new(body);
7987 if !parts.status.is_success() {
7988 let bytes = common::to_bytes(body).await.unwrap_or_default();
7989 let error = serde_json::from_str(&common::to_string(&bytes));
7990 let response = common::to_response(parts, bytes.into());
7991
7992 if let common::Retry::After(d) =
7993 dlg.http_failure(&response, error.as_ref().ok())
7994 {
7995 sleep(d).await;
7996 continue;
7997 }
7998
7999 dlg.finished(false);
8000
8001 return Err(match error {
8002 Ok(value) => common::Error::BadRequest(value),
8003 _ => common::Error::Failure(response),
8004 });
8005 }
8006 let response = {
8007 let bytes = common::to_bytes(body).await.unwrap_or_default();
8008 let encoded = common::to_string(&bytes);
8009 match serde_json::from_str(&encoded) {
8010 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8011 Err(error) => {
8012 dlg.response_json_decode_error(&encoded, &error);
8013 return Err(common::Error::JsonDecodeError(
8014 encoded.to_string(),
8015 error,
8016 ));
8017 }
8018 }
8019 };
8020
8021 dlg.finished(true);
8022 return Ok(response);
8023 }
8024 }
8025 }
8026 }
8027
8028 ///
8029 /// Sets the *request* property to the given value.
8030 ///
8031 /// Even though the property as already been set when instantiating this call,
8032 /// we provide this method for API completeness.
8033 pub fn request(mut self, new_value: IosApp) -> ProjectIosAppPatchCall<'a, C> {
8034 self._request = new_value;
8035 self
8036 }
8037 /// 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)).
8038 ///
8039 /// Sets the *name* path property to the given value.
8040 ///
8041 /// Even though the property as already been set when instantiating this call,
8042 /// we provide this method for API completeness.
8043 pub fn name(mut self, new_value: &str) -> ProjectIosAppPatchCall<'a, C> {
8044 self._name = new_value.to_string();
8045 self
8046 }
8047 /// 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.
8048 ///
8049 /// Sets the *update mask* query property to the given value.
8050 pub fn update_mask(mut self, new_value: common::FieldMask) -> ProjectIosAppPatchCall<'a, C> {
8051 self._update_mask = Some(new_value);
8052 self
8053 }
8054 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8055 /// while executing the actual API request.
8056 ///
8057 /// ````text
8058 /// It should be used to handle progress information, and to implement a certain level of resilience.
8059 /// ````
8060 ///
8061 /// Sets the *delegate* property to the given value.
8062 pub fn delegate(
8063 mut self,
8064 new_value: &'a mut dyn common::Delegate,
8065 ) -> ProjectIosAppPatchCall<'a, C> {
8066 self._delegate = Some(new_value);
8067 self
8068 }
8069
8070 /// Set any additional parameter of the query string used in the request.
8071 /// It should be used to set parameters which are not yet available through their own
8072 /// setters.
8073 ///
8074 /// Please note that this method must not be used to set any of the known parameters
8075 /// which have their own setter method. If done anyway, the request will fail.
8076 ///
8077 /// # Additional Parameters
8078 ///
8079 /// * *$.xgafv* (query-string) - V1 error format.
8080 /// * *access_token* (query-string) - OAuth access token.
8081 /// * *alt* (query-string) - Data format for response.
8082 /// * *callback* (query-string) - JSONP
8083 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8084 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8085 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8086 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8087 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8088 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8089 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8090 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppPatchCall<'a, C>
8091 where
8092 T: AsRef<str>,
8093 {
8094 self._additional_params
8095 .insert(name.as_ref().to_string(), value.as_ref().to_string());
8096 self
8097 }
8098
8099 /// Identifies the authorization scope for the method you are building.
8100 ///
8101 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8102 /// [`Scope::CloudPlatform`].
8103 ///
8104 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8105 /// tokens for more than one scope.
8106 ///
8107 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8108 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8109 /// sufficient, a read-write scope will do as well.
8110 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppPatchCall<'a, C>
8111 where
8112 St: AsRef<str>,
8113 {
8114 self._scopes.insert(String::from(scope.as_ref()));
8115 self
8116 }
8117 /// Identifies the authorization scope(s) for the method you are building.
8118 ///
8119 /// See [`Self::add_scope()`] for details.
8120 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppPatchCall<'a, C>
8121 where
8122 I: IntoIterator<Item = St>,
8123 St: AsRef<str>,
8124 {
8125 self._scopes
8126 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8127 self
8128 }
8129
8130 /// Removes all scopes, and no default scope will be used either.
8131 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8132 /// for details).
8133 pub fn clear_scopes(mut self) -> ProjectIosAppPatchCall<'a, C> {
8134 self._scopes.clear();
8135 self
8136 }
8137}
8138
8139/// Removes the specified IosApp from the FirebaseProject.
8140///
8141/// A builder for the *iosApps.remove* method supported by a *project* resource.
8142/// It is not used directly, but through a [`ProjectMethods`] instance.
8143///
8144/// # Example
8145///
8146/// Instantiate a resource method builder
8147///
8148/// ```test_harness,no_run
8149/// # extern crate hyper;
8150/// # extern crate hyper_rustls;
8151/// # extern crate google_firebase1_beta1 as firebase1_beta1;
8152/// use firebase1_beta1::api::RemoveIosAppRequest;
8153/// # async fn dox() {
8154/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8155///
8156/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8157/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
8158/// # .with_native_roots()
8159/// # .unwrap()
8160/// # .https_only()
8161/// # .enable_http2()
8162/// # .build();
8163///
8164/// # let executor = hyper_util::rt::TokioExecutor::new();
8165/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
8166/// # secret,
8167/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8168/// # yup_oauth2::client::CustomHyperClientBuilder::from(
8169/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
8170/// # ),
8171/// # ).build().await.unwrap();
8172///
8173/// # let client = hyper_util::client::legacy::Client::builder(
8174/// # hyper_util::rt::TokioExecutor::new()
8175/// # )
8176/// # .build(
8177/// # hyper_rustls::HttpsConnectorBuilder::new()
8178/// # .with_native_roots()
8179/// # .unwrap()
8180/// # .https_or_http()
8181/// # .enable_http2()
8182/// # .build()
8183/// # );
8184/// # let mut hub = FirebaseManagement::new(client, auth);
8185/// // As the method needs a request, you would usually fill it with the desired information
8186/// // into the respective structure. Some of the parts shown here might not be applicable !
8187/// // Values shown here are possibly random and not representative !
8188/// let mut req = RemoveIosAppRequest::default();
8189///
8190/// // You can configure optional parameters by calling the respective setters at will, and
8191/// // execute the final call using `doit()`.
8192/// // Values shown here are possibly random and not representative !
8193/// let result = hub.projects().ios_apps_remove(req, "name")
8194/// .doit().await;
8195/// # }
8196/// ```
8197pub struct ProjectIosAppRemoveCall<'a, C>
8198where
8199 C: 'a,
8200{
8201 hub: &'a FirebaseManagement<C>,
8202 _request: RemoveIosAppRequest,
8203 _name: String,
8204 _delegate: Option<&'a mut dyn common::Delegate>,
8205 _additional_params: HashMap<String, String>,
8206 _scopes: BTreeSet<String>,
8207}
8208
8209impl<'a, C> common::CallBuilder for ProjectIosAppRemoveCall<'a, C> {}
8210
8211impl<'a, C> ProjectIosAppRemoveCall<'a, C>
8212where
8213 C: common::Connector,
8214{
8215 /// Perform the operation you have build so far.
8216 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
8217 use std::borrow::Cow;
8218 use std::io::{Read, Seek};
8219
8220 use common::{url::Params, ToParts};
8221 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8222
8223 let mut dd = common::DefaultDelegate;
8224 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8225 dlg.begin(common::MethodInfo {
8226 id: "firebase.projects.iosApps.remove",
8227 http_method: hyper::Method::POST,
8228 });
8229
8230 for &field in ["alt", "name"].iter() {
8231 if self._additional_params.contains_key(field) {
8232 dlg.finished(false);
8233 return Err(common::Error::FieldClash(field));
8234 }
8235 }
8236
8237 let mut params = Params::with_capacity(4 + self._additional_params.len());
8238 params.push("name", self._name);
8239
8240 params.extend(self._additional_params.iter());
8241
8242 params.push("alt", "json");
8243 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:remove";
8244 if self._scopes.is_empty() {
8245 self._scopes
8246 .insert(Scope::CloudPlatform.as_ref().to_string());
8247 }
8248
8249 #[allow(clippy::single_element_loop)]
8250 for &(find_this, param_name) in [("{+name}", "name")].iter() {
8251 url = params.uri_replacement(url, param_name, find_this, true);
8252 }
8253 {
8254 let to_remove = ["name"];
8255 params.remove_params(&to_remove);
8256 }
8257
8258 let url = params.parse_with_url(&url);
8259
8260 let mut json_mime_type = mime::APPLICATION_JSON;
8261 let mut request_value_reader = {
8262 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8263 common::remove_json_null_values(&mut value);
8264 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8265 serde_json::to_writer(&mut dst, &value).unwrap();
8266 dst
8267 };
8268 let request_size = request_value_reader
8269 .seek(std::io::SeekFrom::End(0))
8270 .unwrap();
8271 request_value_reader
8272 .seek(std::io::SeekFrom::Start(0))
8273 .unwrap();
8274
8275 loop {
8276 let token = match self
8277 .hub
8278 .auth
8279 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8280 .await
8281 {
8282 Ok(token) => token,
8283 Err(e) => match dlg.token(e) {
8284 Ok(token) => token,
8285 Err(e) => {
8286 dlg.finished(false);
8287 return Err(common::Error::MissingToken(e));
8288 }
8289 },
8290 };
8291 request_value_reader
8292 .seek(std::io::SeekFrom::Start(0))
8293 .unwrap();
8294 let mut req_result = {
8295 let client = &self.hub.client;
8296 dlg.pre_request();
8297 let mut req_builder = hyper::Request::builder()
8298 .method(hyper::Method::POST)
8299 .uri(url.as_str())
8300 .header(USER_AGENT, self.hub._user_agent.clone());
8301
8302 if let Some(token) = token.as_ref() {
8303 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8304 }
8305
8306 let request = req_builder
8307 .header(CONTENT_TYPE, json_mime_type.to_string())
8308 .header(CONTENT_LENGTH, request_size as u64)
8309 .body(common::to_body(
8310 request_value_reader.get_ref().clone().into(),
8311 ));
8312
8313 client.request(request.unwrap()).await
8314 };
8315
8316 match req_result {
8317 Err(err) => {
8318 if let common::Retry::After(d) = dlg.http_error(&err) {
8319 sleep(d).await;
8320 continue;
8321 }
8322 dlg.finished(false);
8323 return Err(common::Error::HttpError(err));
8324 }
8325 Ok(res) => {
8326 let (mut parts, body) = res.into_parts();
8327 let mut body = common::Body::new(body);
8328 if !parts.status.is_success() {
8329 let bytes = common::to_bytes(body).await.unwrap_or_default();
8330 let error = serde_json::from_str(&common::to_string(&bytes));
8331 let response = common::to_response(parts, bytes.into());
8332
8333 if let common::Retry::After(d) =
8334 dlg.http_failure(&response, error.as_ref().ok())
8335 {
8336 sleep(d).await;
8337 continue;
8338 }
8339
8340 dlg.finished(false);
8341
8342 return Err(match error {
8343 Ok(value) => common::Error::BadRequest(value),
8344 _ => common::Error::Failure(response),
8345 });
8346 }
8347 let response = {
8348 let bytes = common::to_bytes(body).await.unwrap_or_default();
8349 let encoded = common::to_string(&bytes);
8350 match serde_json::from_str(&encoded) {
8351 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8352 Err(error) => {
8353 dlg.response_json_decode_error(&encoded, &error);
8354 return Err(common::Error::JsonDecodeError(
8355 encoded.to_string(),
8356 error,
8357 ));
8358 }
8359 }
8360 };
8361
8362 dlg.finished(true);
8363 return Ok(response);
8364 }
8365 }
8366 }
8367 }
8368
8369 ///
8370 /// Sets the *request* property to the given value.
8371 ///
8372 /// Even though the property as already been set when instantiating this call,
8373 /// we provide this method for API completeness.
8374 pub fn request(mut self, new_value: RemoveIosAppRequest) -> ProjectIosAppRemoveCall<'a, C> {
8375 self._request = new_value;
8376 self
8377 }
8378 /// 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.
8379 ///
8380 /// Sets the *name* path property to the given value.
8381 ///
8382 /// Even though the property as already been set when instantiating this call,
8383 /// we provide this method for API completeness.
8384 pub fn name(mut self, new_value: &str) -> ProjectIosAppRemoveCall<'a, C> {
8385 self._name = new_value.to_string();
8386 self
8387 }
8388 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8389 /// while executing the actual API request.
8390 ///
8391 /// ````text
8392 /// It should be used to handle progress information, and to implement a certain level of resilience.
8393 /// ````
8394 ///
8395 /// Sets the *delegate* property to the given value.
8396 pub fn delegate(
8397 mut self,
8398 new_value: &'a mut dyn common::Delegate,
8399 ) -> ProjectIosAppRemoveCall<'a, C> {
8400 self._delegate = Some(new_value);
8401 self
8402 }
8403
8404 /// Set any additional parameter of the query string used in the request.
8405 /// It should be used to set parameters which are not yet available through their own
8406 /// setters.
8407 ///
8408 /// Please note that this method must not be used to set any of the known parameters
8409 /// which have their own setter method. If done anyway, the request will fail.
8410 ///
8411 /// # Additional Parameters
8412 ///
8413 /// * *$.xgafv* (query-string) - V1 error format.
8414 /// * *access_token* (query-string) - OAuth access token.
8415 /// * *alt* (query-string) - Data format for response.
8416 /// * *callback* (query-string) - JSONP
8417 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8418 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8419 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8420 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8421 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8422 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8423 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8424 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppRemoveCall<'a, C>
8425 where
8426 T: AsRef<str>,
8427 {
8428 self._additional_params
8429 .insert(name.as_ref().to_string(), value.as_ref().to_string());
8430 self
8431 }
8432
8433 /// Identifies the authorization scope for the method you are building.
8434 ///
8435 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8436 /// [`Scope::CloudPlatform`].
8437 ///
8438 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8439 /// tokens for more than one scope.
8440 ///
8441 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8442 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8443 /// sufficient, a read-write scope will do as well.
8444 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppRemoveCall<'a, C>
8445 where
8446 St: AsRef<str>,
8447 {
8448 self._scopes.insert(String::from(scope.as_ref()));
8449 self
8450 }
8451 /// Identifies the authorization scope(s) for the method you are building.
8452 ///
8453 /// See [`Self::add_scope()`] for details.
8454 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppRemoveCall<'a, C>
8455 where
8456 I: IntoIterator<Item = St>,
8457 St: AsRef<str>,
8458 {
8459 self._scopes
8460 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8461 self
8462 }
8463
8464 /// Removes all scopes, and no default scope will be used either.
8465 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8466 /// for details).
8467 pub fn clear_scopes(mut self) -> ProjectIosAppRemoveCall<'a, C> {
8468 self._scopes.clear();
8469 self
8470 }
8471}
8472
8473/// Restores the specified IosApp to the FirebaseProject.
8474///
8475/// A builder for the *iosApps.undelete* method supported by a *project* resource.
8476/// It is not used directly, but through a [`ProjectMethods`] instance.
8477///
8478/// # Example
8479///
8480/// Instantiate a resource method builder
8481///
8482/// ```test_harness,no_run
8483/// # extern crate hyper;
8484/// # extern crate hyper_rustls;
8485/// # extern crate google_firebase1_beta1 as firebase1_beta1;
8486/// use firebase1_beta1::api::UndeleteIosAppRequest;
8487/// # async fn dox() {
8488/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8489///
8490/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8491/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
8492/// # .with_native_roots()
8493/// # .unwrap()
8494/// # .https_only()
8495/// # .enable_http2()
8496/// # .build();
8497///
8498/// # let executor = hyper_util::rt::TokioExecutor::new();
8499/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
8500/// # secret,
8501/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8502/// # yup_oauth2::client::CustomHyperClientBuilder::from(
8503/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
8504/// # ),
8505/// # ).build().await.unwrap();
8506///
8507/// # let client = hyper_util::client::legacy::Client::builder(
8508/// # hyper_util::rt::TokioExecutor::new()
8509/// # )
8510/// # .build(
8511/// # hyper_rustls::HttpsConnectorBuilder::new()
8512/// # .with_native_roots()
8513/// # .unwrap()
8514/// # .https_or_http()
8515/// # .enable_http2()
8516/// # .build()
8517/// # );
8518/// # let mut hub = FirebaseManagement::new(client, auth);
8519/// // As the method needs a request, you would usually fill it with the desired information
8520/// // into the respective structure. Some of the parts shown here might not be applicable !
8521/// // Values shown here are possibly random and not representative !
8522/// let mut req = UndeleteIosAppRequest::default();
8523///
8524/// // You can configure optional parameters by calling the respective setters at will, and
8525/// // execute the final call using `doit()`.
8526/// // Values shown here are possibly random and not representative !
8527/// let result = hub.projects().ios_apps_undelete(req, "name")
8528/// .doit().await;
8529/// # }
8530/// ```
8531pub struct ProjectIosAppUndeleteCall<'a, C>
8532where
8533 C: 'a,
8534{
8535 hub: &'a FirebaseManagement<C>,
8536 _request: UndeleteIosAppRequest,
8537 _name: String,
8538 _delegate: Option<&'a mut dyn common::Delegate>,
8539 _additional_params: HashMap<String, String>,
8540 _scopes: BTreeSet<String>,
8541}
8542
8543impl<'a, C> common::CallBuilder for ProjectIosAppUndeleteCall<'a, C> {}
8544
8545impl<'a, C> ProjectIosAppUndeleteCall<'a, C>
8546where
8547 C: common::Connector,
8548{
8549 /// Perform the operation you have build so far.
8550 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
8551 use std::borrow::Cow;
8552 use std::io::{Read, Seek};
8553
8554 use common::{url::Params, ToParts};
8555 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8556
8557 let mut dd = common::DefaultDelegate;
8558 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8559 dlg.begin(common::MethodInfo {
8560 id: "firebase.projects.iosApps.undelete",
8561 http_method: hyper::Method::POST,
8562 });
8563
8564 for &field in ["alt", "name"].iter() {
8565 if self._additional_params.contains_key(field) {
8566 dlg.finished(false);
8567 return Err(common::Error::FieldClash(field));
8568 }
8569 }
8570
8571 let mut params = Params::with_capacity(4 + self._additional_params.len());
8572 params.push("name", self._name);
8573
8574 params.extend(self._additional_params.iter());
8575
8576 params.push("alt", "json");
8577 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:undelete";
8578 if self._scopes.is_empty() {
8579 self._scopes
8580 .insert(Scope::CloudPlatform.as_ref().to_string());
8581 }
8582
8583 #[allow(clippy::single_element_loop)]
8584 for &(find_this, param_name) in [("{+name}", "name")].iter() {
8585 url = params.uri_replacement(url, param_name, find_this, true);
8586 }
8587 {
8588 let to_remove = ["name"];
8589 params.remove_params(&to_remove);
8590 }
8591
8592 let url = params.parse_with_url(&url);
8593
8594 let mut json_mime_type = mime::APPLICATION_JSON;
8595 let mut request_value_reader = {
8596 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8597 common::remove_json_null_values(&mut value);
8598 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8599 serde_json::to_writer(&mut dst, &value).unwrap();
8600 dst
8601 };
8602 let request_size = request_value_reader
8603 .seek(std::io::SeekFrom::End(0))
8604 .unwrap();
8605 request_value_reader
8606 .seek(std::io::SeekFrom::Start(0))
8607 .unwrap();
8608
8609 loop {
8610 let token = match self
8611 .hub
8612 .auth
8613 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8614 .await
8615 {
8616 Ok(token) => token,
8617 Err(e) => match dlg.token(e) {
8618 Ok(token) => token,
8619 Err(e) => {
8620 dlg.finished(false);
8621 return Err(common::Error::MissingToken(e));
8622 }
8623 },
8624 };
8625 request_value_reader
8626 .seek(std::io::SeekFrom::Start(0))
8627 .unwrap();
8628 let mut req_result = {
8629 let client = &self.hub.client;
8630 dlg.pre_request();
8631 let mut req_builder = hyper::Request::builder()
8632 .method(hyper::Method::POST)
8633 .uri(url.as_str())
8634 .header(USER_AGENT, self.hub._user_agent.clone());
8635
8636 if let Some(token) = token.as_ref() {
8637 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8638 }
8639
8640 let request = req_builder
8641 .header(CONTENT_TYPE, json_mime_type.to_string())
8642 .header(CONTENT_LENGTH, request_size as u64)
8643 .body(common::to_body(
8644 request_value_reader.get_ref().clone().into(),
8645 ));
8646
8647 client.request(request.unwrap()).await
8648 };
8649
8650 match req_result {
8651 Err(err) => {
8652 if let common::Retry::After(d) = dlg.http_error(&err) {
8653 sleep(d).await;
8654 continue;
8655 }
8656 dlg.finished(false);
8657 return Err(common::Error::HttpError(err));
8658 }
8659 Ok(res) => {
8660 let (mut parts, body) = res.into_parts();
8661 let mut body = common::Body::new(body);
8662 if !parts.status.is_success() {
8663 let bytes = common::to_bytes(body).await.unwrap_or_default();
8664 let error = serde_json::from_str(&common::to_string(&bytes));
8665 let response = common::to_response(parts, bytes.into());
8666
8667 if let common::Retry::After(d) =
8668 dlg.http_failure(&response, error.as_ref().ok())
8669 {
8670 sleep(d).await;
8671 continue;
8672 }
8673
8674 dlg.finished(false);
8675
8676 return Err(match error {
8677 Ok(value) => common::Error::BadRequest(value),
8678 _ => common::Error::Failure(response),
8679 });
8680 }
8681 let response = {
8682 let bytes = common::to_bytes(body).await.unwrap_or_default();
8683 let encoded = common::to_string(&bytes);
8684 match serde_json::from_str(&encoded) {
8685 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8686 Err(error) => {
8687 dlg.response_json_decode_error(&encoded, &error);
8688 return Err(common::Error::JsonDecodeError(
8689 encoded.to_string(),
8690 error,
8691 ));
8692 }
8693 }
8694 };
8695
8696 dlg.finished(true);
8697 return Ok(response);
8698 }
8699 }
8700 }
8701 }
8702
8703 ///
8704 /// Sets the *request* property to the given value.
8705 ///
8706 /// Even though the property as already been set when instantiating this call,
8707 /// we provide this method for API completeness.
8708 pub fn request(mut self, new_value: UndeleteIosAppRequest) -> ProjectIosAppUndeleteCall<'a, C> {
8709 self._request = new_value;
8710 self
8711 }
8712 /// 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.
8713 ///
8714 /// Sets the *name* path property to the given value.
8715 ///
8716 /// Even though the property as already been set when instantiating this call,
8717 /// we provide this method for API completeness.
8718 pub fn name(mut self, new_value: &str) -> ProjectIosAppUndeleteCall<'a, C> {
8719 self._name = new_value.to_string();
8720 self
8721 }
8722 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8723 /// while executing the actual API request.
8724 ///
8725 /// ````text
8726 /// It should be used to handle progress information, and to implement a certain level of resilience.
8727 /// ````
8728 ///
8729 /// Sets the *delegate* property to the given value.
8730 pub fn delegate(
8731 mut self,
8732 new_value: &'a mut dyn common::Delegate,
8733 ) -> ProjectIosAppUndeleteCall<'a, C> {
8734 self._delegate = Some(new_value);
8735 self
8736 }
8737
8738 /// Set any additional parameter of the query string used in the request.
8739 /// It should be used to set parameters which are not yet available through their own
8740 /// setters.
8741 ///
8742 /// Please note that this method must not be used to set any of the known parameters
8743 /// which have their own setter method. If done anyway, the request will fail.
8744 ///
8745 /// # Additional Parameters
8746 ///
8747 /// * *$.xgafv* (query-string) - V1 error format.
8748 /// * *access_token* (query-string) - OAuth access token.
8749 /// * *alt* (query-string) - Data format for response.
8750 /// * *callback* (query-string) - JSONP
8751 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8752 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
8753 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8754 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8755 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
8756 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8757 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8758 pub fn param<T>(mut self, name: T, value: T) -> ProjectIosAppUndeleteCall<'a, C>
8759 where
8760 T: AsRef<str>,
8761 {
8762 self._additional_params
8763 .insert(name.as_ref().to_string(), value.as_ref().to_string());
8764 self
8765 }
8766
8767 /// Identifies the authorization scope for the method you are building.
8768 ///
8769 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8770 /// [`Scope::CloudPlatform`].
8771 ///
8772 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8773 /// tokens for more than one scope.
8774 ///
8775 /// Usually there is more than one suitable scope to authorize an operation, some of which may
8776 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8777 /// sufficient, a read-write scope will do as well.
8778 pub fn add_scope<St>(mut self, scope: St) -> ProjectIosAppUndeleteCall<'a, C>
8779 where
8780 St: AsRef<str>,
8781 {
8782 self._scopes.insert(String::from(scope.as_ref()));
8783 self
8784 }
8785 /// Identifies the authorization scope(s) for the method you are building.
8786 ///
8787 /// See [`Self::add_scope()`] for details.
8788 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectIosAppUndeleteCall<'a, C>
8789 where
8790 I: IntoIterator<Item = St>,
8791 St: AsRef<str>,
8792 {
8793 self._scopes
8794 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8795 self
8796 }
8797
8798 /// Removes all scopes, and no default scope will be used either.
8799 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8800 /// for details).
8801 pub fn clear_scopes(mut self) -> ProjectIosAppUndeleteCall<'a, C> {
8802 self._scopes.clear();
8803 self
8804 }
8805}
8806
8807/// 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`.
8808///
8809/// A builder for the *webApps.create* method supported by a *project* resource.
8810/// It is not used directly, but through a [`ProjectMethods`] instance.
8811///
8812/// # Example
8813///
8814/// Instantiate a resource method builder
8815///
8816/// ```test_harness,no_run
8817/// # extern crate hyper;
8818/// # extern crate hyper_rustls;
8819/// # extern crate google_firebase1_beta1 as firebase1_beta1;
8820/// use firebase1_beta1::api::WebApp;
8821/// # async fn dox() {
8822/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8823///
8824/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8825/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
8826/// # .with_native_roots()
8827/// # .unwrap()
8828/// # .https_only()
8829/// # .enable_http2()
8830/// # .build();
8831///
8832/// # let executor = hyper_util::rt::TokioExecutor::new();
8833/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
8834/// # secret,
8835/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8836/// # yup_oauth2::client::CustomHyperClientBuilder::from(
8837/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
8838/// # ),
8839/// # ).build().await.unwrap();
8840///
8841/// # let client = hyper_util::client::legacy::Client::builder(
8842/// # hyper_util::rt::TokioExecutor::new()
8843/// # )
8844/// # .build(
8845/// # hyper_rustls::HttpsConnectorBuilder::new()
8846/// # .with_native_roots()
8847/// # .unwrap()
8848/// # .https_or_http()
8849/// # .enable_http2()
8850/// # .build()
8851/// # );
8852/// # let mut hub = FirebaseManagement::new(client, auth);
8853/// // As the method needs a request, you would usually fill it with the desired information
8854/// // into the respective structure. Some of the parts shown here might not be applicable !
8855/// // Values shown here are possibly random and not representative !
8856/// let mut req = WebApp::default();
8857///
8858/// // You can configure optional parameters by calling the respective setters at will, and
8859/// // execute the final call using `doit()`.
8860/// // Values shown here are possibly random and not representative !
8861/// let result = hub.projects().web_apps_create(req, "parent")
8862/// .doit().await;
8863/// # }
8864/// ```
8865pub struct ProjectWebAppCreateCall<'a, C>
8866where
8867 C: 'a,
8868{
8869 hub: &'a FirebaseManagement<C>,
8870 _request: WebApp,
8871 _parent: String,
8872 _delegate: Option<&'a mut dyn common::Delegate>,
8873 _additional_params: HashMap<String, String>,
8874 _scopes: BTreeSet<String>,
8875}
8876
8877impl<'a, C> common::CallBuilder for ProjectWebAppCreateCall<'a, C> {}
8878
8879impl<'a, C> ProjectWebAppCreateCall<'a, C>
8880where
8881 C: common::Connector,
8882{
8883 /// Perform the operation you have build so far.
8884 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
8885 use std::borrow::Cow;
8886 use std::io::{Read, Seek};
8887
8888 use common::{url::Params, ToParts};
8889 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8890
8891 let mut dd = common::DefaultDelegate;
8892 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8893 dlg.begin(common::MethodInfo {
8894 id: "firebase.projects.webApps.create",
8895 http_method: hyper::Method::POST,
8896 });
8897
8898 for &field in ["alt", "parent"].iter() {
8899 if self._additional_params.contains_key(field) {
8900 dlg.finished(false);
8901 return Err(common::Error::FieldClash(field));
8902 }
8903 }
8904
8905 let mut params = Params::with_capacity(4 + self._additional_params.len());
8906 params.push("parent", self._parent);
8907
8908 params.extend(self._additional_params.iter());
8909
8910 params.push("alt", "json");
8911 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/webApps";
8912 if self._scopes.is_empty() {
8913 self._scopes
8914 .insert(Scope::CloudPlatform.as_ref().to_string());
8915 }
8916
8917 #[allow(clippy::single_element_loop)]
8918 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
8919 url = params.uri_replacement(url, param_name, find_this, true);
8920 }
8921 {
8922 let to_remove = ["parent"];
8923 params.remove_params(&to_remove);
8924 }
8925
8926 let url = params.parse_with_url(&url);
8927
8928 let mut json_mime_type = mime::APPLICATION_JSON;
8929 let mut request_value_reader = {
8930 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8931 common::remove_json_null_values(&mut value);
8932 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8933 serde_json::to_writer(&mut dst, &value).unwrap();
8934 dst
8935 };
8936 let request_size = request_value_reader
8937 .seek(std::io::SeekFrom::End(0))
8938 .unwrap();
8939 request_value_reader
8940 .seek(std::io::SeekFrom::Start(0))
8941 .unwrap();
8942
8943 loop {
8944 let token = match self
8945 .hub
8946 .auth
8947 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8948 .await
8949 {
8950 Ok(token) => token,
8951 Err(e) => match dlg.token(e) {
8952 Ok(token) => token,
8953 Err(e) => {
8954 dlg.finished(false);
8955 return Err(common::Error::MissingToken(e));
8956 }
8957 },
8958 };
8959 request_value_reader
8960 .seek(std::io::SeekFrom::Start(0))
8961 .unwrap();
8962 let mut req_result = {
8963 let client = &self.hub.client;
8964 dlg.pre_request();
8965 let mut req_builder = hyper::Request::builder()
8966 .method(hyper::Method::POST)
8967 .uri(url.as_str())
8968 .header(USER_AGENT, self.hub._user_agent.clone());
8969
8970 if let Some(token) = token.as_ref() {
8971 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8972 }
8973
8974 let request = req_builder
8975 .header(CONTENT_TYPE, json_mime_type.to_string())
8976 .header(CONTENT_LENGTH, request_size as u64)
8977 .body(common::to_body(
8978 request_value_reader.get_ref().clone().into(),
8979 ));
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 ///
9038 /// Sets the *request* property to the given value.
9039 ///
9040 /// Even though the property as already been set when instantiating this call,
9041 /// we provide this method for API completeness.
9042 pub fn request(mut self, new_value: WebApp) -> ProjectWebAppCreateCall<'a, C> {
9043 self._request = new_value;
9044 self
9045 }
9046 /// 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.
9047 ///
9048 /// Sets the *parent* path property to the given value.
9049 ///
9050 /// Even though the property as already been set when instantiating this call,
9051 /// we provide this method for API completeness.
9052 pub fn parent(mut self, new_value: &str) -> ProjectWebAppCreateCall<'a, C> {
9053 self._parent = new_value.to_string();
9054 self
9055 }
9056 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9057 /// while executing the actual API request.
9058 ///
9059 /// ````text
9060 /// It should be used to handle progress information, and to implement a certain level of resilience.
9061 /// ````
9062 ///
9063 /// Sets the *delegate* property to the given value.
9064 pub fn delegate(
9065 mut self,
9066 new_value: &'a mut dyn common::Delegate,
9067 ) -> ProjectWebAppCreateCall<'a, C> {
9068 self._delegate = Some(new_value);
9069 self
9070 }
9071
9072 /// Set any additional parameter of the query string used in the request.
9073 /// It should be used to set parameters which are not yet available through their own
9074 /// setters.
9075 ///
9076 /// Please note that this method must not be used to set any of the known parameters
9077 /// which have their own setter method. If done anyway, the request will fail.
9078 ///
9079 /// # Additional Parameters
9080 ///
9081 /// * *$.xgafv* (query-string) - V1 error format.
9082 /// * *access_token* (query-string) - OAuth access token.
9083 /// * *alt* (query-string) - Data format for response.
9084 /// * *callback* (query-string) - JSONP
9085 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9086 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9087 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9088 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9089 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9090 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9091 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9092 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppCreateCall<'a, C>
9093 where
9094 T: AsRef<str>,
9095 {
9096 self._additional_params
9097 .insert(name.as_ref().to_string(), value.as_ref().to_string());
9098 self
9099 }
9100
9101 /// Identifies the authorization scope for the method you are building.
9102 ///
9103 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9104 /// [`Scope::CloudPlatform`].
9105 ///
9106 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9107 /// tokens for more than one scope.
9108 ///
9109 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9110 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9111 /// sufficient, a read-write scope will do as well.
9112 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppCreateCall<'a, C>
9113 where
9114 St: AsRef<str>,
9115 {
9116 self._scopes.insert(String::from(scope.as_ref()));
9117 self
9118 }
9119 /// Identifies the authorization scope(s) for the method you are building.
9120 ///
9121 /// See [`Self::add_scope()`] for details.
9122 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppCreateCall<'a, C>
9123 where
9124 I: IntoIterator<Item = St>,
9125 St: AsRef<str>,
9126 {
9127 self._scopes
9128 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9129 self
9130 }
9131
9132 /// Removes all scopes, and no default scope will be used either.
9133 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9134 /// for details).
9135 pub fn clear_scopes(mut self) -> ProjectWebAppCreateCall<'a, C> {
9136 self._scopes.clear();
9137 self
9138 }
9139}
9140
9141/// Gets the specified WebApp.
9142///
9143/// A builder for the *webApps.get* method supported by a *project* resource.
9144/// It is not used directly, but through a [`ProjectMethods`] instance.
9145///
9146/// # Example
9147///
9148/// Instantiate a resource method builder
9149///
9150/// ```test_harness,no_run
9151/// # extern crate hyper;
9152/// # extern crate hyper_rustls;
9153/// # extern crate google_firebase1_beta1 as firebase1_beta1;
9154/// # async fn dox() {
9155/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9156///
9157/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9158/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
9159/// # .with_native_roots()
9160/// # .unwrap()
9161/// # .https_only()
9162/// # .enable_http2()
9163/// # .build();
9164///
9165/// # let executor = hyper_util::rt::TokioExecutor::new();
9166/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
9167/// # secret,
9168/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9169/// # yup_oauth2::client::CustomHyperClientBuilder::from(
9170/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
9171/// # ),
9172/// # ).build().await.unwrap();
9173///
9174/// # let client = hyper_util::client::legacy::Client::builder(
9175/// # hyper_util::rt::TokioExecutor::new()
9176/// # )
9177/// # .build(
9178/// # hyper_rustls::HttpsConnectorBuilder::new()
9179/// # .with_native_roots()
9180/// # .unwrap()
9181/// # .https_or_http()
9182/// # .enable_http2()
9183/// # .build()
9184/// # );
9185/// # let mut hub = FirebaseManagement::new(client, auth);
9186/// // You can configure optional parameters by calling the respective setters at will, and
9187/// // execute the final call using `doit()`.
9188/// // Values shown here are possibly random and not representative !
9189/// let result = hub.projects().web_apps_get("name")
9190/// .doit().await;
9191/// # }
9192/// ```
9193pub struct ProjectWebAppGetCall<'a, C>
9194where
9195 C: 'a,
9196{
9197 hub: &'a FirebaseManagement<C>,
9198 _name: String,
9199 _delegate: Option<&'a mut dyn common::Delegate>,
9200 _additional_params: HashMap<String, String>,
9201 _scopes: BTreeSet<String>,
9202}
9203
9204impl<'a, C> common::CallBuilder for ProjectWebAppGetCall<'a, C> {}
9205
9206impl<'a, C> ProjectWebAppGetCall<'a, C>
9207where
9208 C: common::Connector,
9209{
9210 /// Perform the operation you have build so far.
9211 pub async fn doit(mut self) -> common::Result<(common::Response, WebApp)> {
9212 use std::borrow::Cow;
9213 use std::io::{Read, Seek};
9214
9215 use common::{url::Params, ToParts};
9216 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9217
9218 let mut dd = common::DefaultDelegate;
9219 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9220 dlg.begin(common::MethodInfo {
9221 id: "firebase.projects.webApps.get",
9222 http_method: hyper::Method::GET,
9223 });
9224
9225 for &field in ["alt", "name"].iter() {
9226 if self._additional_params.contains_key(field) {
9227 dlg.finished(false);
9228 return Err(common::Error::FieldClash(field));
9229 }
9230 }
9231
9232 let mut params = Params::with_capacity(3 + self._additional_params.len());
9233 params.push("name", self._name);
9234
9235 params.extend(self._additional_params.iter());
9236
9237 params.push("alt", "json");
9238 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
9239 if self._scopes.is_empty() {
9240 self._scopes.insert(Scope::Readonly.as_ref().to_string());
9241 }
9242
9243 #[allow(clippy::single_element_loop)]
9244 for &(find_this, param_name) in [("{+name}", "name")].iter() {
9245 url = params.uri_replacement(url, param_name, find_this, true);
9246 }
9247 {
9248 let to_remove = ["name"];
9249 params.remove_params(&to_remove);
9250 }
9251
9252 let url = params.parse_with_url(&url);
9253
9254 loop {
9255 let token = match self
9256 .hub
9257 .auth
9258 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9259 .await
9260 {
9261 Ok(token) => token,
9262 Err(e) => match dlg.token(e) {
9263 Ok(token) => token,
9264 Err(e) => {
9265 dlg.finished(false);
9266 return Err(common::Error::MissingToken(e));
9267 }
9268 },
9269 };
9270 let mut req_result = {
9271 let client = &self.hub.client;
9272 dlg.pre_request();
9273 let mut req_builder = hyper::Request::builder()
9274 .method(hyper::Method::GET)
9275 .uri(url.as_str())
9276 .header(USER_AGENT, self.hub._user_agent.clone());
9277
9278 if let Some(token) = token.as_ref() {
9279 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9280 }
9281
9282 let request = req_builder
9283 .header(CONTENT_LENGTH, 0_u64)
9284 .body(common::to_body::<String>(None));
9285
9286 client.request(request.unwrap()).await
9287 };
9288
9289 match req_result {
9290 Err(err) => {
9291 if let common::Retry::After(d) = dlg.http_error(&err) {
9292 sleep(d).await;
9293 continue;
9294 }
9295 dlg.finished(false);
9296 return Err(common::Error::HttpError(err));
9297 }
9298 Ok(res) => {
9299 let (mut parts, body) = res.into_parts();
9300 let mut body = common::Body::new(body);
9301 if !parts.status.is_success() {
9302 let bytes = common::to_bytes(body).await.unwrap_or_default();
9303 let error = serde_json::from_str(&common::to_string(&bytes));
9304 let response = common::to_response(parts, bytes.into());
9305
9306 if let common::Retry::After(d) =
9307 dlg.http_failure(&response, error.as_ref().ok())
9308 {
9309 sleep(d).await;
9310 continue;
9311 }
9312
9313 dlg.finished(false);
9314
9315 return Err(match error {
9316 Ok(value) => common::Error::BadRequest(value),
9317 _ => common::Error::Failure(response),
9318 });
9319 }
9320 let response = {
9321 let bytes = common::to_bytes(body).await.unwrap_or_default();
9322 let encoded = common::to_string(&bytes);
9323 match serde_json::from_str(&encoded) {
9324 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9325 Err(error) => {
9326 dlg.response_json_decode_error(&encoded, &error);
9327 return Err(common::Error::JsonDecodeError(
9328 encoded.to_string(),
9329 error,
9330 ));
9331 }
9332 }
9333 };
9334
9335 dlg.finished(true);
9336 return Ok(response);
9337 }
9338 }
9339 }
9340 }
9341
9342 /// 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.
9343 ///
9344 /// Sets the *name* path property to the given value.
9345 ///
9346 /// Even though the property as already been set when instantiating this call,
9347 /// we provide this method for API completeness.
9348 pub fn name(mut self, new_value: &str) -> ProjectWebAppGetCall<'a, C> {
9349 self._name = new_value.to_string();
9350 self
9351 }
9352 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9353 /// while executing the actual API request.
9354 ///
9355 /// ````text
9356 /// It should be used to handle progress information, and to implement a certain level of resilience.
9357 /// ````
9358 ///
9359 /// Sets the *delegate* property to the given value.
9360 pub fn delegate(
9361 mut self,
9362 new_value: &'a mut dyn common::Delegate,
9363 ) -> ProjectWebAppGetCall<'a, C> {
9364 self._delegate = Some(new_value);
9365 self
9366 }
9367
9368 /// Set any additional parameter of the query string used in the request.
9369 /// It should be used to set parameters which are not yet available through their own
9370 /// setters.
9371 ///
9372 /// Please note that this method must not be used to set any of the known parameters
9373 /// which have their own setter method. If done anyway, the request will fail.
9374 ///
9375 /// # Additional Parameters
9376 ///
9377 /// * *$.xgafv* (query-string) - V1 error format.
9378 /// * *access_token* (query-string) - OAuth access token.
9379 /// * *alt* (query-string) - Data format for response.
9380 /// * *callback* (query-string) - JSONP
9381 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9382 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9383 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9384 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9385 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9386 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9387 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9388 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppGetCall<'a, C>
9389 where
9390 T: AsRef<str>,
9391 {
9392 self._additional_params
9393 .insert(name.as_ref().to_string(), value.as_ref().to_string());
9394 self
9395 }
9396
9397 /// Identifies the authorization scope for the method you are building.
9398 ///
9399 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9400 /// [`Scope::Readonly`].
9401 ///
9402 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9403 /// tokens for more than one scope.
9404 ///
9405 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9406 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9407 /// sufficient, a read-write scope will do as well.
9408 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppGetCall<'a, C>
9409 where
9410 St: AsRef<str>,
9411 {
9412 self._scopes.insert(String::from(scope.as_ref()));
9413 self
9414 }
9415 /// Identifies the authorization scope(s) for the method you are building.
9416 ///
9417 /// See [`Self::add_scope()`] for details.
9418 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppGetCall<'a, C>
9419 where
9420 I: IntoIterator<Item = St>,
9421 St: AsRef<str>,
9422 {
9423 self._scopes
9424 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9425 self
9426 }
9427
9428 /// Removes all scopes, and no default scope will be used either.
9429 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9430 /// for details).
9431 pub fn clear_scopes(mut self) -> ProjectWebAppGetCall<'a, C> {
9432 self._scopes.clear();
9433 self
9434 }
9435}
9436
9437/// Gets the configuration artifact associated with the specified WebApp.
9438///
9439/// A builder for the *webApps.getConfig* method supported by a *project* resource.
9440/// It is not used directly, but through a [`ProjectMethods`] instance.
9441///
9442/// # Example
9443///
9444/// Instantiate a resource method builder
9445///
9446/// ```test_harness,no_run
9447/// # extern crate hyper;
9448/// # extern crate hyper_rustls;
9449/// # extern crate google_firebase1_beta1 as firebase1_beta1;
9450/// # async fn dox() {
9451/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9452///
9453/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9454/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
9455/// # .with_native_roots()
9456/// # .unwrap()
9457/// # .https_only()
9458/// # .enable_http2()
9459/// # .build();
9460///
9461/// # let executor = hyper_util::rt::TokioExecutor::new();
9462/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
9463/// # secret,
9464/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9465/// # yup_oauth2::client::CustomHyperClientBuilder::from(
9466/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
9467/// # ),
9468/// # ).build().await.unwrap();
9469///
9470/// # let client = hyper_util::client::legacy::Client::builder(
9471/// # hyper_util::rt::TokioExecutor::new()
9472/// # )
9473/// # .build(
9474/// # hyper_rustls::HttpsConnectorBuilder::new()
9475/// # .with_native_roots()
9476/// # .unwrap()
9477/// # .https_or_http()
9478/// # .enable_http2()
9479/// # .build()
9480/// # );
9481/// # let mut hub = FirebaseManagement::new(client, auth);
9482/// // You can configure optional parameters by calling the respective setters at will, and
9483/// // execute the final call using `doit()`.
9484/// // Values shown here are possibly random and not representative !
9485/// let result = hub.projects().web_apps_get_config("name")
9486/// .doit().await;
9487/// # }
9488/// ```
9489pub struct ProjectWebAppGetConfigCall<'a, C>
9490where
9491 C: 'a,
9492{
9493 hub: &'a FirebaseManagement<C>,
9494 _name: String,
9495 _delegate: Option<&'a mut dyn common::Delegate>,
9496 _additional_params: HashMap<String, String>,
9497 _scopes: BTreeSet<String>,
9498}
9499
9500impl<'a, C> common::CallBuilder for ProjectWebAppGetConfigCall<'a, C> {}
9501
9502impl<'a, C> ProjectWebAppGetConfigCall<'a, C>
9503where
9504 C: common::Connector,
9505{
9506 /// Perform the operation you have build so far.
9507 pub async fn doit(mut self) -> common::Result<(common::Response, WebAppConfig)> {
9508 use std::borrow::Cow;
9509 use std::io::{Read, Seek};
9510
9511 use common::{url::Params, ToParts};
9512 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9513
9514 let mut dd = common::DefaultDelegate;
9515 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9516 dlg.begin(common::MethodInfo {
9517 id: "firebase.projects.webApps.getConfig",
9518 http_method: hyper::Method::GET,
9519 });
9520
9521 for &field in ["alt", "name"].iter() {
9522 if self._additional_params.contains_key(field) {
9523 dlg.finished(false);
9524 return Err(common::Error::FieldClash(field));
9525 }
9526 }
9527
9528 let mut params = Params::with_capacity(3 + self._additional_params.len());
9529 params.push("name", self._name);
9530
9531 params.extend(self._additional_params.iter());
9532
9533 params.push("alt", "json");
9534 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
9535 if self._scopes.is_empty() {
9536 self._scopes.insert(Scope::Readonly.as_ref().to_string());
9537 }
9538
9539 #[allow(clippy::single_element_loop)]
9540 for &(find_this, param_name) in [("{+name}", "name")].iter() {
9541 url = params.uri_replacement(url, param_name, find_this, true);
9542 }
9543 {
9544 let to_remove = ["name"];
9545 params.remove_params(&to_remove);
9546 }
9547
9548 let url = params.parse_with_url(&url);
9549
9550 loop {
9551 let token = match self
9552 .hub
9553 .auth
9554 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9555 .await
9556 {
9557 Ok(token) => token,
9558 Err(e) => match dlg.token(e) {
9559 Ok(token) => token,
9560 Err(e) => {
9561 dlg.finished(false);
9562 return Err(common::Error::MissingToken(e));
9563 }
9564 },
9565 };
9566 let mut req_result = {
9567 let client = &self.hub.client;
9568 dlg.pre_request();
9569 let mut req_builder = hyper::Request::builder()
9570 .method(hyper::Method::GET)
9571 .uri(url.as_str())
9572 .header(USER_AGENT, self.hub._user_agent.clone());
9573
9574 if let Some(token) = token.as_ref() {
9575 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9576 }
9577
9578 let request = req_builder
9579 .header(CONTENT_LENGTH, 0_u64)
9580 .body(common::to_body::<String>(None));
9581
9582 client.request(request.unwrap()).await
9583 };
9584
9585 match req_result {
9586 Err(err) => {
9587 if let common::Retry::After(d) = dlg.http_error(&err) {
9588 sleep(d).await;
9589 continue;
9590 }
9591 dlg.finished(false);
9592 return Err(common::Error::HttpError(err));
9593 }
9594 Ok(res) => {
9595 let (mut parts, body) = res.into_parts();
9596 let mut body = common::Body::new(body);
9597 if !parts.status.is_success() {
9598 let bytes = common::to_bytes(body).await.unwrap_or_default();
9599 let error = serde_json::from_str(&common::to_string(&bytes));
9600 let response = common::to_response(parts, bytes.into());
9601
9602 if let common::Retry::After(d) =
9603 dlg.http_failure(&response, error.as_ref().ok())
9604 {
9605 sleep(d).await;
9606 continue;
9607 }
9608
9609 dlg.finished(false);
9610
9611 return Err(match error {
9612 Ok(value) => common::Error::BadRequest(value),
9613 _ => common::Error::Failure(response),
9614 });
9615 }
9616 let response = {
9617 let bytes = common::to_bytes(body).await.unwrap_or_default();
9618 let encoded = common::to_string(&bytes);
9619 match serde_json::from_str(&encoded) {
9620 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9621 Err(error) => {
9622 dlg.response_json_decode_error(&encoded, &error);
9623 return Err(common::Error::JsonDecodeError(
9624 encoded.to_string(),
9625 error,
9626 ));
9627 }
9628 }
9629 };
9630
9631 dlg.finished(true);
9632 return Ok(response);
9633 }
9634 }
9635 }
9636 }
9637
9638 /// 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.
9639 ///
9640 /// Sets the *name* path property to the given value.
9641 ///
9642 /// Even though the property as already been set when instantiating this call,
9643 /// we provide this method for API completeness.
9644 pub fn name(mut self, new_value: &str) -> ProjectWebAppGetConfigCall<'a, C> {
9645 self._name = new_value.to_string();
9646 self
9647 }
9648 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9649 /// while executing the actual API request.
9650 ///
9651 /// ````text
9652 /// It should be used to handle progress information, and to implement a certain level of resilience.
9653 /// ````
9654 ///
9655 /// Sets the *delegate* property to the given value.
9656 pub fn delegate(
9657 mut self,
9658 new_value: &'a mut dyn common::Delegate,
9659 ) -> ProjectWebAppGetConfigCall<'a, C> {
9660 self._delegate = Some(new_value);
9661 self
9662 }
9663
9664 /// Set any additional parameter of the query string used in the request.
9665 /// It should be used to set parameters which are not yet available through their own
9666 /// setters.
9667 ///
9668 /// Please note that this method must not be used to set any of the known parameters
9669 /// which have their own setter method. If done anyway, the request will fail.
9670 ///
9671 /// # Additional Parameters
9672 ///
9673 /// * *$.xgafv* (query-string) - V1 error format.
9674 /// * *access_token* (query-string) - OAuth access token.
9675 /// * *alt* (query-string) - Data format for response.
9676 /// * *callback* (query-string) - JSONP
9677 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9678 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
9679 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9680 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9681 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
9682 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9683 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9684 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppGetConfigCall<'a, C>
9685 where
9686 T: AsRef<str>,
9687 {
9688 self._additional_params
9689 .insert(name.as_ref().to_string(), value.as_ref().to_string());
9690 self
9691 }
9692
9693 /// Identifies the authorization scope for the method you are building.
9694 ///
9695 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9696 /// [`Scope::Readonly`].
9697 ///
9698 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9699 /// tokens for more than one scope.
9700 ///
9701 /// Usually there is more than one suitable scope to authorize an operation, some of which may
9702 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9703 /// sufficient, a read-write scope will do as well.
9704 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppGetConfigCall<'a, C>
9705 where
9706 St: AsRef<str>,
9707 {
9708 self._scopes.insert(String::from(scope.as_ref()));
9709 self
9710 }
9711 /// Identifies the authorization scope(s) for the method you are building.
9712 ///
9713 /// See [`Self::add_scope()`] for details.
9714 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppGetConfigCall<'a, C>
9715 where
9716 I: IntoIterator<Item = St>,
9717 St: AsRef<str>,
9718 {
9719 self._scopes
9720 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9721 self
9722 }
9723
9724 /// Removes all scopes, and no default scope will be used either.
9725 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9726 /// for details).
9727 pub fn clear_scopes(mut self) -> ProjectWebAppGetConfigCall<'a, C> {
9728 self._scopes.clear();
9729 self
9730 }
9731}
9732
9733/// 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`.
9734///
9735/// A builder for the *webApps.list* method supported by a *project* resource.
9736/// It is not used directly, but through a [`ProjectMethods`] instance.
9737///
9738/// # Example
9739///
9740/// Instantiate a resource method builder
9741///
9742/// ```test_harness,no_run
9743/// # extern crate hyper;
9744/// # extern crate hyper_rustls;
9745/// # extern crate google_firebase1_beta1 as firebase1_beta1;
9746/// # async fn dox() {
9747/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9748///
9749/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9750/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
9751/// # .with_native_roots()
9752/// # .unwrap()
9753/// # .https_only()
9754/// # .enable_http2()
9755/// # .build();
9756///
9757/// # let executor = hyper_util::rt::TokioExecutor::new();
9758/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
9759/// # secret,
9760/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9761/// # yup_oauth2::client::CustomHyperClientBuilder::from(
9762/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
9763/// # ),
9764/// # ).build().await.unwrap();
9765///
9766/// # let client = hyper_util::client::legacy::Client::builder(
9767/// # hyper_util::rt::TokioExecutor::new()
9768/// # )
9769/// # .build(
9770/// # hyper_rustls::HttpsConnectorBuilder::new()
9771/// # .with_native_roots()
9772/// # .unwrap()
9773/// # .https_or_http()
9774/// # .enable_http2()
9775/// # .build()
9776/// # );
9777/// # let mut hub = FirebaseManagement::new(client, auth);
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_list("parent")
9782/// .show_deleted(true)
9783/// .page_token("duo")
9784/// .page_size(-80)
9785/// .doit().await;
9786/// # }
9787/// ```
9788pub struct ProjectWebAppListCall<'a, C>
9789where
9790 C: 'a,
9791{
9792 hub: &'a FirebaseManagement<C>,
9793 _parent: String,
9794 _show_deleted: Option<bool>,
9795 _page_token: Option<String>,
9796 _page_size: Option<i32>,
9797 _delegate: Option<&'a mut dyn common::Delegate>,
9798 _additional_params: HashMap<String, String>,
9799 _scopes: BTreeSet<String>,
9800}
9801
9802impl<'a, C> common::CallBuilder for ProjectWebAppListCall<'a, C> {}
9803
9804impl<'a, C> ProjectWebAppListCall<'a, C>
9805where
9806 C: common::Connector,
9807{
9808 /// Perform the operation you have build so far.
9809 pub async fn doit(mut self) -> common::Result<(common::Response, ListWebAppsResponse)> {
9810 use std::borrow::Cow;
9811 use std::io::{Read, Seek};
9812
9813 use common::{url::Params, ToParts};
9814 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9815
9816 let mut dd = common::DefaultDelegate;
9817 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9818 dlg.begin(common::MethodInfo {
9819 id: "firebase.projects.webApps.list",
9820 http_method: hyper::Method::GET,
9821 });
9822
9823 for &field in ["alt", "parent", "showDeleted", "pageToken", "pageSize"].iter() {
9824 if self._additional_params.contains_key(field) {
9825 dlg.finished(false);
9826 return Err(common::Error::FieldClash(field));
9827 }
9828 }
9829
9830 let mut params = Params::with_capacity(6 + self._additional_params.len());
9831 params.push("parent", self._parent);
9832 if let Some(value) = self._show_deleted.as_ref() {
9833 params.push("showDeleted", value.to_string());
9834 }
9835 if let Some(value) = self._page_token.as_ref() {
9836 params.push("pageToken", value);
9837 }
9838 if let Some(value) = self._page_size.as_ref() {
9839 params.push("pageSize", value.to_string());
9840 }
9841
9842 params.extend(self._additional_params.iter());
9843
9844 params.push("alt", "json");
9845 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/webApps";
9846 if self._scopes.is_empty() {
9847 self._scopes.insert(Scope::Readonly.as_ref().to_string());
9848 }
9849
9850 #[allow(clippy::single_element_loop)]
9851 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
9852 url = params.uri_replacement(url, param_name, find_this, true);
9853 }
9854 {
9855 let to_remove = ["parent"];
9856 params.remove_params(&to_remove);
9857 }
9858
9859 let url = params.parse_with_url(&url);
9860
9861 loop {
9862 let token = match self
9863 .hub
9864 .auth
9865 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9866 .await
9867 {
9868 Ok(token) => token,
9869 Err(e) => match dlg.token(e) {
9870 Ok(token) => token,
9871 Err(e) => {
9872 dlg.finished(false);
9873 return Err(common::Error::MissingToken(e));
9874 }
9875 },
9876 };
9877 let mut req_result = {
9878 let client = &self.hub.client;
9879 dlg.pre_request();
9880 let mut req_builder = hyper::Request::builder()
9881 .method(hyper::Method::GET)
9882 .uri(url.as_str())
9883 .header(USER_AGENT, self.hub._user_agent.clone());
9884
9885 if let Some(token) = token.as_ref() {
9886 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9887 }
9888
9889 let request = req_builder
9890 .header(CONTENT_LENGTH, 0_u64)
9891 .body(common::to_body::<String>(None));
9892
9893 client.request(request.unwrap()).await
9894 };
9895
9896 match req_result {
9897 Err(err) => {
9898 if let common::Retry::After(d) = dlg.http_error(&err) {
9899 sleep(d).await;
9900 continue;
9901 }
9902 dlg.finished(false);
9903 return Err(common::Error::HttpError(err));
9904 }
9905 Ok(res) => {
9906 let (mut parts, body) = res.into_parts();
9907 let mut body = common::Body::new(body);
9908 if !parts.status.is_success() {
9909 let bytes = common::to_bytes(body).await.unwrap_or_default();
9910 let error = serde_json::from_str(&common::to_string(&bytes));
9911 let response = common::to_response(parts, bytes.into());
9912
9913 if let common::Retry::After(d) =
9914 dlg.http_failure(&response, error.as_ref().ok())
9915 {
9916 sleep(d).await;
9917 continue;
9918 }
9919
9920 dlg.finished(false);
9921
9922 return Err(match error {
9923 Ok(value) => common::Error::BadRequest(value),
9924 _ => common::Error::Failure(response),
9925 });
9926 }
9927 let response = {
9928 let bytes = common::to_bytes(body).await.unwrap_or_default();
9929 let encoded = common::to_string(&bytes);
9930 match serde_json::from_str(&encoded) {
9931 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9932 Err(error) => {
9933 dlg.response_json_decode_error(&encoded, &error);
9934 return Err(common::Error::JsonDecodeError(
9935 encoded.to_string(),
9936 error,
9937 ));
9938 }
9939 }
9940 };
9941
9942 dlg.finished(true);
9943 return Ok(response);
9944 }
9945 }
9946 }
9947 }
9948
9949 /// 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.
9950 ///
9951 /// Sets the *parent* path property to the given value.
9952 ///
9953 /// Even though the property as already been set when instantiating this call,
9954 /// we provide this method for API completeness.
9955 pub fn parent(mut self, new_value: &str) -> ProjectWebAppListCall<'a, C> {
9956 self._parent = new_value.to_string();
9957 self
9958 }
9959 /// Controls whether Apps in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Apps will be returned.
9960 ///
9961 /// Sets the *show deleted* query property to the given value.
9962 pub fn show_deleted(mut self, new_value: bool) -> ProjectWebAppListCall<'a, C> {
9963 self._show_deleted = Some(new_value);
9964 self
9965 }
9966 /// Token returned from a previous call to `ListWebApps` indicating where in the set of Apps to resume listing.
9967 ///
9968 /// Sets the *page token* query property to the given value.
9969 pub fn page_token(mut self, new_value: &str) -> ProjectWebAppListCall<'a, C> {
9970 self._page_token = Some(new_value.to_string());
9971 self
9972 }
9973 /// 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.
9974 ///
9975 /// Sets the *page size* query property to the given value.
9976 pub fn page_size(mut self, new_value: i32) -> ProjectWebAppListCall<'a, C> {
9977 self._page_size = Some(new_value);
9978 self
9979 }
9980 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9981 /// while executing the actual API request.
9982 ///
9983 /// ````text
9984 /// It should be used to handle progress information, and to implement a certain level of resilience.
9985 /// ````
9986 ///
9987 /// Sets the *delegate* property to the given value.
9988 pub fn delegate(
9989 mut self,
9990 new_value: &'a mut dyn common::Delegate,
9991 ) -> ProjectWebAppListCall<'a, C> {
9992 self._delegate = Some(new_value);
9993 self
9994 }
9995
9996 /// Set any additional parameter of the query string used in the request.
9997 /// It should be used to set parameters which are not yet available through their own
9998 /// setters.
9999 ///
10000 /// Please note that this method must not be used to set any of the known parameters
10001 /// which have their own setter method. If done anyway, the request will fail.
10002 ///
10003 /// # Additional Parameters
10004 ///
10005 /// * *$.xgafv* (query-string) - V1 error format.
10006 /// * *access_token* (query-string) - OAuth access token.
10007 /// * *alt* (query-string) - Data format for response.
10008 /// * *callback* (query-string) - JSONP
10009 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10010 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10011 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10012 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10013 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10014 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10015 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10016 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppListCall<'a, C>
10017 where
10018 T: AsRef<str>,
10019 {
10020 self._additional_params
10021 .insert(name.as_ref().to_string(), value.as_ref().to_string());
10022 self
10023 }
10024
10025 /// Identifies the authorization scope for the method you are building.
10026 ///
10027 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10028 /// [`Scope::Readonly`].
10029 ///
10030 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10031 /// tokens for more than one scope.
10032 ///
10033 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10034 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10035 /// sufficient, a read-write scope will do as well.
10036 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppListCall<'a, C>
10037 where
10038 St: AsRef<str>,
10039 {
10040 self._scopes.insert(String::from(scope.as_ref()));
10041 self
10042 }
10043 /// Identifies the authorization scope(s) for the method you are building.
10044 ///
10045 /// See [`Self::add_scope()`] for details.
10046 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppListCall<'a, C>
10047 where
10048 I: IntoIterator<Item = St>,
10049 St: AsRef<str>,
10050 {
10051 self._scopes
10052 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10053 self
10054 }
10055
10056 /// Removes all scopes, and no default scope will be used either.
10057 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10058 /// for details).
10059 pub fn clear_scopes(mut self) -> ProjectWebAppListCall<'a, C> {
10060 self._scopes.clear();
10061 self
10062 }
10063}
10064
10065/// Updates the attributes of the specified WebApp.
10066///
10067/// A builder for the *webApps.patch* method supported by a *project* resource.
10068/// It is not used directly, but through a [`ProjectMethods`] instance.
10069///
10070/// # Example
10071///
10072/// Instantiate a resource method builder
10073///
10074/// ```test_harness,no_run
10075/// # extern crate hyper;
10076/// # extern crate hyper_rustls;
10077/// # extern crate google_firebase1_beta1 as firebase1_beta1;
10078/// use firebase1_beta1::api::WebApp;
10079/// # async fn dox() {
10080/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10081///
10082/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10083/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
10084/// # .with_native_roots()
10085/// # .unwrap()
10086/// # .https_only()
10087/// # .enable_http2()
10088/// # .build();
10089///
10090/// # let executor = hyper_util::rt::TokioExecutor::new();
10091/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
10092/// # secret,
10093/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10094/// # yup_oauth2::client::CustomHyperClientBuilder::from(
10095/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
10096/// # ),
10097/// # ).build().await.unwrap();
10098///
10099/// # let client = hyper_util::client::legacy::Client::builder(
10100/// # hyper_util::rt::TokioExecutor::new()
10101/// # )
10102/// # .build(
10103/// # hyper_rustls::HttpsConnectorBuilder::new()
10104/// # .with_native_roots()
10105/// # .unwrap()
10106/// # .https_or_http()
10107/// # .enable_http2()
10108/// # .build()
10109/// # );
10110/// # let mut hub = FirebaseManagement::new(client, auth);
10111/// // As the method needs a request, you would usually fill it with the desired information
10112/// // into the respective structure. Some of the parts shown here might not be applicable !
10113/// // Values shown here are possibly random and not representative !
10114/// let mut req = WebApp::default();
10115///
10116/// // You can configure optional parameters by calling the respective setters at will, and
10117/// // execute the final call using `doit()`.
10118/// // Values shown here are possibly random and not representative !
10119/// let result = hub.projects().web_apps_patch(req, "name")
10120/// .update_mask(FieldMask::new::<&str>(&[]))
10121/// .doit().await;
10122/// # }
10123/// ```
10124pub struct ProjectWebAppPatchCall<'a, C>
10125where
10126 C: 'a,
10127{
10128 hub: &'a FirebaseManagement<C>,
10129 _request: WebApp,
10130 _name: String,
10131 _update_mask: Option<common::FieldMask>,
10132 _delegate: Option<&'a mut dyn common::Delegate>,
10133 _additional_params: HashMap<String, String>,
10134 _scopes: BTreeSet<String>,
10135}
10136
10137impl<'a, C> common::CallBuilder for ProjectWebAppPatchCall<'a, C> {}
10138
10139impl<'a, C> ProjectWebAppPatchCall<'a, C>
10140where
10141 C: common::Connector,
10142{
10143 /// Perform the operation you have build so far.
10144 pub async fn doit(mut self) -> common::Result<(common::Response, WebApp)> {
10145 use std::borrow::Cow;
10146 use std::io::{Read, Seek};
10147
10148 use common::{url::Params, ToParts};
10149 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10150
10151 let mut dd = common::DefaultDelegate;
10152 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10153 dlg.begin(common::MethodInfo {
10154 id: "firebase.projects.webApps.patch",
10155 http_method: hyper::Method::PATCH,
10156 });
10157
10158 for &field in ["alt", "name", "updateMask"].iter() {
10159 if self._additional_params.contains_key(field) {
10160 dlg.finished(false);
10161 return Err(common::Error::FieldClash(field));
10162 }
10163 }
10164
10165 let mut params = Params::with_capacity(5 + self._additional_params.len());
10166 params.push("name", self._name);
10167 if let Some(value) = self._update_mask.as_ref() {
10168 params.push("updateMask", value.to_string());
10169 }
10170
10171 params.extend(self._additional_params.iter());
10172
10173 params.push("alt", "json");
10174 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
10175 if self._scopes.is_empty() {
10176 self._scopes
10177 .insert(Scope::CloudPlatform.as_ref().to_string());
10178 }
10179
10180 #[allow(clippy::single_element_loop)]
10181 for &(find_this, param_name) in [("{+name}", "name")].iter() {
10182 url = params.uri_replacement(url, param_name, find_this, true);
10183 }
10184 {
10185 let to_remove = ["name"];
10186 params.remove_params(&to_remove);
10187 }
10188
10189 let url = params.parse_with_url(&url);
10190
10191 let mut json_mime_type = mime::APPLICATION_JSON;
10192 let mut request_value_reader = {
10193 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10194 common::remove_json_null_values(&mut value);
10195 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10196 serde_json::to_writer(&mut dst, &value).unwrap();
10197 dst
10198 };
10199 let request_size = request_value_reader
10200 .seek(std::io::SeekFrom::End(0))
10201 .unwrap();
10202 request_value_reader
10203 .seek(std::io::SeekFrom::Start(0))
10204 .unwrap();
10205
10206 loop {
10207 let token = match self
10208 .hub
10209 .auth
10210 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10211 .await
10212 {
10213 Ok(token) => token,
10214 Err(e) => match dlg.token(e) {
10215 Ok(token) => token,
10216 Err(e) => {
10217 dlg.finished(false);
10218 return Err(common::Error::MissingToken(e));
10219 }
10220 },
10221 };
10222 request_value_reader
10223 .seek(std::io::SeekFrom::Start(0))
10224 .unwrap();
10225 let mut req_result = {
10226 let client = &self.hub.client;
10227 dlg.pre_request();
10228 let mut req_builder = hyper::Request::builder()
10229 .method(hyper::Method::PATCH)
10230 .uri(url.as_str())
10231 .header(USER_AGENT, self.hub._user_agent.clone());
10232
10233 if let Some(token) = token.as_ref() {
10234 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10235 }
10236
10237 let request = req_builder
10238 .header(CONTENT_TYPE, json_mime_type.to_string())
10239 .header(CONTENT_LENGTH, request_size as u64)
10240 .body(common::to_body(
10241 request_value_reader.get_ref().clone().into(),
10242 ));
10243
10244 client.request(request.unwrap()).await
10245 };
10246
10247 match req_result {
10248 Err(err) => {
10249 if let common::Retry::After(d) = dlg.http_error(&err) {
10250 sleep(d).await;
10251 continue;
10252 }
10253 dlg.finished(false);
10254 return Err(common::Error::HttpError(err));
10255 }
10256 Ok(res) => {
10257 let (mut parts, body) = res.into_parts();
10258 let mut body = common::Body::new(body);
10259 if !parts.status.is_success() {
10260 let bytes = common::to_bytes(body).await.unwrap_or_default();
10261 let error = serde_json::from_str(&common::to_string(&bytes));
10262 let response = common::to_response(parts, bytes.into());
10263
10264 if let common::Retry::After(d) =
10265 dlg.http_failure(&response, error.as_ref().ok())
10266 {
10267 sleep(d).await;
10268 continue;
10269 }
10270
10271 dlg.finished(false);
10272
10273 return Err(match error {
10274 Ok(value) => common::Error::BadRequest(value),
10275 _ => common::Error::Failure(response),
10276 });
10277 }
10278 let response = {
10279 let bytes = common::to_bytes(body).await.unwrap_or_default();
10280 let encoded = common::to_string(&bytes);
10281 match serde_json::from_str(&encoded) {
10282 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10283 Err(error) => {
10284 dlg.response_json_decode_error(&encoded, &error);
10285 return Err(common::Error::JsonDecodeError(
10286 encoded.to_string(),
10287 error,
10288 ));
10289 }
10290 }
10291 };
10292
10293 dlg.finished(true);
10294 return Ok(response);
10295 }
10296 }
10297 }
10298 }
10299
10300 ///
10301 /// Sets the *request* property to the given value.
10302 ///
10303 /// Even though the property as already been set when instantiating this call,
10304 /// we provide this method for API completeness.
10305 pub fn request(mut self, new_value: WebApp) -> ProjectWebAppPatchCall<'a, C> {
10306 self._request = new_value;
10307 self
10308 }
10309 /// 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)).
10310 ///
10311 /// Sets the *name* path property to the given value.
10312 ///
10313 /// Even though the property as already been set when instantiating this call,
10314 /// we provide this method for API completeness.
10315 pub fn name(mut self, new_value: &str) -> ProjectWebAppPatchCall<'a, C> {
10316 self._name = new_value.to_string();
10317 self
10318 }
10319 /// 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.
10320 ///
10321 /// Sets the *update mask* query property to the given value.
10322 pub fn update_mask(mut self, new_value: common::FieldMask) -> ProjectWebAppPatchCall<'a, C> {
10323 self._update_mask = Some(new_value);
10324 self
10325 }
10326 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10327 /// while executing the actual API request.
10328 ///
10329 /// ````text
10330 /// It should be used to handle progress information, and to implement a certain level of resilience.
10331 /// ````
10332 ///
10333 /// Sets the *delegate* property to the given value.
10334 pub fn delegate(
10335 mut self,
10336 new_value: &'a mut dyn common::Delegate,
10337 ) -> ProjectWebAppPatchCall<'a, C> {
10338 self._delegate = Some(new_value);
10339 self
10340 }
10341
10342 /// Set any additional parameter of the query string used in the request.
10343 /// It should be used to set parameters which are not yet available through their own
10344 /// setters.
10345 ///
10346 /// Please note that this method must not be used to set any of the known parameters
10347 /// which have their own setter method. If done anyway, the request will fail.
10348 ///
10349 /// # Additional Parameters
10350 ///
10351 /// * *$.xgafv* (query-string) - V1 error format.
10352 /// * *access_token* (query-string) - OAuth access token.
10353 /// * *alt* (query-string) - Data format for response.
10354 /// * *callback* (query-string) - JSONP
10355 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10356 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10357 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10358 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10359 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10360 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10361 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10362 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppPatchCall<'a, C>
10363 where
10364 T: AsRef<str>,
10365 {
10366 self._additional_params
10367 .insert(name.as_ref().to_string(), value.as_ref().to_string());
10368 self
10369 }
10370
10371 /// Identifies the authorization scope for the method you are building.
10372 ///
10373 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10374 /// [`Scope::CloudPlatform`].
10375 ///
10376 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10377 /// tokens for more than one scope.
10378 ///
10379 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10380 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10381 /// sufficient, a read-write scope will do as well.
10382 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppPatchCall<'a, C>
10383 where
10384 St: AsRef<str>,
10385 {
10386 self._scopes.insert(String::from(scope.as_ref()));
10387 self
10388 }
10389 /// Identifies the authorization scope(s) for the method you are building.
10390 ///
10391 /// See [`Self::add_scope()`] for details.
10392 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppPatchCall<'a, C>
10393 where
10394 I: IntoIterator<Item = St>,
10395 St: AsRef<str>,
10396 {
10397 self._scopes
10398 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10399 self
10400 }
10401
10402 /// Removes all scopes, and no default scope will be used either.
10403 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10404 /// for details).
10405 pub fn clear_scopes(mut self) -> ProjectWebAppPatchCall<'a, C> {
10406 self._scopes.clear();
10407 self
10408 }
10409}
10410
10411/// Removes the specified WebApp from the FirebaseProject.
10412///
10413/// A builder for the *webApps.remove* method supported by a *project* resource.
10414/// It is not used directly, but through a [`ProjectMethods`] instance.
10415///
10416/// # Example
10417///
10418/// Instantiate a resource method builder
10419///
10420/// ```test_harness,no_run
10421/// # extern crate hyper;
10422/// # extern crate hyper_rustls;
10423/// # extern crate google_firebase1_beta1 as firebase1_beta1;
10424/// use firebase1_beta1::api::RemoveWebAppRequest;
10425/// # async fn dox() {
10426/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10427///
10428/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10429/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
10430/// # .with_native_roots()
10431/// # .unwrap()
10432/// # .https_only()
10433/// # .enable_http2()
10434/// # .build();
10435///
10436/// # let executor = hyper_util::rt::TokioExecutor::new();
10437/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
10438/// # secret,
10439/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10440/// # yup_oauth2::client::CustomHyperClientBuilder::from(
10441/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
10442/// # ),
10443/// # ).build().await.unwrap();
10444///
10445/// # let client = hyper_util::client::legacy::Client::builder(
10446/// # hyper_util::rt::TokioExecutor::new()
10447/// # )
10448/// # .build(
10449/// # hyper_rustls::HttpsConnectorBuilder::new()
10450/// # .with_native_roots()
10451/// # .unwrap()
10452/// # .https_or_http()
10453/// # .enable_http2()
10454/// # .build()
10455/// # );
10456/// # let mut hub = FirebaseManagement::new(client, auth);
10457/// // As the method needs a request, you would usually fill it with the desired information
10458/// // into the respective structure. Some of the parts shown here might not be applicable !
10459/// // Values shown here are possibly random and not representative !
10460/// let mut req = RemoveWebAppRequest::default();
10461///
10462/// // You can configure optional parameters by calling the respective setters at will, and
10463/// // execute the final call using `doit()`.
10464/// // Values shown here are possibly random and not representative !
10465/// let result = hub.projects().web_apps_remove(req, "name")
10466/// .doit().await;
10467/// # }
10468/// ```
10469pub struct ProjectWebAppRemoveCall<'a, C>
10470where
10471 C: 'a,
10472{
10473 hub: &'a FirebaseManagement<C>,
10474 _request: RemoveWebAppRequest,
10475 _name: String,
10476 _delegate: Option<&'a mut dyn common::Delegate>,
10477 _additional_params: HashMap<String, String>,
10478 _scopes: BTreeSet<String>,
10479}
10480
10481impl<'a, C> common::CallBuilder for ProjectWebAppRemoveCall<'a, C> {}
10482
10483impl<'a, C> ProjectWebAppRemoveCall<'a, C>
10484where
10485 C: common::Connector,
10486{
10487 /// Perform the operation you have build so far.
10488 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
10489 use std::borrow::Cow;
10490 use std::io::{Read, Seek};
10491
10492 use common::{url::Params, ToParts};
10493 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10494
10495 let mut dd = common::DefaultDelegate;
10496 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10497 dlg.begin(common::MethodInfo {
10498 id: "firebase.projects.webApps.remove",
10499 http_method: hyper::Method::POST,
10500 });
10501
10502 for &field in ["alt", "name"].iter() {
10503 if self._additional_params.contains_key(field) {
10504 dlg.finished(false);
10505 return Err(common::Error::FieldClash(field));
10506 }
10507 }
10508
10509 let mut params = Params::with_capacity(4 + self._additional_params.len());
10510 params.push("name", self._name);
10511
10512 params.extend(self._additional_params.iter());
10513
10514 params.push("alt", "json");
10515 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:remove";
10516 if self._scopes.is_empty() {
10517 self._scopes
10518 .insert(Scope::CloudPlatform.as_ref().to_string());
10519 }
10520
10521 #[allow(clippy::single_element_loop)]
10522 for &(find_this, param_name) in [("{+name}", "name")].iter() {
10523 url = params.uri_replacement(url, param_name, find_this, true);
10524 }
10525 {
10526 let to_remove = ["name"];
10527 params.remove_params(&to_remove);
10528 }
10529
10530 let url = params.parse_with_url(&url);
10531
10532 let mut json_mime_type = mime::APPLICATION_JSON;
10533 let mut request_value_reader = {
10534 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10535 common::remove_json_null_values(&mut value);
10536 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10537 serde_json::to_writer(&mut dst, &value).unwrap();
10538 dst
10539 };
10540 let request_size = request_value_reader
10541 .seek(std::io::SeekFrom::End(0))
10542 .unwrap();
10543 request_value_reader
10544 .seek(std::io::SeekFrom::Start(0))
10545 .unwrap();
10546
10547 loop {
10548 let token = match self
10549 .hub
10550 .auth
10551 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10552 .await
10553 {
10554 Ok(token) => token,
10555 Err(e) => match dlg.token(e) {
10556 Ok(token) => token,
10557 Err(e) => {
10558 dlg.finished(false);
10559 return Err(common::Error::MissingToken(e));
10560 }
10561 },
10562 };
10563 request_value_reader
10564 .seek(std::io::SeekFrom::Start(0))
10565 .unwrap();
10566 let mut req_result = {
10567 let client = &self.hub.client;
10568 dlg.pre_request();
10569 let mut req_builder = hyper::Request::builder()
10570 .method(hyper::Method::POST)
10571 .uri(url.as_str())
10572 .header(USER_AGENT, self.hub._user_agent.clone());
10573
10574 if let Some(token) = token.as_ref() {
10575 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10576 }
10577
10578 let request = req_builder
10579 .header(CONTENT_TYPE, json_mime_type.to_string())
10580 .header(CONTENT_LENGTH, request_size as u64)
10581 .body(common::to_body(
10582 request_value_reader.get_ref().clone().into(),
10583 ));
10584
10585 client.request(request.unwrap()).await
10586 };
10587
10588 match req_result {
10589 Err(err) => {
10590 if let common::Retry::After(d) = dlg.http_error(&err) {
10591 sleep(d).await;
10592 continue;
10593 }
10594 dlg.finished(false);
10595 return Err(common::Error::HttpError(err));
10596 }
10597 Ok(res) => {
10598 let (mut parts, body) = res.into_parts();
10599 let mut body = common::Body::new(body);
10600 if !parts.status.is_success() {
10601 let bytes = common::to_bytes(body).await.unwrap_or_default();
10602 let error = serde_json::from_str(&common::to_string(&bytes));
10603 let response = common::to_response(parts, bytes.into());
10604
10605 if let common::Retry::After(d) =
10606 dlg.http_failure(&response, error.as_ref().ok())
10607 {
10608 sleep(d).await;
10609 continue;
10610 }
10611
10612 dlg.finished(false);
10613
10614 return Err(match error {
10615 Ok(value) => common::Error::BadRequest(value),
10616 _ => common::Error::Failure(response),
10617 });
10618 }
10619 let response = {
10620 let bytes = common::to_bytes(body).await.unwrap_or_default();
10621 let encoded = common::to_string(&bytes);
10622 match serde_json::from_str(&encoded) {
10623 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10624 Err(error) => {
10625 dlg.response_json_decode_error(&encoded, &error);
10626 return Err(common::Error::JsonDecodeError(
10627 encoded.to_string(),
10628 error,
10629 ));
10630 }
10631 }
10632 };
10633
10634 dlg.finished(true);
10635 return Ok(response);
10636 }
10637 }
10638 }
10639 }
10640
10641 ///
10642 /// Sets the *request* property to the given value.
10643 ///
10644 /// Even though the property as already been set when instantiating this call,
10645 /// we provide this method for API completeness.
10646 pub fn request(mut self, new_value: RemoveWebAppRequest) -> ProjectWebAppRemoveCall<'a, C> {
10647 self._request = new_value;
10648 self
10649 }
10650 /// 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.
10651 ///
10652 /// Sets the *name* path property to the given value.
10653 ///
10654 /// Even though the property as already been set when instantiating this call,
10655 /// we provide this method for API completeness.
10656 pub fn name(mut self, new_value: &str) -> ProjectWebAppRemoveCall<'a, C> {
10657 self._name = new_value.to_string();
10658 self
10659 }
10660 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10661 /// while executing the actual API request.
10662 ///
10663 /// ````text
10664 /// It should be used to handle progress information, and to implement a certain level of resilience.
10665 /// ````
10666 ///
10667 /// Sets the *delegate* property to the given value.
10668 pub fn delegate(
10669 mut self,
10670 new_value: &'a mut dyn common::Delegate,
10671 ) -> ProjectWebAppRemoveCall<'a, C> {
10672 self._delegate = Some(new_value);
10673 self
10674 }
10675
10676 /// Set any additional parameter of the query string used in the request.
10677 /// It should be used to set parameters which are not yet available through their own
10678 /// setters.
10679 ///
10680 /// Please note that this method must not be used to set any of the known parameters
10681 /// which have their own setter method. If done anyway, the request will fail.
10682 ///
10683 /// # Additional Parameters
10684 ///
10685 /// * *$.xgafv* (query-string) - V1 error format.
10686 /// * *access_token* (query-string) - OAuth access token.
10687 /// * *alt* (query-string) - Data format for response.
10688 /// * *callback* (query-string) - JSONP
10689 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10690 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
10691 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10692 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10693 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
10694 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10695 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10696 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppRemoveCall<'a, C>
10697 where
10698 T: AsRef<str>,
10699 {
10700 self._additional_params
10701 .insert(name.as_ref().to_string(), value.as_ref().to_string());
10702 self
10703 }
10704
10705 /// Identifies the authorization scope for the method you are building.
10706 ///
10707 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10708 /// [`Scope::CloudPlatform`].
10709 ///
10710 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10711 /// tokens for more than one scope.
10712 ///
10713 /// Usually there is more than one suitable scope to authorize an operation, some of which may
10714 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10715 /// sufficient, a read-write scope will do as well.
10716 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppRemoveCall<'a, C>
10717 where
10718 St: AsRef<str>,
10719 {
10720 self._scopes.insert(String::from(scope.as_ref()));
10721 self
10722 }
10723 /// Identifies the authorization scope(s) for the method you are building.
10724 ///
10725 /// See [`Self::add_scope()`] for details.
10726 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppRemoveCall<'a, C>
10727 where
10728 I: IntoIterator<Item = St>,
10729 St: AsRef<str>,
10730 {
10731 self._scopes
10732 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10733 self
10734 }
10735
10736 /// Removes all scopes, and no default scope will be used either.
10737 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10738 /// for details).
10739 pub fn clear_scopes(mut self) -> ProjectWebAppRemoveCall<'a, C> {
10740 self._scopes.clear();
10741 self
10742 }
10743}
10744
10745/// Restores the specified WebApp to the FirebaseProject.
10746///
10747/// A builder for the *webApps.undelete* method supported by a *project* resource.
10748/// It is not used directly, but through a [`ProjectMethods`] instance.
10749///
10750/// # Example
10751///
10752/// Instantiate a resource method builder
10753///
10754/// ```test_harness,no_run
10755/// # extern crate hyper;
10756/// # extern crate hyper_rustls;
10757/// # extern crate google_firebase1_beta1 as firebase1_beta1;
10758/// use firebase1_beta1::api::UndeleteWebAppRequest;
10759/// # async fn dox() {
10760/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10761///
10762/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10763/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
10764/// # .with_native_roots()
10765/// # .unwrap()
10766/// # .https_only()
10767/// # .enable_http2()
10768/// # .build();
10769///
10770/// # let executor = hyper_util::rt::TokioExecutor::new();
10771/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
10772/// # secret,
10773/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10774/// # yup_oauth2::client::CustomHyperClientBuilder::from(
10775/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
10776/// # ),
10777/// # ).build().await.unwrap();
10778///
10779/// # let client = hyper_util::client::legacy::Client::builder(
10780/// # hyper_util::rt::TokioExecutor::new()
10781/// # )
10782/// # .build(
10783/// # hyper_rustls::HttpsConnectorBuilder::new()
10784/// # .with_native_roots()
10785/// # .unwrap()
10786/// # .https_or_http()
10787/// # .enable_http2()
10788/// # .build()
10789/// # );
10790/// # let mut hub = FirebaseManagement::new(client, auth);
10791/// // As the method needs a request, you would usually fill it with the desired information
10792/// // into the respective structure. Some of the parts shown here might not be applicable !
10793/// // Values shown here are possibly random and not representative !
10794/// let mut req = UndeleteWebAppRequest::default();
10795///
10796/// // You can configure optional parameters by calling the respective setters at will, and
10797/// // execute the final call using `doit()`.
10798/// // Values shown here are possibly random and not representative !
10799/// let result = hub.projects().web_apps_undelete(req, "name")
10800/// .doit().await;
10801/// # }
10802/// ```
10803pub struct ProjectWebAppUndeleteCall<'a, C>
10804where
10805 C: 'a,
10806{
10807 hub: &'a FirebaseManagement<C>,
10808 _request: UndeleteWebAppRequest,
10809 _name: String,
10810 _delegate: Option<&'a mut dyn common::Delegate>,
10811 _additional_params: HashMap<String, String>,
10812 _scopes: BTreeSet<String>,
10813}
10814
10815impl<'a, C> common::CallBuilder for ProjectWebAppUndeleteCall<'a, C> {}
10816
10817impl<'a, C> ProjectWebAppUndeleteCall<'a, C>
10818where
10819 C: common::Connector,
10820{
10821 /// Perform the operation you have build so far.
10822 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
10823 use std::borrow::Cow;
10824 use std::io::{Read, Seek};
10825
10826 use common::{url::Params, ToParts};
10827 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10828
10829 let mut dd = common::DefaultDelegate;
10830 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10831 dlg.begin(common::MethodInfo {
10832 id: "firebase.projects.webApps.undelete",
10833 http_method: hyper::Method::POST,
10834 });
10835
10836 for &field in ["alt", "name"].iter() {
10837 if self._additional_params.contains_key(field) {
10838 dlg.finished(false);
10839 return Err(common::Error::FieldClash(field));
10840 }
10841 }
10842
10843 let mut params = Params::with_capacity(4 + self._additional_params.len());
10844 params.push("name", self._name);
10845
10846 params.extend(self._additional_params.iter());
10847
10848 params.push("alt", "json");
10849 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:undelete";
10850 if self._scopes.is_empty() {
10851 self._scopes
10852 .insert(Scope::CloudPlatform.as_ref().to_string());
10853 }
10854
10855 #[allow(clippy::single_element_loop)]
10856 for &(find_this, param_name) in [("{+name}", "name")].iter() {
10857 url = params.uri_replacement(url, param_name, find_this, true);
10858 }
10859 {
10860 let to_remove = ["name"];
10861 params.remove_params(&to_remove);
10862 }
10863
10864 let url = params.parse_with_url(&url);
10865
10866 let mut json_mime_type = mime::APPLICATION_JSON;
10867 let mut request_value_reader = {
10868 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
10869 common::remove_json_null_values(&mut value);
10870 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
10871 serde_json::to_writer(&mut dst, &value).unwrap();
10872 dst
10873 };
10874 let request_size = request_value_reader
10875 .seek(std::io::SeekFrom::End(0))
10876 .unwrap();
10877 request_value_reader
10878 .seek(std::io::SeekFrom::Start(0))
10879 .unwrap();
10880
10881 loop {
10882 let token = match self
10883 .hub
10884 .auth
10885 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10886 .await
10887 {
10888 Ok(token) => token,
10889 Err(e) => match dlg.token(e) {
10890 Ok(token) => token,
10891 Err(e) => {
10892 dlg.finished(false);
10893 return Err(common::Error::MissingToken(e));
10894 }
10895 },
10896 };
10897 request_value_reader
10898 .seek(std::io::SeekFrom::Start(0))
10899 .unwrap();
10900 let mut req_result = {
10901 let client = &self.hub.client;
10902 dlg.pre_request();
10903 let mut req_builder = hyper::Request::builder()
10904 .method(hyper::Method::POST)
10905 .uri(url.as_str())
10906 .header(USER_AGENT, self.hub._user_agent.clone());
10907
10908 if let Some(token) = token.as_ref() {
10909 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10910 }
10911
10912 let request = req_builder
10913 .header(CONTENT_TYPE, json_mime_type.to_string())
10914 .header(CONTENT_LENGTH, request_size as u64)
10915 .body(common::to_body(
10916 request_value_reader.get_ref().clone().into(),
10917 ));
10918
10919 client.request(request.unwrap()).await
10920 };
10921
10922 match req_result {
10923 Err(err) => {
10924 if let common::Retry::After(d) = dlg.http_error(&err) {
10925 sleep(d).await;
10926 continue;
10927 }
10928 dlg.finished(false);
10929 return Err(common::Error::HttpError(err));
10930 }
10931 Ok(res) => {
10932 let (mut parts, body) = res.into_parts();
10933 let mut body = common::Body::new(body);
10934 if !parts.status.is_success() {
10935 let bytes = common::to_bytes(body).await.unwrap_or_default();
10936 let error = serde_json::from_str(&common::to_string(&bytes));
10937 let response = common::to_response(parts, bytes.into());
10938
10939 if let common::Retry::After(d) =
10940 dlg.http_failure(&response, error.as_ref().ok())
10941 {
10942 sleep(d).await;
10943 continue;
10944 }
10945
10946 dlg.finished(false);
10947
10948 return Err(match error {
10949 Ok(value) => common::Error::BadRequest(value),
10950 _ => common::Error::Failure(response),
10951 });
10952 }
10953 let response = {
10954 let bytes = common::to_bytes(body).await.unwrap_or_default();
10955 let encoded = common::to_string(&bytes);
10956 match serde_json::from_str(&encoded) {
10957 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10958 Err(error) => {
10959 dlg.response_json_decode_error(&encoded, &error);
10960 return Err(common::Error::JsonDecodeError(
10961 encoded.to_string(),
10962 error,
10963 ));
10964 }
10965 }
10966 };
10967
10968 dlg.finished(true);
10969 return Ok(response);
10970 }
10971 }
10972 }
10973 }
10974
10975 ///
10976 /// Sets the *request* property to the given value.
10977 ///
10978 /// Even though the property as already been set when instantiating this call,
10979 /// we provide this method for API completeness.
10980 pub fn request(mut self, new_value: UndeleteWebAppRequest) -> ProjectWebAppUndeleteCall<'a, C> {
10981 self._request = new_value;
10982 self
10983 }
10984 /// 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.
10985 ///
10986 /// Sets the *name* path property to the given value.
10987 ///
10988 /// Even though the property as already been set when instantiating this call,
10989 /// we provide this method for API completeness.
10990 pub fn name(mut self, new_value: &str) -> ProjectWebAppUndeleteCall<'a, C> {
10991 self._name = new_value.to_string();
10992 self
10993 }
10994 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10995 /// while executing the actual API request.
10996 ///
10997 /// ````text
10998 /// It should be used to handle progress information, and to implement a certain level of resilience.
10999 /// ````
11000 ///
11001 /// Sets the *delegate* property to the given value.
11002 pub fn delegate(
11003 mut self,
11004 new_value: &'a mut dyn common::Delegate,
11005 ) -> ProjectWebAppUndeleteCall<'a, C> {
11006 self._delegate = Some(new_value);
11007 self
11008 }
11009
11010 /// Set any additional parameter of the query string used in the request.
11011 /// It should be used to set parameters which are not yet available through their own
11012 /// setters.
11013 ///
11014 /// Please note that this method must not be used to set any of the known parameters
11015 /// which have their own setter method. If done anyway, the request will fail.
11016 ///
11017 /// # Additional Parameters
11018 ///
11019 /// * *$.xgafv* (query-string) - V1 error format.
11020 /// * *access_token* (query-string) - OAuth access token.
11021 /// * *alt* (query-string) - Data format for response.
11022 /// * *callback* (query-string) - JSONP
11023 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11024 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11025 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11026 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11027 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11028 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11029 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11030 pub fn param<T>(mut self, name: T, value: T) -> ProjectWebAppUndeleteCall<'a, C>
11031 where
11032 T: AsRef<str>,
11033 {
11034 self._additional_params
11035 .insert(name.as_ref().to_string(), value.as_ref().to_string());
11036 self
11037 }
11038
11039 /// Identifies the authorization scope for the method you are building.
11040 ///
11041 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11042 /// [`Scope::CloudPlatform`].
11043 ///
11044 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11045 /// tokens for more than one scope.
11046 ///
11047 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11048 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11049 /// sufficient, a read-write scope will do as well.
11050 pub fn add_scope<St>(mut self, scope: St) -> ProjectWebAppUndeleteCall<'a, C>
11051 where
11052 St: AsRef<str>,
11053 {
11054 self._scopes.insert(String::from(scope.as_ref()));
11055 self
11056 }
11057 /// Identifies the authorization scope(s) for the method you are building.
11058 ///
11059 /// See [`Self::add_scope()`] for details.
11060 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectWebAppUndeleteCall<'a, C>
11061 where
11062 I: IntoIterator<Item = St>,
11063 St: AsRef<str>,
11064 {
11065 self._scopes
11066 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11067 self
11068 }
11069
11070 /// Removes all scopes, and no default scope will be used either.
11071 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11072 /// for details).
11073 pub fn clear_scopes(mut self) -> ProjectWebAppUndeleteCall<'a, C> {
11074 self._scopes.clear();
11075 self
11076 }
11077}
11078
11079/// Adds Firebase resources and enables Firebase services in the specified existing [Google Cloud `Project`](https://cloud.google.com/resource-manager/reference/rest/v1/projects). Since a FirebaseProject is actually also a Google Cloud `Project`, a `FirebaseProject` has the same underlying Google Cloud 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 Google Cloud `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`.
11080///
11081/// A builder for the *addFirebase* method supported by a *project* resource.
11082/// It is not used directly, but through a [`ProjectMethods`] instance.
11083///
11084/// # Example
11085///
11086/// Instantiate a resource method builder
11087///
11088/// ```test_harness,no_run
11089/// # extern crate hyper;
11090/// # extern crate hyper_rustls;
11091/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11092/// use firebase1_beta1::api::AddFirebaseRequest;
11093/// # async fn dox() {
11094/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11095///
11096/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11097/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
11098/// # .with_native_roots()
11099/// # .unwrap()
11100/// # .https_only()
11101/// # .enable_http2()
11102/// # .build();
11103///
11104/// # let executor = hyper_util::rt::TokioExecutor::new();
11105/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
11106/// # secret,
11107/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11108/// # yup_oauth2::client::CustomHyperClientBuilder::from(
11109/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
11110/// # ),
11111/// # ).build().await.unwrap();
11112///
11113/// # let client = hyper_util::client::legacy::Client::builder(
11114/// # hyper_util::rt::TokioExecutor::new()
11115/// # )
11116/// # .build(
11117/// # hyper_rustls::HttpsConnectorBuilder::new()
11118/// # .with_native_roots()
11119/// # .unwrap()
11120/// # .https_or_http()
11121/// # .enable_http2()
11122/// # .build()
11123/// # );
11124/// # let mut hub = FirebaseManagement::new(client, auth);
11125/// // As the method needs a request, you would usually fill it with the desired information
11126/// // into the respective structure. Some of the parts shown here might not be applicable !
11127/// // Values shown here are possibly random and not representative !
11128/// let mut req = AddFirebaseRequest::default();
11129///
11130/// // You can configure optional parameters by calling the respective setters at will, and
11131/// // execute the final call using `doit()`.
11132/// // Values shown here are possibly random and not representative !
11133/// let result = hub.projects().add_firebase(req, "project")
11134/// .doit().await;
11135/// # }
11136/// ```
11137pub struct ProjectAddFirebaseCall<'a, C>
11138where
11139 C: 'a,
11140{
11141 hub: &'a FirebaseManagement<C>,
11142 _request: AddFirebaseRequest,
11143 _project: String,
11144 _delegate: Option<&'a mut dyn common::Delegate>,
11145 _additional_params: HashMap<String, String>,
11146 _scopes: BTreeSet<String>,
11147}
11148
11149impl<'a, C> common::CallBuilder for ProjectAddFirebaseCall<'a, C> {}
11150
11151impl<'a, C> ProjectAddFirebaseCall<'a, C>
11152where
11153 C: common::Connector,
11154{
11155 /// Perform the operation you have build so far.
11156 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
11157 use std::borrow::Cow;
11158 use std::io::{Read, Seek};
11159
11160 use common::{url::Params, ToParts};
11161 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11162
11163 let mut dd = common::DefaultDelegate;
11164 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11165 dlg.begin(common::MethodInfo {
11166 id: "firebase.projects.addFirebase",
11167 http_method: hyper::Method::POST,
11168 });
11169
11170 for &field in ["alt", "project"].iter() {
11171 if self._additional_params.contains_key(field) {
11172 dlg.finished(false);
11173 return Err(common::Error::FieldClash(field));
11174 }
11175 }
11176
11177 let mut params = Params::with_capacity(4 + self._additional_params.len());
11178 params.push("project", self._project);
11179
11180 params.extend(self._additional_params.iter());
11181
11182 params.push("alt", "json");
11183 let mut url = self.hub._base_url.clone() + "v1beta1/{+project}:addFirebase";
11184 if self._scopes.is_empty() {
11185 self._scopes
11186 .insert(Scope::CloudPlatform.as_ref().to_string());
11187 }
11188
11189 #[allow(clippy::single_element_loop)]
11190 for &(find_this, param_name) in [("{+project}", "project")].iter() {
11191 url = params.uri_replacement(url, param_name, find_this, true);
11192 }
11193 {
11194 let to_remove = ["project"];
11195 params.remove_params(&to_remove);
11196 }
11197
11198 let url = params.parse_with_url(&url);
11199
11200 let mut json_mime_type = mime::APPLICATION_JSON;
11201 let mut request_value_reader = {
11202 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
11203 common::remove_json_null_values(&mut value);
11204 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
11205 serde_json::to_writer(&mut dst, &value).unwrap();
11206 dst
11207 };
11208 let request_size = request_value_reader
11209 .seek(std::io::SeekFrom::End(0))
11210 .unwrap();
11211 request_value_reader
11212 .seek(std::io::SeekFrom::Start(0))
11213 .unwrap();
11214
11215 loop {
11216 let token = match self
11217 .hub
11218 .auth
11219 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11220 .await
11221 {
11222 Ok(token) => token,
11223 Err(e) => match dlg.token(e) {
11224 Ok(token) => token,
11225 Err(e) => {
11226 dlg.finished(false);
11227 return Err(common::Error::MissingToken(e));
11228 }
11229 },
11230 };
11231 request_value_reader
11232 .seek(std::io::SeekFrom::Start(0))
11233 .unwrap();
11234 let mut req_result = {
11235 let client = &self.hub.client;
11236 dlg.pre_request();
11237 let mut req_builder = hyper::Request::builder()
11238 .method(hyper::Method::POST)
11239 .uri(url.as_str())
11240 .header(USER_AGENT, self.hub._user_agent.clone());
11241
11242 if let Some(token) = token.as_ref() {
11243 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11244 }
11245
11246 let request = req_builder
11247 .header(CONTENT_TYPE, json_mime_type.to_string())
11248 .header(CONTENT_LENGTH, request_size as u64)
11249 .body(common::to_body(
11250 request_value_reader.get_ref().clone().into(),
11251 ));
11252
11253 client.request(request.unwrap()).await
11254 };
11255
11256 match req_result {
11257 Err(err) => {
11258 if let common::Retry::After(d) = dlg.http_error(&err) {
11259 sleep(d).await;
11260 continue;
11261 }
11262 dlg.finished(false);
11263 return Err(common::Error::HttpError(err));
11264 }
11265 Ok(res) => {
11266 let (mut parts, body) = res.into_parts();
11267 let mut body = common::Body::new(body);
11268 if !parts.status.is_success() {
11269 let bytes = common::to_bytes(body).await.unwrap_or_default();
11270 let error = serde_json::from_str(&common::to_string(&bytes));
11271 let response = common::to_response(parts, bytes.into());
11272
11273 if let common::Retry::After(d) =
11274 dlg.http_failure(&response, error.as_ref().ok())
11275 {
11276 sleep(d).await;
11277 continue;
11278 }
11279
11280 dlg.finished(false);
11281
11282 return Err(match error {
11283 Ok(value) => common::Error::BadRequest(value),
11284 _ => common::Error::Failure(response),
11285 });
11286 }
11287 let response = {
11288 let bytes = common::to_bytes(body).await.unwrap_or_default();
11289 let encoded = common::to_string(&bytes);
11290 match serde_json::from_str(&encoded) {
11291 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11292 Err(error) => {
11293 dlg.response_json_decode_error(&encoded, &error);
11294 return Err(common::Error::JsonDecodeError(
11295 encoded.to_string(),
11296 error,
11297 ));
11298 }
11299 }
11300 };
11301
11302 dlg.finished(true);
11303 return Ok(response);
11304 }
11305 }
11306 }
11307 }
11308
11309 ///
11310 /// Sets the *request* property to the given value.
11311 ///
11312 /// Even though the property as already been set when instantiating this call,
11313 /// we provide this method for API completeness.
11314 pub fn request(mut self, new_value: AddFirebaseRequest) -> ProjectAddFirebaseCall<'a, C> {
11315 self._request = new_value;
11316 self
11317 }
11318 /// The resource name of the Google Cloud `Project` in which Firebase resources will be added and Firebase services enabled, 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 Google Cloud `Project` are also the identifiers of the FirebaseProject.
11319 ///
11320 /// Sets the *project* path property to the given value.
11321 ///
11322 /// Even though the property as already been set when instantiating this call,
11323 /// we provide this method for API completeness.
11324 pub fn project(mut self, new_value: &str) -> ProjectAddFirebaseCall<'a, C> {
11325 self._project = new_value.to_string();
11326 self
11327 }
11328 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11329 /// while executing the actual API request.
11330 ///
11331 /// ````text
11332 /// It should be used to handle progress information, and to implement a certain level of resilience.
11333 /// ````
11334 ///
11335 /// Sets the *delegate* property to the given value.
11336 pub fn delegate(
11337 mut self,
11338 new_value: &'a mut dyn common::Delegate,
11339 ) -> ProjectAddFirebaseCall<'a, C> {
11340 self._delegate = Some(new_value);
11341 self
11342 }
11343
11344 /// Set any additional parameter of the query string used in the request.
11345 /// It should be used to set parameters which are not yet available through their own
11346 /// setters.
11347 ///
11348 /// Please note that this method must not be used to set any of the known parameters
11349 /// which have their own setter method. If done anyway, the request will fail.
11350 ///
11351 /// # Additional Parameters
11352 ///
11353 /// * *$.xgafv* (query-string) - V1 error format.
11354 /// * *access_token* (query-string) - OAuth access token.
11355 /// * *alt* (query-string) - Data format for response.
11356 /// * *callback* (query-string) - JSONP
11357 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11358 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11359 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11360 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11361 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11362 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11363 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11364 pub fn param<T>(mut self, name: T, value: T) -> ProjectAddFirebaseCall<'a, C>
11365 where
11366 T: AsRef<str>,
11367 {
11368 self._additional_params
11369 .insert(name.as_ref().to_string(), value.as_ref().to_string());
11370 self
11371 }
11372
11373 /// Identifies the authorization scope for the method you are building.
11374 ///
11375 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11376 /// [`Scope::CloudPlatform`].
11377 ///
11378 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11379 /// tokens for more than one scope.
11380 ///
11381 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11382 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11383 /// sufficient, a read-write scope will do as well.
11384 pub fn add_scope<St>(mut self, scope: St) -> ProjectAddFirebaseCall<'a, C>
11385 where
11386 St: AsRef<str>,
11387 {
11388 self._scopes.insert(String::from(scope.as_ref()));
11389 self
11390 }
11391 /// Identifies the authorization scope(s) for the method you are building.
11392 ///
11393 /// See [`Self::add_scope()`] for details.
11394 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAddFirebaseCall<'a, C>
11395 where
11396 I: IntoIterator<Item = St>,
11397 St: AsRef<str>,
11398 {
11399 self._scopes
11400 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11401 self
11402 }
11403
11404 /// Removes all scopes, and no default scope will be used either.
11405 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11406 /// for details).
11407 pub fn clear_scopes(mut self) -> ProjectAddFirebaseCall<'a, C> {
11408 self._scopes.clear();
11409 self
11410 }
11411}
11412
11413/// 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).
11414///
11415/// A builder for the *addGoogleAnalytics* method supported by a *project* resource.
11416/// It is not used directly, but through a [`ProjectMethods`] instance.
11417///
11418/// # Example
11419///
11420/// Instantiate a resource method builder
11421///
11422/// ```test_harness,no_run
11423/// # extern crate hyper;
11424/// # extern crate hyper_rustls;
11425/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11426/// use firebase1_beta1::api::AddGoogleAnalyticsRequest;
11427/// # async fn dox() {
11428/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11429///
11430/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11431/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
11432/// # .with_native_roots()
11433/// # .unwrap()
11434/// # .https_only()
11435/// # .enable_http2()
11436/// # .build();
11437///
11438/// # let executor = hyper_util::rt::TokioExecutor::new();
11439/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
11440/// # secret,
11441/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11442/// # yup_oauth2::client::CustomHyperClientBuilder::from(
11443/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
11444/// # ),
11445/// # ).build().await.unwrap();
11446///
11447/// # let client = hyper_util::client::legacy::Client::builder(
11448/// # hyper_util::rt::TokioExecutor::new()
11449/// # )
11450/// # .build(
11451/// # hyper_rustls::HttpsConnectorBuilder::new()
11452/// # .with_native_roots()
11453/// # .unwrap()
11454/// # .https_or_http()
11455/// # .enable_http2()
11456/// # .build()
11457/// # );
11458/// # let mut hub = FirebaseManagement::new(client, auth);
11459/// // As the method needs a request, you would usually fill it with the desired information
11460/// // into the respective structure. Some of the parts shown here might not be applicable !
11461/// // Values shown here are possibly random and not representative !
11462/// let mut req = AddGoogleAnalyticsRequest::default();
11463///
11464/// // You can configure optional parameters by calling the respective setters at will, and
11465/// // execute the final call using `doit()`.
11466/// // Values shown here are possibly random and not representative !
11467/// let result = hub.projects().add_google_analytics(req, "parent")
11468/// .doit().await;
11469/// # }
11470/// ```
11471pub struct ProjectAddGoogleAnalyticCall<'a, C>
11472where
11473 C: 'a,
11474{
11475 hub: &'a FirebaseManagement<C>,
11476 _request: AddGoogleAnalyticsRequest,
11477 _parent: String,
11478 _delegate: Option<&'a mut dyn common::Delegate>,
11479 _additional_params: HashMap<String, String>,
11480 _scopes: BTreeSet<String>,
11481}
11482
11483impl<'a, C> common::CallBuilder for ProjectAddGoogleAnalyticCall<'a, C> {}
11484
11485impl<'a, C> ProjectAddGoogleAnalyticCall<'a, C>
11486where
11487 C: common::Connector,
11488{
11489 /// Perform the operation you have build so far.
11490 pub async fn doit(mut self) -> common::Result<(common::Response, Operation)> {
11491 use std::borrow::Cow;
11492 use std::io::{Read, Seek};
11493
11494 use common::{url::Params, ToParts};
11495 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11496
11497 let mut dd = common::DefaultDelegate;
11498 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11499 dlg.begin(common::MethodInfo {
11500 id: "firebase.projects.addGoogleAnalytics",
11501 http_method: hyper::Method::POST,
11502 });
11503
11504 for &field in ["alt", "parent"].iter() {
11505 if self._additional_params.contains_key(field) {
11506 dlg.finished(false);
11507 return Err(common::Error::FieldClash(field));
11508 }
11509 }
11510
11511 let mut params = Params::with_capacity(4 + self._additional_params.len());
11512 params.push("parent", self._parent);
11513
11514 params.extend(self._additional_params.iter());
11515
11516 params.push("alt", "json");
11517 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:addGoogleAnalytics";
11518 if self._scopes.is_empty() {
11519 self._scopes
11520 .insert(Scope::CloudPlatform.as_ref().to_string());
11521 }
11522
11523 #[allow(clippy::single_element_loop)]
11524 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
11525 url = params.uri_replacement(url, param_name, find_this, true);
11526 }
11527 {
11528 let to_remove = ["parent"];
11529 params.remove_params(&to_remove);
11530 }
11531
11532 let url = params.parse_with_url(&url);
11533
11534 let mut json_mime_type = mime::APPLICATION_JSON;
11535 let mut request_value_reader = {
11536 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
11537 common::remove_json_null_values(&mut value);
11538 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
11539 serde_json::to_writer(&mut dst, &value).unwrap();
11540 dst
11541 };
11542 let request_size = request_value_reader
11543 .seek(std::io::SeekFrom::End(0))
11544 .unwrap();
11545 request_value_reader
11546 .seek(std::io::SeekFrom::Start(0))
11547 .unwrap();
11548
11549 loop {
11550 let token = match self
11551 .hub
11552 .auth
11553 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11554 .await
11555 {
11556 Ok(token) => token,
11557 Err(e) => match dlg.token(e) {
11558 Ok(token) => token,
11559 Err(e) => {
11560 dlg.finished(false);
11561 return Err(common::Error::MissingToken(e));
11562 }
11563 },
11564 };
11565 request_value_reader
11566 .seek(std::io::SeekFrom::Start(0))
11567 .unwrap();
11568 let mut req_result = {
11569 let client = &self.hub.client;
11570 dlg.pre_request();
11571 let mut req_builder = hyper::Request::builder()
11572 .method(hyper::Method::POST)
11573 .uri(url.as_str())
11574 .header(USER_AGENT, self.hub._user_agent.clone());
11575
11576 if let Some(token) = token.as_ref() {
11577 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11578 }
11579
11580 let request = req_builder
11581 .header(CONTENT_TYPE, json_mime_type.to_string())
11582 .header(CONTENT_LENGTH, request_size as u64)
11583 .body(common::to_body(
11584 request_value_reader.get_ref().clone().into(),
11585 ));
11586
11587 client.request(request.unwrap()).await
11588 };
11589
11590 match req_result {
11591 Err(err) => {
11592 if let common::Retry::After(d) = dlg.http_error(&err) {
11593 sleep(d).await;
11594 continue;
11595 }
11596 dlg.finished(false);
11597 return Err(common::Error::HttpError(err));
11598 }
11599 Ok(res) => {
11600 let (mut parts, body) = res.into_parts();
11601 let mut body = common::Body::new(body);
11602 if !parts.status.is_success() {
11603 let bytes = common::to_bytes(body).await.unwrap_or_default();
11604 let error = serde_json::from_str(&common::to_string(&bytes));
11605 let response = common::to_response(parts, bytes.into());
11606
11607 if let common::Retry::After(d) =
11608 dlg.http_failure(&response, error.as_ref().ok())
11609 {
11610 sleep(d).await;
11611 continue;
11612 }
11613
11614 dlg.finished(false);
11615
11616 return Err(match error {
11617 Ok(value) => common::Error::BadRequest(value),
11618 _ => common::Error::Failure(response),
11619 });
11620 }
11621 let response = {
11622 let bytes = common::to_bytes(body).await.unwrap_or_default();
11623 let encoded = common::to_string(&bytes);
11624 match serde_json::from_str(&encoded) {
11625 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11626 Err(error) => {
11627 dlg.response_json_decode_error(&encoded, &error);
11628 return Err(common::Error::JsonDecodeError(
11629 encoded.to_string(),
11630 error,
11631 ));
11632 }
11633 }
11634 };
11635
11636 dlg.finished(true);
11637 return Ok(response);
11638 }
11639 }
11640 }
11641 }
11642
11643 ///
11644 /// Sets the *request* property to the given value.
11645 ///
11646 /// Even though the property as already been set when instantiating this call,
11647 /// we provide this method for API completeness.
11648 pub fn request(
11649 mut self,
11650 new_value: AddGoogleAnalyticsRequest,
11651 ) -> ProjectAddGoogleAnalyticCall<'a, C> {
11652 self._request = new_value;
11653 self
11654 }
11655 /// 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.
11656 ///
11657 /// Sets the *parent* path property to the given value.
11658 ///
11659 /// Even though the property as already been set when instantiating this call,
11660 /// we provide this method for API completeness.
11661 pub fn parent(mut self, new_value: &str) -> ProjectAddGoogleAnalyticCall<'a, C> {
11662 self._parent = new_value.to_string();
11663 self
11664 }
11665 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11666 /// while executing the actual API request.
11667 ///
11668 /// ````text
11669 /// It should be used to handle progress information, and to implement a certain level of resilience.
11670 /// ````
11671 ///
11672 /// Sets the *delegate* property to the given value.
11673 pub fn delegate(
11674 mut self,
11675 new_value: &'a mut dyn common::Delegate,
11676 ) -> ProjectAddGoogleAnalyticCall<'a, C> {
11677 self._delegate = Some(new_value);
11678 self
11679 }
11680
11681 /// Set any additional parameter of the query string used in the request.
11682 /// It should be used to set parameters which are not yet available through their own
11683 /// setters.
11684 ///
11685 /// Please note that this method must not be used to set any of the known parameters
11686 /// which have their own setter method. If done anyway, the request will fail.
11687 ///
11688 /// # Additional Parameters
11689 ///
11690 /// * *$.xgafv* (query-string) - V1 error format.
11691 /// * *access_token* (query-string) - OAuth access token.
11692 /// * *alt* (query-string) - Data format for response.
11693 /// * *callback* (query-string) - JSONP
11694 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11695 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11696 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11697 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11698 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11699 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11700 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11701 pub fn param<T>(mut self, name: T, value: T) -> ProjectAddGoogleAnalyticCall<'a, C>
11702 where
11703 T: AsRef<str>,
11704 {
11705 self._additional_params
11706 .insert(name.as_ref().to_string(), value.as_ref().to_string());
11707 self
11708 }
11709
11710 /// Identifies the authorization scope for the method you are building.
11711 ///
11712 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11713 /// [`Scope::CloudPlatform`].
11714 ///
11715 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11716 /// tokens for more than one scope.
11717 ///
11718 /// Usually there is more than one suitable scope to authorize an operation, some of which may
11719 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11720 /// sufficient, a read-write scope will do as well.
11721 pub fn add_scope<St>(mut self, scope: St) -> ProjectAddGoogleAnalyticCall<'a, C>
11722 where
11723 St: AsRef<str>,
11724 {
11725 self._scopes.insert(String::from(scope.as_ref()));
11726 self
11727 }
11728 /// Identifies the authorization scope(s) for the method you are building.
11729 ///
11730 /// See [`Self::add_scope()`] for details.
11731 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectAddGoogleAnalyticCall<'a, C>
11732 where
11733 I: IntoIterator<Item = St>,
11734 St: AsRef<str>,
11735 {
11736 self._scopes
11737 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11738 self
11739 }
11740
11741 /// Removes all scopes, and no default scope will be used either.
11742 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11743 /// for details).
11744 pub fn clear_scopes(mut self) -> ProjectAddGoogleAnalyticCall<'a, C> {
11745 self._scopes.clear();
11746 self
11747 }
11748}
11749
11750/// Gets the specified FirebaseProject.
11751///
11752/// A builder for the *get* method supported by a *project* resource.
11753/// It is not used directly, but through a [`ProjectMethods`] instance.
11754///
11755/// # Example
11756///
11757/// Instantiate a resource method builder
11758///
11759/// ```test_harness,no_run
11760/// # extern crate hyper;
11761/// # extern crate hyper_rustls;
11762/// # extern crate google_firebase1_beta1 as firebase1_beta1;
11763/// # async fn dox() {
11764/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11765///
11766/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11767/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
11768/// # .with_native_roots()
11769/// # .unwrap()
11770/// # .https_only()
11771/// # .enable_http2()
11772/// # .build();
11773///
11774/// # let executor = hyper_util::rt::TokioExecutor::new();
11775/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
11776/// # secret,
11777/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11778/// # yup_oauth2::client::CustomHyperClientBuilder::from(
11779/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
11780/// # ),
11781/// # ).build().await.unwrap();
11782///
11783/// # let client = hyper_util::client::legacy::Client::builder(
11784/// # hyper_util::rt::TokioExecutor::new()
11785/// # )
11786/// # .build(
11787/// # hyper_rustls::HttpsConnectorBuilder::new()
11788/// # .with_native_roots()
11789/// # .unwrap()
11790/// # .https_or_http()
11791/// # .enable_http2()
11792/// # .build()
11793/// # );
11794/// # let mut hub = FirebaseManagement::new(client, auth);
11795/// // You can configure optional parameters by calling the respective setters at will, and
11796/// // execute the final call using `doit()`.
11797/// // Values shown here are possibly random and not representative !
11798/// let result = hub.projects().get("name")
11799/// .doit().await;
11800/// # }
11801/// ```
11802pub struct ProjectGetCall<'a, C>
11803where
11804 C: 'a,
11805{
11806 hub: &'a FirebaseManagement<C>,
11807 _name: String,
11808 _delegate: Option<&'a mut dyn common::Delegate>,
11809 _additional_params: HashMap<String, String>,
11810 _scopes: BTreeSet<String>,
11811}
11812
11813impl<'a, C> common::CallBuilder for ProjectGetCall<'a, C> {}
11814
11815impl<'a, C> ProjectGetCall<'a, C>
11816where
11817 C: common::Connector,
11818{
11819 /// Perform the operation you have build so far.
11820 pub async fn doit(mut self) -> common::Result<(common::Response, FirebaseProject)> {
11821 use std::borrow::Cow;
11822 use std::io::{Read, Seek};
11823
11824 use common::{url::Params, ToParts};
11825 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11826
11827 let mut dd = common::DefaultDelegate;
11828 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11829 dlg.begin(common::MethodInfo {
11830 id: "firebase.projects.get",
11831 http_method: hyper::Method::GET,
11832 });
11833
11834 for &field in ["alt", "name"].iter() {
11835 if self._additional_params.contains_key(field) {
11836 dlg.finished(false);
11837 return Err(common::Error::FieldClash(field));
11838 }
11839 }
11840
11841 let mut params = Params::with_capacity(3 + self._additional_params.len());
11842 params.push("name", self._name);
11843
11844 params.extend(self._additional_params.iter());
11845
11846 params.push("alt", "json");
11847 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
11848 if self._scopes.is_empty() {
11849 self._scopes.insert(Scope::Readonly.as_ref().to_string());
11850 }
11851
11852 #[allow(clippy::single_element_loop)]
11853 for &(find_this, param_name) in [("{+name}", "name")].iter() {
11854 url = params.uri_replacement(url, param_name, find_this, true);
11855 }
11856 {
11857 let to_remove = ["name"];
11858 params.remove_params(&to_remove);
11859 }
11860
11861 let url = params.parse_with_url(&url);
11862
11863 loop {
11864 let token = match self
11865 .hub
11866 .auth
11867 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11868 .await
11869 {
11870 Ok(token) => token,
11871 Err(e) => match dlg.token(e) {
11872 Ok(token) => token,
11873 Err(e) => {
11874 dlg.finished(false);
11875 return Err(common::Error::MissingToken(e));
11876 }
11877 },
11878 };
11879 let mut req_result = {
11880 let client = &self.hub.client;
11881 dlg.pre_request();
11882 let mut req_builder = hyper::Request::builder()
11883 .method(hyper::Method::GET)
11884 .uri(url.as_str())
11885 .header(USER_AGENT, self.hub._user_agent.clone());
11886
11887 if let Some(token) = token.as_ref() {
11888 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11889 }
11890
11891 let request = req_builder
11892 .header(CONTENT_LENGTH, 0_u64)
11893 .body(common::to_body::<String>(None));
11894
11895 client.request(request.unwrap()).await
11896 };
11897
11898 match req_result {
11899 Err(err) => {
11900 if let common::Retry::After(d) = dlg.http_error(&err) {
11901 sleep(d).await;
11902 continue;
11903 }
11904 dlg.finished(false);
11905 return Err(common::Error::HttpError(err));
11906 }
11907 Ok(res) => {
11908 let (mut parts, body) = res.into_parts();
11909 let mut body = common::Body::new(body);
11910 if !parts.status.is_success() {
11911 let bytes = common::to_bytes(body).await.unwrap_or_default();
11912 let error = serde_json::from_str(&common::to_string(&bytes));
11913 let response = common::to_response(parts, bytes.into());
11914
11915 if let common::Retry::After(d) =
11916 dlg.http_failure(&response, error.as_ref().ok())
11917 {
11918 sleep(d).await;
11919 continue;
11920 }
11921
11922 dlg.finished(false);
11923
11924 return Err(match error {
11925 Ok(value) => common::Error::BadRequest(value),
11926 _ => common::Error::Failure(response),
11927 });
11928 }
11929 let response = {
11930 let bytes = common::to_bytes(body).await.unwrap_or_default();
11931 let encoded = common::to_string(&bytes);
11932 match serde_json::from_str(&encoded) {
11933 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11934 Err(error) => {
11935 dlg.response_json_decode_error(&encoded, &error);
11936 return Err(common::Error::JsonDecodeError(
11937 encoded.to_string(),
11938 error,
11939 ));
11940 }
11941 }
11942 };
11943
11944 dlg.finished(true);
11945 return Ok(response);
11946 }
11947 }
11948 }
11949 }
11950
11951 /// 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.
11952 ///
11953 /// Sets the *name* path property to the given value.
11954 ///
11955 /// Even though the property as already been set when instantiating this call,
11956 /// we provide this method for API completeness.
11957 pub fn name(mut self, new_value: &str) -> ProjectGetCall<'a, C> {
11958 self._name = new_value.to_string();
11959 self
11960 }
11961 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11962 /// while executing the actual API request.
11963 ///
11964 /// ````text
11965 /// It should be used to handle progress information, and to implement a certain level of resilience.
11966 /// ````
11967 ///
11968 /// Sets the *delegate* property to the given value.
11969 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ProjectGetCall<'a, C> {
11970 self._delegate = Some(new_value);
11971 self
11972 }
11973
11974 /// Set any additional parameter of the query string used in the request.
11975 /// It should be used to set parameters which are not yet available through their own
11976 /// setters.
11977 ///
11978 /// Please note that this method must not be used to set any of the known parameters
11979 /// which have their own setter method. If done anyway, the request will fail.
11980 ///
11981 /// # Additional Parameters
11982 ///
11983 /// * *$.xgafv* (query-string) - V1 error format.
11984 /// * *access_token* (query-string) - OAuth access token.
11985 /// * *alt* (query-string) - Data format for response.
11986 /// * *callback* (query-string) - JSONP
11987 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11988 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
11989 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11990 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11991 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
11992 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11993 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11994 pub fn param<T>(mut self, name: T, value: T) -> ProjectGetCall<'a, C>
11995 where
11996 T: AsRef<str>,
11997 {
11998 self._additional_params
11999 .insert(name.as_ref().to_string(), value.as_ref().to_string());
12000 self
12001 }
12002
12003 /// Identifies the authorization scope for the method you are building.
12004 ///
12005 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12006 /// [`Scope::Readonly`].
12007 ///
12008 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12009 /// tokens for more than one scope.
12010 ///
12011 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12012 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12013 /// sufficient, a read-write scope will do as well.
12014 pub fn add_scope<St>(mut self, scope: St) -> ProjectGetCall<'a, C>
12015 where
12016 St: AsRef<str>,
12017 {
12018 self._scopes.insert(String::from(scope.as_ref()));
12019 self
12020 }
12021 /// Identifies the authorization scope(s) for the method you are building.
12022 ///
12023 /// See [`Self::add_scope()`] for details.
12024 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectGetCall<'a, C>
12025 where
12026 I: IntoIterator<Item = St>,
12027 St: AsRef<str>,
12028 {
12029 self._scopes
12030 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12031 self
12032 }
12033
12034 /// Removes all scopes, and no default scope will be used either.
12035 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12036 /// for details).
12037 pub fn clear_scopes(mut self) -> ProjectGetCall<'a, C> {
12038 self._scopes.clear();
12039 self
12040 }
12041}
12042
12043/// 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.
12044///
12045/// A builder for the *getAdminSdkConfig* method supported by a *project* resource.
12046/// It is not used directly, but through a [`ProjectMethods`] instance.
12047///
12048/// # Example
12049///
12050/// Instantiate a resource method builder
12051///
12052/// ```test_harness,no_run
12053/// # extern crate hyper;
12054/// # extern crate hyper_rustls;
12055/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12056/// # async fn dox() {
12057/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12058///
12059/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12060/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12061/// # .with_native_roots()
12062/// # .unwrap()
12063/// # .https_only()
12064/// # .enable_http2()
12065/// # .build();
12066///
12067/// # let executor = hyper_util::rt::TokioExecutor::new();
12068/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12069/// # secret,
12070/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12071/// # yup_oauth2::client::CustomHyperClientBuilder::from(
12072/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
12073/// # ),
12074/// # ).build().await.unwrap();
12075///
12076/// # let client = hyper_util::client::legacy::Client::builder(
12077/// # hyper_util::rt::TokioExecutor::new()
12078/// # )
12079/// # .build(
12080/// # hyper_rustls::HttpsConnectorBuilder::new()
12081/// # .with_native_roots()
12082/// # .unwrap()
12083/// # .https_or_http()
12084/// # .enable_http2()
12085/// # .build()
12086/// # );
12087/// # let mut hub = FirebaseManagement::new(client, auth);
12088/// // You can configure optional parameters by calling the respective setters at will, and
12089/// // execute the final call using `doit()`.
12090/// // Values shown here are possibly random and not representative !
12091/// let result = hub.projects().get_admin_sdk_config("name")
12092/// .doit().await;
12093/// # }
12094/// ```
12095pub struct ProjectGetAdminSdkConfigCall<'a, C>
12096where
12097 C: 'a,
12098{
12099 hub: &'a FirebaseManagement<C>,
12100 _name: String,
12101 _delegate: Option<&'a mut dyn common::Delegate>,
12102 _additional_params: HashMap<String, String>,
12103 _scopes: BTreeSet<String>,
12104}
12105
12106impl<'a, C> common::CallBuilder for ProjectGetAdminSdkConfigCall<'a, C> {}
12107
12108impl<'a, C> ProjectGetAdminSdkConfigCall<'a, C>
12109where
12110 C: common::Connector,
12111{
12112 /// Perform the operation you have build so far.
12113 pub async fn doit(mut self) -> common::Result<(common::Response, AdminSdkConfig)> {
12114 use std::borrow::Cow;
12115 use std::io::{Read, Seek};
12116
12117 use common::{url::Params, ToParts};
12118 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12119
12120 let mut dd = common::DefaultDelegate;
12121 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12122 dlg.begin(common::MethodInfo {
12123 id: "firebase.projects.getAdminSdkConfig",
12124 http_method: hyper::Method::GET,
12125 });
12126
12127 for &field in ["alt", "name"].iter() {
12128 if self._additional_params.contains_key(field) {
12129 dlg.finished(false);
12130 return Err(common::Error::FieldClash(field));
12131 }
12132 }
12133
12134 let mut params = Params::with_capacity(3 + self._additional_params.len());
12135 params.push("name", self._name);
12136
12137 params.extend(self._additional_params.iter());
12138
12139 params.push("alt", "json");
12140 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
12141 if self._scopes.is_empty() {
12142 self._scopes.insert(Scope::Readonly.as_ref().to_string());
12143 }
12144
12145 #[allow(clippy::single_element_loop)]
12146 for &(find_this, param_name) in [("{+name}", "name")].iter() {
12147 url = params.uri_replacement(url, param_name, find_this, true);
12148 }
12149 {
12150 let to_remove = ["name"];
12151 params.remove_params(&to_remove);
12152 }
12153
12154 let url = params.parse_with_url(&url);
12155
12156 loop {
12157 let token = match self
12158 .hub
12159 .auth
12160 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12161 .await
12162 {
12163 Ok(token) => token,
12164 Err(e) => match dlg.token(e) {
12165 Ok(token) => token,
12166 Err(e) => {
12167 dlg.finished(false);
12168 return Err(common::Error::MissingToken(e));
12169 }
12170 },
12171 };
12172 let mut req_result = {
12173 let client = &self.hub.client;
12174 dlg.pre_request();
12175 let mut req_builder = hyper::Request::builder()
12176 .method(hyper::Method::GET)
12177 .uri(url.as_str())
12178 .header(USER_AGENT, self.hub._user_agent.clone());
12179
12180 if let Some(token) = token.as_ref() {
12181 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12182 }
12183
12184 let request = req_builder
12185 .header(CONTENT_LENGTH, 0_u64)
12186 .body(common::to_body::<String>(None));
12187
12188 client.request(request.unwrap()).await
12189 };
12190
12191 match req_result {
12192 Err(err) => {
12193 if let common::Retry::After(d) = dlg.http_error(&err) {
12194 sleep(d).await;
12195 continue;
12196 }
12197 dlg.finished(false);
12198 return Err(common::Error::HttpError(err));
12199 }
12200 Ok(res) => {
12201 let (mut parts, body) = res.into_parts();
12202 let mut body = common::Body::new(body);
12203 if !parts.status.is_success() {
12204 let bytes = common::to_bytes(body).await.unwrap_or_default();
12205 let error = serde_json::from_str(&common::to_string(&bytes));
12206 let response = common::to_response(parts, bytes.into());
12207
12208 if let common::Retry::After(d) =
12209 dlg.http_failure(&response, error.as_ref().ok())
12210 {
12211 sleep(d).await;
12212 continue;
12213 }
12214
12215 dlg.finished(false);
12216
12217 return Err(match error {
12218 Ok(value) => common::Error::BadRequest(value),
12219 _ => common::Error::Failure(response),
12220 });
12221 }
12222 let response = {
12223 let bytes = common::to_bytes(body).await.unwrap_or_default();
12224 let encoded = common::to_string(&bytes);
12225 match serde_json::from_str(&encoded) {
12226 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12227 Err(error) => {
12228 dlg.response_json_decode_error(&encoded, &error);
12229 return Err(common::Error::JsonDecodeError(
12230 encoded.to_string(),
12231 error,
12232 ));
12233 }
12234 }
12235 };
12236
12237 dlg.finished(true);
12238 return Ok(response);
12239 }
12240 }
12241 }
12242 }
12243
12244 /// 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.
12245 ///
12246 /// Sets the *name* path property to the given value.
12247 ///
12248 /// Even though the property as already been set when instantiating this call,
12249 /// we provide this method for API completeness.
12250 pub fn name(mut self, new_value: &str) -> ProjectGetAdminSdkConfigCall<'a, C> {
12251 self._name = new_value.to_string();
12252 self
12253 }
12254 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12255 /// while executing the actual API request.
12256 ///
12257 /// ````text
12258 /// It should be used to handle progress information, and to implement a certain level of resilience.
12259 /// ````
12260 ///
12261 /// Sets the *delegate* property to the given value.
12262 pub fn delegate(
12263 mut self,
12264 new_value: &'a mut dyn common::Delegate,
12265 ) -> ProjectGetAdminSdkConfigCall<'a, C> {
12266 self._delegate = Some(new_value);
12267 self
12268 }
12269
12270 /// Set any additional parameter of the query string used in the request.
12271 /// It should be used to set parameters which are not yet available through their own
12272 /// setters.
12273 ///
12274 /// Please note that this method must not be used to set any of the known parameters
12275 /// which have their own setter method. If done anyway, the request will fail.
12276 ///
12277 /// # Additional Parameters
12278 ///
12279 /// * *$.xgafv* (query-string) - V1 error format.
12280 /// * *access_token* (query-string) - OAuth access token.
12281 /// * *alt* (query-string) - Data format for response.
12282 /// * *callback* (query-string) - JSONP
12283 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12284 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12285 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12286 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12287 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12288 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12289 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12290 pub fn param<T>(mut self, name: T, value: T) -> ProjectGetAdminSdkConfigCall<'a, C>
12291 where
12292 T: AsRef<str>,
12293 {
12294 self._additional_params
12295 .insert(name.as_ref().to_string(), value.as_ref().to_string());
12296 self
12297 }
12298
12299 /// Identifies the authorization scope for the method you are building.
12300 ///
12301 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12302 /// [`Scope::Readonly`].
12303 ///
12304 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12305 /// tokens for more than one scope.
12306 ///
12307 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12308 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12309 /// sufficient, a read-write scope will do as well.
12310 pub fn add_scope<St>(mut self, scope: St) -> ProjectGetAdminSdkConfigCall<'a, C>
12311 where
12312 St: AsRef<str>,
12313 {
12314 self._scopes.insert(String::from(scope.as_ref()));
12315 self
12316 }
12317 /// Identifies the authorization scope(s) for the method you are building.
12318 ///
12319 /// See [`Self::add_scope()`] for details.
12320 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectGetAdminSdkConfigCall<'a, C>
12321 where
12322 I: IntoIterator<Item = St>,
12323 St: AsRef<str>,
12324 {
12325 self._scopes
12326 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12327 self
12328 }
12329
12330 /// Removes all scopes, and no default scope will be used either.
12331 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12332 /// for details).
12333 pub fn clear_scopes(mut self) -> ProjectGetAdminSdkConfigCall<'a, C> {
12334 self._scopes.clear();
12335 self
12336 }
12337}
12338
12339/// 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`.
12340///
12341/// A builder for the *getAnalyticsDetails* method supported by a *project* resource.
12342/// It is not used directly, but through a [`ProjectMethods`] instance.
12343///
12344/// # Example
12345///
12346/// Instantiate a resource method builder
12347///
12348/// ```test_harness,no_run
12349/// # extern crate hyper;
12350/// # extern crate hyper_rustls;
12351/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12352/// # async fn dox() {
12353/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12354///
12355/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12356/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12357/// # .with_native_roots()
12358/// # .unwrap()
12359/// # .https_only()
12360/// # .enable_http2()
12361/// # .build();
12362///
12363/// # let executor = hyper_util::rt::TokioExecutor::new();
12364/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12365/// # secret,
12366/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12367/// # yup_oauth2::client::CustomHyperClientBuilder::from(
12368/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
12369/// # ),
12370/// # ).build().await.unwrap();
12371///
12372/// # let client = hyper_util::client::legacy::Client::builder(
12373/// # hyper_util::rt::TokioExecutor::new()
12374/// # )
12375/// # .build(
12376/// # hyper_rustls::HttpsConnectorBuilder::new()
12377/// # .with_native_roots()
12378/// # .unwrap()
12379/// # .https_or_http()
12380/// # .enable_http2()
12381/// # .build()
12382/// # );
12383/// # let mut hub = FirebaseManagement::new(client, auth);
12384/// // You can configure optional parameters by calling the respective setters at will, and
12385/// // execute the final call using `doit()`.
12386/// // Values shown here are possibly random and not representative !
12387/// let result = hub.projects().get_analytics_details("name")
12388/// .doit().await;
12389/// # }
12390/// ```
12391pub struct ProjectGetAnalyticsDetailCall<'a, C>
12392where
12393 C: 'a,
12394{
12395 hub: &'a FirebaseManagement<C>,
12396 _name: String,
12397 _delegate: Option<&'a mut dyn common::Delegate>,
12398 _additional_params: HashMap<String, String>,
12399 _scopes: BTreeSet<String>,
12400}
12401
12402impl<'a, C> common::CallBuilder for ProjectGetAnalyticsDetailCall<'a, C> {}
12403
12404impl<'a, C> ProjectGetAnalyticsDetailCall<'a, C>
12405where
12406 C: common::Connector,
12407{
12408 /// Perform the operation you have build so far.
12409 pub async fn doit(mut self) -> common::Result<(common::Response, AnalyticsDetails)> {
12410 use std::borrow::Cow;
12411 use std::io::{Read, Seek};
12412
12413 use common::{url::Params, ToParts};
12414 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12415
12416 let mut dd = common::DefaultDelegate;
12417 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12418 dlg.begin(common::MethodInfo {
12419 id: "firebase.projects.getAnalyticsDetails",
12420 http_method: hyper::Method::GET,
12421 });
12422
12423 for &field in ["alt", "name"].iter() {
12424 if self._additional_params.contains_key(field) {
12425 dlg.finished(false);
12426 return Err(common::Error::FieldClash(field));
12427 }
12428 }
12429
12430 let mut params = Params::with_capacity(3 + self._additional_params.len());
12431 params.push("name", self._name);
12432
12433 params.extend(self._additional_params.iter());
12434
12435 params.push("alt", "json");
12436 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
12437 if self._scopes.is_empty() {
12438 self._scopes.insert(Scope::Readonly.as_ref().to_string());
12439 }
12440
12441 #[allow(clippy::single_element_loop)]
12442 for &(find_this, param_name) in [("{+name}", "name")].iter() {
12443 url = params.uri_replacement(url, param_name, find_this, true);
12444 }
12445 {
12446 let to_remove = ["name"];
12447 params.remove_params(&to_remove);
12448 }
12449
12450 let url = params.parse_with_url(&url);
12451
12452 loop {
12453 let token = match self
12454 .hub
12455 .auth
12456 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12457 .await
12458 {
12459 Ok(token) => token,
12460 Err(e) => match dlg.token(e) {
12461 Ok(token) => token,
12462 Err(e) => {
12463 dlg.finished(false);
12464 return Err(common::Error::MissingToken(e));
12465 }
12466 },
12467 };
12468 let mut req_result = {
12469 let client = &self.hub.client;
12470 dlg.pre_request();
12471 let mut req_builder = hyper::Request::builder()
12472 .method(hyper::Method::GET)
12473 .uri(url.as_str())
12474 .header(USER_AGENT, self.hub._user_agent.clone());
12475
12476 if let Some(token) = token.as_ref() {
12477 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12478 }
12479
12480 let request = req_builder
12481 .header(CONTENT_LENGTH, 0_u64)
12482 .body(common::to_body::<String>(None));
12483
12484 client.request(request.unwrap()).await
12485 };
12486
12487 match req_result {
12488 Err(err) => {
12489 if let common::Retry::After(d) = dlg.http_error(&err) {
12490 sleep(d).await;
12491 continue;
12492 }
12493 dlg.finished(false);
12494 return Err(common::Error::HttpError(err));
12495 }
12496 Ok(res) => {
12497 let (mut parts, body) = res.into_parts();
12498 let mut body = common::Body::new(body);
12499 if !parts.status.is_success() {
12500 let bytes = common::to_bytes(body).await.unwrap_or_default();
12501 let error = serde_json::from_str(&common::to_string(&bytes));
12502 let response = common::to_response(parts, bytes.into());
12503
12504 if let common::Retry::After(d) =
12505 dlg.http_failure(&response, error.as_ref().ok())
12506 {
12507 sleep(d).await;
12508 continue;
12509 }
12510
12511 dlg.finished(false);
12512
12513 return Err(match error {
12514 Ok(value) => common::Error::BadRequest(value),
12515 _ => common::Error::Failure(response),
12516 });
12517 }
12518 let response = {
12519 let bytes = common::to_bytes(body).await.unwrap_or_default();
12520 let encoded = common::to_string(&bytes);
12521 match serde_json::from_str(&encoded) {
12522 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12523 Err(error) => {
12524 dlg.response_json_decode_error(&encoded, &error);
12525 return Err(common::Error::JsonDecodeError(
12526 encoded.to_string(),
12527 error,
12528 ));
12529 }
12530 }
12531 };
12532
12533 dlg.finished(true);
12534 return Ok(response);
12535 }
12536 }
12537 }
12538 }
12539
12540 /// 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.
12541 ///
12542 /// Sets the *name* path property to the given value.
12543 ///
12544 /// Even though the property as already been set when instantiating this call,
12545 /// we provide this method for API completeness.
12546 pub fn name(mut self, new_value: &str) -> ProjectGetAnalyticsDetailCall<'a, C> {
12547 self._name = new_value.to_string();
12548 self
12549 }
12550 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12551 /// while executing the actual API request.
12552 ///
12553 /// ````text
12554 /// It should be used to handle progress information, and to implement a certain level of resilience.
12555 /// ````
12556 ///
12557 /// Sets the *delegate* property to the given value.
12558 pub fn delegate(
12559 mut self,
12560 new_value: &'a mut dyn common::Delegate,
12561 ) -> ProjectGetAnalyticsDetailCall<'a, C> {
12562 self._delegate = Some(new_value);
12563 self
12564 }
12565
12566 /// Set any additional parameter of the query string used in the request.
12567 /// It should be used to set parameters which are not yet available through their own
12568 /// setters.
12569 ///
12570 /// Please note that this method must not be used to set any of the known parameters
12571 /// which have their own setter method. If done anyway, the request will fail.
12572 ///
12573 /// # Additional Parameters
12574 ///
12575 /// * *$.xgafv* (query-string) - V1 error format.
12576 /// * *access_token* (query-string) - OAuth access token.
12577 /// * *alt* (query-string) - Data format for response.
12578 /// * *callback* (query-string) - JSONP
12579 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12580 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12581 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12582 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12583 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12584 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12585 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12586 pub fn param<T>(mut self, name: T, value: T) -> ProjectGetAnalyticsDetailCall<'a, C>
12587 where
12588 T: AsRef<str>,
12589 {
12590 self._additional_params
12591 .insert(name.as_ref().to_string(), value.as_ref().to_string());
12592 self
12593 }
12594
12595 /// Identifies the authorization scope for the method you are building.
12596 ///
12597 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12598 /// [`Scope::Readonly`].
12599 ///
12600 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12601 /// tokens for more than one scope.
12602 ///
12603 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12604 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12605 /// sufficient, a read-write scope will do as well.
12606 pub fn add_scope<St>(mut self, scope: St) -> ProjectGetAnalyticsDetailCall<'a, C>
12607 where
12608 St: AsRef<str>,
12609 {
12610 self._scopes.insert(String::from(scope.as_ref()));
12611 self
12612 }
12613 /// Identifies the authorization scope(s) for the method you are building.
12614 ///
12615 /// See [`Self::add_scope()`] for details.
12616 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectGetAnalyticsDetailCall<'a, C>
12617 where
12618 I: IntoIterator<Item = St>,
12619 St: AsRef<str>,
12620 {
12621 self._scopes
12622 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12623 self
12624 }
12625
12626 /// Removes all scopes, and no default scope will be used either.
12627 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12628 /// for details).
12629 pub fn clear_scopes(mut self) -> ProjectGetAnalyticsDetailCall<'a, C> {
12630 self._scopes.clear();
12631 self
12632 }
12633}
12634
12635/// 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.
12636///
12637/// A builder for the *list* method supported by a *project* resource.
12638/// It is not used directly, but through a [`ProjectMethods`] instance.
12639///
12640/// # Example
12641///
12642/// Instantiate a resource method builder
12643///
12644/// ```test_harness,no_run
12645/// # extern crate hyper;
12646/// # extern crate hyper_rustls;
12647/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12648/// # async fn dox() {
12649/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12650///
12651/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12652/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12653/// # .with_native_roots()
12654/// # .unwrap()
12655/// # .https_only()
12656/// # .enable_http2()
12657/// # .build();
12658///
12659/// # let executor = hyper_util::rt::TokioExecutor::new();
12660/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12661/// # secret,
12662/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12663/// # yup_oauth2::client::CustomHyperClientBuilder::from(
12664/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
12665/// # ),
12666/// # ).build().await.unwrap();
12667///
12668/// # let client = hyper_util::client::legacy::Client::builder(
12669/// # hyper_util::rt::TokioExecutor::new()
12670/// # )
12671/// # .build(
12672/// # hyper_rustls::HttpsConnectorBuilder::new()
12673/// # .with_native_roots()
12674/// # .unwrap()
12675/// # .https_or_http()
12676/// # .enable_http2()
12677/// # .build()
12678/// # );
12679/// # let mut hub = FirebaseManagement::new(client, auth);
12680/// // You can configure optional parameters by calling the respective setters at will, and
12681/// // execute the final call using `doit()`.
12682/// // Values shown here are possibly random and not representative !
12683/// let result = hub.projects().list()
12684/// .show_deleted(false)
12685/// .page_token("duo")
12686/// .page_size(-34)
12687/// .doit().await;
12688/// # }
12689/// ```
12690pub struct ProjectListCall<'a, C>
12691where
12692 C: 'a,
12693{
12694 hub: &'a FirebaseManagement<C>,
12695 _show_deleted: Option<bool>,
12696 _page_token: Option<String>,
12697 _page_size: Option<i32>,
12698 _delegate: Option<&'a mut dyn common::Delegate>,
12699 _additional_params: HashMap<String, String>,
12700 _scopes: BTreeSet<String>,
12701}
12702
12703impl<'a, C> common::CallBuilder for ProjectListCall<'a, C> {}
12704
12705impl<'a, C> ProjectListCall<'a, C>
12706where
12707 C: common::Connector,
12708{
12709 /// Perform the operation you have build so far.
12710 pub async fn doit(
12711 mut self,
12712 ) -> common::Result<(common::Response, ListFirebaseProjectsResponse)> {
12713 use std::borrow::Cow;
12714 use std::io::{Read, Seek};
12715
12716 use common::{url::Params, ToParts};
12717 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12718
12719 let mut dd = common::DefaultDelegate;
12720 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12721 dlg.begin(common::MethodInfo {
12722 id: "firebase.projects.list",
12723 http_method: hyper::Method::GET,
12724 });
12725
12726 for &field in ["alt", "showDeleted", "pageToken", "pageSize"].iter() {
12727 if self._additional_params.contains_key(field) {
12728 dlg.finished(false);
12729 return Err(common::Error::FieldClash(field));
12730 }
12731 }
12732
12733 let mut params = Params::with_capacity(5 + self._additional_params.len());
12734 if let Some(value) = self._show_deleted.as_ref() {
12735 params.push("showDeleted", value.to_string());
12736 }
12737 if let Some(value) = self._page_token.as_ref() {
12738 params.push("pageToken", value);
12739 }
12740 if let Some(value) = self._page_size.as_ref() {
12741 params.push("pageSize", value.to_string());
12742 }
12743
12744 params.extend(self._additional_params.iter());
12745
12746 params.push("alt", "json");
12747 let mut url = self.hub._base_url.clone() + "v1beta1/projects";
12748 if self._scopes.is_empty() {
12749 self._scopes.insert(Scope::Readonly.as_ref().to_string());
12750 }
12751
12752 let url = params.parse_with_url(&url);
12753
12754 loop {
12755 let token = match self
12756 .hub
12757 .auth
12758 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12759 .await
12760 {
12761 Ok(token) => token,
12762 Err(e) => match dlg.token(e) {
12763 Ok(token) => token,
12764 Err(e) => {
12765 dlg.finished(false);
12766 return Err(common::Error::MissingToken(e));
12767 }
12768 },
12769 };
12770 let mut req_result = {
12771 let client = &self.hub.client;
12772 dlg.pre_request();
12773 let mut req_builder = hyper::Request::builder()
12774 .method(hyper::Method::GET)
12775 .uri(url.as_str())
12776 .header(USER_AGENT, self.hub._user_agent.clone());
12777
12778 if let Some(token) = token.as_ref() {
12779 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12780 }
12781
12782 let request = req_builder
12783 .header(CONTENT_LENGTH, 0_u64)
12784 .body(common::to_body::<String>(None));
12785
12786 client.request(request.unwrap()).await
12787 };
12788
12789 match req_result {
12790 Err(err) => {
12791 if let common::Retry::After(d) = dlg.http_error(&err) {
12792 sleep(d).await;
12793 continue;
12794 }
12795 dlg.finished(false);
12796 return Err(common::Error::HttpError(err));
12797 }
12798 Ok(res) => {
12799 let (mut parts, body) = res.into_parts();
12800 let mut body = common::Body::new(body);
12801 if !parts.status.is_success() {
12802 let bytes = common::to_bytes(body).await.unwrap_or_default();
12803 let error = serde_json::from_str(&common::to_string(&bytes));
12804 let response = common::to_response(parts, bytes.into());
12805
12806 if let common::Retry::After(d) =
12807 dlg.http_failure(&response, error.as_ref().ok())
12808 {
12809 sleep(d).await;
12810 continue;
12811 }
12812
12813 dlg.finished(false);
12814
12815 return Err(match error {
12816 Ok(value) => common::Error::BadRequest(value),
12817 _ => common::Error::Failure(response),
12818 });
12819 }
12820 let response = {
12821 let bytes = common::to_bytes(body).await.unwrap_or_default();
12822 let encoded = common::to_string(&bytes);
12823 match serde_json::from_str(&encoded) {
12824 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12825 Err(error) => {
12826 dlg.response_json_decode_error(&encoded, &error);
12827 return Err(common::Error::JsonDecodeError(
12828 encoded.to_string(),
12829 error,
12830 ));
12831 }
12832 }
12833 };
12834
12835 dlg.finished(true);
12836 return Ok(response);
12837 }
12838 }
12839 }
12840 }
12841
12842 /// Optional. Controls whether Projects in the DELETED state should be returned in the response. If not specified, only `ACTIVE` Projects will be returned.
12843 ///
12844 /// Sets the *show deleted* query property to the given value.
12845 pub fn show_deleted(mut self, new_value: bool) -> ProjectListCall<'a, C> {
12846 self._show_deleted = Some(new_value);
12847 self
12848 }
12849 /// Token returned from a previous call to `ListFirebaseProjects` indicating where in the set of Projects to resume listing.
12850 ///
12851 /// Sets the *page token* query property to the given value.
12852 pub fn page_token(mut self, new_value: &str) -> ProjectListCall<'a, C> {
12853 self._page_token = Some(new_value.to_string());
12854 self
12855 }
12856 /// 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.
12857 ///
12858 /// Sets the *page size* query property to the given value.
12859 pub fn page_size(mut self, new_value: i32) -> ProjectListCall<'a, C> {
12860 self._page_size = Some(new_value);
12861 self
12862 }
12863 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12864 /// while executing the actual API request.
12865 ///
12866 /// ````text
12867 /// It should be used to handle progress information, and to implement a certain level of resilience.
12868 /// ````
12869 ///
12870 /// Sets the *delegate* property to the given value.
12871 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ProjectListCall<'a, C> {
12872 self._delegate = Some(new_value);
12873 self
12874 }
12875
12876 /// Set any additional parameter of the query string used in the request.
12877 /// It should be used to set parameters which are not yet available through their own
12878 /// setters.
12879 ///
12880 /// Please note that this method must not be used to set any of the known parameters
12881 /// which have their own setter method. If done anyway, the request will fail.
12882 ///
12883 /// # Additional Parameters
12884 ///
12885 /// * *$.xgafv* (query-string) - V1 error format.
12886 /// * *access_token* (query-string) - OAuth access token.
12887 /// * *alt* (query-string) - Data format for response.
12888 /// * *callback* (query-string) - JSONP
12889 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12890 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
12891 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12892 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12893 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
12894 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12895 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12896 pub fn param<T>(mut self, name: T, value: T) -> ProjectListCall<'a, C>
12897 where
12898 T: AsRef<str>,
12899 {
12900 self._additional_params
12901 .insert(name.as_ref().to_string(), value.as_ref().to_string());
12902 self
12903 }
12904
12905 /// Identifies the authorization scope for the method you are building.
12906 ///
12907 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12908 /// [`Scope::Readonly`].
12909 ///
12910 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12911 /// tokens for more than one scope.
12912 ///
12913 /// Usually there is more than one suitable scope to authorize an operation, some of which may
12914 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12915 /// sufficient, a read-write scope will do as well.
12916 pub fn add_scope<St>(mut self, scope: St) -> ProjectListCall<'a, C>
12917 where
12918 St: AsRef<str>,
12919 {
12920 self._scopes.insert(String::from(scope.as_ref()));
12921 self
12922 }
12923 /// Identifies the authorization scope(s) for the method you are building.
12924 ///
12925 /// See [`Self::add_scope()`] for details.
12926 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectListCall<'a, C>
12927 where
12928 I: IntoIterator<Item = St>,
12929 St: AsRef<str>,
12930 {
12931 self._scopes
12932 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12933 self
12934 }
12935
12936 /// Removes all scopes, and no default scope will be used either.
12937 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12938 /// for details).
12939 pub fn clear_scopes(mut self) -> ProjectListCall<'a, C> {
12940 self._scopes.clear();
12941 self
12942 }
12943}
12944
12945/// Updates the attributes of the specified FirebaseProject. All [query parameters](#query-parameters) are required.
12946///
12947/// A builder for the *patch* method supported by a *project* resource.
12948/// It is not used directly, but through a [`ProjectMethods`] instance.
12949///
12950/// # Example
12951///
12952/// Instantiate a resource method builder
12953///
12954/// ```test_harness,no_run
12955/// # extern crate hyper;
12956/// # extern crate hyper_rustls;
12957/// # extern crate google_firebase1_beta1 as firebase1_beta1;
12958/// use firebase1_beta1::api::FirebaseProject;
12959/// # async fn dox() {
12960/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12961///
12962/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12963/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12964/// # .with_native_roots()
12965/// # .unwrap()
12966/// # .https_only()
12967/// # .enable_http2()
12968/// # .build();
12969///
12970/// # let executor = hyper_util::rt::TokioExecutor::new();
12971/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12972/// # secret,
12973/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12974/// # yup_oauth2::client::CustomHyperClientBuilder::from(
12975/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
12976/// # ),
12977/// # ).build().await.unwrap();
12978///
12979/// # let client = hyper_util::client::legacy::Client::builder(
12980/// # hyper_util::rt::TokioExecutor::new()
12981/// # )
12982/// # .build(
12983/// # hyper_rustls::HttpsConnectorBuilder::new()
12984/// # .with_native_roots()
12985/// # .unwrap()
12986/// # .https_or_http()
12987/// # .enable_http2()
12988/// # .build()
12989/// # );
12990/// # let mut hub = FirebaseManagement::new(client, auth);
12991/// // As the method needs a request, you would usually fill it with the desired information
12992/// // into the respective structure. Some of the parts shown here might not be applicable !
12993/// // Values shown here are possibly random and not representative !
12994/// let mut req = FirebaseProject::default();
12995///
12996/// // You can configure optional parameters by calling the respective setters at will, and
12997/// // execute the final call using `doit()`.
12998/// // Values shown here are possibly random and not representative !
12999/// let result = hub.projects().patch(req, "name")
13000/// .update_mask(FieldMask::new::<&str>(&[]))
13001/// .doit().await;
13002/// # }
13003/// ```
13004pub struct ProjectPatchCall<'a, C>
13005where
13006 C: 'a,
13007{
13008 hub: &'a FirebaseManagement<C>,
13009 _request: FirebaseProject,
13010 _name: String,
13011 _update_mask: Option<common::FieldMask>,
13012 _delegate: Option<&'a mut dyn common::Delegate>,
13013 _additional_params: HashMap<String, String>,
13014 _scopes: BTreeSet<String>,
13015}
13016
13017impl<'a, C> common::CallBuilder for ProjectPatchCall<'a, C> {}
13018
13019impl<'a, C> ProjectPatchCall<'a, C>
13020where
13021 C: common::Connector,
13022{
13023 /// Perform the operation you have build so far.
13024 pub async fn doit(mut self) -> common::Result<(common::Response, FirebaseProject)> {
13025 use std::borrow::Cow;
13026 use std::io::{Read, Seek};
13027
13028 use common::{url::Params, ToParts};
13029 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
13030
13031 let mut dd = common::DefaultDelegate;
13032 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
13033 dlg.begin(common::MethodInfo {
13034 id: "firebase.projects.patch",
13035 http_method: hyper::Method::PATCH,
13036 });
13037
13038 for &field in ["alt", "name", "updateMask"].iter() {
13039 if self._additional_params.contains_key(field) {
13040 dlg.finished(false);
13041 return Err(common::Error::FieldClash(field));
13042 }
13043 }
13044
13045 let mut params = Params::with_capacity(5 + self._additional_params.len());
13046 params.push("name", self._name);
13047 if let Some(value) = self._update_mask.as_ref() {
13048 params.push("updateMask", value.to_string());
13049 }
13050
13051 params.extend(self._additional_params.iter());
13052
13053 params.push("alt", "json");
13054 let mut url = self.hub._base_url.clone() + "v1beta1/{+name}";
13055 if self._scopes.is_empty() {
13056 self._scopes
13057 .insert(Scope::CloudPlatform.as_ref().to_string());
13058 }
13059
13060 #[allow(clippy::single_element_loop)]
13061 for &(find_this, param_name) in [("{+name}", "name")].iter() {
13062 url = params.uri_replacement(url, param_name, find_this, true);
13063 }
13064 {
13065 let to_remove = ["name"];
13066 params.remove_params(&to_remove);
13067 }
13068
13069 let url = params.parse_with_url(&url);
13070
13071 let mut json_mime_type = mime::APPLICATION_JSON;
13072 let mut request_value_reader = {
13073 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
13074 common::remove_json_null_values(&mut value);
13075 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
13076 serde_json::to_writer(&mut dst, &value).unwrap();
13077 dst
13078 };
13079 let request_size = request_value_reader
13080 .seek(std::io::SeekFrom::End(0))
13081 .unwrap();
13082 request_value_reader
13083 .seek(std::io::SeekFrom::Start(0))
13084 .unwrap();
13085
13086 loop {
13087 let token = match self
13088 .hub
13089 .auth
13090 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13091 .await
13092 {
13093 Ok(token) => token,
13094 Err(e) => match dlg.token(e) {
13095 Ok(token) => token,
13096 Err(e) => {
13097 dlg.finished(false);
13098 return Err(common::Error::MissingToken(e));
13099 }
13100 },
13101 };
13102 request_value_reader
13103 .seek(std::io::SeekFrom::Start(0))
13104 .unwrap();
13105 let mut req_result = {
13106 let client = &self.hub.client;
13107 dlg.pre_request();
13108 let mut req_builder = hyper::Request::builder()
13109 .method(hyper::Method::PATCH)
13110 .uri(url.as_str())
13111 .header(USER_AGENT, self.hub._user_agent.clone());
13112
13113 if let Some(token) = token.as_ref() {
13114 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13115 }
13116
13117 let request = req_builder
13118 .header(CONTENT_TYPE, json_mime_type.to_string())
13119 .header(CONTENT_LENGTH, request_size as u64)
13120 .body(common::to_body(
13121 request_value_reader.get_ref().clone().into(),
13122 ));
13123
13124 client.request(request.unwrap()).await
13125 };
13126
13127 match req_result {
13128 Err(err) => {
13129 if let common::Retry::After(d) = dlg.http_error(&err) {
13130 sleep(d).await;
13131 continue;
13132 }
13133 dlg.finished(false);
13134 return Err(common::Error::HttpError(err));
13135 }
13136 Ok(res) => {
13137 let (mut parts, body) = res.into_parts();
13138 let mut body = common::Body::new(body);
13139 if !parts.status.is_success() {
13140 let bytes = common::to_bytes(body).await.unwrap_or_default();
13141 let error = serde_json::from_str(&common::to_string(&bytes));
13142 let response = common::to_response(parts, bytes.into());
13143
13144 if let common::Retry::After(d) =
13145 dlg.http_failure(&response, error.as_ref().ok())
13146 {
13147 sleep(d).await;
13148 continue;
13149 }
13150
13151 dlg.finished(false);
13152
13153 return Err(match error {
13154 Ok(value) => common::Error::BadRequest(value),
13155 _ => common::Error::Failure(response),
13156 });
13157 }
13158 let response = {
13159 let bytes = common::to_bytes(body).await.unwrap_or_default();
13160 let encoded = common::to_string(&bytes);
13161 match serde_json::from_str(&encoded) {
13162 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13163 Err(error) => {
13164 dlg.response_json_decode_error(&encoded, &error);
13165 return Err(common::Error::JsonDecodeError(
13166 encoded.to_string(),
13167 error,
13168 ));
13169 }
13170 }
13171 };
13172
13173 dlg.finished(true);
13174 return Ok(response);
13175 }
13176 }
13177 }
13178 }
13179
13180 ///
13181 /// Sets the *request* property to the given value.
13182 ///
13183 /// Even though the property as already been set when instantiating this call,
13184 /// we provide this method for API completeness.
13185 pub fn request(mut self, new_value: FirebaseProject) -> ProjectPatchCall<'a, C> {
13186 self._request = new_value;
13187 self
13188 }
13189 /// 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`.
13190 ///
13191 /// Sets the *name* path property to the given value.
13192 ///
13193 /// Even though the property as already been set when instantiating this call,
13194 /// we provide this method for API completeness.
13195 pub fn name(mut self, new_value: &str) -> ProjectPatchCall<'a, C> {
13196 self._name = new_value.to_string();
13197 self
13198 }
13199 /// 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)
13200 ///
13201 /// Sets the *update mask* query property to the given value.
13202 pub fn update_mask(mut self, new_value: common::FieldMask) -> ProjectPatchCall<'a, C> {
13203 self._update_mask = Some(new_value);
13204 self
13205 }
13206 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13207 /// while executing the actual API request.
13208 ///
13209 /// ````text
13210 /// It should be used to handle progress information, and to implement a certain level of resilience.
13211 /// ````
13212 ///
13213 /// Sets the *delegate* property to the given value.
13214 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ProjectPatchCall<'a, C> {
13215 self._delegate = Some(new_value);
13216 self
13217 }
13218
13219 /// Set any additional parameter of the query string used in the request.
13220 /// It should be used to set parameters which are not yet available through their own
13221 /// setters.
13222 ///
13223 /// Please note that this method must not be used to set any of the known parameters
13224 /// which have their own setter method. If done anyway, the request will fail.
13225 ///
13226 /// # Additional Parameters
13227 ///
13228 /// * *$.xgafv* (query-string) - V1 error format.
13229 /// * *access_token* (query-string) - OAuth access token.
13230 /// * *alt* (query-string) - Data format for response.
13231 /// * *callback* (query-string) - JSONP
13232 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13233 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13234 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13235 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13236 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13237 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13238 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13239 pub fn param<T>(mut self, name: T, value: T) -> ProjectPatchCall<'a, C>
13240 where
13241 T: AsRef<str>,
13242 {
13243 self._additional_params
13244 .insert(name.as_ref().to_string(), value.as_ref().to_string());
13245 self
13246 }
13247
13248 /// Identifies the authorization scope for the method you are building.
13249 ///
13250 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13251 /// [`Scope::CloudPlatform`].
13252 ///
13253 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13254 /// tokens for more than one scope.
13255 ///
13256 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13257 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13258 /// sufficient, a read-write scope will do as well.
13259 pub fn add_scope<St>(mut self, scope: St) -> ProjectPatchCall<'a, C>
13260 where
13261 St: AsRef<str>,
13262 {
13263 self._scopes.insert(String::from(scope.as_ref()));
13264 self
13265 }
13266 /// Identifies the authorization scope(s) for the method you are building.
13267 ///
13268 /// See [`Self::add_scope()`] for details.
13269 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectPatchCall<'a, C>
13270 where
13271 I: IntoIterator<Item = St>,
13272 St: AsRef<str>,
13273 {
13274 self._scopes
13275 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13276 self
13277 }
13278
13279 /// Removes all scopes, and no default scope will be used either.
13280 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13281 /// for details).
13282 pub fn clear_scopes(mut self) -> ProjectPatchCall<'a, C> {
13283 self._scopes.clear();
13284 self
13285 }
13286}
13287
13288/// 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`.
13289///
13290/// A builder for the *removeAnalytics* method supported by a *project* resource.
13291/// It is not used directly, but through a [`ProjectMethods`] instance.
13292///
13293/// # Example
13294///
13295/// Instantiate a resource method builder
13296///
13297/// ```test_harness,no_run
13298/// # extern crate hyper;
13299/// # extern crate hyper_rustls;
13300/// # extern crate google_firebase1_beta1 as firebase1_beta1;
13301/// use firebase1_beta1::api::RemoveAnalyticsRequest;
13302/// # async fn dox() {
13303/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
13304///
13305/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
13306/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
13307/// # .with_native_roots()
13308/// # .unwrap()
13309/// # .https_only()
13310/// # .enable_http2()
13311/// # .build();
13312///
13313/// # let executor = hyper_util::rt::TokioExecutor::new();
13314/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
13315/// # secret,
13316/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13317/// # yup_oauth2::client::CustomHyperClientBuilder::from(
13318/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
13319/// # ),
13320/// # ).build().await.unwrap();
13321///
13322/// # let client = hyper_util::client::legacy::Client::builder(
13323/// # hyper_util::rt::TokioExecutor::new()
13324/// # )
13325/// # .build(
13326/// # hyper_rustls::HttpsConnectorBuilder::new()
13327/// # .with_native_roots()
13328/// # .unwrap()
13329/// # .https_or_http()
13330/// # .enable_http2()
13331/// # .build()
13332/// # );
13333/// # let mut hub = FirebaseManagement::new(client, auth);
13334/// // As the method needs a request, you would usually fill it with the desired information
13335/// // into the respective structure. Some of the parts shown here might not be applicable !
13336/// // Values shown here are possibly random and not representative !
13337/// let mut req = RemoveAnalyticsRequest::default();
13338///
13339/// // You can configure optional parameters by calling the respective setters at will, and
13340/// // execute the final call using `doit()`.
13341/// // Values shown here are possibly random and not representative !
13342/// let result = hub.projects().remove_analytics(req, "parent")
13343/// .doit().await;
13344/// # }
13345/// ```
13346pub struct ProjectRemoveAnalyticCall<'a, C>
13347where
13348 C: 'a,
13349{
13350 hub: &'a FirebaseManagement<C>,
13351 _request: RemoveAnalyticsRequest,
13352 _parent: String,
13353 _delegate: Option<&'a mut dyn common::Delegate>,
13354 _additional_params: HashMap<String, String>,
13355 _scopes: BTreeSet<String>,
13356}
13357
13358impl<'a, C> common::CallBuilder for ProjectRemoveAnalyticCall<'a, C> {}
13359
13360impl<'a, C> ProjectRemoveAnalyticCall<'a, C>
13361where
13362 C: common::Connector,
13363{
13364 /// Perform the operation you have build so far.
13365 pub async fn doit(mut self) -> common::Result<(common::Response, Empty)> {
13366 use std::borrow::Cow;
13367 use std::io::{Read, Seek};
13368
13369 use common::{url::Params, ToParts};
13370 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
13371
13372 let mut dd = common::DefaultDelegate;
13373 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
13374 dlg.begin(common::MethodInfo {
13375 id: "firebase.projects.removeAnalytics",
13376 http_method: hyper::Method::POST,
13377 });
13378
13379 for &field in ["alt", "parent"].iter() {
13380 if self._additional_params.contains_key(field) {
13381 dlg.finished(false);
13382 return Err(common::Error::FieldClash(field));
13383 }
13384 }
13385
13386 let mut params = Params::with_capacity(4 + self._additional_params.len());
13387 params.push("parent", self._parent);
13388
13389 params.extend(self._additional_params.iter());
13390
13391 params.push("alt", "json");
13392 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:removeAnalytics";
13393 if self._scopes.is_empty() {
13394 self._scopes
13395 .insert(Scope::CloudPlatform.as_ref().to_string());
13396 }
13397
13398 #[allow(clippy::single_element_loop)]
13399 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
13400 url = params.uri_replacement(url, param_name, find_this, true);
13401 }
13402 {
13403 let to_remove = ["parent"];
13404 params.remove_params(&to_remove);
13405 }
13406
13407 let url = params.parse_with_url(&url);
13408
13409 let mut json_mime_type = mime::APPLICATION_JSON;
13410 let mut request_value_reader = {
13411 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
13412 common::remove_json_null_values(&mut value);
13413 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
13414 serde_json::to_writer(&mut dst, &value).unwrap();
13415 dst
13416 };
13417 let request_size = request_value_reader
13418 .seek(std::io::SeekFrom::End(0))
13419 .unwrap();
13420 request_value_reader
13421 .seek(std::io::SeekFrom::Start(0))
13422 .unwrap();
13423
13424 loop {
13425 let token = match self
13426 .hub
13427 .auth
13428 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13429 .await
13430 {
13431 Ok(token) => token,
13432 Err(e) => match dlg.token(e) {
13433 Ok(token) => token,
13434 Err(e) => {
13435 dlg.finished(false);
13436 return Err(common::Error::MissingToken(e));
13437 }
13438 },
13439 };
13440 request_value_reader
13441 .seek(std::io::SeekFrom::Start(0))
13442 .unwrap();
13443 let mut req_result = {
13444 let client = &self.hub.client;
13445 dlg.pre_request();
13446 let mut req_builder = hyper::Request::builder()
13447 .method(hyper::Method::POST)
13448 .uri(url.as_str())
13449 .header(USER_AGENT, self.hub._user_agent.clone());
13450
13451 if let Some(token) = token.as_ref() {
13452 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13453 }
13454
13455 let request = req_builder
13456 .header(CONTENT_TYPE, json_mime_type.to_string())
13457 .header(CONTENT_LENGTH, request_size as u64)
13458 .body(common::to_body(
13459 request_value_reader.get_ref().clone().into(),
13460 ));
13461
13462 client.request(request.unwrap()).await
13463 };
13464
13465 match req_result {
13466 Err(err) => {
13467 if let common::Retry::After(d) = dlg.http_error(&err) {
13468 sleep(d).await;
13469 continue;
13470 }
13471 dlg.finished(false);
13472 return Err(common::Error::HttpError(err));
13473 }
13474 Ok(res) => {
13475 let (mut parts, body) = res.into_parts();
13476 let mut body = common::Body::new(body);
13477 if !parts.status.is_success() {
13478 let bytes = common::to_bytes(body).await.unwrap_or_default();
13479 let error = serde_json::from_str(&common::to_string(&bytes));
13480 let response = common::to_response(parts, bytes.into());
13481
13482 if let common::Retry::After(d) =
13483 dlg.http_failure(&response, error.as_ref().ok())
13484 {
13485 sleep(d).await;
13486 continue;
13487 }
13488
13489 dlg.finished(false);
13490
13491 return Err(match error {
13492 Ok(value) => common::Error::BadRequest(value),
13493 _ => common::Error::Failure(response),
13494 });
13495 }
13496 let response = {
13497 let bytes = common::to_bytes(body).await.unwrap_or_default();
13498 let encoded = common::to_string(&bytes);
13499 match serde_json::from_str(&encoded) {
13500 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13501 Err(error) => {
13502 dlg.response_json_decode_error(&encoded, &error);
13503 return Err(common::Error::JsonDecodeError(
13504 encoded.to_string(),
13505 error,
13506 ));
13507 }
13508 }
13509 };
13510
13511 dlg.finished(true);
13512 return Ok(response);
13513 }
13514 }
13515 }
13516 }
13517
13518 ///
13519 /// Sets the *request* property to the given value.
13520 ///
13521 /// Even though the property as already been set when instantiating this call,
13522 /// we provide this method for API completeness.
13523 pub fn request(
13524 mut self,
13525 new_value: RemoveAnalyticsRequest,
13526 ) -> ProjectRemoveAnalyticCall<'a, C> {
13527 self._request = new_value;
13528 self
13529 }
13530 /// 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.
13531 ///
13532 /// Sets the *parent* path property to the given value.
13533 ///
13534 /// Even though the property as already been set when instantiating this call,
13535 /// we provide this method for API completeness.
13536 pub fn parent(mut self, new_value: &str) -> ProjectRemoveAnalyticCall<'a, C> {
13537 self._parent = new_value.to_string();
13538 self
13539 }
13540 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13541 /// while executing the actual API request.
13542 ///
13543 /// ````text
13544 /// It should be used to handle progress information, and to implement a certain level of resilience.
13545 /// ````
13546 ///
13547 /// Sets the *delegate* property to the given value.
13548 pub fn delegate(
13549 mut self,
13550 new_value: &'a mut dyn common::Delegate,
13551 ) -> ProjectRemoveAnalyticCall<'a, C> {
13552 self._delegate = Some(new_value);
13553 self
13554 }
13555
13556 /// Set any additional parameter of the query string used in the request.
13557 /// It should be used to set parameters which are not yet available through their own
13558 /// setters.
13559 ///
13560 /// Please note that this method must not be used to set any of the known parameters
13561 /// which have their own setter method. If done anyway, the request will fail.
13562 ///
13563 /// # Additional Parameters
13564 ///
13565 /// * *$.xgafv* (query-string) - V1 error format.
13566 /// * *access_token* (query-string) - OAuth access token.
13567 /// * *alt* (query-string) - Data format for response.
13568 /// * *callback* (query-string) - JSONP
13569 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13570 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13571 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13572 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13573 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13574 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13575 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13576 pub fn param<T>(mut self, name: T, value: T) -> ProjectRemoveAnalyticCall<'a, C>
13577 where
13578 T: AsRef<str>,
13579 {
13580 self._additional_params
13581 .insert(name.as_ref().to_string(), value.as_ref().to_string());
13582 self
13583 }
13584
13585 /// Identifies the authorization scope for the method you are building.
13586 ///
13587 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13588 /// [`Scope::CloudPlatform`].
13589 ///
13590 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13591 /// tokens for more than one scope.
13592 ///
13593 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13594 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13595 /// sufficient, a read-write scope will do as well.
13596 pub fn add_scope<St>(mut self, scope: St) -> ProjectRemoveAnalyticCall<'a, C>
13597 where
13598 St: AsRef<str>,
13599 {
13600 self._scopes.insert(String::from(scope.as_ref()));
13601 self
13602 }
13603 /// Identifies the authorization scope(s) for the method you are building.
13604 ///
13605 /// See [`Self::add_scope()`] for details.
13606 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectRemoveAnalyticCall<'a, C>
13607 where
13608 I: IntoIterator<Item = St>,
13609 St: AsRef<str>,
13610 {
13611 self._scopes
13612 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13613 self
13614 }
13615
13616 /// Removes all scopes, and no default scope will be used either.
13617 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13618 /// for details).
13619 pub fn clear_scopes(mut self) -> ProjectRemoveAnalyticCall<'a, C> {
13620 self._scopes.clear();
13621 self
13622 }
13623}
13624
13625/// 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).
13626///
13627/// A builder for the *searchApps* method supported by a *project* resource.
13628/// It is not used directly, but through a [`ProjectMethods`] instance.
13629///
13630/// # Example
13631///
13632/// Instantiate a resource method builder
13633///
13634/// ```test_harness,no_run
13635/// # extern crate hyper;
13636/// # extern crate hyper_rustls;
13637/// # extern crate google_firebase1_beta1 as firebase1_beta1;
13638/// # async fn dox() {
13639/// # use firebase1_beta1::{FirebaseManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
13640///
13641/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
13642/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
13643/// # .with_native_roots()
13644/// # .unwrap()
13645/// # .https_only()
13646/// # .enable_http2()
13647/// # .build();
13648///
13649/// # let executor = hyper_util::rt::TokioExecutor::new();
13650/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
13651/// # secret,
13652/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13653/// # yup_oauth2::client::CustomHyperClientBuilder::from(
13654/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
13655/// # ),
13656/// # ).build().await.unwrap();
13657///
13658/// # let client = hyper_util::client::legacy::Client::builder(
13659/// # hyper_util::rt::TokioExecutor::new()
13660/// # )
13661/// # .build(
13662/// # hyper_rustls::HttpsConnectorBuilder::new()
13663/// # .with_native_roots()
13664/// # .unwrap()
13665/// # .https_or_http()
13666/// # .enable_http2()
13667/// # .build()
13668/// # );
13669/// # let mut hub = FirebaseManagement::new(client, auth);
13670/// // You can configure optional parameters by calling the respective setters at will, and
13671/// // execute the final call using `doit()`.
13672/// // Values shown here are possibly random and not representative !
13673/// let result = hub.projects().search_apps("parent")
13674/// .show_deleted(false)
13675/// .page_token("diam")
13676/// .page_size(-49)
13677/// .filter("et")
13678/// .doit().await;
13679/// # }
13680/// ```
13681pub struct ProjectSearchAppCall<'a, C>
13682where
13683 C: 'a,
13684{
13685 hub: &'a FirebaseManagement<C>,
13686 _parent: String,
13687 _show_deleted: Option<bool>,
13688 _page_token: Option<String>,
13689 _page_size: Option<i32>,
13690 _filter: Option<String>,
13691 _delegate: Option<&'a mut dyn common::Delegate>,
13692 _additional_params: HashMap<String, String>,
13693 _scopes: BTreeSet<String>,
13694}
13695
13696impl<'a, C> common::CallBuilder for ProjectSearchAppCall<'a, C> {}
13697
13698impl<'a, C> ProjectSearchAppCall<'a, C>
13699where
13700 C: common::Connector,
13701{
13702 /// Perform the operation you have build so far.
13703 pub async fn doit(mut self) -> common::Result<(common::Response, SearchFirebaseAppsResponse)> {
13704 use std::borrow::Cow;
13705 use std::io::{Read, Seek};
13706
13707 use common::{url::Params, ToParts};
13708 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
13709
13710 let mut dd = common::DefaultDelegate;
13711 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
13712 dlg.begin(common::MethodInfo {
13713 id: "firebase.projects.searchApps",
13714 http_method: hyper::Method::GET,
13715 });
13716
13717 for &field in [
13718 "alt",
13719 "parent",
13720 "showDeleted",
13721 "pageToken",
13722 "pageSize",
13723 "filter",
13724 ]
13725 .iter()
13726 {
13727 if self._additional_params.contains_key(field) {
13728 dlg.finished(false);
13729 return Err(common::Error::FieldClash(field));
13730 }
13731 }
13732
13733 let mut params = Params::with_capacity(7 + self._additional_params.len());
13734 params.push("parent", self._parent);
13735 if let Some(value) = self._show_deleted.as_ref() {
13736 params.push("showDeleted", value.to_string());
13737 }
13738 if let Some(value) = self._page_token.as_ref() {
13739 params.push("pageToken", value);
13740 }
13741 if let Some(value) = self._page_size.as_ref() {
13742 params.push("pageSize", value.to_string());
13743 }
13744 if let Some(value) = self._filter.as_ref() {
13745 params.push("filter", value);
13746 }
13747
13748 params.extend(self._additional_params.iter());
13749
13750 params.push("alt", "json");
13751 let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:searchApps";
13752 if self._scopes.is_empty() {
13753 self._scopes.insert(Scope::Readonly.as_ref().to_string());
13754 }
13755
13756 #[allow(clippy::single_element_loop)]
13757 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
13758 url = params.uri_replacement(url, param_name, find_this, true);
13759 }
13760 {
13761 let to_remove = ["parent"];
13762 params.remove_params(&to_remove);
13763 }
13764
13765 let url = params.parse_with_url(&url);
13766
13767 loop {
13768 let token = match self
13769 .hub
13770 .auth
13771 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13772 .await
13773 {
13774 Ok(token) => token,
13775 Err(e) => match dlg.token(e) {
13776 Ok(token) => token,
13777 Err(e) => {
13778 dlg.finished(false);
13779 return Err(common::Error::MissingToken(e));
13780 }
13781 },
13782 };
13783 let mut req_result = {
13784 let client = &self.hub.client;
13785 dlg.pre_request();
13786 let mut req_builder = hyper::Request::builder()
13787 .method(hyper::Method::GET)
13788 .uri(url.as_str())
13789 .header(USER_AGENT, self.hub._user_agent.clone());
13790
13791 if let Some(token) = token.as_ref() {
13792 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13793 }
13794
13795 let request = req_builder
13796 .header(CONTENT_LENGTH, 0_u64)
13797 .body(common::to_body::<String>(None));
13798
13799 client.request(request.unwrap()).await
13800 };
13801
13802 match req_result {
13803 Err(err) => {
13804 if let common::Retry::After(d) = dlg.http_error(&err) {
13805 sleep(d).await;
13806 continue;
13807 }
13808 dlg.finished(false);
13809 return Err(common::Error::HttpError(err));
13810 }
13811 Ok(res) => {
13812 let (mut parts, body) = res.into_parts();
13813 let mut body = common::Body::new(body);
13814 if !parts.status.is_success() {
13815 let bytes = common::to_bytes(body).await.unwrap_or_default();
13816 let error = serde_json::from_str(&common::to_string(&bytes));
13817 let response = common::to_response(parts, bytes.into());
13818
13819 if let common::Retry::After(d) =
13820 dlg.http_failure(&response, error.as_ref().ok())
13821 {
13822 sleep(d).await;
13823 continue;
13824 }
13825
13826 dlg.finished(false);
13827
13828 return Err(match error {
13829 Ok(value) => common::Error::BadRequest(value),
13830 _ => common::Error::Failure(response),
13831 });
13832 }
13833 let response = {
13834 let bytes = common::to_bytes(body).await.unwrap_or_default();
13835 let encoded = common::to_string(&bytes);
13836 match serde_json::from_str(&encoded) {
13837 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13838 Err(error) => {
13839 dlg.response_json_decode_error(&encoded, &error);
13840 return Err(common::Error::JsonDecodeError(
13841 encoded.to_string(),
13842 error,
13843 ));
13844 }
13845 }
13846 };
13847
13848 dlg.finished(true);
13849 return Ok(response);
13850 }
13851 }
13852 }
13853 }
13854
13855 /// 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.
13856 ///
13857 /// Sets the *parent* path property to the given value.
13858 ///
13859 /// Even though the property as already been set when instantiating this call,
13860 /// we provide this method for API completeness.
13861 pub fn parent(mut self, new_value: &str) -> ProjectSearchAppCall<'a, C> {
13862 self._parent = new_value.to_string();
13863 self
13864 }
13865 /// Controls whether Apps in the DELETED state should be returned. If not specified, only `ACTIVE` Apps will be returned.
13866 ///
13867 /// Sets the *show deleted* query property to the given value.
13868 pub fn show_deleted(mut self, new_value: bool) -> ProjectSearchAppCall<'a, C> {
13869 self._show_deleted = Some(new_value);
13870 self
13871 }
13872 /// Token returned from a previous call to `SearchFirebaseApps` indicating where in the set of Apps to resume listing.
13873 ///
13874 /// Sets the *page token* query property to the given value.
13875 pub fn page_token(mut self, new_value: &str) -> ProjectSearchAppCall<'a, C> {
13876 self._page_token = Some(new_value.to_string());
13877 self
13878 }
13879 /// 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.
13880 ///
13881 /// Sets the *page size* query property to the given value.
13882 pub fn page_size(mut self, new_value: i32) -> ProjectSearchAppCall<'a, C> {
13883 self._page_size = Some(new_value);
13884 self
13885 }
13886 /// 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`.
13887 ///
13888 /// Sets the *filter* query property to the given value.
13889 pub fn filter(mut self, new_value: &str) -> ProjectSearchAppCall<'a, C> {
13890 self._filter = Some(new_value.to_string());
13891 self
13892 }
13893 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13894 /// while executing the actual API request.
13895 ///
13896 /// ````text
13897 /// It should be used to handle progress information, and to implement a certain level of resilience.
13898 /// ````
13899 ///
13900 /// Sets the *delegate* property to the given value.
13901 pub fn delegate(
13902 mut self,
13903 new_value: &'a mut dyn common::Delegate,
13904 ) -> ProjectSearchAppCall<'a, C> {
13905 self._delegate = Some(new_value);
13906 self
13907 }
13908
13909 /// Set any additional parameter of the query string used in the request.
13910 /// It should be used to set parameters which are not yet available through their own
13911 /// setters.
13912 ///
13913 /// Please note that this method must not be used to set any of the known parameters
13914 /// which have their own setter method. If done anyway, the request will fail.
13915 ///
13916 /// # Additional Parameters
13917 ///
13918 /// * *$.xgafv* (query-string) - V1 error format.
13919 /// * *access_token* (query-string) - OAuth access token.
13920 /// * *alt* (query-string) - Data format for response.
13921 /// * *callback* (query-string) - JSONP
13922 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13923 /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
13924 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13925 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13926 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
13927 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13928 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13929 pub fn param<T>(mut self, name: T, value: T) -> ProjectSearchAppCall<'a, C>
13930 where
13931 T: AsRef<str>,
13932 {
13933 self._additional_params
13934 .insert(name.as_ref().to_string(), value.as_ref().to_string());
13935 self
13936 }
13937
13938 /// Identifies the authorization scope for the method you are building.
13939 ///
13940 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13941 /// [`Scope::Readonly`].
13942 ///
13943 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13944 /// tokens for more than one scope.
13945 ///
13946 /// Usually there is more than one suitable scope to authorize an operation, some of which may
13947 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13948 /// sufficient, a read-write scope will do as well.
13949 pub fn add_scope<St>(mut self, scope: St) -> ProjectSearchAppCall<'a, C>
13950 where
13951 St: AsRef<str>,
13952 {
13953 self._scopes.insert(String::from(scope.as_ref()));
13954 self
13955 }
13956 /// Identifies the authorization scope(s) for the method you are building.
13957 ///
13958 /// See [`Self::add_scope()`] for details.
13959 pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectSearchAppCall<'a, C>
13960 where
13961 I: IntoIterator<Item = St>,
13962 St: AsRef<str>,
13963 {
13964 self._scopes
13965 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13966 self
13967 }
13968
13969 /// Removes all scopes, and no default scope will be used either.
13970 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13971 /// for details).
13972 pub fn clear_scopes(mut self) -> ProjectSearchAppCall<'a, C> {
13973 self._scopes.clear();
13974 self
13975 }
13976}