google_chromemanagement1/
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 detailed information about apps installed on Chrome browsers and devices managed by your organization
17    ChromeManagementAppdetailReadonly,
18
19    /// See, edit, delete, and take other necessary actions on Chrome browser profiles managed by your organization
20    ChromeManagementProfile,
21
22    /// See Chrome browser profiles managed by your organization
23    ChromeManagementProfileReadonly,
24
25    /// See reports about devices and Chrome browsers managed within your organization
26    ChromeManagementReportReadonly,
27
28    /// See basic device and telemetry information collected from ChromeOS devices or users managed within your organization
29    ChromeManagementTelemetryReadonly,
30}
31
32impl AsRef<str> for Scope {
33    fn as_ref(&self) -> &str {
34        match *self {
35            Scope::ChromeManagementAppdetailReadonly => {
36                "https://www.googleapis.com/auth/chrome.management.appdetails.readonly"
37            }
38            Scope::ChromeManagementProfile => {
39                "https://www.googleapis.com/auth/chrome.management.profiles"
40            }
41            Scope::ChromeManagementProfileReadonly => {
42                "https://www.googleapis.com/auth/chrome.management.profiles.readonly"
43            }
44            Scope::ChromeManagementReportReadonly => {
45                "https://www.googleapis.com/auth/chrome.management.reports.readonly"
46            }
47            Scope::ChromeManagementTelemetryReadonly => {
48                "https://www.googleapis.com/auth/chrome.management.telemetry.readonly"
49            }
50        }
51    }
52}
53
54#[allow(clippy::derivable_impls)]
55impl Default for Scope {
56    fn default() -> Scope {
57        Scope::ChromeManagementAppdetailReadonly
58    }
59}
60
61// ########
62// HUB ###
63// ######
64
65/// Central instance to access all ChromeManagement related resource activities
66///
67/// # Examples
68///
69/// Instantiate a new hub
70///
71/// ```test_harness,no_run
72/// extern crate hyper;
73/// extern crate hyper_rustls;
74/// extern crate google_chromemanagement1 as chromemanagement1;
75/// use chromemanagement1::api::GoogleLongrunningCancelOperationRequest;
76/// use chromemanagement1::{Result, Error};
77/// # async fn dox() {
78/// use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
79///
80/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
81/// // `client_secret`, among other things.
82/// let secret: yup_oauth2::ApplicationSecret = Default::default();
83/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
84/// // unless you replace  `None` with the desired Flow.
85/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
86/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
87/// // retrieve them from storage.
88/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
89///     .with_native_roots()
90///     .unwrap()
91///     .https_only()
92///     .enable_http2()
93///     .build();
94///
95/// let executor = hyper_util::rt::TokioExecutor::new();
96/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
97///     secret,
98///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
99///     yup_oauth2::client::CustomHyperClientBuilder::from(
100///         hyper_util::client::legacy::Client::builder(executor).build(connector),
101///     ),
102/// ).build().await.unwrap();
103///
104/// let client = hyper_util::client::legacy::Client::builder(
105///     hyper_util::rt::TokioExecutor::new()
106/// )
107/// .build(
108///     hyper_rustls::HttpsConnectorBuilder::new()
109///         .with_native_roots()
110///         .unwrap()
111///         .https_or_http()
112///         .enable_http2()
113///         .build()
114/// );
115/// let mut hub = ChromeManagement::new(client, auth);
116/// // As the method needs a request, you would usually fill it with the desired information
117/// // into the respective structure. Some of the parts shown here might not be applicable !
118/// // Values shown here are possibly random and not representative !
119/// let mut req = GoogleLongrunningCancelOperationRequest::default();
120///
121/// // You can configure optional parameters by calling the respective setters at will, and
122/// // execute the final call using `doit()`.
123/// // Values shown here are possibly random and not representative !
124/// let result = hub.operations().cancel(req, "name")
125///              .doit().await;
126///
127/// match result {
128///     Err(e) => match e {
129///         // The Error enum provides details about what exactly happened.
130///         // You can also just use its `Debug`, `Display` or `Error` traits
131///          Error::HttpError(_)
132///         |Error::Io(_)
133///         |Error::MissingAPIKey
134///         |Error::MissingToken(_)
135///         |Error::Cancelled
136///         |Error::UploadSizeLimitExceeded(_, _)
137///         |Error::Failure(_)
138///         |Error::BadRequest(_)
139///         |Error::FieldClash(_)
140///         |Error::JsonDecodeError(_, _) => println!("{}", e),
141///     },
142///     Ok(res) => println!("Success: {:?}", res),
143/// }
144/// # }
145/// ```
146#[derive(Clone)]
147pub struct ChromeManagement<C> {
148    pub client: common::Client<C>,
149    pub auth: Box<dyn common::GetToken>,
150    _user_agent: String,
151    _base_url: String,
152    _root_url: String,
153}
154
155impl<C> common::Hub for ChromeManagement<C> {}
156
157impl<'a, C> ChromeManagement<C> {
158    pub fn new<A: 'static + common::GetToken>(
159        client: common::Client<C>,
160        auth: A,
161    ) -> ChromeManagement<C> {
162        ChromeManagement {
163            client,
164            auth: Box::new(auth),
165            _user_agent: "google-api-rust-client/7.0.0".to_string(),
166            _base_url: "https://chromemanagement.googleapis.com/".to_string(),
167            _root_url: "https://chromemanagement.googleapis.com/".to_string(),
168        }
169    }
170
171    pub fn customers(&'a self) -> CustomerMethods<'a, C> {
172        CustomerMethods { hub: self }
173    }
174    pub fn operations(&'a self) -> OperationMethods<'a, C> {
175        OperationMethods { hub: self }
176    }
177
178    /// Set the user-agent header field to use in all requests to the server.
179    /// It defaults to `google-api-rust-client/7.0.0`.
180    ///
181    /// Returns the previously set user-agent.
182    pub fn user_agent(&mut self, agent_name: String) -> String {
183        std::mem::replace(&mut self._user_agent, agent_name)
184    }
185
186    /// Set the base url to use in all requests to the server.
187    /// It defaults to `https://chromemanagement.googleapis.com/`.
188    ///
189    /// Returns the previously set base url.
190    pub fn base_url(&mut self, new_base_url: String) -> String {
191        std::mem::replace(&mut self._base_url, new_base_url)
192    }
193
194    /// Set the root url to use in all requests to the server.
195    /// It defaults to `https://chromemanagement.googleapis.com/`.
196    ///
197    /// Returns the previously set root url.
198    pub fn root_url(&mut self, new_root_url: String) -> String {
199        std::mem::replace(&mut self._root_url, new_root_url)
200    }
201}
202
203// ############
204// SCHEMAS ###
205// ##########
206/// Android app information.
207///
208/// This type is not used in any activity, and only used as *part* of another schema.
209///
210#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
211#[serde_with::serde_as]
212#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
213pub struct GoogleChromeManagementV1AndroidAppInfo {
214    /// Output only. Permissions requested by an Android app.
215    pub permissions: Option<Vec<GoogleChromeManagementV1AndroidAppPermission>>,
216}
217
218impl common::Part for GoogleChromeManagementV1AndroidAppInfo {}
219
220/// Permission requested by an Android app.
221///
222/// This type is not used in any activity, and only used as *part* of another schema.
223///
224#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
225#[serde_with::serde_as]
226#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
227pub struct GoogleChromeManagementV1AndroidAppPermission {
228    /// Output only. The type of the permission.
229    #[serde(rename = "type")]
230    pub type_: Option<String>,
231}
232
233impl common::Part for GoogleChromeManagementV1AndroidAppPermission {}
234
235/// Resource representing app details.
236///
237/// # Activities
238///
239/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
240/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
241///
242/// * [apps android get customers](CustomerAppAndroidGetCall) (response)
243/// * [apps chrome get customers](CustomerAppChromeGetCall) (response)
244/// * [apps web get customers](CustomerAppWebGetCall) (response)
245#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
246#[serde_with::serde_as]
247#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
248pub struct GoogleChromeManagementV1AppDetails {
249    /// Output only. Android app information.
250    #[serde(rename = "androidAppInfo")]
251    pub android_app_info: Option<GoogleChromeManagementV1AndroidAppInfo>,
252    /// Output only. Unique store identifier for the item. Examples: "gmbmikajjgmnabiglmofipeabaddhgne" for the Save to Google Drive Chrome extension, "com.google.android.apps.docs" for the Google Drive Android app.
253    #[serde(rename = "appId")]
254    pub app_id: Option<String>,
255    /// Output only. Chrome Web Store app information.
256    #[serde(rename = "chromeAppInfo")]
257    pub chrome_app_info: Option<GoogleChromeManagementV1ChromeAppInfo>,
258    /// Output only. App's description.
259    pub description: Option<String>,
260    /// Output only. The uri for the detail page of the item.
261    #[serde(rename = "detailUri")]
262    pub detail_uri: Option<String>,
263    /// Output only. App's display name.
264    #[serde(rename = "displayName")]
265    pub display_name: Option<String>,
266    /// Output only. First published time.
267    #[serde(rename = "firstPublishTime")]
268    pub first_publish_time: Option<chrono::DateTime<chrono::offset::Utc>>,
269    /// Output only. Home page or Website uri.
270    #[serde(rename = "homepageUri")]
271    pub homepage_uri: Option<String>,
272    /// Output only. A link to an image that can be used as an icon for the product.
273    #[serde(rename = "iconUri")]
274    pub icon_uri: Option<String>,
275    /// Output only. Indicates if the app has to be paid for OR has paid content.
276    #[serde(rename = "isPaidApp")]
277    pub is_paid_app: Option<bool>,
278    /// Output only. Latest published time.
279    #[serde(rename = "latestPublishTime")]
280    pub latest_publish_time: Option<chrono::DateTime<chrono::offset::Utc>>,
281    /// Output only. Format: name=customers/{customer_id}/apps/{chrome|android|web}/{app_id}@{version}
282    pub name: Option<String>,
283    /// Output only. The URI pointing to the privacy policy of the app, if it was provided by the developer. Version-specific field that will only be set when the requested app version is found.
284    #[serde(rename = "privacyPolicyUri")]
285    pub privacy_policy_uri: Option<String>,
286    /// Output only. The publisher of the item.
287    pub publisher: Option<String>,
288    /// Output only. Number of reviews received. Chrome Web Store review information will always be for the latest version of an app.
289    #[serde(rename = "reviewNumber")]
290    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
291    pub review_number: Option<i64>,
292    /// Output only. The rating of the app (on 5 stars). Chrome Web Store review information will always be for the latest version of an app.
293    #[serde(rename = "reviewRating")]
294    pub review_rating: Option<f32>,
295    /// Output only. App version. A new revision is committed whenever a new version of the app is published.
296    #[serde(rename = "revisionId")]
297    pub revision_id: Option<String>,
298    /// Output only. Information about a partial service error if applicable.
299    #[serde(rename = "serviceError")]
300    pub service_error: Option<GoogleRpcStatus>,
301    /// Output only. App type.
302    #[serde(rename = "type")]
303    pub type_: Option<String>,
304}
305
306impl common::ResponseResult for GoogleChromeManagementV1AppDetails {}
307
308/// App report.
309///
310/// This type is not used in any activity, and only used as *part* of another schema.
311///
312#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
313#[serde_with::serde_as]
314#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
315pub struct GoogleChromeManagementV1AppReport {
316    /// Timestamp when the report was collected.
317    #[serde(rename = "reportTime")]
318    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
319    /// App usage data.
320    #[serde(rename = "usageData")]
321    pub usage_data: Option<Vec<GoogleChromeManagementV1AppUsageData>>,
322}
323
324impl common::Part for GoogleChromeManagementV1AppReport {}
325
326/// App usage data.
327///
328/// This type is not used in any activity, and only used as *part* of another schema.
329///
330#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
331#[serde_with::serde_as]
332#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
333pub struct GoogleChromeManagementV1AppUsageData {
334    /// App id.
335    #[serde(rename = "appId")]
336    pub app_id: Option<String>,
337    /// Application instance id. This will be unique per window/instance.
338    #[serde(rename = "appInstanceId")]
339    pub app_instance_id: Option<String>,
340    /// Type of app.
341    #[serde(rename = "appType")]
342    pub app_type: Option<String>,
343    /// App foreground running time.
344    #[serde(rename = "runningDuration")]
345    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
346    pub running_duration: Option<chrono::Duration>,
347}
348
349impl common::Part for GoogleChromeManagementV1AppUsageData {}
350
351/// Status data for storage. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceAudioStatus](https://chromeenterprise.google/policies/#ReportDeviceAudioStatus) * Data Collection Frequency: 10 minutes * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_AUDIO_REPORT
352///
353/// This type is not used in any activity, and only used as *part* of another schema.
354///
355#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
356#[serde_with::serde_as]
357#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
358pub struct GoogleChromeManagementV1AudioStatusReport {
359    /// Output only. Active input device's name.
360    #[serde(rename = "inputDevice")]
361    pub input_device: Option<String>,
362    /// Output only. Active input device's gain in [0, 100].
363    #[serde(rename = "inputGain")]
364    pub input_gain: Option<i32>,
365    /// Output only. Is active input device mute or not.
366    #[serde(rename = "inputMute")]
367    pub input_mute: Option<bool>,
368    /// Output only. Active output device's name.
369    #[serde(rename = "outputDevice")]
370    pub output_device: Option<String>,
371    /// Output only. Is active output device mute or not.
372    #[serde(rename = "outputMute")]
373    pub output_mute: Option<bool>,
374    /// Output only. Active output device's volume in [0, 100].
375    #[serde(rename = "outputVolume")]
376    pub output_volume: Option<i32>,
377    /// Output only. Timestamp of when the sample was collected on device.
378    #[serde(rename = "reportTime")]
379    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
380}
381
382impl common::Part for GoogleChromeManagementV1AudioStatusReport {}
383
384/// Information about the battery. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportDevicePowerStatus](https://chromeenterprise.google/policies/#ReportDevicePowerStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_BATTERY_INFO
385///
386/// This type is not used in any activity, and only used as *part* of another schema.
387///
388#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
389#[serde_with::serde_as]
390#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
391pub struct GoogleChromeManagementV1BatteryInfo {
392    /// Output only. Design capacity (mAmpere-hours).
393    #[serde(rename = "designCapacity")]
394    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
395    pub design_capacity: Option<i64>,
396    /// Output only. Designed minimum output voltage (mV)
397    #[serde(rename = "designMinVoltage")]
398    pub design_min_voltage: Option<i32>,
399    /// Output only. The date the battery was manufactured.
400    #[serde(rename = "manufactureDate")]
401    pub manufacture_date: Option<GoogleTypeDate>,
402    /// Output only. Battery manufacturer.
403    pub manufacturer: Option<String>,
404    /// Output only. Battery serial number.
405    #[serde(rename = "serialNumber")]
406    pub serial_number: Option<String>,
407    /// Output only. Technology of the battery. Example: Li-ion
408    pub technology: Option<String>,
409}
410
411impl common::Part for GoogleChromeManagementV1BatteryInfo {}
412
413/// Sampling data for battery. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDevicePowerStatus](https://chromeenterprise.google/policies/#ReportDevicePowerStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A
414///
415/// This type is not used in any activity, and only used as *part* of another schema.
416///
417#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
418#[serde_with::serde_as]
419#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
420pub struct GoogleChromeManagementV1BatterySampleReport {
421    /// Output only. Battery charge percentage.
422    #[serde(rename = "chargeRate")]
423    pub charge_rate: Option<i32>,
424    /// Output only. Battery current (mA).
425    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
426    pub current: Option<i64>,
427    /// Output only. The battery discharge rate measured in mW. Positive if the battery is being discharged, negative if it's being charged.
428    #[serde(rename = "dischargeRate")]
429    pub discharge_rate: Option<i32>,
430    /// Output only. Battery remaining capacity (mAmpere-hours).
431    #[serde(rename = "remainingCapacity")]
432    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
433    pub remaining_capacity: Option<i64>,
434    /// Output only. Timestamp of when the sample was collected on device
435    #[serde(rename = "reportTime")]
436    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
437    /// Output only. Battery status read from sysfs. Example: Discharging
438    pub status: Option<String>,
439    /// Output only. Temperature in Celsius degrees.
440    pub temperature: Option<i32>,
441    /// Output only. Battery voltage (millivolt).
442    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
443    pub voltage: Option<i64>,
444}
445
446impl common::Part for GoogleChromeManagementV1BatterySampleReport {}
447
448/// Status data for battery. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDevicePowerStatus](https://chromeenterprise.google/policies/#ReportDevicePowerStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_BATTERY_REPORT
449///
450/// This type is not used in any activity, and only used as *part* of another schema.
451///
452#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
453#[serde_with::serde_as]
454#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
455pub struct GoogleChromeManagementV1BatteryStatusReport {
456    /// Output only. Battery health.
457    #[serde(rename = "batteryHealth")]
458    pub battery_health: Option<String>,
459    /// Output only. Cycle count.
460    #[serde(rename = "cycleCount")]
461    pub cycle_count: Option<i32>,
462    /// Output only. Full charge capacity (mAmpere-hours).
463    #[serde(rename = "fullChargeCapacity")]
464    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
465    pub full_charge_capacity: Option<i64>,
466    /// Output only. Timestamp of when the sample was collected on device
467    #[serde(rename = "reportTime")]
468    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
469    /// Output only. Sampling data for the battery sorted in a decreasing order of report_time.
470    pub sample: Option<Vec<GoogleChromeManagementV1BatterySampleReport>>,
471    /// Output only. Battery serial number.
472    #[serde(rename = "serialNumber")]
473    pub serial_number: Option<String>,
474}
475
476impl common::Part for GoogleChromeManagementV1BatteryStatusReport {}
477
478/// Boot performance report of a device. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceBootMode](https://chromeenterprise.google/policies/#ReportDeviceBootMode) * Data Collection Frequency: On every boot up event * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: Yes * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_OS_REPORT
479///
480/// This type is not used in any activity, and only used as *part* of another schema.
481///
482#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
483#[serde_with::serde_as]
484#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
485pub struct GoogleChromeManagementV1BootPerformanceReport {
486    /// Total time to boot up.
487    #[serde(rename = "bootUpDuration")]
488    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
489    pub boot_up_duration: Option<chrono::Duration>,
490    /// The timestamp when power came on.
491    #[serde(rename = "bootUpTime")]
492    pub boot_up_time: Option<chrono::DateTime<chrono::offset::Utc>>,
493    /// Timestamp when the report was collected.
494    #[serde(rename = "reportTime")]
495    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
496    /// Total time since shutdown start to power off.
497    #[serde(rename = "shutdownDuration")]
498    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
499    pub shutdown_duration: Option<chrono::Duration>,
500    /// The shutdown reason.
501    #[serde(rename = "shutdownReason")]
502    pub shutdown_reason: Option<String>,
503    /// The timestamp when shutdown.
504    #[serde(rename = "shutdownTime")]
505    pub shutdown_time: Option<chrono::DateTime<chrono::offset::Utc>>,
506}
507
508impl common::Part for GoogleChromeManagementV1BootPerformanceReport {}
509
510/// Describes a browser version and its install count.
511///
512/// This type is not used in any activity, and only used as *part* of another schema.
513///
514#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
515#[serde_with::serde_as]
516#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
517pub struct GoogleChromeManagementV1BrowserVersion {
518    /// Output only. The release channel of the installed browser.
519    pub channel: Option<String>,
520    /// Output only. Count grouped by device_system and major version
521    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
522    pub count: Option<i64>,
523    /// Output only. Version of the system-specified operating system.
524    #[serde(rename = "deviceOsVersion")]
525    pub device_os_version: Option<String>,
526    /// Output only. The device operating system.
527    pub system: Option<String>,
528    /// Output only. The full version of the installed browser.
529    pub version: Option<String>,
530}
531
532impl common::Part for GoogleChromeManagementV1BrowserVersion {}
533
534/// Chrome Web Store app information.
535///
536/// This type is not used in any activity, and only used as *part* of another schema.
537///
538#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
539#[serde_with::serde_as]
540#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
541pub struct GoogleChromeManagementV1ChromeAppInfo {
542    /// Output only. Whether the app or extension is built and maintained by Google. Version-specific field that will only be set when the requested app version is found.
543    #[serde(rename = "googleOwned")]
544    pub google_owned: Option<bool>,
545    /// Output only. Whether the app or extension is in a published state in the Chrome Web Store.
546    #[serde(rename = "isCwsHosted")]
547    pub is_cws_hosted: Option<bool>,
548    /// Output only. Whether an app supports policy for extensions.
549    #[serde(rename = "isExtensionPolicySupported")]
550    pub is_extension_policy_supported: Option<bool>,
551    /// Output only. Whether the app is only for Kiosk mode on ChromeOS devices
552    #[serde(rename = "isKioskOnly")]
553    pub is_kiosk_only: Option<bool>,
554    /// Output only. Whether the app or extension is a theme.
555    #[serde(rename = "isTheme")]
556    pub is_theme: Option<bool>,
557    /// Output only. Whether this app is enabled for Kiosk mode on ChromeOS devices
558    #[serde(rename = "kioskEnabled")]
559    pub kiosk_enabled: Option<bool>,
560    /// Output only. The version of this extension's manifest.
561    #[serde(rename = "manifestVersion")]
562    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
563    pub manifest_version: Option<i64>,
564    /// Output only. The minimum number of users using this app.
565    #[serde(rename = "minUserCount")]
566    pub min_user_count: Option<i32>,
567    /// Output only. Every custom permission requested by the app. Version-specific field that will only be set when the requested app version is found.
568    pub permissions: Option<Vec<GoogleChromeManagementV1ChromeAppPermission>>,
569    /// Output only. Every permission giving access to domains or broad host patterns. ( e.g. www.google.com). This includes the matches from content scripts as well as hosts in the permissions node of the manifest. Version-specific field that will only be set when the requested app version is found.
570    #[serde(rename = "siteAccess")]
571    pub site_access: Option<Vec<GoogleChromeManagementV1ChromeAppSiteAccess>>,
572    /// Output only. The app developer has enabled support for their app. Version-specific field that will only be set when the requested app version is found.
573    #[serde(rename = "supportEnabled")]
574    pub support_enabled: Option<bool>,
575    /// Output only. Types of an item in the Chrome Web Store
576    #[serde(rename = "type")]
577    pub type_: Option<String>,
578}
579
580impl common::Part for GoogleChromeManagementV1ChromeAppInfo {}
581
582/// Permission requested by a Chrome app or extension.
583///
584/// This type is not used in any activity, and only used as *part* of another schema.
585///
586#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
587#[serde_with::serde_as]
588#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
589pub struct GoogleChromeManagementV1ChromeAppPermission {
590    /// Output only. If available, whether this permissions grants the app/extension access to user data.
591    #[serde(rename = "accessUserData")]
592    pub access_user_data: Option<bool>,
593    /// Output only. If available, a URI to a page that has documentation for the current permission.
594    #[serde(rename = "documentationUri")]
595    pub documentation_uri: Option<String>,
596    /// Output only. The type of the permission.
597    #[serde(rename = "type")]
598    pub type_: Option<String>,
599}
600
601impl common::Part for GoogleChromeManagementV1ChromeAppPermission {}
602
603/// Details of an app installation request.
604///
605/// This type is not used in any activity, and only used as *part* of another schema.
606///
607#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
608#[serde_with::serde_as]
609#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
610pub struct GoogleChromeManagementV1ChromeAppRequest {
611    /// Output only. Format: app_details=customers/{customer_id}/apps/chrome/{app_id}
612    #[serde(rename = "appDetails")]
613    pub app_details: Option<String>,
614    /// Output only. Unique store identifier for the app. Example: "gmbmikajjgmnabiglmofipeabaddhgne" for the Save to Google Drive Chrome extension.
615    #[serde(rename = "appId")]
616    pub app_id: Option<String>,
617    /// Output only. The uri for the detail page of the item.
618    #[serde(rename = "detailUri")]
619    pub detail_uri: Option<String>,
620    /// Output only. App's display name.
621    #[serde(rename = "displayName")]
622    pub display_name: Option<String>,
623    /// Output only. A link to an image that can be used as an icon for the product.
624    #[serde(rename = "iconUri")]
625    pub icon_uri: Option<String>,
626    /// Output only. The timestamp of the most recently made request for this app.
627    #[serde(rename = "latestRequestTime")]
628    pub latest_request_time: Option<chrono::DateTime<chrono::offset::Utc>>,
629    /// Output only. Total count of requests for this app.
630    #[serde(rename = "requestCount")]
631    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
632    pub request_count: Option<i64>,
633}
634
635impl common::Part for GoogleChromeManagementV1ChromeAppRequest {}
636
637/// Represent one host permission.
638///
639/// This type is not used in any activity, and only used as *part* of another schema.
640///
641#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
642#[serde_with::serde_as]
643#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
644pub struct GoogleChromeManagementV1ChromeAppSiteAccess {
645    /// Output only. This can contain very specific hosts, or patterns like "*.com" for instance.
646    #[serde(rename = "hostMatch")]
647    pub host_match: Option<String>,
648}
649
650impl common::Part for GoogleChromeManagementV1ChromeAppSiteAccess {}
651
652/// Response containing the number of active devices.
653///
654/// # Activities
655///
656/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
657/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
658///
659/// * [reports count active devices customers](CustomerReportCountActiveDeviceCall) (response)
660#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
661#[serde_with::serde_as]
662#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
663pub struct GoogleChromeManagementV1CountActiveDevicesResponse {
664    /// Number of active devices in the 7 days leading up to the date specified in the request.
665    #[serde(rename = "sevenDaysCount")]
666    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
667    pub seven_days_count: Option<i64>,
668    /// Number of active devices in the 30 days leading up to the date specified in the request.
669    #[serde(rename = "thirtyDaysCount")]
670    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
671    pub thirty_days_count: Option<i64>,
672}
673
674impl common::ResponseResult for GoogleChromeManagementV1CountActiveDevicesResponse {}
675
676/// Response containing summary of requested app installations.
677///
678/// # Activities
679///
680/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
681/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
682///
683/// * [apps count chrome app requests customers](CustomerAppCountChromeAppRequestCall) (response)
684#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
685#[serde_with::serde_as]
686#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
687pub struct GoogleChromeManagementV1CountChromeAppRequestsResponse {
688    /// Token to specify the next page in the list.
689    #[serde(rename = "nextPageToken")]
690    pub next_page_token: Option<String>,
691    /// Count of requested apps matching request.
692    #[serde(rename = "requestedApps")]
693    pub requested_apps: Option<Vec<GoogleChromeManagementV1ChromeAppRequest>>,
694    /// Total number of matching app requests.
695    #[serde(rename = "totalSize")]
696    pub total_size: Option<i32>,
697}
698
699impl common::ResponseResult for GoogleChromeManagementV1CountChromeAppRequestsResponse {}
700
701/// Response containing counts for browsers that need attention.
702///
703/// # Activities
704///
705/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
706/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
707///
708/// * [reports count chrome browsers needing attention customers](CustomerReportCountChromeBrowsersNeedingAttentionCall) (response)
709#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
710#[serde_with::serde_as]
711#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
712pub struct GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse {
713    /// Number of browsers that haven’t had any recent activity
714    #[serde(rename = "noRecentActivityCount")]
715    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
716    pub no_recent_activity_count: Option<i64>,
717    /// Number of browsers that are pending an OS update
718    #[serde(rename = "pendingBrowserUpdateCount")]
719    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
720    pub pending_browser_update_count: Option<i64>,
721    /// Number of browsers that have been recently enrolled
722    #[serde(rename = "recentlyEnrolledCount")]
723    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
724    pub recently_enrolled_count: Option<i64>,
725}
726
727impl common::ResponseResult
728    for GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse
729{
730}
731
732/// Response contains a list of CrashEventCountByVersionPerDay which count the chrome crash at the certain date.
733///
734/// # Activities
735///
736/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
737/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
738///
739/// * [reports count chrome crash events customers](CustomerReportCountChromeCrashEventCall) (response)
740#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
741#[serde_with::serde_as]
742#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
743pub struct GoogleChromeManagementV1CountChromeCrashEventsResponse {
744    /// Crash event counts grouped by date and browser version.
745    #[serde(rename = "crashEventCounts")]
746    pub crash_event_counts:
747        Option<Vec<GoogleChromeManagementV1CountChromeCrashEventsResponseCrashEventCount>>,
748}
749
750impl common::ResponseResult for GoogleChromeManagementV1CountChromeCrashEventsResponse {}
751
752/// The `count` of the Chrome crash events at the `date`.
753///
754/// This type is not used in any activity, and only used as *part* of another schema.
755///
756#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
757#[serde_with::serde_as]
758#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
759pub struct GoogleChromeManagementV1CountChromeCrashEventsResponseCrashEventCount {
760    /// Browser version this is counting.
761    #[serde(rename = "browserVersion")]
762    pub browser_version: Option<String>,
763    /// Total count of crash events.
764    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
765    pub count: Option<i64>,
766    /// Date of the crash event.
767    pub date: Option<GoogleTypeDate>,
768}
769
770impl common::Part for GoogleChromeManagementV1CountChromeCrashEventsResponseCrashEventCount {}
771
772/// Response containing a list of devices expiring in each month of a selected time frame. Counts are grouped by model and Auto Update Expiration date.
773///
774/// # Activities
775///
776/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
777/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
778///
779/// * [reports count chrome devices reaching auto expiration date customers](CustomerReportCountChromeDevicesReachingAutoExpirationDateCall) (response)
780#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
781#[serde_with::serde_as]
782#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
783pub struct GoogleChromeManagementV1CountChromeDevicesReachingAutoExpirationDateResponse {
784    /// The list of reports sorted by auto update expiration date in ascending order.
785    #[serde(rename = "deviceAueCountReports")]
786    pub device_aue_count_reports: Option<Vec<GoogleChromeManagementV1DeviceAueCountReport>>,
787}
788
789impl common::ResponseResult
790    for GoogleChromeManagementV1CountChromeDevicesReachingAutoExpirationDateResponse
791{
792}
793
794/// Response containing counts for devices that need attention.
795///
796/// # Activities
797///
798/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
799/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
800///
801/// * [reports count chrome devices that need attention customers](CustomerReportCountChromeDevicesThatNeedAttentionCall) (response)
802#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
803#[serde_with::serde_as]
804#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
805pub struct GoogleChromeManagementV1CountChromeDevicesThatNeedAttentionResponse {
806    /// Number of ChromeOS devices have not synced policies in the past 28 days.
807    #[serde(rename = "noRecentPolicySyncCount")]
808    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
809    pub no_recent_policy_sync_count: Option<i64>,
810    /// Number of ChromeOS devices that have not seen any user activity in the past 28 days.
811    #[serde(rename = "noRecentUserActivityCount")]
812    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
813    pub no_recent_user_activity_count: Option<i64>,
814    /// Number of devices whose OS version is not compliant.
815    #[serde(rename = "osVersionNotCompliantCount")]
816    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
817    pub os_version_not_compliant_count: Option<i64>,
818    /// Number of devices that are pending an OS update.
819    #[serde(rename = "pendingUpdate")]
820    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
821    pub pending_update: Option<i64>,
822    /// Number of devices that are unable to apply a policy due to an OS version mismatch.
823    #[serde(rename = "unsupportedPolicyCount")]
824    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
825    pub unsupported_policy_count: Option<i64>,
826}
827
828impl common::ResponseResult
829    for GoogleChromeManagementV1CountChromeDevicesThatNeedAttentionResponse
830{
831}
832
833/// Response containing a list of devices with a specific type of hardware specification from the requested hardware type.
834///
835/// # Activities
836///
837/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
838/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
839///
840/// * [reports count chrome hardware fleet devices customers](CustomerReportCountChromeHardwareFleetDeviceCall) (response)
841#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
842#[serde_with::serde_as]
843#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
844pub struct GoogleChromeManagementV1CountChromeHardwareFleetDevicesResponse {
845    /// The DeviceHardwareCountReport for device cpu type (for example Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz).
846    #[serde(rename = "cpuReports")]
847    pub cpu_reports: Option<Vec<GoogleChromeManagementV1DeviceHardwareCountReport>>,
848    /// The DeviceHardwareCountReport for device memory amount in gigabytes (for example 16).
849    #[serde(rename = "memoryReports")]
850    pub memory_reports: Option<Vec<GoogleChromeManagementV1DeviceHardwareCountReport>>,
851    /// The DeviceHardwareCountReport for device model type (for example Acer C7 Chromebook).
852    #[serde(rename = "modelReports")]
853    pub model_reports: Option<Vec<GoogleChromeManagementV1DeviceHardwareCountReport>>,
854    /// The DeviceHardwareCountReport for device storage amount in gigabytes (for example 128).
855    #[serde(rename = "storageReports")]
856    pub storage_reports: Option<Vec<GoogleChromeManagementV1DeviceHardwareCountReport>>,
857}
858
859impl common::ResponseResult for GoogleChromeManagementV1CountChromeHardwareFleetDevicesResponse {}
860
861/// Response containing requested browser versions details and counts.
862///
863/// # Activities
864///
865/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
866/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
867///
868/// * [reports count chrome versions customers](CustomerReportCountChromeVersionCall) (response)
869#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
870#[serde_with::serde_as]
871#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
872pub struct GoogleChromeManagementV1CountChromeVersionsResponse {
873    /// List of all browser versions and their install counts.
874    #[serde(rename = "browserVersions")]
875    pub browser_versions: Option<Vec<GoogleChromeManagementV1BrowserVersion>>,
876    /// Token to specify the next page of the request.
877    #[serde(rename = "nextPageToken")]
878    pub next_page_token: Option<String>,
879    /// Total number browser versions matching request.
880    #[serde(rename = "totalSize")]
881    pub total_size: Option<i32>,
882}
883
884impl common::ResponseResult for GoogleChromeManagementV1CountChromeVersionsResponse {}
885
886/// Response containing the number of devices with the given boot type.
887///
888/// # Activities
889///
890/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
891/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
892///
893/// * [reports count devices per boot type customers](CustomerReportCountDevicesPerBootTypeCall) (response)
894#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
895#[serde_with::serde_as]
896#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
897pub struct GoogleChromeManagementV1CountDevicesPerBootTypeResponse {
898    /// Number of devices with dev boot type.
899    #[serde(rename = "devBootTypeCount")]
900    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
901    pub dev_boot_type_count: Option<i64>,
902    /// Number of devices with unreported boot type.
903    #[serde(rename = "unreportedBootTypeCount")]
904    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
905    pub unreported_boot_type_count: Option<i64>,
906    /// Number of devices with verified boot type.
907    #[serde(rename = "verifiedBootTypeCount")]
908    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
909    pub verified_boot_type_count: Option<i64>,
910}
911
912impl common::ResponseResult for GoogleChromeManagementV1CountDevicesPerBootTypeResponse {}
913
914/// Response containing the number of devices with the given channel.
915///
916/// # Activities
917///
918/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
919/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
920///
921/// * [reports count devices per release channel customers](CustomerReportCountDevicesPerReleaseChannelCall) (response)
922#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
923#[serde_with::serde_as]
924#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
925pub struct GoogleChromeManagementV1CountDevicesPerReleaseChannelResponse {
926    /// Number of devices with beta release channel.
927    #[serde(rename = "betaChannelCount")]
928    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
929    pub beta_channel_count: Option<i64>,
930    /// Number of devices with canary release channel.
931    #[serde(rename = "canaryChannelCount")]
932    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
933    pub canary_channel_count: Option<i64>,
934    /// Number of devices with dev release channel.
935    #[serde(rename = "devChannelCount")]
936    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
937    pub dev_channel_count: Option<i64>,
938    /// Number of devices with ltc release channel.
939    #[serde(rename = "ltcChannelCount")]
940    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
941    pub ltc_channel_count: Option<i64>,
942    /// Number of devices with lts release channel.
943    #[serde(rename = "ltsChannelCount")]
944    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
945    pub lts_channel_count: Option<i64>,
946    /// Number of devices with stable release channel.
947    #[serde(rename = "stableChannelCount")]
948    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
949    pub stable_channel_count: Option<i64>,
950    /// Number of devices with an unreported release channel.
951    #[serde(rename = "unreportedChannelCount")]
952    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
953    pub unreported_channel_count: Option<i64>,
954    /// Number of devices with unsupported release channel.
955    #[serde(rename = "unsupportedChannelCount")]
956    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
957    pub unsupported_channel_count: Option<i64>,
958}
959
960impl common::ResponseResult for GoogleChromeManagementV1CountDevicesPerReleaseChannelResponse {}
961
962/// Response containing details of queried installed apps.
963///
964/// # Activities
965///
966/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
967/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
968///
969/// * [reports count installed apps customers](CustomerReportCountInstalledAppCall) (response)
970#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
971#[serde_with::serde_as]
972#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
973pub struct GoogleChromeManagementV1CountInstalledAppsResponse {
974    /// List of installed apps matching request.
975    #[serde(rename = "installedApps")]
976    pub installed_apps: Option<Vec<GoogleChromeManagementV1InstalledApp>>,
977    /// Token to specify the next page of the request.
978    #[serde(rename = "nextPageToken")]
979    pub next_page_token: Option<String>,
980    /// Total number of installed apps matching request.
981    #[serde(rename = "totalSize")]
982    pub total_size: Option<i32>,
983}
984
985impl common::ResponseResult for GoogleChromeManagementV1CountInstalledAppsResponse {}
986
987/// Response containing a summary printing report for each printer from the specified organizational unit for the requested time interval.
988///
989/// # Activities
990///
991/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
992/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
993///
994/// * [reports count print jobs by printer customers](CustomerReportCountPrintJobsByPrinterCall) (response)
995#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
996#[serde_with::serde_as]
997#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
998pub struct GoogleChromeManagementV1CountPrintJobsByPrinterResponse {
999    /// Pagination token for requesting the next page.
1000    #[serde(rename = "nextPageToken")]
1001    pub next_page_token: Option<String>,
1002    /// List of PrinterReports matching request.
1003    #[serde(rename = "printerReports")]
1004    pub printer_reports: Option<Vec<GoogleChromeManagementV1PrinterReport>>,
1005    /// Total number of printers matching request.
1006    #[serde(rename = "totalSize")]
1007    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1008    pub total_size: Option<i64>,
1009}
1010
1011impl common::ResponseResult for GoogleChromeManagementV1CountPrintJobsByPrinterResponse {}
1012
1013/// Response containing a summary printing report for each user that has initiated a print job with a printer from the specified organizational unit during the requested time interval.
1014///
1015/// # Activities
1016///
1017/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1018/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1019///
1020/// * [reports count print jobs by user customers](CustomerReportCountPrintJobsByUserCall) (response)
1021#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1022#[serde_with::serde_as]
1023#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1024pub struct GoogleChromeManagementV1CountPrintJobsByUserResponse {
1025    /// Pagination token for requesting the next page.
1026    #[serde(rename = "nextPageToken")]
1027    pub next_page_token: Option<String>,
1028    /// Total number of users matching request.
1029    #[serde(rename = "totalSize")]
1030    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1031    pub total_size: Option<i64>,
1032    /// List of UserPrintReports matching request.
1033    #[serde(rename = "userPrintReports")]
1034    pub user_print_reports: Option<Vec<GoogleChromeManagementV1UserPrintReport>>,
1035}
1036
1037impl common::ResponseResult for GoogleChromeManagementV1CountPrintJobsByUserResponse {}
1038
1039/// CPU specifications for the device * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportDeviceCpuInfo](https://chromeenterprise.google/policies/#ReportDeviceCpuInfo) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_CPU_INFO
1040///
1041/// This type is not used in any activity, and only used as *part* of another schema.
1042///
1043#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1044#[serde_with::serde_as]
1045#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1046pub struct GoogleChromeManagementV1CpuInfo {
1047    /// Output only. Architecture type for the CPU. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportDeviceCpuInfo](https://chromeenterprise.google/policies/#ReportDeviceCpuInfo) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A
1048    pub architecture: Option<String>,
1049    /// Output only. Whether keylocker is configured.`TRUE` = Enabled; `FALSE` = disabled. Only reported if keylockerSupported = `TRUE`.
1050    #[serde(rename = "keylockerConfigured")]
1051    pub keylocker_configured: Option<bool>,
1052    /// Output only. Whether keylocker is supported.
1053    #[serde(rename = "keylockerSupported")]
1054    pub keylocker_supported: Option<bool>,
1055    /// Output only. The max CPU clock speed in kHz.
1056    #[serde(rename = "maxClockSpeed")]
1057    pub max_clock_speed: Option<i32>,
1058    /// Output only. The CPU model name. Example: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
1059    pub model: Option<String>,
1060}
1061
1062impl common::Part for GoogleChromeManagementV1CpuInfo {}
1063
1064/// Provides information about the status of the CPU. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceCpuInfo](https://chromeenterprise.google/policies/#ReportDeviceCpuInfo) * Data Collection Frequency: Every 10 minutes * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_CPU_REPORT
1065///
1066/// This type is not used in any activity, and only used as *part* of another schema.
1067///
1068#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1069#[serde_with::serde_as]
1070#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1071pub struct GoogleChromeManagementV1CpuStatusReport {
1072    /// Output only. CPU temperature sample info per CPU core in Celsius
1073    #[serde(rename = "cpuTemperatureInfo")]
1074    pub cpu_temperature_info: Option<Vec<GoogleChromeManagementV1CpuTemperatureInfo>>,
1075    /// Output only. Sample of CPU utilization (0-100 percent).
1076    #[serde(rename = "cpuUtilizationPct")]
1077    pub cpu_utilization_pct: Option<i32>,
1078    /// Output only. The timestamp in milliseconds representing time at which this report was sampled.
1079    #[serde(rename = "reportTime")]
1080    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1081    /// Output only. Frequency the report is sampled.
1082    #[serde(rename = "sampleFrequency")]
1083    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1084    pub sample_frequency: Option<chrono::Duration>,
1085}
1086
1087impl common::Part for GoogleChromeManagementV1CpuStatusReport {}
1088
1089/// CPU temperature of a device. Sampled per CPU core in Celsius. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceCpuInfo](https://chromeenterprise.google/policies/#ReportDeviceCpuInfo) * Data Collection Frequency: Every 10 minutes * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A
1090///
1091/// This type is not used in any activity, and only used as *part* of another schema.
1092///
1093#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1094#[serde_with::serde_as]
1095#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1096pub struct GoogleChromeManagementV1CpuTemperatureInfo {
1097    /// Output only. CPU label. Example: Core 0
1098    pub label: Option<String>,
1099    /// Output only. CPU temperature in Celsius.
1100    #[serde(rename = "temperatureCelsius")]
1101    pub temperature_celsius: Option<i32>,
1102}
1103
1104impl common::Part for GoogleChromeManagementV1CpuTemperatureInfo {}
1105
1106/// Describes a device reporting Chrome browser information.
1107///
1108/// This type is not used in any activity, and only used as *part* of another schema.
1109///
1110#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1111#[serde_with::serde_as]
1112#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1113pub struct GoogleChromeManagementV1Device {
1114    /// Output only. The ID of the device that reported this Chrome browser information.
1115    #[serde(rename = "deviceId")]
1116    pub device_id: Option<String>,
1117    /// Output only. The name of the machine within its local network.
1118    pub machine: Option<String>,
1119}
1120
1121impl common::Part for GoogleChromeManagementV1Device {}
1122
1123/// Device activity report. * Granular permission needed: TELEMETRY_API_DEVICE_ACTIVITY_REPORT
1124///
1125/// This type is not used in any activity, and only used as *part* of another schema.
1126///
1127#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1128#[serde_with::serde_as]
1129#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1130pub struct GoogleChromeManagementV1DeviceActivityReport {
1131    /// Output only. Device activity state.
1132    #[serde(rename = "deviceActivityState")]
1133    pub device_activity_state: Option<String>,
1134    /// Output only. Timestamp of when the report was collected.
1135    #[serde(rename = "reportTime")]
1136    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1137}
1138
1139impl common::Part for GoogleChromeManagementV1DeviceActivityReport {}
1140
1141/// Report for CountChromeDevicesPerAueDateResponse, contains the count of devices of a specific model and auto update expiration range.
1142///
1143/// This type is not used in any activity, and only used as *part* of another schema.
1144///
1145#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1146#[serde_with::serde_as]
1147#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1148pub struct GoogleChromeManagementV1DeviceAueCountReport {
1149    /// Enum value of month corresponding to the auto update expiration date in UTC time zone. If the device is already expired, this field is empty.
1150    #[serde(rename = "aueMonth")]
1151    pub aue_month: Option<String>,
1152    /// Int value of year corresponding to the Auto Update Expiration date in UTC time zone. If the device is already expired, this field is empty.
1153    #[serde(rename = "aueYear")]
1154    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1155    pub aue_year: Option<i64>,
1156    /// Count of devices of this model.
1157    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1158    pub count: Option<i64>,
1159    /// Boolean value for whether or not the device has already expired.
1160    pub expired: Option<bool>,
1161    /// Public model name of the devices.
1162    pub model: Option<String>,
1163}
1164
1165impl common::Part for GoogleChromeManagementV1DeviceAueCountReport {}
1166
1167/// Report for CountChromeDevicesPerHardwareSpecResponse, contains the count of devices with a unique hardware specification.
1168///
1169/// This type is not used in any activity, and only used as *part* of another schema.
1170///
1171#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1172#[serde_with::serde_as]
1173#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1174pub struct GoogleChromeManagementV1DeviceHardwareCountReport {
1175    /// Public name of the hardware specification.
1176    pub bucket: Option<String>,
1177    /// Count of devices with a unique hardware specification.
1178    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1179    pub count: Option<i64>,
1180}
1181
1182impl common::Part for GoogleChromeManagementV1DeviceHardwareCountReport {}
1183
1184/// Details of a device requesting an extension, including the name of the device and the justification of the request.
1185///
1186/// This type is not used in any activity, and only used as *part* of another schema.
1187///
1188#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1189#[serde_with::serde_as]
1190#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1191pub struct GoogleChromeManagementV1DeviceRequestingExtensionDetails {
1192    /// The name of a device that has requested the extension.
1193    #[serde(rename = "deviceName")]
1194    pub device_name: Option<String>,
1195    /// Request justification as entered by the user.
1196    pub justification: Option<String>,
1197}
1198
1199impl common::Part for GoogleChromeManagementV1DeviceRequestingExtensionDetails {}
1200
1201/// Status of the single storage device.
1202///
1203/// This type is not used in any activity, and only used as *part* of another schema.
1204///
1205#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1206#[serde_with::serde_as]
1207#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1208pub struct GoogleChromeManagementV1DiskInfo {
1209    /// Output only. Number of bytes read since last boot.
1210    #[serde(rename = "bytesReadThisSession")]
1211    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1212    pub bytes_read_this_session: Option<i64>,
1213    /// Output only. Number of bytes written since last boot.
1214    #[serde(rename = "bytesWrittenThisSession")]
1215    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1216    pub bytes_written_this_session: Option<i64>,
1217    /// Output only. Time spent discarding since last boot. Discarding is writing to clear blocks which are no longer in use. Supported on kernels 4.18+.
1218    #[serde(rename = "discardTimeThisSession")]
1219    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1220    pub discard_time_this_session: Option<chrono::Duration>,
1221    /// Output only. Disk health.
1222    pub health: Option<String>,
1223    /// Output only. Counts the time the disk and queue were busy, so unlike the fields above, parallel requests are not counted multiple times.
1224    #[serde(rename = "ioTimeThisSession")]
1225    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1226    pub io_time_this_session: Option<chrono::Duration>,
1227    /// Output only. Disk manufacturer.
1228    pub manufacturer: Option<String>,
1229    /// Output only. Disk model.
1230    pub model: Option<String>,
1231    /// Output only. Time spent reading from disk since last boot.
1232    #[serde(rename = "readTimeThisSession")]
1233    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1234    pub read_time_this_session: Option<chrono::Duration>,
1235    /// Output only. Disk serial number.
1236    #[serde(rename = "serialNumber")]
1237    pub serial_number: Option<String>,
1238    /// Output only. Disk size.
1239    #[serde(rename = "sizeBytes")]
1240    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1241    pub size_bytes: Option<i64>,
1242    /// Output only. Disk type: eMMC / NVMe / ATA / SCSI.
1243    #[serde(rename = "type")]
1244    pub type_: Option<String>,
1245    /// Output only. Disk volumes.
1246    #[serde(rename = "volumeIds")]
1247    pub volume_ids: Option<Vec<String>>,
1248    /// Output only. Time spent writing to disk since last boot.
1249    #[serde(rename = "writeTimeThisSession")]
1250    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1251    pub write_time_this_session: Option<chrono::Duration>,
1252}
1253
1254impl common::Part for GoogleChromeManagementV1DiskInfo {}
1255
1256/// Information of a display device.
1257///
1258/// This type is not used in any activity, and only used as *part* of another schema.
1259///
1260#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1261#[serde_with::serde_as]
1262#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1263pub struct GoogleChromeManagementV1DisplayDevice {
1264    /// Output only. Display height in millimeters.
1265    #[serde(rename = "displayHeightMm")]
1266    pub display_height_mm: Option<i32>,
1267    /// Output only. Display device name.
1268    #[serde(rename = "displayName")]
1269    pub display_name: Option<String>,
1270    /// Output only. Display width in millimeters.
1271    #[serde(rename = "displayWidthMm")]
1272    pub display_width_mm: Option<i32>,
1273    /// Output only. EDID version.
1274    #[serde(rename = "edidVersion")]
1275    pub edid_version: Option<String>,
1276    /// Output only. Is display internal or not.
1277    pub internal: Option<bool>,
1278    /// Output only. Year of manufacture.
1279    #[serde(rename = "manufactureYear")]
1280    pub manufacture_year: Option<i32>,
1281    /// Output only. Three letter manufacturer ID.
1282    #[serde(rename = "manufacturerId")]
1283    pub manufacturer_id: Option<String>,
1284    /// Output only. Manufacturer product code.
1285    #[serde(rename = "modelId")]
1286    pub model_id: Option<i32>,
1287    /// Output only. Serial number.
1288    #[serde(rename = "serialNumber")]
1289    pub serial_number: Option<i32>,
1290}
1291
1292impl common::Part for GoogleChromeManagementV1DisplayDevice {}
1293
1294/// Information for a display.
1295///
1296/// This type is not used in any activity, and only used as *part* of another schema.
1297///
1298#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1299#[serde_with::serde_as]
1300#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1301pub struct GoogleChromeManagementV1DisplayInfo {
1302    /// Output only. Represents the graphics card device id.
1303    #[serde(rename = "deviceId")]
1304    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1305    pub device_id: Option<i64>,
1306    /// Output only. Display device name.
1307    #[serde(rename = "displayName")]
1308    pub display_name: Option<String>,
1309    /// Output only. EDID version.
1310    #[serde(rename = "edidVersion")]
1311    pub edid_version: Option<String>,
1312    /// Output only. Indicates if display is internal or not.
1313    #[serde(rename = "isInternal")]
1314    pub is_internal: Option<bool>,
1315    /// Output only. Refresh rate in Hz.
1316    #[serde(rename = "refreshRate")]
1317    pub refresh_rate: Option<i32>,
1318    /// Output only. Resolution height in pixels.
1319    #[serde(rename = "resolutionHeight")]
1320    pub resolution_height: Option<i32>,
1321    /// Output only. Resolution width in pixels.
1322    #[serde(rename = "resolutionWidth")]
1323    pub resolution_width: Option<i32>,
1324    /// Output only. Serial number.
1325    #[serde(rename = "serialNumber")]
1326    pub serial_number: Option<i32>,
1327}
1328
1329impl common::Part for GoogleChromeManagementV1DisplayInfo {}
1330
1331/// Response containing a list of print jobs.
1332///
1333/// # Activities
1334///
1335/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1336/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1337///
1338/// * [reports enumerate print jobs customers](CustomerReportEnumeratePrintJobCall) (response)
1339#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1340#[serde_with::serde_as]
1341#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1342pub struct GoogleChromeManagementV1EnumeratePrintJobsResponse {
1343    /// A token, which can be used in a subsequent request to retrieve the next page. If this field is omitted, there are no subsequent pages.
1344    #[serde(rename = "nextPageToken")]
1345    pub next_page_token: Option<String>,
1346    /// List of requested print jobs.
1347    #[serde(rename = "printJobs")]
1348    pub print_jobs: Option<Vec<GoogleChromeManagementV1PrintJob>>,
1349    /// Total number of print jobs matching request.
1350    #[serde(rename = "totalSize")]
1351    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1352    pub total_size: Option<i64>,
1353}
1354
1355impl common::ResponseResult for GoogleChromeManagementV1EnumeratePrintJobsResponse {}
1356
1357/// Response containing a list of devices that have requested the queried extension.
1358///
1359/// # Activities
1360///
1361/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1362/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1363///
1364/// * [apps fetch devices requesting extension customers](CustomerAppFetchDevicesRequestingExtensionCall) (response)
1365#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1366#[serde_with::serde_as]
1367#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1368pub struct GoogleChromeManagementV1FetchDevicesRequestingExtensionResponse {
1369    /// Details of devices that have requested the queried extension.
1370    #[serde(rename = "deviceDetails")]
1371    pub device_details: Option<Vec<GoogleChromeManagementV1DeviceRequestingExtensionDetails>>,
1372    /// Optional. Token to specify the next page in the list. Token expires after 1 day.
1373    #[serde(rename = "nextPageToken")]
1374    pub next_page_token: Option<String>,
1375    /// Optional. Total number of devices in response.
1376    #[serde(rename = "totalSize")]
1377    pub total_size: Option<i32>,
1378}
1379
1380impl common::ResponseResult for GoogleChromeManagementV1FetchDevicesRequestingExtensionResponse {}
1381
1382/// Response containing a list of users that have requested the queried extension.
1383///
1384/// # Activities
1385///
1386/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1387/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1388///
1389/// * [apps fetch users requesting extension customers](CustomerAppFetchUsersRequestingExtensionCall) (response)
1390#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1391#[serde_with::serde_as]
1392#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1393pub struct GoogleChromeManagementV1FetchUsersRequestingExtensionResponse {
1394    /// Token to specify the next page in the list.
1395    #[serde(rename = "nextPageToken")]
1396    pub next_page_token: Option<String>,
1397    /// Total number of users in response.
1398    #[serde(rename = "totalSize")]
1399    pub total_size: Option<i32>,
1400    /// Details of users that have requested the queried extension.
1401    #[serde(rename = "userDetails")]
1402    pub user_details: Option<Vec<GoogleChromeManagementV1UserRequestingExtensionDetails>>,
1403}
1404
1405impl common::ResponseResult for GoogleChromeManagementV1FetchUsersRequestingExtensionResponse {}
1406
1407/// Response containing a list of devices with queried app installed.
1408///
1409/// # Activities
1410///
1411/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1412/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1413///
1414/// * [reports find installed app devices customers](CustomerReportFindInstalledAppDeviceCall) (response)
1415#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1416#[serde_with::serde_as]
1417#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1418pub struct GoogleChromeManagementV1FindInstalledAppDevicesResponse {
1419    /// A list of devices which have the app installed. Sorted in ascending alphabetical order on the Device.machine field.
1420    pub devices: Option<Vec<GoogleChromeManagementV1Device>>,
1421    /// Token to specify the next page of the request.
1422    #[serde(rename = "nextPageToken")]
1423    pub next_page_token: Option<String>,
1424    /// Total number of devices matching request.
1425    #[serde(rename = "totalSize")]
1426    pub total_size: Option<i32>,
1427}
1428
1429impl common::ResponseResult for GoogleChromeManagementV1FindInstalledAppDevicesResponse {}
1430
1431/// Information of a graphics adapter (GPU).
1432///
1433/// This type is not used in any activity, and only used as *part* of another schema.
1434///
1435#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1436#[serde_with::serde_as]
1437#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1438pub struct GoogleChromeManagementV1GraphicsAdapterInfo {
1439    /// Output only. Adapter name. Example: Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2).
1440    pub adapter: Option<String>,
1441    /// Output only. Represents the graphics card device id.
1442    #[serde(rename = "deviceId")]
1443    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1444    pub device_id: Option<i64>,
1445    /// Output only. Version of the GPU driver.
1446    #[serde(rename = "driverVersion")]
1447    pub driver_version: Option<String>,
1448}
1449
1450impl common::Part for GoogleChromeManagementV1GraphicsAdapterInfo {}
1451
1452/// Information of the graphics subsystem. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportDeviceGraphicsStatus](https://chromeenterprise.google/policies/#ReportDeviceGraphicsStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_GRAPHICS_INFO
1453///
1454/// This type is not used in any activity, and only used as *part* of another schema.
1455///
1456#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1457#[serde_with::serde_as]
1458#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1459pub struct GoogleChromeManagementV1GraphicsInfo {
1460    /// Output only. Information about the graphics adapter (GPU).
1461    #[serde(rename = "adapterInfo")]
1462    pub adapter_info: Option<GoogleChromeManagementV1GraphicsAdapterInfo>,
1463    /// Output only. Information about the display(s) of the device.
1464    #[serde(rename = "displayDevices")]
1465    pub display_devices: Option<Vec<GoogleChromeManagementV1DisplayDevice>>,
1466    /// Output only. Is ePrivacy screen supported or not.
1467    #[serde(rename = "eprivacySupported")]
1468    pub eprivacy_supported: Option<bool>,
1469    /// Output only. Information about the internal touch screen(s) of the device.
1470    #[serde(rename = "touchScreenInfo")]
1471    pub touch_screen_info: Option<GoogleChromeManagementV1TouchScreenInfo>,
1472}
1473
1474impl common::Part for GoogleChromeManagementV1GraphicsInfo {}
1475
1476/// Information of the graphics subsystem. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceGraphicsInfo](https://chromeenterprise.google/policies/#ReportDeviceGraphicsInfo) * Data Collection Frequency: 3 hours. * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_GRAPHICS_REPORT
1477///
1478/// This type is not used in any activity, and only used as *part* of another schema.
1479///
1480#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1481#[serde_with::serde_as]
1482#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1483pub struct GoogleChromeManagementV1GraphicsStatusReport {
1484    /// Output only. Information about the displays for the device.
1485    pub displays: Option<Vec<GoogleChromeManagementV1DisplayInfo>>,
1486    /// Output only. Time at which the graphics data was reported.
1487    #[serde(rename = "reportTime")]
1488    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1489}
1490
1491impl common::Part for GoogleChromeManagementV1GraphicsStatusReport {}
1492
1493/// Heartbeat status report of a device. * Available for Kiosks * This field provides online/offline/unknown status of a device and will only be included if the status has changed (e.g. Online -> Offline) * Data for this field is controlled via policy: [HeartbeatEnabled](https://chromeenterprise.google/policies/#HeartbeatEnabled) [More Info](https://support.google.com/chrome/a/answer/6179663#:~:text=On%20the%20Chrome,device%20status%20alerts) * Heartbeat Frequency: 2 mins * Note: If a device goes offline, it can take up to 12 minutes for the online status of the device to be updated * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: N/A * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_DEVICE_ACTIVITY_REPORT
1494///
1495/// This type is not used in any activity, and only used as *part* of another schema.
1496///
1497#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1498#[serde_with::serde_as]
1499#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1500pub struct GoogleChromeManagementV1HeartbeatStatusReport {
1501    /// Timestamp of when status changed was detected
1502    #[serde(rename = "reportTime")]
1503    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1504    /// State the device changed to
1505    pub state: Option<String>,
1506}
1507
1508impl common::Part for GoogleChromeManagementV1HeartbeatStatusReport {}
1509
1510/// Data that describes the result of the HTTPS latency diagnostics routine, with the HTTPS requests issued to Google websites.
1511///
1512/// This type is not used in any activity, and only used as *part* of another schema.
1513///
1514#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1515#[serde_with::serde_as]
1516#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1517pub struct GoogleChromeManagementV1HttpsLatencyRoutineData {
1518    /// Output only. HTTPS latency if routine succeeded or failed because of HIGH_LATENCY or VERY_HIGH_LATENCY.
1519    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1520    pub latency: Option<chrono::Duration>,
1521    /// Output only. HTTPS latency routine problem if a problem occurred.
1522    pub problem: Option<String>,
1523}
1524
1525impl common::Part for GoogleChromeManagementV1HttpsLatencyRoutineData {}
1526
1527/// Describes an installed app.
1528///
1529/// This type is not used in any activity, and only used as *part* of another schema.
1530///
1531#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1532#[serde_with::serde_as]
1533#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1534pub struct GoogleChromeManagementV1InstalledApp {
1535    /// Output only. Unique identifier of the app. For Chrome apps and extensions, the 32-character id (e.g. ehoadneljpdggcbbknedodolkkjodefl). For Android apps, the package name (e.g. com.evernote).
1536    #[serde(rename = "appId")]
1537    pub app_id: Option<String>,
1538    /// Output only. How the app was installed.
1539    #[serde(rename = "appInstallType")]
1540    pub app_install_type: Option<String>,
1541    /// Output only. Source of the installed app.
1542    #[serde(rename = "appSource")]
1543    pub app_source: Option<String>,
1544    /// Output only. Type of the app.
1545    #[serde(rename = "appType")]
1546    pub app_type: Option<String>,
1547    /// Output only. Count of browser devices with this app installed.
1548    #[serde(rename = "browserDeviceCount")]
1549    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1550    pub browser_device_count: Option<i64>,
1551    /// Output only. Description of the installed app.
1552    pub description: Option<String>,
1553    /// Output only. Whether the app is disabled.
1554    pub disabled: Option<bool>,
1555    /// Output only. Name of the installed app.
1556    #[serde(rename = "displayName")]
1557    pub display_name: Option<String>,
1558    /// Output only. Homepage uri of the installed app.
1559    #[serde(rename = "homepageUri")]
1560    pub homepage_uri: Option<String>,
1561    /// Output only. Count of ChromeOS users with this app installed.
1562    #[serde(rename = "osUserCount")]
1563    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1564    pub os_user_count: Option<i64>,
1565    /// Output only. Permissions of the installed app.
1566    pub permissions: Option<Vec<String>>,
1567    /// Output only. If available, the risk assessment data about this extension.
1568    #[serde(rename = "riskAssessment")]
1569    pub risk_assessment: Option<GoogleChromeManagementV1RiskAssessmentData>,
1570}
1571
1572impl common::Part for GoogleChromeManagementV1InstalledApp {}
1573
1574/// Kiosk app status report of a device. * Available for Kiosks * This field provides the app id and version number running on a kiosk device and the timestamp of when the report was last updated * Data for this field is controlled via policy: [ReportDeviceSessionStatus](https://chromeenterprise.google/policies/#ReportDeviceSessionStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_APPS_REPORT
1575///
1576/// This type is not used in any activity, and only used as *part* of another schema.
1577///
1578#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1579#[serde_with::serde_as]
1580#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1581pub struct GoogleChromeManagementV1KioskAppStatusReport {
1582    /// App id of kiosk app for example "mdmkkicfmmkgmpkmkdikhlbggogpicma"
1583    #[serde(rename = "appId")]
1584    pub app_id: Option<String>,
1585    /// App version number of kiosk app for example "1.10.118"
1586    #[serde(rename = "appVersion")]
1587    pub app_version: Option<String>,
1588    /// Timestamp of when report was collected
1589    #[serde(rename = "reportTime")]
1590    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1591}
1592
1593impl common::Part for GoogleChromeManagementV1KioskAppStatusReport {}
1594
1595/// There is no detailed description.
1596///
1597/// # Activities
1598///
1599/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1600/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1601///
1602/// * [telemetry devices list customers](CustomerTelemetryDeviceListCall) (response)
1603#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1604#[serde_with::serde_as]
1605#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1606pub struct GoogleChromeManagementV1ListTelemetryDevicesResponse {
1607    /// Telemetry devices returned in the response.
1608    pub devices: Option<Vec<GoogleChromeManagementV1TelemetryDevice>>,
1609    /// Token to specify next page in the list.
1610    #[serde(rename = "nextPageToken")]
1611    pub next_page_token: Option<String>,
1612}
1613
1614impl common::ResponseResult for GoogleChromeManagementV1ListTelemetryDevicesResponse {}
1615
1616/// Response message for listing telemetry events for a customer.
1617///
1618/// # Activities
1619///
1620/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1621/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1622///
1623/// * [telemetry events list customers](CustomerTelemetryEventListCall) (response)
1624#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1625#[serde_with::serde_as]
1626#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1627pub struct GoogleChromeManagementV1ListTelemetryEventsResponse {
1628    /// Token to specify next page in the list.
1629    #[serde(rename = "nextPageToken")]
1630    pub next_page_token: Option<String>,
1631    /// Telemetry events returned in the response.
1632    #[serde(rename = "telemetryEvents")]
1633    pub telemetry_events: Option<Vec<GoogleChromeManagementV1TelemetryEvent>>,
1634}
1635
1636impl common::ResponseResult for GoogleChromeManagementV1ListTelemetryEventsResponse {}
1637
1638/// Response message for listing notification configs for a customer.
1639///
1640/// # Activities
1641///
1642/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1643/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1644///
1645/// * [telemetry notification configs list customers](CustomerTelemetryNotificationConfigListCall) (response)
1646#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1647#[serde_with::serde_as]
1648#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1649pub struct GoogleChromeManagementV1ListTelemetryNotificationConfigsResponse {
1650    /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
1651    #[serde(rename = "nextPageToken")]
1652    pub next_page_token: Option<String>,
1653    /// The telemetry notification configs from the specified customer.
1654    #[serde(rename = "telemetryNotificationConfigs")]
1655    pub telemetry_notification_configs:
1656        Option<Vec<GoogleChromeManagementV1TelemetryNotificationConfig>>,
1657}
1658
1659impl common::ResponseResult for GoogleChromeManagementV1ListTelemetryNotificationConfigsResponse {}
1660
1661/// Response message for listing telemetry users for a customer.
1662///
1663/// # Activities
1664///
1665/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
1666/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
1667///
1668/// * [telemetry users list customers](CustomerTelemetryUserListCall) (response)
1669#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1670#[serde_with::serde_as]
1671#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1672pub struct GoogleChromeManagementV1ListTelemetryUsersResponse {
1673    /// Token to specify next page in the list.
1674    #[serde(rename = "nextPageToken")]
1675    pub next_page_token: Option<String>,
1676    /// Telemetry users returned in the response.
1677    #[serde(rename = "telemetryUsers")]
1678    pub telemetry_users: Option<Vec<GoogleChromeManagementV1TelemetryUser>>,
1679}
1680
1681impl common::ResponseResult for GoogleChromeManagementV1ListTelemetryUsersResponse {}
1682
1683/// Memory information of a device. * This field has both telemetry and device information: - `totalRamBytes` - Device information - `availableRamBytes` - Telemetry information - `totalMemoryEncryption` - Device information * Data for this field is controlled via policy: [ReportDeviceMemoryInfo](https://chromeenterprise.google/policies/#ReportDeviceMemoryInfo) * Data Collection Frequency: - `totalRamBytes` - Only at upload - `availableRamBytes` - Every 10 minutes - `totalMemoryEncryption` - at device startup * Default Data Reporting Frequency: - `totalRamBytes` - 3 hours - `availableRamBytes` - 3 hours - `totalMemoryEncryption` - at device startup - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: only for `totalMemoryEncryption` * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_MEMORY_INFO
1684///
1685/// This type is not used in any activity, and only used as *part* of another schema.
1686///
1687#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1688#[serde_with::serde_as]
1689#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1690pub struct GoogleChromeManagementV1MemoryInfo {
1691    /// Output only. Amount of available RAM in bytes.
1692    #[serde(rename = "availableRamBytes")]
1693    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1694    pub available_ram_bytes: Option<i64>,
1695    /// Output only. Total memory encryption info for the device.
1696    #[serde(rename = "totalMemoryEncryption")]
1697    pub total_memory_encryption: Option<GoogleChromeManagementV1TotalMemoryEncryptionInfo>,
1698    /// Output only. Total RAM in bytes.
1699    #[serde(rename = "totalRamBytes")]
1700    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1701    pub total_ram_bytes: Option<i64>,
1702}
1703
1704impl common::Part for GoogleChromeManagementV1MemoryInfo {}
1705
1706/// Contains samples of memory status reports. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceMemoryInfo](https://chromeenterprise.google/policies/#ReportDeviceMemoryInfo) * Data Collection Frequency: Only at upload, SystemRamFreeByes is collected every 10 minutes * Default Data Reporting Frequency: Every 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_MEMORY_REPORT
1707///
1708/// This type is not used in any activity, and only used as *part* of another schema.
1709///
1710#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1711#[serde_with::serde_as]
1712#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1713pub struct GoogleChromeManagementV1MemoryStatusReport {
1714    /// Output only. Number of page faults during this collection
1715    #[serde(rename = "pageFaults")]
1716    pub page_faults: Option<i32>,
1717    /// Output only. The timestamp in milliseconds representing time at which this report was sampled.
1718    #[serde(rename = "reportTime")]
1719    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1720    /// Output only. Frequency the report is sampled.
1721    #[serde(rename = "sampleFrequency")]
1722    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1723    pub sample_frequency: Option<chrono::Duration>,
1724    /// Output only. Amount of free RAM in bytes (unreliable due to Garbage Collection).
1725    #[serde(rename = "systemRamFreeBytes")]
1726    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1727    pub system_ram_free_bytes: Option<i64>,
1728}
1729
1730impl common::Part for GoogleChromeManagementV1MemoryStatusReport {}
1731
1732/// Network bandwidth report. * Granular permission needed: TELEMETRY_API_NETWORK_REPORT
1733///
1734/// This type is not used in any activity, and only used as *part* of another schema.
1735///
1736#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1737#[serde_with::serde_as]
1738#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1739pub struct GoogleChromeManagementV1NetworkBandwidthReport {
1740    /// Output only. Download speed in kilobits per second.
1741    #[serde(rename = "downloadSpeedKbps")]
1742    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1743    pub download_speed_kbps: Option<i64>,
1744    /// Output only. Timestamp of when the report was collected.
1745    #[serde(rename = "reportTime")]
1746    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1747}
1748
1749impl common::Part for GoogleChromeManagementV1NetworkBandwidthReport {}
1750
1751/// Details about the network device. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportNetworkDeviceConfiguration](https://chromeenterprise.google/policies/#ReportNetworkDeviceConfiguration) * Data Collection Frequency: At device startup * Default Data Reporting Frequency: At device startup - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: Yes * Reported for affiliated users only: N/A
1752///
1753/// This type is not used in any activity, and only used as *part* of another schema.
1754///
1755#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1756#[serde_with::serde_as]
1757#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1758pub struct GoogleChromeManagementV1NetworkDevice {
1759    /// Output only. The integrated circuit card ID associated with the device's sim card.
1760    pub iccid: Option<String>,
1761    /// Output only. IMEI (if applicable) of the corresponding network device.
1762    pub imei: Option<String>,
1763    /// Output only. MAC address (if applicable) of the corresponding network device.
1764    #[serde(rename = "macAddress")]
1765    pub mac_address: Option<String>,
1766    /// Output only. The mobile directory number associated with the device's sim card.
1767    pub mdn: Option<String>,
1768    /// Output only. MEID (if applicable) of the corresponding network device.
1769    pub meid: Option<String>,
1770    /// Output only. Network device type.
1771    #[serde(rename = "type")]
1772    pub type_: Option<String>,
1773}
1774
1775impl common::Part for GoogleChromeManagementV1NetworkDevice {}
1776
1777/// Network testing results to determine the health of the device's network connection, for example whether the HTTPS latency is high or normal. * Granular permission needed: TELEMETRY_API_NETWORK_REPORT
1778///
1779/// This type is not used in any activity, and only used as *part* of another schema.
1780///
1781#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1782#[serde_with::serde_as]
1783#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1784pub struct GoogleChromeManagementV1NetworkDiagnosticsReport {
1785    /// Output only. HTTPS latency test data.
1786    #[serde(rename = "httpsLatencyData")]
1787    pub https_latency_data: Option<GoogleChromeManagementV1HttpsLatencyRoutineData>,
1788    /// Output only. Timestamp of when the diagnostics were collected.
1789    #[serde(rename = "reportTime")]
1790    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1791}
1792
1793impl common::Part for GoogleChromeManagementV1NetworkDiagnosticsReport {}
1794
1795/// Network device information. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportNetworkDeviceConfiguration](https://chromeenterprise.google/policies/#ReportNetworkDeviceConfiguration) * Data Collection Frequency: At device startup * Default Data Reporting Frequency: At device startup - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: Yes * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_NETWORK_INFO
1796///
1797/// This type is not used in any activity, and only used as *part* of another schema.
1798///
1799#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1800#[serde_with::serde_as]
1801#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1802pub struct GoogleChromeManagementV1NetworkInfo {
1803    /// Output only. List of network devices.
1804    #[serde(rename = "networkDevices")]
1805    pub network_devices: Option<Vec<GoogleChromeManagementV1NetworkDevice>>,
1806}
1807
1808impl common::Part for GoogleChromeManagementV1NetworkInfo {}
1809
1810/// State of visible/configured networks. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportNetworkStatus](https://chromeenterprise.google/policies/#ReportNetworkStatus) * Data Collection Frequency: 60 minutes * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: Yes * Reported for affiliated users only: Yes * Granular permission needed: TELEMETRY_API_NETWORK_REPORT
1811///
1812/// This type is not used in any activity, and only used as *part* of another schema.
1813///
1814#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1815#[serde_with::serde_as]
1816#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1817pub struct GoogleChromeManagementV1NetworkStatusReport {
1818    /// Output only. Current connection state of the network.
1819    #[serde(rename = "connectionState")]
1820    pub connection_state: Option<String>,
1821    /// Output only. Network connection type.
1822    #[serde(rename = "connectionType")]
1823    pub connection_type: Option<String>,
1824    /// Output only. Whether the wifi encryption key is turned off.
1825    #[serde(rename = "encryptionOn")]
1826    pub encryption_on: Option<bool>,
1827    /// Output only. Gateway IP address.
1828    #[serde(rename = "gatewayIpAddress")]
1829    pub gateway_ip_address: Option<String>,
1830    /// Output only. The gateway IPv6 for this interface, if detected
1831    #[serde(rename = "gatewayIpv6Address")]
1832    pub gateway_ipv6_address: Option<String>,
1833    /// Output only. Network connection guid.
1834    pub guid: Option<String>,
1835    /// Output only. IPv6 addresses assigned to this network, if any. Each address is a string in standard IPv6 text representation (e.g., "2001:db8::1").
1836    #[serde(rename = "ipv6Address")]
1837    pub ipv6_address: Option<Vec<String>>,
1838    /// Output only. LAN IP address.
1839    #[serde(rename = "lanIpAddress")]
1840    pub lan_ip_address: Option<String>,
1841    /// Output only. The maximum downstream bandwidth in Kilobits per second (Kbps), if reported by the network interface or connection.
1842    #[serde(rename = "linkDownSpeedKbps")]
1843    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1844    pub link_down_speed_kbps: Option<i64>,
1845    /// Output only. Whether the network was detected as metered.
1846    pub metered: Option<bool>,
1847    /// Output only. Receiving bit rate measured in Megabits per second.
1848    #[serde(rename = "receivingBitRateMbps")]
1849    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1850    pub receiving_bit_rate_mbps: Option<i64>,
1851    /// Output only. Time at which the network state was reported.
1852    #[serde(rename = "reportTime")]
1853    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1854    /// Output only. Frequency the report is sampled.
1855    #[serde(rename = "sampleFrequency")]
1856    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
1857    pub sample_frequency: Option<chrono::Duration>,
1858    /// Output only. Signal strength for wireless networks measured in decibels.
1859    #[serde(rename = "signalStrengthDbm")]
1860    pub signal_strength_dbm: Option<i32>,
1861    /// Output only. Transmission bit rate measured in Megabits per second.
1862    #[serde(rename = "transmissionBitRateMbps")]
1863    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1864    pub transmission_bit_rate_mbps: Option<i64>,
1865    /// Output only. Transmission power measured in decibels.
1866    #[serde(rename = "transmissionPowerDbm")]
1867    pub transmission_power_dbm: Option<i32>,
1868    /// Output only. Wifi link quality. Value ranges from [0, 70]. 0 indicates no signal and 70 indicates a strong signal.
1869    #[serde(rename = "wifiLinkQuality")]
1870    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1871    pub wifi_link_quality: Option<i64>,
1872    /// Output only. Wifi power management enabled
1873    #[serde(rename = "wifiPowerManagementEnabled")]
1874    pub wifi_power_management_enabled: Option<bool>,
1875}
1876
1877impl common::Part for GoogleChromeManagementV1NetworkStatusReport {}
1878
1879/// Contains information regarding the current OS update status. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceOsUpdateStatus](https://chromeenterprise.google/policies/#ReportDeviceOsUpdateStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_OS_REPORT
1880///
1881/// This type is not used in any activity, and only used as *part* of another schema.
1882///
1883#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1884#[serde_with::serde_as]
1885#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1886pub struct GoogleChromeManagementV1OsUpdateStatus {
1887    /// Output only. Timestamp of the last reboot.
1888    #[serde(rename = "lastRebootTime")]
1889    pub last_reboot_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1890    /// Output only. Timestamp of the last update check.
1891    #[serde(rename = "lastUpdateCheckTime")]
1892    pub last_update_check_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1893    /// Output only. Timestamp of the last successful update.
1894    #[serde(rename = "lastUpdateTime")]
1895    pub last_update_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1896    /// Output only. New platform version of the os image being downloaded and applied. It is only set when update status is OS_IMAGE_DOWNLOAD_IN_PROGRESS or OS_UPDATE_NEED_REBOOT. Note this could be a dummy "0.0.0.0" for OS_UPDATE_NEED_REBOOT status for some edge cases, e.g. update engine is restarted without a reboot.
1897    #[serde(rename = "newPlatformVersion")]
1898    pub new_platform_version: Option<String>,
1899    /// Output only. New requested platform version from the pending updated kiosk app.
1900    #[serde(rename = "newRequestedPlatformVersion")]
1901    pub new_requested_platform_version: Option<String>,
1902    /// Output only. Current state of the os update.
1903    #[serde(rename = "updateState")]
1904    pub update_state: Option<String>,
1905}
1906
1907impl common::Part for GoogleChromeManagementV1OsUpdateStatus {}
1908
1909/// Peripherals report. * Granular permission needed: TELEMETRY_API_PERIPHERALS_REPORT
1910///
1911/// This type is not used in any activity, and only used as *part* of another schema.
1912///
1913#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1914#[serde_with::serde_as]
1915#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1916pub struct GoogleChromeManagementV1PeripheralsReport {
1917    /// Output only. Timestamp of when the report was collected.
1918    #[serde(rename = "reportTime")]
1919    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1920    /// Reports of all usb connected devices.
1921    #[serde(rename = "usbPeripheralReport")]
1922    pub usb_peripheral_report: Option<Vec<GoogleChromeManagementV1UsbPeripheralReport>>,
1923}
1924
1925impl common::Part for GoogleChromeManagementV1PeripheralsReport {}
1926
1927/// Represents a request to print a document that has been submitted to a printer.
1928///
1929/// This type is not used in any activity, and only used as *part* of another schema.
1930///
1931#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1932#[serde_with::serde_as]
1933#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1934pub struct GoogleChromeManagementV1PrintJob {
1935    /// Color mode.
1936    #[serde(rename = "colorMode")]
1937    pub color_mode: Option<String>,
1938    /// Print job completion timestamp.
1939    #[serde(rename = "completeTime")]
1940    pub complete_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1941    /// Number of copies.
1942    #[serde(rename = "copyCount")]
1943    pub copy_count: Option<i32>,
1944    /// Print job creation timestamp.
1945    #[serde(rename = "createTime")]
1946    pub create_time: Option<chrono::DateTime<chrono::offset::Utc>>,
1947    /// Number of pages in the document.
1948    #[serde(rename = "documentPageCount")]
1949    pub document_page_count: Option<i32>,
1950    /// Duplex mode.
1951    #[serde(rename = "duplexMode")]
1952    pub duplex_mode: Option<String>,
1953    /// Unique ID of the print job.
1954    pub id: Option<String>,
1955    /// Name of the printer used for printing.
1956    pub printer: Option<String>,
1957    /// API ID of the printer used for printing.
1958    #[serde(rename = "printerId")]
1959    pub printer_id: Option<String>,
1960    /// The final state of the job.
1961    pub state: Option<String>,
1962    /// The title of the document.
1963    pub title: Option<String>,
1964    /// The primary e-mail address of the user who submitted the print job.
1965    #[serde(rename = "userEmail")]
1966    pub user_email: Option<String>,
1967    /// The unique Directory API ID of the user who submitted the print job.
1968    #[serde(rename = "userId")]
1969    pub user_id: Option<String>,
1970}
1971
1972impl common::Part for GoogleChromeManagementV1PrintJob {}
1973
1974/// Report for CountPrintJobsByPrinter, contains statistics on printer usage. Contains the total number of print jobs initiated with this printer, the number of users and the number of devices that have initiated at least one print job with this printer.
1975///
1976/// This type is not used in any activity, and only used as *part* of another schema.
1977///
1978#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1979#[serde_with::serde_as]
1980#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1981pub struct GoogleChromeManagementV1PrinterReport {
1982    /// Number of chrome devices that have been used to send print jobs to the specified printer.
1983    #[serde(rename = "deviceCount")]
1984    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1985    pub device_count: Option<i64>,
1986    /// Number of print jobs sent to the printer.
1987    #[serde(rename = "jobCount")]
1988    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
1989    pub job_count: Option<i64>,
1990    /// Printer name.
1991    pub printer: Option<String>,
1992    /// Printer API ID.
1993    #[serde(rename = "printerId")]
1994    pub printer_id: Option<String>,
1995    /// Printer model.
1996    #[serde(rename = "printerModel")]
1997    pub printer_model: Option<String>,
1998    /// Number of users that have sent print jobs to the printer.
1999    #[serde(rename = "userCount")]
2000    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2001    pub user_count: Option<i64>,
2002}
2003
2004impl common::Part for GoogleChromeManagementV1PrinterReport {}
2005
2006/// Risk assessment for a Chrome extension.
2007///
2008/// This type is not used in any activity, and only used as *part* of another schema.
2009///
2010#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2011#[serde_with::serde_as]
2012#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2013pub struct GoogleChromeManagementV1RiskAssessment {
2014    /// Risk assessment for the extension. Currently, this is a numerical value, and its interpretation is specific to each risk assessment provider.
2015    pub assessment: Option<String>,
2016    /// A URL that a user can navigate to for more information about the risk assessment.
2017    #[serde(rename = "detailsUrl")]
2018    pub details_url: Option<String>,
2019    /// The version of the extension that this assessment applies to.
2020    pub version: Option<String>,
2021}
2022
2023impl common::Part for GoogleChromeManagementV1RiskAssessment {}
2024
2025/// Risk assessment data about an extension/app.
2026///
2027/// This type is not used in any activity, and only used as *part* of another schema.
2028///
2029#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2030#[serde_with::serde_as]
2031#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2032pub struct GoogleChromeManagementV1RiskAssessmentData {
2033    /// Individual risk assessments.
2034    pub entries: Option<Vec<GoogleChromeManagementV1RiskAssessmentEntry>>,
2035    /// Overall assessed risk level across all entries. This will be the highest risk level from all entries.
2036    #[serde(rename = "overallRiskLevel")]
2037    pub overall_risk_level: Option<String>,
2038}
2039
2040impl common::Part for GoogleChromeManagementV1RiskAssessmentData {}
2041
2042/// One risk assessment entry.
2043///
2044/// This type is not used in any activity, and only used as *part* of another schema.
2045///
2046#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2047#[serde_with::serde_as]
2048#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2049pub struct GoogleChromeManagementV1RiskAssessmentEntry {
2050    /// Output only. The risk assessment provider from which this entry comes from.
2051    pub provider: Option<String>,
2052    /// Output only. The details of the provider's risk assessment.
2053    #[serde(rename = "riskAssessment")]
2054    pub risk_assessment: Option<GoogleChromeManagementV1RiskAssessment>,
2055    /// Output only. The bucketed risk level for the risk assessment.
2056    #[serde(rename = "riskLevel")]
2057    pub risk_level: Option<String>,
2058}
2059
2060impl common::Part for GoogleChromeManagementV1RiskAssessmentEntry {}
2061
2062/// Runtime counters retrieved from CPU. Currently the runtime counters telemetry is only supported by Intel vPro PSR on Gen 14+.
2063///
2064/// This type is not used in any activity, and only used as *part* of another schema.
2065///
2066#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2067#[serde_with::serde_as]
2068#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2069pub struct GoogleChromeManagementV1RuntimeCountersReport {
2070    /// Number of times that the device has entered into the hibernation state. Currently obtained via the PSR, count from S0->S4.
2071    #[serde(rename = "enterHibernationCount")]
2072    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2073    pub enter_hibernation_count: Option<i64>,
2074    /// Number of times that the device has entered into the power-off state. Currently obtained via the PSR, count from S0->S5.
2075    #[serde(rename = "enterPoweroffCount")]
2076    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2077    pub enter_poweroff_count: Option<i64>,
2078    /// Number of times that the device has entered into the sleep state. Currently obtained via the PSR, count from S0->S3.
2079    #[serde(rename = "enterSleepCount")]
2080    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2081    pub enter_sleep_count: Option<i64>,
2082    /// Timestamp when the report was collected.
2083    #[serde(rename = "reportTime")]
2084    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2085    /// Total lifetime runtime. Currently always S0 runtime from Intel vPro PSR.
2086    #[serde(rename = "uptimeRuntimeDuration")]
2087    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
2088    pub uptime_runtime_duration: Option<chrono::Duration>,
2089}
2090
2091impl common::Part for GoogleChromeManagementV1RuntimeCountersReport {}
2092
2093/// Status data for storage. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceStorageStatus](https://chromeenterprise.google/policies/#ReportDeviceStorageStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_STORAGE_INFO
2094///
2095/// This type is not used in any activity, and only used as *part* of another schema.
2096///
2097#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2098#[serde_with::serde_as]
2099#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2100pub struct GoogleChromeManagementV1StorageInfo {
2101    /// The available space for user data storage in the device in bytes.
2102    #[serde(rename = "availableDiskBytes")]
2103    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2104    pub available_disk_bytes: Option<i64>,
2105    /// The total space for user data storage in the device in bytes.
2106    #[serde(rename = "totalDiskBytes")]
2107    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2108    pub total_disk_bytes: Option<i64>,
2109    /// Information for disk volumes
2110    pub volume: Option<Vec<GoogleChromeManagementV1StorageInfoDiskVolume>>,
2111}
2112
2113impl common::Part for GoogleChromeManagementV1StorageInfo {}
2114
2115/// Information for disk volumes
2116///
2117/// This type is not used in any activity, and only used as *part* of another schema.
2118///
2119#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2120#[serde_with::serde_as]
2121#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2122pub struct GoogleChromeManagementV1StorageInfoDiskVolume {
2123    /// Free storage space in bytes.
2124    #[serde(rename = "storageFreeBytes")]
2125    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2126    pub storage_free_bytes: Option<i64>,
2127    /// Total storage space in bytes.
2128    #[serde(rename = "storageTotalBytes")]
2129    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2130    pub storage_total_bytes: Option<i64>,
2131    /// Disk volume id.
2132    #[serde(rename = "volumeId")]
2133    pub volume_id: Option<String>,
2134}
2135
2136impl common::Part for GoogleChromeManagementV1StorageInfoDiskVolume {}
2137
2138/// Status data for storage. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceStorageStatus](https://chromeenterprise.google/policies/#ReportDeviceStorageStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_STORAGE_REPORT
2139///
2140/// This type is not used in any activity, and only used as *part* of another schema.
2141///
2142#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2143#[serde_with::serde_as]
2144#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2145pub struct GoogleChromeManagementV1StorageStatusReport {
2146    /// Output only. Reports on disk.
2147    pub disk: Option<Vec<GoogleChromeManagementV1DiskInfo>>,
2148    /// Output only. Timestamp of when the sample was collected on device
2149    #[serde(rename = "reportTime")]
2150    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2151}
2152
2153impl common::Part for GoogleChromeManagementV1StorageStatusReport {}
2154
2155/// App installation data.
2156///
2157/// This type is not used in any activity, and only used as *part* of another schema.
2158///
2159#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2160#[serde_with::serde_as]
2161#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2162pub struct GoogleChromeManagementV1TelemetryAppInstallEvent {
2163    /// App id. For PWAs this is the start URL, and for extensions this is the extension id.
2164    #[serde(rename = "appId")]
2165    pub app_id: Option<String>,
2166    /// App installation reason.
2167    #[serde(rename = "appInstallReason")]
2168    pub app_install_reason: Option<String>,
2169    /// App installation source.
2170    #[serde(rename = "appInstallSource")]
2171    pub app_install_source: Option<String>,
2172    /// App installation time depending on the app lifecycle.
2173    #[serde(rename = "appInstallTime")]
2174    pub app_install_time: Option<String>,
2175    /// Type of app.
2176    #[serde(rename = "appType")]
2177    pub app_type: Option<String>,
2178}
2179
2180impl common::Part for GoogleChromeManagementV1TelemetryAppInstallEvent {}
2181
2182/// App launch data.
2183///
2184/// This type is not used in any activity, and only used as *part* of another schema.
2185///
2186#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2187#[serde_with::serde_as]
2188#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2189pub struct GoogleChromeManagementV1TelemetryAppLaunchEvent {
2190    /// App id. For PWAs this is the start URL, and for extensions this is the extension id.
2191    #[serde(rename = "appId")]
2192    pub app_id: Option<String>,
2193    /// App launch source.
2194    #[serde(rename = "appLaunchSource")]
2195    pub app_launch_source: Option<String>,
2196    /// Type of app.
2197    #[serde(rename = "appType")]
2198    pub app_type: Option<String>,
2199}
2200
2201impl common::Part for GoogleChromeManagementV1TelemetryAppLaunchEvent {}
2202
2203/// App uninstall data.
2204///
2205/// This type is not used in any activity, and only used as *part* of another schema.
2206///
2207#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2208#[serde_with::serde_as]
2209#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2210pub struct GoogleChromeManagementV1TelemetryAppUninstallEvent {
2211    /// App id. For PWAs this is the start URL, and for extensions this is the extension id.
2212    #[serde(rename = "appId")]
2213    pub app_id: Option<String>,
2214    /// Type of app.
2215    #[serde(rename = "appType")]
2216    pub app_type: Option<String>,
2217    /// App uninstall source.
2218    #[serde(rename = "appUninstallSource")]
2219    pub app_uninstall_source: Option<String>,
2220}
2221
2222impl common::Part for GoogleChromeManagementV1TelemetryAppUninstallEvent {}
2223
2224/// `TelemetryAudioSevereUnderrunEvent` is triggered when a audio devices run out of buffer data for more than 5 seconds. * Granular permission needed: TELEMETRY_API_AUDIO_REPORT
2225///
2226/// This type is not used in any activity, and only used as *part* of another schema.
2227///
2228#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2229#[serde_with::serde_as]
2230#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2231pub struct GoogleChromeManagementV1TelemetryAudioSevereUnderrunEvent {
2232    _never_set: Option<bool>,
2233}
2234
2235impl common::Part for GoogleChromeManagementV1TelemetryAudioSevereUnderrunEvent {}
2236
2237/// Telemetry data collected from a managed device. * Granular permission needed: TELEMETRY_API_DEVICE
2238///
2239/// # Activities
2240///
2241/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
2242/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
2243///
2244/// * [telemetry devices get customers](CustomerTelemetryDeviceGetCall) (response)
2245#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2246#[serde_with::serde_as]
2247#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2248pub struct GoogleChromeManagementV1TelemetryDevice {
2249    /// Output only. App reports collected periodically sorted in a decreasing order of report_time.
2250    #[serde(rename = "appReport")]
2251    pub app_report: Option<Vec<GoogleChromeManagementV1AppReport>>,
2252    /// Output only. Audio reports collected periodically sorted in a decreasing order of report_time.
2253    #[serde(rename = "audioStatusReport")]
2254    pub audio_status_report: Option<Vec<GoogleChromeManagementV1AudioStatusReport>>,
2255    /// Output only. Information on battery specs for the device.
2256    #[serde(rename = "batteryInfo")]
2257    pub battery_info: Option<Vec<GoogleChromeManagementV1BatteryInfo>>,
2258    /// Output only. Battery reports collected periodically.
2259    #[serde(rename = "batteryStatusReport")]
2260    pub battery_status_report: Option<Vec<GoogleChromeManagementV1BatteryStatusReport>>,
2261    /// Output only. Boot performance reports of the device.
2262    #[serde(rename = "bootPerformanceReport")]
2263    pub boot_performance_report: Option<Vec<GoogleChromeManagementV1BootPerformanceReport>>,
2264    /// Output only. Information regarding CPU specs for the device.
2265    #[serde(rename = "cpuInfo")]
2266    pub cpu_info: Option<Vec<GoogleChromeManagementV1CpuInfo>>,
2267    /// Output only. CPU status reports collected periodically sorted in a decreasing order of report_time.
2268    #[serde(rename = "cpuStatusReport")]
2269    pub cpu_status_report: Option<Vec<GoogleChromeManagementV1CpuStatusReport>>,
2270    /// Output only. Google Workspace Customer whose enterprise enrolled the device.
2271    pub customer: Option<String>,
2272    /// Output only. The unique Directory API ID of the device. This value is the same as the Admin Console's Directory API ID in the ChromeOS Devices tab
2273    #[serde(rename = "deviceId")]
2274    pub device_id: Option<String>,
2275    /// Output only. Contains information regarding Graphic peripherals for the device.
2276    #[serde(rename = "graphicsInfo")]
2277    pub graphics_info: Option<GoogleChromeManagementV1GraphicsInfo>,
2278    /// Output only. Graphics reports collected periodically.
2279    #[serde(rename = "graphicsStatusReport")]
2280    pub graphics_status_report: Option<Vec<GoogleChromeManagementV1GraphicsStatusReport>>,
2281    /// Output only. Heartbeat status report containing timestamps periodically sorted in decreasing order of report_time
2282    #[serde(rename = "heartbeatStatusReport")]
2283    pub heartbeat_status_report: Option<Vec<GoogleChromeManagementV1HeartbeatStatusReport>>,
2284    /// Output only. Kiosk app status report for the kiosk device
2285    #[serde(rename = "kioskAppStatusReport")]
2286    pub kiosk_app_status_report: Option<Vec<GoogleChromeManagementV1KioskAppStatusReport>>,
2287    /// Output only. Information regarding memory specs for the device.
2288    #[serde(rename = "memoryInfo")]
2289    pub memory_info: Option<GoogleChromeManagementV1MemoryInfo>,
2290    /// Output only. Memory status reports collected periodically sorted decreasing by report_time.
2291    #[serde(rename = "memoryStatusReport")]
2292    pub memory_status_report: Option<Vec<GoogleChromeManagementV1MemoryStatusReport>>,
2293    /// Output only. Resource name of the device.
2294    pub name: Option<String>,
2295    /// Output only. Network bandwidth reports collected periodically sorted in a decreasing order of report_time.
2296    #[serde(rename = "networkBandwidthReport")]
2297    pub network_bandwidth_report: Option<Vec<GoogleChromeManagementV1NetworkBandwidthReport>>,
2298    /// Output only. Network diagnostics collected periodically.
2299    #[serde(rename = "networkDiagnosticsReport")]
2300    pub network_diagnostics_report: Option<Vec<GoogleChromeManagementV1NetworkDiagnosticsReport>>,
2301    /// Output only. Network devices information.
2302    #[serde(rename = "networkInfo")]
2303    pub network_info: Option<GoogleChromeManagementV1NetworkInfo>,
2304    /// Output only. Network specs collected periodically.
2305    #[serde(rename = "networkStatusReport")]
2306    pub network_status_report: Option<Vec<GoogleChromeManagementV1NetworkStatusReport>>,
2307    /// Output only. Organization unit ID of the device.
2308    #[serde(rename = "orgUnitId")]
2309    pub org_unit_id: Option<String>,
2310    /// Output only. Contains relevant information regarding ChromeOS update status.
2311    #[serde(rename = "osUpdateStatus")]
2312    pub os_update_status: Option<Vec<GoogleChromeManagementV1OsUpdateStatus>>,
2313    /// Output only. Peripherals reports collected periodically sorted in a decreasing order of report_time.
2314    #[serde(rename = "peripheralsReport")]
2315    pub peripherals_report: Option<Vec<GoogleChromeManagementV1PeripheralsReport>>,
2316    /// Output only. Runtime counters reports collected device lifetime runtime, as well as the counts of S0->S3, S0->S4, and S0->S5 transitions, meaning entering into sleep, hibernation, and power-off states
2317    #[serde(rename = "runtimeCountersReport")]
2318    pub runtime_counters_report: Option<Vec<GoogleChromeManagementV1RuntimeCountersReport>>,
2319    /// Output only. Device serial number. This value is the same as the Admin Console's Serial Number in the ChromeOS Devices tab.
2320    #[serde(rename = "serialNumber")]
2321    pub serial_number: Option<String>,
2322    /// Output only. Information of storage specs for the device.
2323    #[serde(rename = "storageInfo")]
2324    pub storage_info: Option<GoogleChromeManagementV1StorageInfo>,
2325    /// Output only. Storage reports collected periodically.
2326    #[serde(rename = "storageStatusReport")]
2327    pub storage_status_report: Option<Vec<GoogleChromeManagementV1StorageStatusReport>>,
2328    /// Output only. Information on Thunderbolt bus.
2329    #[serde(rename = "thunderboltInfo")]
2330    pub thunderbolt_info: Option<Vec<GoogleChromeManagementV1ThunderboltInfo>>,
2331}
2332
2333impl common::ResponseResult for GoogleChromeManagementV1TelemetryDevice {}
2334
2335/// Information about a device associated with telemetry data. * Granular Permission needed: TELEMETRY_API_DEVICE
2336///
2337/// This type is not used in any activity, and only used as *part* of another schema.
2338///
2339#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2340#[serde_with::serde_as]
2341#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2342pub struct GoogleChromeManagementV1TelemetryDeviceInfo {
2343    /// Output only. The unique Directory API ID of the device. This value is the same as the Admin Console's Directory API ID in the ChromeOS Devices tab.
2344    #[serde(rename = "deviceId")]
2345    pub device_id: Option<String>,
2346    /// Output only. Organization unit ID of the device.
2347    #[serde(rename = "orgUnitId")]
2348    pub org_unit_id: Option<String>,
2349}
2350
2351impl common::Part for GoogleChromeManagementV1TelemetryDeviceInfo {}
2352
2353/// Telemetry data reported by a managed device.
2354///
2355/// This type is not used in any activity, and only used as *part* of another schema.
2356///
2357#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2358#[serde_with::serde_as]
2359#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2360pub struct GoogleChromeManagementV1TelemetryEvent {
2361    /// Output only. Payload for app install event. Present only when `event_type` is `APP_INSTALLED`.
2362    #[serde(rename = "appInstallEvent")]
2363    pub app_install_event: Option<GoogleChromeManagementV1TelemetryAppInstallEvent>,
2364    /// Output only. Payload for app launch event.Present only when `event_type` is `APP_LAUNCHED`.
2365    #[serde(rename = "appLaunchEvent")]
2366    pub app_launch_event: Option<GoogleChromeManagementV1TelemetryAppLaunchEvent>,
2367    /// Output only. Payload for app uninstall event. Present only when `event_type` is `APP_UNINSTALLED`.
2368    #[serde(rename = "appUninstallEvent")]
2369    pub app_uninstall_event: Option<GoogleChromeManagementV1TelemetryAppUninstallEvent>,
2370    /// Output only. Payload for audio severe underrun event. Present only when the `event_type` field is `AUDIO_SEVERE_UNDERRUN`.
2371    #[serde(rename = "audioSevereUnderrunEvent")]
2372    pub audio_severe_underrun_event:
2373        Option<GoogleChromeManagementV1TelemetryAudioSevereUnderrunEvent>,
2374    /// Output only. Information about the device associated with the event.
2375    pub device: Option<GoogleChromeManagementV1TelemetryDeviceInfo>,
2376    /// The event type of the current event.
2377    #[serde(rename = "eventType")]
2378    pub event_type: Option<String>,
2379    /// Output only. Payload for external display connected/disconnected event. Present only when `event_type` is `EXTERNAL_DISPLAY_CONNECTED` or `EXTERNAL_DISPLAY_DISCONNECTED`.
2380    #[serde(rename = "externalDisplaysEvent")]
2381    pub external_displays_event: Option<GoogleChromeManagementV1TelemetryExternalDisplayEvent>,
2382    /// Output only. Payload for HTTPS latency change event. Present only when `event_type` is `NETWORK_HTTPS_LATENCY_CHANGE`.
2383    #[serde(rename = "httpsLatencyChangeEvent")]
2384    pub https_latency_change_event:
2385        Option<GoogleChromeManagementV1TelemetryHttpsLatencyChangeEvent>,
2386    /// Output only. Resource name of the event.
2387    pub name: Option<String>,
2388    /// Output only. Payload for network connection state change event. Present only when `event_type` is `NETWORK_STATE_CHANGE`.
2389    #[serde(rename = "networkStateChangeEvent")]
2390    pub network_state_change_event:
2391        Option<GoogleChromeManagementV1TelemetryNetworkConnectionStateChangeEvent>,
2392    /// Output only. Payload for OS crash event. Present only when `event_type` is `OS_CRASH`.
2393    #[serde(rename = "osCrashEvent")]
2394    pub os_crash_event: Option<GoogleChromeManagementV1TelemetryOsCrashEvent>,
2395    /// Timestamp that represents when the event was reported.
2396    #[serde(rename = "reportTime")]
2397    pub report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2398    /// Output only. Payload for usb peripherals event. Present only when the `event_type` field is either `USB_ADDED` or `USB_REMOVED`.
2399    #[serde(rename = "usbPeripheralsEvent")]
2400    pub usb_peripherals_event: Option<GoogleChromeManagementV1TelemetryUsbPeripheralsEvent>,
2401    /// Output only. Information about the user associated with the event.
2402    pub user: Option<GoogleChromeManagementV1TelemetryUserInfo>,
2403    /// Output only. Payload for VPN connection state change event. Present only when `event_type` is `VPN_CONNECTION_STATE_CHANGE`.
2404    #[serde(rename = "vpnConnectionStateChangeEvent")]
2405    pub vpn_connection_state_change_event:
2406        Option<GoogleChromeManagementV1TelemetryNetworkConnectionStateChangeEvent>,
2407    /// Output only. Payload for WiFi signal strength events. Present only when `event_type` is `WIFI_SIGNAL_STRENGTH_LOW` or `WIFI_SIGNAL_STRENGTH_RECOVERED`.
2408    #[serde(rename = "wifiSignalStrengthEvent")]
2409    pub wifi_signal_strength_event:
2410        Option<GoogleChromeManagementV1TelemetryNetworkSignalStrengthEvent>,
2411}
2412
2413impl common::Part for GoogleChromeManagementV1TelemetryEvent {}
2414
2415/// Configures how the telemetry events should be filtered.
2416///
2417/// This type is not used in any activity, and only used as *part* of another schema.
2418///
2419#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2420#[serde_with::serde_as]
2421#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2422pub struct GoogleChromeManagementV1TelemetryEventNotificationFilter {
2423    /// Only sends the notifications for events of these types. Must not be empty.
2424    #[serde(rename = "eventTypes")]
2425    pub event_types: Option<Vec<String>>,
2426}
2427
2428impl common::Part for GoogleChromeManagementV1TelemetryEventNotificationFilter {}
2429
2430/// External display data.
2431///
2432/// This type is not used in any activity, and only used as *part* of another schema.
2433///
2434#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2435#[serde_with::serde_as]
2436#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2437pub struct GoogleChromeManagementV1TelemetryExternalDisplayData {
2438    /// The display name.
2439    #[serde(rename = "displayName")]
2440    pub display_name: Option<String>,
2441    /// The EDID version.
2442    #[serde(rename = "edidVersion")]
2443    pub edid_version: Option<String>,
2444    /// The refresh rate.
2445    #[serde(rename = "refreshRate")]
2446    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2447    pub refresh_rate: Option<i64>,
2448    /// The horizontal resolution.
2449    #[serde(rename = "resolutionHorizontal")]
2450    pub resolution_horizontal: Option<i32>,
2451    /// The vertical resolution.
2452    #[serde(rename = "resolutionVertical")]
2453    pub resolution_vertical: Option<i32>,
2454    /// The serial number.
2455    #[serde(rename = "serialNumber")]
2456    pub serial_number: Option<i32>,
2457}
2458
2459impl common::Part for GoogleChromeManagementV1TelemetryExternalDisplayData {}
2460
2461/// External display connected/disconnected event payload.
2462///
2463/// This type is not used in any activity, and only used as *part* of another schema.
2464///
2465#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2466#[serde_with::serde_as]
2467#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2468pub struct GoogleChromeManagementV1TelemetryExternalDisplayEvent {
2469    /// List of external displays that were connected/disconnected.
2470    #[serde(rename = "externalDisplayData")]
2471    pub external_display_data: Option<Vec<GoogleChromeManagementV1TelemetryExternalDisplayData>>,
2472}
2473
2474impl common::Part for GoogleChromeManagementV1TelemetryExternalDisplayEvent {}
2475
2476/// Https latency routine is run periodically and `TelemetryHttpsLatencyChangeEvent` is triggered if a latency problem was detected or if the device has recovered from a latency problem. * Granular permission needed: TELEMETRY_API_NETWORK_REPORT
2477///
2478/// This type is not used in any activity, and only used as *part* of another schema.
2479///
2480#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2481#[serde_with::serde_as]
2482#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2483pub struct GoogleChromeManagementV1TelemetryHttpsLatencyChangeEvent {
2484    /// HTTPS latency routine data that triggered the event.
2485    #[serde(rename = "httpsLatencyRoutineData")]
2486    pub https_latency_routine_data: Option<GoogleChromeManagementV1HttpsLatencyRoutineData>,
2487    /// Current HTTPS latency state.
2488    #[serde(rename = "httpsLatencyState")]
2489    pub https_latency_state: Option<String>,
2490}
2491
2492impl common::Part for GoogleChromeManagementV1TelemetryHttpsLatencyChangeEvent {}
2493
2494/// `TelemetryNetworkConnectionStateChangeEvent` is triggered on network connection state changes. * Granular permission needed: TELEMETRY_API_NETWORK_REPORT
2495///
2496/// This type is not used in any activity, and only used as *part* of another schema.
2497///
2498#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2499#[serde_with::serde_as]
2500#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2501pub struct GoogleChromeManagementV1TelemetryNetworkConnectionStateChangeEvent {
2502    /// Current connection state of the network.
2503    #[serde(rename = "connectionState")]
2504    pub connection_state: Option<String>,
2505    /// Unique identifier of the network.
2506    pub guid: Option<String>,
2507}
2508
2509impl common::Part for GoogleChromeManagementV1TelemetryNetworkConnectionStateChangeEvent {}
2510
2511/// `TelemetryNetworkSignalStrengthEvent` is triggered on WiFi signal strength events. * Granular permission needed: TELEMETRY_API_NETWORK_REPORT
2512///
2513/// This type is not used in any activity, and only used as *part* of another schema.
2514///
2515#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2516#[serde_with::serde_as]
2517#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2518pub struct GoogleChromeManagementV1TelemetryNetworkSignalStrengthEvent {
2519    /// Unique identifier of the network.
2520    pub guid: Option<String>,
2521    /// Signal strength RSSI value.
2522    #[serde(rename = "signalStrengthDbm")]
2523    pub signal_strength_dbm: Option<i32>,
2524}
2525
2526impl common::Part for GoogleChromeManagementV1TelemetryNetworkSignalStrengthEvent {}
2527
2528/// Configuration to receive notifications of telemetry data.
2529///
2530/// # Activities
2531///
2532/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
2533/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
2534///
2535/// * [telemetry notification configs create customers](CustomerTelemetryNotificationConfigCreateCall) (request|response)
2536#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2537#[serde_with::serde_as]
2538#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2539pub struct GoogleChromeManagementV1TelemetryNotificationConfig {
2540    /// Output only. Google Workspace customer that owns the resource.
2541    pub customer: Option<String>,
2542    /// Only send notifications for telemetry data matching this filter.
2543    pub filter: Option<GoogleChromeManagementV1TelemetryNotificationFilter>,
2544    /// The pubsub topic to which notifications are published to.
2545    #[serde(rename = "googleCloudPubsubTopic")]
2546    pub google_cloud_pubsub_topic: Option<String>,
2547    /// Output only. Resource name of the notification configuration.
2548    pub name: Option<String>,
2549}
2550
2551impl common::RequestValue for GoogleChromeManagementV1TelemetryNotificationConfig {}
2552impl common::ResponseResult for GoogleChromeManagementV1TelemetryNotificationConfig {}
2553
2554/// Configures how the telemetry data should be filtered.
2555///
2556/// This type is not used in any activity, and only used as *part* of another schema.
2557///
2558#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2559#[serde_with::serde_as]
2560#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2561pub struct GoogleChromeManagementV1TelemetryNotificationFilter {
2562    /// If set, only sends notifications for telemetry data coming from this device.
2563    #[serde(rename = "deviceId")]
2564    pub device_id: Option<String>,
2565    /// If set, only sends notifications for telemetry data coming from devices in this org unit.
2566    #[serde(rename = "deviceOrgUnitId")]
2567    pub device_org_unit_id: Option<String>,
2568    /// Only sends notifications for the telemetry events matching this filter.
2569    #[serde(rename = "telemetryEventNotificationFilter")]
2570    pub telemetry_event_notification_filter:
2571        Option<GoogleChromeManagementV1TelemetryEventNotificationFilter>,
2572    /// If set, only sends notifications for telemetry data coming from devices owned by this user.
2573    #[serde(rename = "userEmail")]
2574    pub user_email: Option<String>,
2575    /// If set, only sends notifications for telemetry data coming from devices owned by users in this org unit.
2576    #[serde(rename = "userOrgUnitId")]
2577    pub user_org_unit_id: Option<String>,
2578}
2579
2580impl common::Part for GoogleChromeManagementV1TelemetryNotificationFilter {}
2581
2582/// OS crash data.
2583///
2584/// This type is not used in any activity, and only used as *part* of another schema.
2585///
2586#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2587#[serde_with::serde_as]
2588#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2589pub struct GoogleChromeManagementV1TelemetryOsCrashEvent {
2590    /// Crash id.
2591    #[serde(rename = "crashId")]
2592    pub crash_id: Option<String>,
2593    /// Crash type.
2594    #[serde(rename = "crashType")]
2595    pub crash_type: Option<String>,
2596    /// Session type.
2597    #[serde(rename = "sessionType")]
2598    pub session_type: Option<String>,
2599}
2600
2601impl common::Part for GoogleChromeManagementV1TelemetryOsCrashEvent {}
2602
2603/// `TelemetryUsbPeripheralsEvent` is triggered USB devices are either added or removed. * Granular permission needed: TELEMETRY_API_PERIPHERALS_REPORT
2604///
2605/// This type is not used in any activity, and only used as *part* of another schema.
2606///
2607#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2608#[serde_with::serde_as]
2609#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2610pub struct GoogleChromeManagementV1TelemetryUsbPeripheralsEvent {
2611    /// List of usb devices that were either added or removed.
2612    #[serde(rename = "usbPeripheralReport")]
2613    pub usb_peripheral_report: Option<Vec<GoogleChromeManagementV1UsbPeripheralReport>>,
2614}
2615
2616impl common::Part for GoogleChromeManagementV1TelemetryUsbPeripheralsEvent {}
2617
2618/// Telemetry data collected from a managed user. * Granular permission needed: TELEMETRY_API_USER
2619///
2620/// # Activities
2621///
2622/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
2623/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
2624///
2625/// * [telemetry users get customers](CustomerTelemetryUserGetCall) (response)
2626#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2627#[serde_with::serde_as]
2628#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2629pub struct GoogleChromeManagementV1TelemetryUser {
2630    /// G Suite Customer whose enterprise enrolled the device.
2631    pub customer: Option<String>,
2632    /// Resource name of the user.
2633    pub name: Option<String>,
2634    /// Organization unit of the user.
2635    #[serde(rename = "orgUnitId")]
2636    pub org_unit_id: Option<String>,
2637    /// Telemetry data collected from a managed user and device.
2638    #[serde(rename = "userDevice")]
2639    pub user_device: Option<Vec<GoogleChromeManagementV1TelemetryUserDevice>>,
2640    /// Email address of the user.
2641    #[serde(rename = "userEmail")]
2642    pub user_email: Option<String>,
2643    /// Directory ID of the user.
2644    #[serde(rename = "userId")]
2645    pub user_id: Option<String>,
2646}
2647
2648impl common::ResponseResult for GoogleChromeManagementV1TelemetryUser {}
2649
2650/// Telemetry data collected for a managed user and device. * Granular permission needed: TELEMETRY_API_DEVICE
2651///
2652/// This type is not used in any activity, and only used as *part* of another schema.
2653///
2654#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2655#[serde_with::serde_as]
2656#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2657pub struct GoogleChromeManagementV1TelemetryUserDevice {
2658    /// Output only. App reports collected periodically sorted in a decreasing order of report_time.
2659    #[serde(rename = "appReport")]
2660    pub app_report: Option<Vec<GoogleChromeManagementV1AppReport>>,
2661    /// Output only. Audio reports collected periodically sorted in a decreasing order of report_time.
2662    #[serde(rename = "audioStatusReport")]
2663    pub audio_status_report: Option<Vec<GoogleChromeManagementV1AudioStatusReport>>,
2664    /// Output only. Device activity reports collected periodically sorted in a decreasing order of report_time.
2665    #[serde(rename = "deviceActivityReport")]
2666    pub device_activity_report: Option<Vec<GoogleChromeManagementV1DeviceActivityReport>>,
2667    /// The unique Directory API ID of the device. This value is the same as the Admin Console's Directory API ID in the ChromeOS Devices tab.
2668    #[serde(rename = "deviceId")]
2669    pub device_id: Option<String>,
2670    /// Output only. Network bandwidth reports collected periodically sorted in a decreasing order of report_time.
2671    #[serde(rename = "networkBandwidthReport")]
2672    pub network_bandwidth_report: Option<Vec<GoogleChromeManagementV1NetworkBandwidthReport>>,
2673    /// Output only. Peripherals reports collected periodically sorted in a decreasing order of report_time.
2674    #[serde(rename = "peripheralsReport")]
2675    pub peripherals_report: Option<Vec<GoogleChromeManagementV1PeripheralsReport>>,
2676}
2677
2678impl common::Part for GoogleChromeManagementV1TelemetryUserDevice {}
2679
2680/// Information about a user associated with telemetry data. * Granular permission needed: TELEMETRY_API_USER
2681///
2682/// This type is not used in any activity, and only used as *part* of another schema.
2683///
2684#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2685#[serde_with::serde_as]
2686#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2687pub struct GoogleChromeManagementV1TelemetryUserInfo {
2688    /// Output only. User's email.
2689    pub email: Option<String>,
2690    /// Output only. Organization unit ID of the user.
2691    #[serde(rename = "orgUnitId")]
2692    pub org_unit_id: Option<String>,
2693}
2694
2695impl common::Part for GoogleChromeManagementV1TelemetryUserInfo {}
2696
2697/// Thunderbolt bus info. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportDeviceSecurityStatus](https://chromeenterprise.google/policies/#ReportDeviceSecurityStatus) * Data Collection Frequency: At device startup * Default Data Reporting Frequency: At device startup - Policy Controlled: No * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: Yes * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_BUS_DEVICE_INFO
2698///
2699/// This type is not used in any activity, and only used as *part* of another schema.
2700///
2701#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2702#[serde_with::serde_as]
2703#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2704pub struct GoogleChromeManagementV1ThunderboltInfo {
2705    /// Security level of the Thunderbolt bus.
2706    #[serde(rename = "securityLevel")]
2707    pub security_level: Option<String>,
2708}
2709
2710impl common::Part for GoogleChromeManagementV1ThunderboltInfo {}
2711
2712/// Memory encryption information of a device. * This field provides device information, which is static and will not change over time. * Data for this field is controlled via policy: [ReportDeviceMemoryInfo](https://chromeenterprise.google/policies/#ReportDeviceMemoryInfo) * Data Collection Frequency: At device startup * Default Data Reporting Frequency: At device startup - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: Yes * Reported for affiliated users only: N/A
2713///
2714/// This type is not used in any activity, and only used as *part* of another schema.
2715///
2716#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2717#[serde_with::serde_as]
2718#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2719pub struct GoogleChromeManagementV1TotalMemoryEncryptionInfo {
2720    /// Memory encryption algorithm.
2721    #[serde(rename = "encryptionAlgorithm")]
2722    pub encryption_algorithm: Option<String>,
2723    /// The state of memory encryption on the device.
2724    #[serde(rename = "encryptionState")]
2725    pub encryption_state: Option<String>,
2726    /// The length of the encryption keys.
2727    #[serde(rename = "keyLength")]
2728    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2729    pub key_length: Option<i64>,
2730    /// The maximum number of keys that can be used for encryption.
2731    #[serde(rename = "maxKeys")]
2732    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2733    pub max_keys: Option<i64>,
2734}
2735
2736impl common::Part for GoogleChromeManagementV1TotalMemoryEncryptionInfo {}
2737
2738/// Information of an internal touch screen device.
2739///
2740/// This type is not used in any activity, and only used as *part* of another schema.
2741///
2742#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2743#[serde_with::serde_as]
2744#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2745pub struct GoogleChromeManagementV1TouchScreenDevice {
2746    /// Output only. Touch screen device display name.
2747    #[serde(rename = "displayName")]
2748    pub display_name: Option<String>,
2749    /// Output only. Touch screen device is stylus capable or not.
2750    #[serde(rename = "stylusCapable")]
2751    pub stylus_capable: Option<bool>,
2752    /// Output only. Number of touch points supported on the device.
2753    #[serde(rename = "touchPointCount")]
2754    pub touch_point_count: Option<i32>,
2755}
2756
2757impl common::Part for GoogleChromeManagementV1TouchScreenDevice {}
2758
2759/// Information on the device touch screen.
2760///
2761/// This type is not used in any activity, and only used as *part* of another schema.
2762///
2763#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2764#[serde_with::serde_as]
2765#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2766pub struct GoogleChromeManagementV1TouchScreenInfo {
2767    /// Output only. List of the internal touch screen devices.
2768    pub devices: Option<Vec<GoogleChromeManagementV1TouchScreenDevice>>,
2769    /// Output only. Touchpad library name used by the input stack.
2770    #[serde(rename = "touchpadLibrary")]
2771    pub touchpad_library: Option<String>,
2772}
2773
2774impl common::Part for GoogleChromeManagementV1TouchScreenInfo {}
2775
2776/// USB connected peripheral report.
2777///
2778/// This type is not used in any activity, and only used as *part* of another schema.
2779///
2780#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2781#[serde_with::serde_as]
2782#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2783pub struct GoogleChromeManagementV1UsbPeripheralReport {
2784    /// Output only. Categories the device belongs to https://www.usb.org/defined-class-codes
2785    pub categories: Option<Vec<String>>,
2786    /// Output only. Class ID https://www.usb.org/defined-class-codes
2787    #[serde(rename = "classId")]
2788    pub class_id: Option<i32>,
2789    /// Output only. Firmware version
2790    #[serde(rename = "firmwareVersion")]
2791    pub firmware_version: Option<String>,
2792    /// Output only. Device name, model name, or product name
2793    pub name: Option<String>,
2794    /// Output only. Product ID
2795    pub pid: Option<i32>,
2796    /// Output only. Subclass ID https://www.usb.org/defined-class-codes
2797    #[serde(rename = "subclassId")]
2798    pub subclass_id: Option<i32>,
2799    /// Output only. Vendor name
2800    pub vendor: Option<String>,
2801    /// Output only. Vendor ID
2802    pub vid: Option<i32>,
2803}
2804
2805impl common::Part for GoogleChromeManagementV1UsbPeripheralReport {}
2806
2807/// Report for CountPrintJobsByUser, contains printing statistics for a user. Contains the number of printers, the number of devices used to initiate print jobs, and the number of print jobs initiated.
2808///
2809/// This type is not used in any activity, and only used as *part* of another schema.
2810///
2811#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2812#[serde_with::serde_as]
2813#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2814pub struct GoogleChromeManagementV1UserPrintReport {
2815    /// Number of chrome devices that have been used to initiate print jobs by the user.
2816    #[serde(rename = "deviceCount")]
2817    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2818    pub device_count: Option<i64>,
2819    /// Number of print jobs initiated by the user.
2820    #[serde(rename = "jobCount")]
2821    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2822    pub job_count: Option<i64>,
2823    /// Number of printers used by the user.
2824    #[serde(rename = "printerCount")]
2825    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2826    pub printer_count: Option<i64>,
2827    /// The primary e-mail address of the user.
2828    #[serde(rename = "userEmail")]
2829    pub user_email: Option<String>,
2830    /// The unique Directory API ID of the user.
2831    #[serde(rename = "userId")]
2832    pub user_id: Option<String>,
2833}
2834
2835impl common::Part for GoogleChromeManagementV1UserPrintReport {}
2836
2837/// Details of a user requesting an extension, including the email and the justification.
2838///
2839/// This type is not used in any activity, and only used as *part* of another schema.
2840///
2841#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2842#[serde_with::serde_as]
2843#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2844pub struct GoogleChromeManagementV1UserRequestingExtensionDetails {
2845    /// The e-mail address of a user that has requested the extension.
2846    pub email: Option<String>,
2847    /// Request justification as entered by the user.
2848    pub justification: Option<String>,
2849}
2850
2851impl common::Part for GoogleChromeManagementV1UserRequestingExtensionDetails {}
2852
2853/// Information of public key associated with a Chrome browser profile.
2854///
2855/// This type is not used in any activity, and only used as *part* of another schema.
2856///
2857#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2858#[serde_with::serde_as]
2859#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2860pub struct GoogleChromeManagementVersionsV1AttestationCredential {
2861    /// Output only. Latest rotation timestamp of the public key rotation.
2862    #[serde(rename = "keyRotationTime")]
2863    pub key_rotation_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2864    /// Output only. Trust level of the public key.
2865    #[serde(rename = "keyTrustLevel")]
2866    pub key_trust_level: Option<String>,
2867    /// Output only. Type of the public key.
2868    #[serde(rename = "keyType")]
2869    pub key_type: Option<String>,
2870    /// Output only. Value of the public key.
2871    #[serde(rename = "publicKey")]
2872    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
2873    pub public_key: Option<Vec<u8>>,
2874}
2875
2876impl common::Part for GoogleChromeManagementVersionsV1AttestationCredential {}
2877
2878/// A certificate provisioning process.
2879///
2880/// # Activities
2881///
2882/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
2883/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
2884///
2885/// * [certificate provisioning processes get customers](CustomerCertificateProvisioningProcessGetCall) (response)
2886#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2887#[serde_with::serde_as]
2888#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2889pub struct GoogleChromeManagementVersionsV1CertificateProvisioningProcess {
2890    /// Output only. The client certificate is being provisioned for a ChromeOS device. This contains information about the device.
2891    #[serde(rename = "chromeOsDevice")]
2892    pub chrome_os_device: Option<GoogleChromeManagementVersionsV1ChromeOsDevice>,
2893    /// Output only. The client certificate is being provisioned for a ChromeOS user. This contains information about the current user session.
2894    #[serde(rename = "chromeOsUserSession")]
2895    pub chrome_os_user_session: Option<GoogleChromeManagementVersionsV1ChromeOsUserSession>,
2896    /// Output only. A message describing why this `CertificateProvisioningProcess` has failed. Presence of this field indicates that the `CertificateProvisioningProcess` has failed.
2897    #[serde(rename = "failureMessage")]
2898    pub failure_message: Option<String>,
2899    /// Output only. The CA connection is a generic CA connection.
2900    #[serde(rename = "genericCaConnection")]
2901    pub generic_ca_connection: Option<GoogleChromeManagementVersionsV1GenericCaConnection>,
2902    /// Output only. The profile is a generic certificate provisioning profile.
2903    #[serde(rename = "genericProfile")]
2904    pub generic_profile: Option<GoogleChromeManagementVersionsV1GenericProfile>,
2905    /// Output only. The issued certificate for this `CertificateProvisioningProcess` in PEM format.
2906    #[serde(rename = "issuedCertificate")]
2907    pub issued_certificate: Option<String>,
2908    /// Identifier. Resource name of the `CertificateProvisioningProcess`. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
2909    pub name: Option<String>,
2910    /// Output only. The ID of the certificate provisioning profile.
2911    #[serde(rename = "provisioningProfileId")]
2912    pub provisioning_profile_id: Option<String>,
2913    /// Output only. The CA connection is a SCEP CA connection.
2914    #[serde(rename = "scepCaConnection")]
2915    pub scep_ca_connection: Option<GoogleChromeManagementVersionsV1ScepCaConnection>,
2916    /// Output only. The profile is a SCEP certificate provisioning profile.
2917    #[serde(rename = "scepProfile")]
2918    pub scep_profile: Option<GoogleChromeManagementVersionsV1ScepProfile>,
2919    /// Output only. The data that the client was asked to sign. This field is only present after the `SignData` operation has been initiated.
2920    #[serde(rename = "signData")]
2921    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
2922    pub sign_data: Option<Vec<u8>>,
2923    /// Output only. The signature of `signature_algorithm`, generated using the client's private key using `signature_algorithm`. This field is only present after the `SignData` operation has finished.
2924    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
2925    pub signature: Option<Vec<u8>>,
2926    /// Output only. The signature algorithm that the client and backend components use when processing `sign_data`. If the `profile_type` is a `GenericProfile`, this field will only be present after the `SignData` operation was initiated. If the `profile_type` is a `ScepProfile`, the field will always be present.
2927    #[serde(rename = "signatureAlgorithm")]
2928    pub signature_algorithm: Option<String>,
2929    /// Output only. Server-generated timestamp of when the certificate provisioning process has been created.
2930    #[serde(rename = "startTime")]
2931    pub start_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2932    /// Output only. The public key for which a certificate should be provisioned. Represented as a DER-encoded X.509 SubjectPublicKeyInfo.
2933    #[serde(rename = "subjectPublicKeyInfo")]
2934    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
2935    pub subject_public_key_info: Option<Vec<u8>>,
2936}
2937
2938impl common::ResponseResult for GoogleChromeManagementVersionsV1CertificateProvisioningProcess {}
2939
2940/// A representation of a Chrome browser profile.
2941///
2942/// # Activities
2943///
2944/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
2945/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
2946///
2947/// * [profiles get customers](CustomerProfileGetCall) (response)
2948#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
2949#[serde_with::serde_as]
2950#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
2951pub struct GoogleChromeManagementVersionsV1ChromeBrowserProfile {
2952    /// Output only. The specific affiliation state of the profile.
2953    #[serde(rename = "affiliationState")]
2954    pub affiliation_state: Option<String>,
2955    /// Optional. Location of the profile annotated by the admin.
2956    #[serde(rename = "annotatedLocation")]
2957    pub annotated_location: Option<String>,
2958    /// Optional. User of the profile annotated by the admin.
2959    #[serde(rename = "annotatedUser")]
2960    pub annotated_user: Option<String>,
2961    /// Output only. Attestation credential information of the profile.
2962    #[serde(rename = "attestationCredential")]
2963    pub attestation_credential: Option<GoogleChromeManagementVersionsV1AttestationCredential>,
2964    /// Output only. Channel of the browser on which the profile exists.
2965    #[serde(rename = "browserChannel")]
2966    pub browser_channel: Option<String>,
2967    /// Output only. Version of the browser on which the profile exists.
2968    #[serde(rename = "browserVersion")]
2969    pub browser_version: Option<String>,
2970    /// Output only. Basic information of the device on which the profile exists. This information is only available for the affiliated profiles.
2971    #[serde(rename = "deviceInfo")]
2972    pub device_info: Option<GoogleChromeManagementVersionsV1DeviceInfo>,
2973    /// Output only. Profile display name set by client.
2974    #[serde(rename = "displayName")]
2975    pub display_name: Option<String>,
2976    /// Output only. Etag of this ChromeBrowserProfile resource. This etag can be used with UPDATE operation to ensure consistency.
2977    pub etag: Option<String>,
2978    /// Output only. Number of extensions installed on the profile.
2979    #[serde(rename = "extensionCount")]
2980    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
2981    pub extension_count: Option<i64>,
2982    /// Output only. Timestamp of the first enrollment of the profile.
2983    #[serde(rename = "firstEnrollmentTime")]
2984    pub first_enrollment_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2985    /// Output only. Identify provider of the profile.
2986    #[serde(rename = "identityProvider")]
2987    pub identity_provider: Option<String>,
2988    /// Output only. Timestamp of the latest activity by the profile.
2989    #[serde(rename = "lastActivityTime")]
2990    pub last_activity_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2991    /// Output only. Timestamp of the latest policy fetch by the profile.
2992    #[serde(rename = "lastPolicyFetchTime")]
2993    pub last_policy_fetch_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2994    /// Output only. Timestamp of the latest policy sync by the profile.
2995    #[serde(rename = "lastPolicySyncTime")]
2996    pub last_policy_sync_time: Option<chrono::DateTime<chrono::offset::Utc>>,
2997    /// Output only. Timestamp of the latest status report by the profile.
2998    #[serde(rename = "lastStatusReportTime")]
2999    pub last_status_report_time: Option<chrono::DateTime<chrono::offset::Utc>>,
3000    /// Identifier. Format: customers/{customer_id}/profiles/{profile_permanent_id}
3001    pub name: Option<String>,
3002    /// Output only. OS platform of the device on which the profile exists.
3003    #[serde(rename = "osPlatformType")]
3004    pub os_platform_type: Option<String>,
3005    /// Output only. Major OS platform version of the device on which the profile exists, from profile reporting.
3006    #[serde(rename = "osPlatformVersion")]
3007    pub os_platform_version: Option<String>,
3008    /// Output only. OS version of the device on which the profile exists.
3009    #[serde(rename = "osVersion")]
3010    pub os_version: Option<String>,
3011    /// Output only. Number of policies applied on the profile.
3012    #[serde(rename = "policyCount")]
3013    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
3014    pub policy_count: Option<i64>,
3015    /// Output only. Chrome client side profile ID.
3016    #[serde(rename = "profileId")]
3017    pub profile_id: Option<String>,
3018    /// Output only. Profile permanent ID is the unique identifier of a profile within one customer.
3019    #[serde(rename = "profilePermanentId")]
3020    pub profile_permanent_id: Option<String>,
3021    /// Output only. Detailed reporting data of the profile. This information is only available when the profile reporting policy is enabled.
3022    #[serde(rename = "reportingData")]
3023    pub reporting_data: Option<GoogleChromeManagementVersionsV1ReportingData>,
3024    /// Output only. Whether the profile supports FCM notifications.
3025    #[serde(rename = "supportsFcmNotifications")]
3026    pub supports_fcm_notifications: Option<bool>,
3027    /// Output only. Email address of the user to which the profile belongs.
3028    #[serde(rename = "userEmail")]
3029    pub user_email: Option<String>,
3030    /// Output only. Unique Directory API ID of the user that can be used in Admin SDK Users API.
3031    #[serde(rename = "userId")]
3032    pub user_id: Option<String>,
3033}
3034
3035impl common::ResponseResult for GoogleChromeManagementVersionsV1ChromeBrowserProfile {}
3036
3037/// A representation of a remote command for a Chrome browser profile.
3038///
3039/// # Activities
3040///
3041/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3042/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3043///
3044/// * [profiles commands create customers](CustomerProfileCommandCreateCall) (request|response)
3045/// * [profiles commands get customers](CustomerProfileCommandGetCall) (response)
3046#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3047#[serde_with::serde_as]
3048#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3049pub struct GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand {
3050    /// Output only. Result of the remote command.
3051    #[serde(rename = "commandResult")]
3052    pub command_result:
3053        Option<GoogleChromeManagementVersionsV1ChromeBrowserProfileCommandCommandResult>,
3054    /// Output only. State of the remote command.
3055    #[serde(rename = "commandState")]
3056    pub command_state: Option<String>,
3057    /// Required. Type of the remote command. The only supported command_type is "clearBrowsingData".
3058    #[serde(rename = "commandType")]
3059    pub command_type: Option<String>,
3060    /// Output only. Timestamp of the issurance of the remote command.
3061    #[serde(rename = "issueTime")]
3062    pub issue_time: Option<chrono::DateTime<chrono::offset::Utc>>,
3063    /// Identifier. Format: customers/{customer_id}/profiles/{profile_permanent_id}/commands/{command_id}
3064    pub name: Option<String>,
3065    /// Required. Payload of the remote command. The payload for "clearBrowsingData" command supports: - fields "clearCache" and "clearCookies" - values of boolean type.
3066    pub payload: Option<HashMap<String, serde_json::Value>>,
3067    /// Output only. Valid duration of the remote command.
3068    #[serde(rename = "validDuration")]
3069    #[serde_as(as = "Option<common::serde::duration::Wrapper>")]
3070    pub valid_duration: Option<chrono::Duration>,
3071}
3072
3073impl common::RequestValue for GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand {}
3074impl common::ResponseResult for GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand {}
3075
3076/// Result of the execution of a command.
3077///
3078/// This type is not used in any activity, and only used as *part* of another schema.
3079///
3080#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3081#[serde_with::serde_as]
3082#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3083pub struct GoogleChromeManagementVersionsV1ChromeBrowserProfileCommandCommandResult {
3084    /// Output only. Timestamp of the client execution of the remote command.
3085    #[serde(rename = "clientExecutionTime")]
3086    pub client_execution_time: Option<chrono::DateTime<chrono::offset::Utc>>,
3087    /// Output only. Result code that indicates the type of error or success of the command.
3088    #[serde(rename = "resultCode")]
3089    pub result_code: Option<String>,
3090    /// Output only. Result type of the remote command.
3091    #[serde(rename = "resultType")]
3092    pub result_type: Option<String>,
3093}
3094
3095impl common::Part for GoogleChromeManagementVersionsV1ChromeBrowserProfileCommandCommandResult {}
3096
3097/// Describes the ChromeOS device that a `CertificateProvisioningProcess` belongs to.
3098///
3099/// This type is not used in any activity, and only used as *part* of another schema.
3100///
3101#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3102#[serde_with::serde_as]
3103#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3104pub struct GoogleChromeManagementVersionsV1ChromeOsDevice {
3105    /// Output only. The unique Directory API ID of the device. This value is the same as the Admin Console's Directory API ID in the ChromeOS Devices tab.
3106    #[serde(rename = "deviceDirectoryApiId")]
3107    pub device_directory_api_id: Option<String>,
3108    /// Output only. Device serial number. This value is the same as the Admin Console's Serial Number in the ChromeOS Devices tab.
3109    #[serde(rename = "serialNumber")]
3110    pub serial_number: Option<String>,
3111}
3112
3113impl common::Part for GoogleChromeManagementVersionsV1ChromeOsDevice {}
3114
3115/// Describes the ChromeOS user session that a `CertificateProvisioningProcess` belongs to.
3116///
3117/// This type is not used in any activity, and only used as *part* of another schema.
3118///
3119#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3120#[serde_with::serde_as]
3121#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3122pub struct GoogleChromeManagementVersionsV1ChromeOsUserSession {
3123    /// Output only. This field contains information about the ChromeOS device that the user session is running on. It is only set if the user is affiliated, i.e., if the user is managed by the same organization that manages the ChromeOS device.
3124    #[serde(rename = "chromeOsDevice")]
3125    pub chrome_os_device: Option<GoogleChromeManagementVersionsV1ChromeOsDevice>,
3126    /// Output only. The unique Directory API ID of the user.
3127    #[serde(rename = "userDirectoryApiId")]
3128    pub user_directory_api_id: Option<String>,
3129    /// Output only. The primary e-mail address of the user.
3130    #[serde(rename = "userPrimaryEmail")]
3131    pub user_primary_email: Option<String>,
3132}
3133
3134impl common::Part for GoogleChromeManagementVersionsV1ChromeOsUserSession {}
3135
3136/// Request message for claiming a certificate provisioning process.
3137///
3138/// # Activities
3139///
3140/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3141/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3142///
3143/// * [certificate provisioning processes claim customers](CustomerCertificateProvisioningProcessClaimCall) (request)
3144#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3145#[serde_with::serde_as]
3146#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3147pub struct GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest {
3148    /// Required. The instance id of the caller.
3149    #[serde(rename = "callerInstanceId")]
3150    pub caller_instance_id: Option<String>,
3151}
3152
3153impl common::RequestValue
3154    for GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest
3155{
3156}
3157
3158/// Response message for claiming a certificate provisioning process.
3159///
3160/// # Activities
3161///
3162/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3163/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3164///
3165/// * [certificate provisioning processes claim customers](CustomerCertificateProvisioningProcessClaimCall) (response)
3166#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3167#[serde_with::serde_as]
3168#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3169pub struct GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessResponse {
3170    _never_set: Option<bool>,
3171}
3172
3173impl common::ResponseResult
3174    for GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessResponse
3175{
3176}
3177
3178/// Information of a device that runs a Chrome browser profile.
3179///
3180/// This type is not used in any activity, and only used as *part* of another schema.
3181///
3182#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3183#[serde_with::serde_as]
3184#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3185pub struct GoogleChromeManagementVersionsV1DeviceInfo {
3186    /// Output only. Device ID that identifies the affiliated device on which the profile exists. If the device type is CHROME_BROWSER, then this represents a unique Directory API ID of the device that can be used in Admin SDK Browsers API.
3187    #[serde(rename = "affiliatedDeviceId")]
3188    pub affiliated_device_id: Option<String>,
3189    /// Output only. Type of the device on which the profile exists.
3190    #[serde(rename = "deviceType")]
3191    pub device_type: Option<String>,
3192    /// Output only. Hostname of the device on which the profile exists.
3193    pub hostname: Option<String>,
3194    /// Output only. Machine name of the device on which the profile exists. On platforms which do not report the machine name (currently iOS and Android) this is instead set to the browser's device_id - but note that this is a different device_id than the |affiliated_device_id|.
3195    pub machine: Option<String>,
3196}
3197
3198impl common::Part for GoogleChromeManagementVersionsV1DeviceInfo {}
3199
3200/// Describes a generic Certificate Authority Connection.
3201///
3202/// This type is not used in any activity, and only used as *part* of another schema.
3203///
3204#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3205#[serde_with::serde_as]
3206#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3207pub struct GoogleChromeManagementVersionsV1GenericCaConnection {
3208    /// Output only. A string that references the administrator-provided configuration for the certification authority service.
3209    #[serde(rename = "caConnectionAdapterConfigReference")]
3210    pub ca_connection_adapter_config_reference: Option<String>,
3211}
3212
3213impl common::Part for GoogleChromeManagementVersionsV1GenericCaConnection {}
3214
3215/// Describes a generic certificate provisioning profile.
3216///
3217/// This type is not used in any activity, and only used as *part* of another schema.
3218///
3219#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3220#[serde_with::serde_as]
3221#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3222pub struct GoogleChromeManagementVersionsV1GenericProfile {
3223    /// Output only. A string that references the administrator-provided configuration for the certificate provisioning profile.
3224    #[serde(rename = "profileAdapterConfigReference")]
3225    pub profile_adapter_config_reference: Option<String>,
3226}
3227
3228impl common::Part for GoogleChromeManagementVersionsV1GenericProfile {}
3229
3230/// Response to ListChromeBrowserProfileCommands method.
3231///
3232/// # Activities
3233///
3234/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3235/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3236///
3237/// * [profiles commands list customers](CustomerProfileCommandListCall) (response)
3238#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3239#[serde_with::serde_as]
3240#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3241pub struct GoogleChromeManagementVersionsV1ListChromeBrowserProfileCommandsResponse {
3242    /// The list of commands returned.
3243    #[serde(rename = "chromeBrowserProfileCommands")]
3244    pub chrome_browser_profile_commands:
3245        Option<Vec<GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand>>,
3246    /// The pagination token that can be used to list the next page.
3247    #[serde(rename = "nextPageToken")]
3248    pub next_page_token: Option<String>,
3249    /// Total size represents an estimated number of resources returned.
3250    #[serde(rename = "totalSize")]
3251    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
3252    pub total_size: Option<i64>,
3253}
3254
3255impl common::ResponseResult
3256    for GoogleChromeManagementVersionsV1ListChromeBrowserProfileCommandsResponse
3257{
3258}
3259
3260/// Response to ListChromeBrowserProfiles method.
3261///
3262/// # Activities
3263///
3264/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3265/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3266///
3267/// * [profiles list customers](CustomerProfileListCall) (response)
3268#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3269#[serde_with::serde_as]
3270#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3271pub struct GoogleChromeManagementVersionsV1ListChromeBrowserProfilesResponse {
3272    /// The list of profiles returned.
3273    #[serde(rename = "chromeBrowserProfiles")]
3274    pub chrome_browser_profiles: Option<Vec<GoogleChromeManagementVersionsV1ChromeBrowserProfile>>,
3275    /// The pagination token that can be used to list the next page.
3276    #[serde(rename = "nextPageToken")]
3277    pub next_page_token: Option<String>,
3278    /// Total size represents an estimated number of resources returned. Not guaranteed to be accurate above 10k profiles.
3279    #[serde(rename = "totalSize")]
3280    #[serde_as(as = "Option<serde_with::DisplayFromStr>")]
3281    pub total_size: Option<i64>,
3282}
3283
3284impl common::ResponseResult for GoogleChromeManagementVersionsV1ListChromeBrowserProfilesResponse {}
3285
3286/// Request to MoveThirdPartyProfileUser method.
3287///
3288/// # Activities
3289///
3290/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3291/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3292///
3293/// * [third party profile users move customers](CustomerThirdPartyProfileUserMoveCall) (request)
3294#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3295#[serde_with::serde_as]
3296#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3297pub struct GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest {
3298    /// Required. Destination organizational unit where the third party chrome profile user will be moved to.
3299    #[serde(rename = "destinationOrgUnit")]
3300    pub destination_org_unit: Option<String>,
3301}
3302
3303impl common::RequestValue for GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest {}
3304
3305/// Response for MoveThirdPartyProfileUser method.
3306///
3307/// # Activities
3308///
3309/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3310/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3311///
3312/// * [third party profile users move customers](CustomerThirdPartyProfileUserMoveCall) (response)
3313#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3314#[serde_with::serde_as]
3315#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3316pub struct GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserResponse {
3317    /// Output only. The moved third party profile user.
3318    #[serde(rename = "thirdPartyProfileUser")]
3319    pub third_party_profile_user: Option<GoogleChromeManagementVersionsV1ThirdPartyProfileUser>,
3320}
3321
3322impl common::ResponseResult for GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserResponse {}
3323
3324/// Reporting data of a Chrome browser profile.
3325///
3326/// This type is not used in any activity, and only used as *part* of another schema.
3327///
3328#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3329#[serde_with::serde_as]
3330#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3331pub struct GoogleChromeManagementVersionsV1ReportingData {
3332    /// Output only. Executable path of the installed Chrome browser. A valid path is included only in affiliated profiles.
3333    #[serde(rename = "browserExecutablePath")]
3334    pub browser_executable_path: Option<String>,
3335    /// Output only. Information of the extensions installed on the profile.
3336    #[serde(rename = "extensionData")]
3337    pub extension_data: Option<Vec<GoogleChromeManagementVersionsV1ReportingDataExtensionData>>,
3338    /// Output only. Information of the policies applied on the extensions.
3339    #[serde(rename = "extensionPolicyData")]
3340    pub extension_policy_data:
3341        Option<Vec<GoogleChromeManagementVersionsV1ReportingDataExtensionPolicyData>>,
3342    /// Output only. Updated version of a browser, if it is different from the active browser version.
3343    #[serde(rename = "installedBrowserVersion")]
3344    pub installed_browser_version: Option<String>,
3345    /// Output only. Information of the policies applied on the profile.
3346    #[serde(rename = "policyData")]
3347    pub policy_data: Option<Vec<GoogleChromeManagementVersionsV1ReportingDataPolicyData>>,
3348    /// Output only. Path of the profile. A valid path is included only in affiliated profiles.
3349    #[serde(rename = "profilePath")]
3350    pub profile_path: Option<String>,
3351}
3352
3353impl common::Part for GoogleChromeManagementVersionsV1ReportingData {}
3354
3355/// Information of conflicting policy applied on a Chrome browser profile.
3356///
3357/// This type is not used in any activity, and only used as *part* of another schema.
3358///
3359#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3360#[serde_with::serde_as]
3361#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3362pub struct GoogleChromeManagementVersionsV1ReportingDataConflictingPolicyData {
3363    /// Output only. Source of the policy.
3364    pub source: Option<String>,
3365}
3366
3367impl common::Part for GoogleChromeManagementVersionsV1ReportingDataConflictingPolicyData {}
3368
3369/// Information of an extension installed on a Chrome browser profile.
3370///
3371/// This type is not used in any activity, and only used as *part* of another schema.
3372///
3373#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3374#[serde_with::serde_as]
3375#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3376pub struct GoogleChromeManagementVersionsV1ReportingDataExtensionData {
3377    /// Output only. Description of the extension.
3378    pub description: Option<String>,
3379    /// Output only. ID of the extension.
3380    #[serde(rename = "extensionId")]
3381    pub extension_id: Option<String>,
3382    /// Output only. Type of the extension.
3383    #[serde(rename = "extensionType")]
3384    pub extension_type: Option<String>,
3385    /// Output only. The URL of the homepage of the extension.
3386    #[serde(rename = "homepageUri")]
3387    pub homepage_uri: Option<String>,
3388    /// Output only. Installation type of the extension.
3389    #[serde(rename = "installationType")]
3390    pub installation_type: Option<String>,
3391    /// Output only. Represents whether the user disabled the extension.
3392    #[serde(rename = "isDisabled")]
3393    pub is_disabled: Option<bool>,
3394    /// Output only. Represents whether the extension is from the webstore.
3395    #[serde(rename = "isWebstoreExtension")]
3396    pub is_webstore_extension: Option<bool>,
3397    /// Output only. Manifest version of the extension.
3398    #[serde(rename = "manifestVersion")]
3399    pub manifest_version: Option<i32>,
3400    /// Output only. Name of the extension.
3401    pub name: Option<String>,
3402    /// Output only. Permissions requested by the extension.
3403    pub permissions: Option<Vec<String>>,
3404    /// Output only. Version of the extension.
3405    pub version: Option<String>,
3406}
3407
3408impl common::Part for GoogleChromeManagementVersionsV1ReportingDataExtensionData {}
3409
3410/// Information of the policies applied on an extension.
3411///
3412/// This type is not used in any activity, and only used as *part* of another schema.
3413///
3414#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3415#[serde_with::serde_as]
3416#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3417pub struct GoogleChromeManagementVersionsV1ReportingDataExtensionPolicyData {
3418    /// Output only. ID of the extension.
3419    #[serde(rename = "extensionId")]
3420    pub extension_id: Option<String>,
3421    /// Output only. Name of the extension.
3422    #[serde(rename = "extensionName")]
3423    pub extension_name: Option<String>,
3424    /// Output only. Information of the policies applied on the extension.
3425    #[serde(rename = "policyData")]
3426    pub policy_data: Option<Vec<GoogleChromeManagementVersionsV1ReportingDataPolicyData>>,
3427}
3428
3429impl common::Part for GoogleChromeManagementVersionsV1ReportingDataExtensionPolicyData {}
3430
3431/// Information of a policy applied on a Chrome browser profile.
3432///
3433/// This type is not used in any activity, and only used as *part* of another schema.
3434///
3435#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3436#[serde_with::serde_as]
3437#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3438pub struct GoogleChromeManagementVersionsV1ReportingDataPolicyData {
3439    /// Output only. Conflicting policy information.
3440    pub conflicts: Option<Vec<GoogleChromeManagementVersionsV1ReportingDataConflictingPolicyData>>,
3441    /// Output only. Error message of the policy, if any.
3442    pub error: Option<String>,
3443    /// Output only. Name of the policy.
3444    pub name: Option<String>,
3445    /// Output only. Source of the policy.
3446    pub source: Option<String>,
3447    /// Output only. Value of the policy.
3448    pub value: Option<String>,
3449}
3450
3451impl common::Part for GoogleChromeManagementVersionsV1ReportingDataPolicyData {}
3452
3453/// Describes a SCEP Certificate Authority Connection.
3454///
3455/// This type is not used in any activity, and only used as *part* of another schema.
3456///
3457#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3458#[serde_with::serde_as]
3459#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3460pub struct GoogleChromeManagementVersionsV1ScepCaConnection {
3461    /// Output only. A string that references the administrator-provided configuration for the certification authority service.
3462    #[serde(rename = "caConnectionAdapterConfigReference")]
3463    pub ca_connection_adapter_config_reference: Option<String>,
3464}
3465
3466impl common::Part for GoogleChromeManagementVersionsV1ScepCaConnection {}
3467
3468/// Describes a SCEP certificate provisioning profile.
3469///
3470/// This type is not used in any activity, and only used as *part* of another schema.
3471///
3472#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3473#[serde_with::serde_as]
3474#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3475pub struct GoogleChromeManagementVersionsV1ScepProfile {
3476    /// Output only. The certificate template name as defined by the admin on their on-prem infrastructure. The Certificate Authority uses this name to identify the certificate template.
3477    #[serde(rename = "certificateTemplateName")]
3478    pub certificate_template_name: Option<String>,
3479    /// Output only. The country of the subject.
3480    pub country: Option<String>,
3481    /// Output only. The allowed key usages for certificate's key.
3482    #[serde(rename = "keyUsages")]
3483    pub key_usages: Option<Vec<String>>,
3484    /// Output only. The locality of the subject.
3485    pub locality: Option<String>,
3486    /// Output only. The name of the organization the subject belongs to.
3487    pub organization: Option<String>,
3488    /// Output only. The organizational units of the subject.
3489    #[serde(rename = "organizationalUnits")]
3490    pub organizational_units: Option<Vec<String>>,
3491    /// Output only. The state of the subject.
3492    pub state: Option<String>,
3493    /// Output only. The subject alternative names.
3494    #[serde(rename = "subjectAltNames")]
3495    pub subject_alt_names: Option<Vec<GoogleChromeManagementVersionsV1SubjectAltName>>,
3496    /// Output only. The common name of the subject.
3497    #[serde(rename = "subjectCommonName")]
3498    pub subject_common_name: Option<String>,
3499}
3500
3501impl common::Part for GoogleChromeManagementVersionsV1ScepProfile {}
3502
3503/// Request message for marking a certificate provisioning process as failed.
3504///
3505/// # Activities
3506///
3507/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3508/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3509///
3510/// * [certificate provisioning processes set failure customers](CustomerCertificateProvisioningProcessSetFailureCall) (request)
3511#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3512#[serde_with::serde_as]
3513#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3514pub struct GoogleChromeManagementVersionsV1SetFailureRequest {
3515    /// Required. A message describing the failure details. It is displayed on the ChromeOS client device.
3516    #[serde(rename = "errorMessage")]
3517    pub error_message: Option<String>,
3518}
3519
3520impl common::RequestValue for GoogleChromeManagementVersionsV1SetFailureRequest {}
3521
3522/// Response message for publishing a failure for a certificate provisioning process.
3523///
3524/// # Activities
3525///
3526/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3527/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3528///
3529/// * [certificate provisioning processes set failure customers](CustomerCertificateProvisioningProcessSetFailureCall) (response)
3530#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3531#[serde_with::serde_as]
3532#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3533pub struct GoogleChromeManagementVersionsV1SetFailureResponse {
3534    _never_set: Option<bool>,
3535}
3536
3537impl common::ResponseResult for GoogleChromeManagementVersionsV1SetFailureResponse {}
3538
3539/// Request message for requesting a signature from the client that initated a certificate provisioning process.
3540///
3541/// # Activities
3542///
3543/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3544/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3545///
3546/// * [certificate provisioning processes sign data customers](CustomerCertificateProvisioningProcessSignDataCall) (request)
3547#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3548#[serde_with::serde_as]
3549#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3550pub struct GoogleChromeManagementVersionsV1SignDataRequest {
3551    /// Required. The data that the client was asked to sign.
3552    #[serde(rename = "signData")]
3553    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
3554    pub sign_data: Option<Vec<u8>>,
3555    /// Required. The signature algorithm that the adapter expects the client and backend components to use when processing `sign_data`.
3556    #[serde(rename = "signatureAlgorithm")]
3557    pub signature_algorithm: Option<String>,
3558}
3559
3560impl common::RequestValue for GoogleChromeManagementVersionsV1SignDataRequest {}
3561
3562/// Describes a subject alternative name.
3563///
3564/// This type is not used in any activity, and only used as *part* of another schema.
3565///
3566#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3567#[serde_with::serde_as]
3568#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3569pub struct GoogleChromeManagementVersionsV1SubjectAltName {
3570    /// Output only. The type of the SubjectAltName extension.
3571    #[serde(rename = "type")]
3572    pub type_: Option<String>,
3573    /// Output only. The value of the subject alternative name with respect to the `type`.
3574    pub value: Option<String>,
3575}
3576
3577impl common::Part for GoogleChromeManagementVersionsV1SubjectAltName {}
3578
3579/// A representation of non-Google (third party) user that is associated with a managed Chrome profile.
3580///
3581/// This type is not used in any activity, and only used as *part* of another schema.
3582///
3583#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3584#[serde_with::serde_as]
3585#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3586pub struct GoogleChromeManagementVersionsV1ThirdPartyProfileUser {
3587    /// Identifier. Format: customers/{customer_id}/thirdPartyProfileUsers/{third_party_profile_user_id}
3588    pub name: Option<String>,
3589    /// Output only. The ID of the organizational unit assigned to the user.
3590    #[serde(rename = "orgUnitId")]
3591    pub org_unit_id: Option<String>,
3592}
3593
3594impl common::Part for GoogleChromeManagementVersionsV1ThirdPartyProfileUser {}
3595
3596/// Request message for uploading an issued certificate for a certificate provisioning process.
3597///
3598/// # Activities
3599///
3600/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3601/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3602///
3603/// * [certificate provisioning processes upload certificate customers](CustomerCertificateProvisioningProcessUploadCertificateCall) (request)
3604#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3605#[serde_with::serde_as]
3606#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3607pub struct GoogleChromeManagementVersionsV1UploadCertificateRequest {
3608    /// Required. The issued certificate in PEM format.
3609    #[serde(rename = "certificatePem")]
3610    pub certificate_pem: Option<String>,
3611}
3612
3613impl common::RequestValue for GoogleChromeManagementVersionsV1UploadCertificateRequest {}
3614
3615/// Response message for publishing an issued certificate for a certificate provisioning process.
3616///
3617/// # Activities
3618///
3619/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3620/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3621///
3622/// * [certificate provisioning processes upload certificate customers](CustomerCertificateProvisioningProcessUploadCertificateCall) (response)
3623#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3624#[serde_with::serde_as]
3625#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3626pub struct GoogleChromeManagementVersionsV1UploadCertificateResponse {
3627    _never_set: Option<bool>,
3628}
3629
3630impl common::ResponseResult for GoogleChromeManagementVersionsV1UploadCertificateResponse {}
3631
3632/// The request message for Operations.CancelOperation.
3633///
3634/// # Activities
3635///
3636/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3637/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3638///
3639/// * [cancel operations](OperationCancelCall) (request)
3640#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3641#[serde_with::serde_as]
3642#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3643pub struct GoogleLongrunningCancelOperationRequest {
3644    _never_set: Option<bool>,
3645}
3646
3647impl common::RequestValue for GoogleLongrunningCancelOperationRequest {}
3648
3649/// The response message for Operations.ListOperations.
3650///
3651/// # Activities
3652///
3653/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3654/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3655///
3656/// * [list operations](OperationListCall) (response)
3657#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3658#[serde_with::serde_as]
3659#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3660pub struct GoogleLongrunningListOperationsResponse {
3661    /// The standard List next-page token.
3662    #[serde(rename = "nextPageToken")]
3663    pub next_page_token: Option<String>,
3664    /// A list of operations that matches the specified filter in the request.
3665    pub operations: Option<Vec<GoogleLongrunningOperation>>,
3666    /// Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.
3667    pub unreachable: Option<Vec<String>>,
3668}
3669
3670impl common::ResponseResult for GoogleLongrunningListOperationsResponse {}
3671
3672/// This resource represents a long-running operation that is the result of a network API call.
3673///
3674/// # Activities
3675///
3676/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3677/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3678///
3679/// * [certificate provisioning processes operations get customers](CustomerCertificateProvisioningProcessOperationGetCall) (response)
3680/// * [certificate provisioning processes sign data customers](CustomerCertificateProvisioningProcessSignDataCall) (response)
3681#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3682#[serde_with::serde_as]
3683#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3684pub struct GoogleLongrunningOperation {
3685    /// 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.
3686    pub done: Option<bool>,
3687    /// The error result of the operation in case of failure or cancellation.
3688    pub error: Option<GoogleRpcStatus>,
3689    /// 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.
3690    pub metadata: Option<HashMap<String, serde_json::Value>>,
3691    /// 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}`.
3692    pub name: Option<String>,
3693    /// 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`.
3694    pub response: Option<HashMap<String, serde_json::Value>>,
3695}
3696
3697impl common::ResponseResult for GoogleLongrunningOperation {}
3698
3699/// 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); }
3700///
3701/// # Activities
3702///
3703/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
3704/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
3705///
3706/// * [profiles delete customers](CustomerProfileDeleteCall) (response)
3707/// * [telemetry notification configs delete customers](CustomerTelemetryNotificationConfigDeleteCall) (response)
3708/// * [cancel operations](OperationCancelCall) (response)
3709/// * [delete operations](OperationDeleteCall) (response)
3710#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3711#[serde_with::serde_as]
3712#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3713pub struct GoogleProtobufEmpty {
3714    _never_set: Option<bool>,
3715}
3716
3717impl common::ResponseResult for GoogleProtobufEmpty {}
3718
3719/// 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).
3720///
3721/// This type is not used in any activity, and only used as *part* of another schema.
3722///
3723#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3724#[serde_with::serde_as]
3725#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3726pub struct GoogleRpcStatus {
3727    /// The status code, which should be an enum value of google.rpc.Code.
3728    pub code: Option<i32>,
3729    /// A list of messages that carry the error details. There is a common set of message types for APIs to use.
3730    pub details: Option<Vec<HashMap<String, serde_json::Value>>>,
3731    /// 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.
3732    pub message: Option<String>,
3733}
3734
3735impl common::Part for GoogleRpcStatus {}
3736
3737/// Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
3738///
3739/// This type is not used in any activity, and only used as *part* of another schema.
3740///
3741#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
3742#[serde_with::serde_as]
3743#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
3744pub struct GoogleTypeDate {
3745    /// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
3746    pub day: Option<i32>,
3747    /// Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
3748    pub month: Option<i32>,
3749    /// Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
3750    pub year: Option<i32>,
3751}
3752
3753impl common::Part for GoogleTypeDate {}
3754
3755// ###################
3756// MethodBuilders ###
3757// #################
3758
3759/// A builder providing access to all methods supported on *customer* resources.
3760/// It is not used directly, but through the [`ChromeManagement`] hub.
3761///
3762/// # Example
3763///
3764/// Instantiate a resource builder
3765///
3766/// ```test_harness,no_run
3767/// extern crate hyper;
3768/// extern crate hyper_rustls;
3769/// extern crate google_chromemanagement1 as chromemanagement1;
3770///
3771/// # async fn dox() {
3772/// use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3773///
3774/// let secret: yup_oauth2::ApplicationSecret = Default::default();
3775/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
3776///     .with_native_roots()
3777///     .unwrap()
3778///     .https_only()
3779///     .enable_http2()
3780///     .build();
3781///
3782/// let executor = hyper_util::rt::TokioExecutor::new();
3783/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
3784///     secret,
3785///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3786///     yup_oauth2::client::CustomHyperClientBuilder::from(
3787///         hyper_util::client::legacy::Client::builder(executor).build(connector),
3788///     ),
3789/// ).build().await.unwrap();
3790///
3791/// let client = hyper_util::client::legacy::Client::builder(
3792///     hyper_util::rt::TokioExecutor::new()
3793/// )
3794/// .build(
3795///     hyper_rustls::HttpsConnectorBuilder::new()
3796///         .with_native_roots()
3797///         .unwrap()
3798///         .https_or_http()
3799///         .enable_http2()
3800///         .build()
3801/// );
3802/// let mut hub = ChromeManagement::new(client, auth);
3803/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
3804/// // like `apps_android_get(...)`, `apps_chrome_get(...)`, `apps_count_chrome_app_requests(...)`, `apps_fetch_devices_requesting_extension(...)`, `apps_fetch_users_requesting_extension(...)`, `apps_web_get(...)`, `certificate_provisioning_processes_claim(...)`, `certificate_provisioning_processes_get(...)`, `certificate_provisioning_processes_operations_get(...)`, `certificate_provisioning_processes_set_failure(...)`, `certificate_provisioning_processes_sign_data(...)`, `certificate_provisioning_processes_upload_certificate(...)`, `profiles_commands_create(...)`, `profiles_commands_get(...)`, `profiles_commands_list(...)`, `profiles_delete(...)`, `profiles_get(...)`, `profiles_list(...)`, `reports_count_active_devices(...)`, `reports_count_chrome_browsers_needing_attention(...)`, `reports_count_chrome_crash_events(...)`, `reports_count_chrome_devices_reaching_auto_expiration_date(...)`, `reports_count_chrome_devices_that_need_attention(...)`, `reports_count_chrome_hardware_fleet_devices(...)`, `reports_count_chrome_versions(...)`, `reports_count_devices_per_boot_type(...)`, `reports_count_devices_per_release_channel(...)`, `reports_count_installed_apps(...)`, `reports_count_print_jobs_by_printer(...)`, `reports_count_print_jobs_by_user(...)`, `reports_enumerate_print_jobs(...)`, `reports_find_installed_app_devices(...)`, `telemetry_devices_get(...)`, `telemetry_devices_list(...)`, `telemetry_events_list(...)`, `telemetry_notification_configs_create(...)`, `telemetry_notification_configs_delete(...)`, `telemetry_notification_configs_list(...)`, `telemetry_users_get(...)`, `telemetry_users_list(...)` and `third_party_profile_users_move(...)`
3805/// // to build up your call.
3806/// let rb = hub.customers();
3807/// # }
3808/// ```
3809pub struct CustomerMethods<'a, C>
3810where
3811    C: 'a,
3812{
3813    hub: &'a ChromeManagement<C>,
3814}
3815
3816impl<'a, C> common::MethodsBuilder for CustomerMethods<'a, C> {}
3817
3818impl<'a, C> CustomerMethods<'a, C> {
3819    /// Create a builder to help you perform the following task:
3820    ///
3821    /// Get a specific app for a customer by its resource name.
3822    ///
3823    /// # Arguments
3824    ///
3825    /// * `name` - Required. The app for which details are being queried. Examples: "customers/my_customer/apps/chrome/gmbmikajjgmnabiglmofipeabaddhgne@2.1.2" for the Save to Google Drive Chrome extension version 2.1.2, "customers/my_customer/apps/android/com.google.android.apps.docs" for the Google Drive Android app's latest version.
3826    pub fn apps_android_get(&self, name: &str) -> CustomerAppAndroidGetCall<'a, C> {
3827        CustomerAppAndroidGetCall {
3828            hub: self.hub,
3829            _name: name.to_string(),
3830            _delegate: Default::default(),
3831            _additional_params: Default::default(),
3832            _scopes: Default::default(),
3833        }
3834    }
3835
3836    /// Create a builder to help you perform the following task:
3837    ///
3838    /// Get a specific app for a customer by its resource name.
3839    ///
3840    /// # Arguments
3841    ///
3842    /// * `name` - Required. The app for which details are being queried. Examples: "customers/my_customer/apps/chrome/gmbmikajjgmnabiglmofipeabaddhgne@2.1.2" for the Save to Google Drive Chrome extension version 2.1.2, "customers/my_customer/apps/android/com.google.android.apps.docs" for the Google Drive Android app's latest version.
3843    pub fn apps_chrome_get(&self, name: &str) -> CustomerAppChromeGetCall<'a, C> {
3844        CustomerAppChromeGetCall {
3845            hub: self.hub,
3846            _name: name.to_string(),
3847            _delegate: Default::default(),
3848            _additional_params: Default::default(),
3849            _scopes: Default::default(),
3850        }
3851    }
3852
3853    /// Create a builder to help you perform the following task:
3854    ///
3855    /// Get a specific app for a customer by its resource name.
3856    ///
3857    /// # Arguments
3858    ///
3859    /// * `name` - Required. The app for which details are being queried. Examples: "customers/my_customer/apps/chrome/gmbmikajjgmnabiglmofipeabaddhgne@2.1.2" for the Save to Google Drive Chrome extension version 2.1.2, "customers/my_customer/apps/android/com.google.android.apps.docs" for the Google Drive Android app's latest version.
3860    pub fn apps_web_get(&self, name: &str) -> CustomerAppWebGetCall<'a, C> {
3861        CustomerAppWebGetCall {
3862            hub: self.hub,
3863            _name: name.to_string(),
3864            _delegate: Default::default(),
3865            _additional_params: Default::default(),
3866            _scopes: Default::default(),
3867        }
3868    }
3869
3870    /// Create a builder to help you perform the following task:
3871    ///
3872    /// Generate summary of app installation requests.
3873    ///
3874    /// # Arguments
3875    ///
3876    /// * `customer` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
3877    pub fn apps_count_chrome_app_requests(
3878        &self,
3879        customer: &str,
3880    ) -> CustomerAppCountChromeAppRequestCall<'a, C> {
3881        CustomerAppCountChromeAppRequestCall {
3882            hub: self.hub,
3883            _customer: customer.to_string(),
3884            _page_token: Default::default(),
3885            _page_size: Default::default(),
3886            _org_unit_id: Default::default(),
3887            _order_by: Default::default(),
3888            _delegate: Default::default(),
3889            _additional_params: Default::default(),
3890            _scopes: Default::default(),
3891        }
3892    }
3893
3894    /// Create a builder to help you perform the following task:
3895    ///
3896    /// Get a list of devices that have requested to install an extension.
3897    ///
3898    /// # Arguments
3899    ///
3900    /// * `customer` - Required. The customer ID or "my_customer" prefixed with "customers/".
3901    pub fn apps_fetch_devices_requesting_extension(
3902        &self,
3903        customer: &str,
3904    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
3905        CustomerAppFetchDevicesRequestingExtensionCall {
3906            hub: self.hub,
3907            _customer: customer.to_string(),
3908            _page_token: Default::default(),
3909            _page_size: Default::default(),
3910            _org_unit_id: Default::default(),
3911            _extension_id: Default::default(),
3912            _delegate: Default::default(),
3913            _additional_params: Default::default(),
3914            _scopes: Default::default(),
3915        }
3916    }
3917
3918    /// Create a builder to help you perform the following task:
3919    ///
3920    /// Get a list of users that have requested to install an extension.
3921    ///
3922    /// # Arguments
3923    ///
3924    /// * `customer` - Required. The customer ID or "my_customer" prefixed with "customers/".
3925    pub fn apps_fetch_users_requesting_extension(
3926        &self,
3927        customer: &str,
3928    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
3929        CustomerAppFetchUsersRequestingExtensionCall {
3930            hub: self.hub,
3931            _customer: customer.to_string(),
3932            _page_token: Default::default(),
3933            _page_size: Default::default(),
3934            _org_unit_id: Default::default(),
3935            _extension_id: Default::default(),
3936            _delegate: Default::default(),
3937            _additional_params: Default::default(),
3938            _scopes: Default::default(),
3939        }
3940    }
3941
3942    /// Create a builder to help you perform the following task:
3943    ///
3944    /// 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.
3945    ///
3946    /// # Arguments
3947    ///
3948    /// * `name` - The name of the operation resource.
3949    pub fn certificate_provisioning_processes_operations_get(
3950        &self,
3951        name: &str,
3952    ) -> CustomerCertificateProvisioningProcessOperationGetCall<'a, C> {
3953        CustomerCertificateProvisioningProcessOperationGetCall {
3954            hub: self.hub,
3955            _name: name.to_string(),
3956            _delegate: Default::default(),
3957            _additional_params: Default::default(),
3958        }
3959    }
3960
3961    /// Create a builder to help you perform the following task:
3962    ///
3963    /// Claims a certificate provisioning process. For each certificate provisioning process, this operation can succeed only for one `caller_instance_id`.
3964    ///
3965    /// # Arguments
3966    ///
3967    /// * `request` - No description provided.
3968    /// * `name` - Required. Resource name of the `CertificateProvisioningProcess` to claim. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
3969    pub fn certificate_provisioning_processes_claim(
3970        &self,
3971        request: GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest,
3972        name: &str,
3973    ) -> CustomerCertificateProvisioningProcessClaimCall<'a, C> {
3974        CustomerCertificateProvisioningProcessClaimCall {
3975            hub: self.hub,
3976            _request: request,
3977            _name: name.to_string(),
3978            _delegate: Default::default(),
3979            _additional_params: Default::default(),
3980        }
3981    }
3982
3983    /// Create a builder to help you perform the following task:
3984    ///
3985    /// Retrieves a certificate provisioning process.
3986    ///
3987    /// # Arguments
3988    ///
3989    /// * `name` - Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
3990    pub fn certificate_provisioning_processes_get(
3991        &self,
3992        name: &str,
3993    ) -> CustomerCertificateProvisioningProcessGetCall<'a, C> {
3994        CustomerCertificateProvisioningProcessGetCall {
3995            hub: self.hub,
3996            _name: name.to_string(),
3997            _delegate: Default::default(),
3998            _additional_params: Default::default(),
3999        }
4000    }
4001
4002    /// Create a builder to help you perform the following task:
4003    ///
4004    /// Marks a certificate provisioning process as failed.
4005    ///
4006    /// # Arguments
4007    ///
4008    /// * `request` - No description provided.
4009    /// * `name` - Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
4010    pub fn certificate_provisioning_processes_set_failure(
4011        &self,
4012        request: GoogleChromeManagementVersionsV1SetFailureRequest,
4013        name: &str,
4014    ) -> CustomerCertificateProvisioningProcessSetFailureCall<'a, C> {
4015        CustomerCertificateProvisioningProcessSetFailureCall {
4016            hub: self.hub,
4017            _request: request,
4018            _name: name.to_string(),
4019            _delegate: Default::default(),
4020            _additional_params: Default::default(),
4021        }
4022    }
4023
4024    /// Create a builder to help you perform the following task:
4025    ///
4026    /// Requests the client that initiated a certificate provisioning process to sign data. This should only be called after `ClaimCertificateProvisioningProcess` has been successfully executed.
4027    ///
4028    /// # Arguments
4029    ///
4030    /// * `request` - No description provided.
4031    /// * `name` - Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
4032    pub fn certificate_provisioning_processes_sign_data(
4033        &self,
4034        request: GoogleChromeManagementVersionsV1SignDataRequest,
4035        name: &str,
4036    ) -> CustomerCertificateProvisioningProcessSignDataCall<'a, C> {
4037        CustomerCertificateProvisioningProcessSignDataCall {
4038            hub: self.hub,
4039            _request: request,
4040            _name: name.to_string(),
4041            _delegate: Default::default(),
4042            _additional_params: Default::default(),
4043        }
4044    }
4045
4046    /// Create a builder to help you perform the following task:
4047    ///
4048    /// Uploads a successfully issued certificate for a certificate provisioning process.
4049    ///
4050    /// # Arguments
4051    ///
4052    /// * `request` - No description provided.
4053    /// * `name` - Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
4054    pub fn certificate_provisioning_processes_upload_certificate(
4055        &self,
4056        request: GoogleChromeManagementVersionsV1UploadCertificateRequest,
4057        name: &str,
4058    ) -> CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C> {
4059        CustomerCertificateProvisioningProcessUploadCertificateCall {
4060            hub: self.hub,
4061            _request: request,
4062            _name: name.to_string(),
4063            _delegate: Default::default(),
4064            _additional_params: Default::default(),
4065        }
4066    }
4067
4068    /// Create a builder to help you perform the following task:
4069    ///
4070    /// Creates a Chrome browser profile remote command.
4071    ///
4072    /// # Arguments
4073    ///
4074    /// * `request` - No description provided.
4075    /// * `parent` - Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
4076    pub fn profiles_commands_create(
4077        &self,
4078        request: GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand,
4079        parent: &str,
4080    ) -> CustomerProfileCommandCreateCall<'a, C> {
4081        CustomerProfileCommandCreateCall {
4082            hub: self.hub,
4083            _request: request,
4084            _parent: parent.to_string(),
4085            _delegate: Default::default(),
4086            _additional_params: Default::default(),
4087            _scopes: Default::default(),
4088        }
4089    }
4090
4091    /// Create a builder to help you perform the following task:
4092    ///
4093    /// Gets a Chrome browser profile remote command.
4094    ///
4095    /// # Arguments
4096    ///
4097    /// * `name` - Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}/commands/{command_id}
4098    pub fn profiles_commands_get(&self, name: &str) -> CustomerProfileCommandGetCall<'a, C> {
4099        CustomerProfileCommandGetCall {
4100            hub: self.hub,
4101            _name: name.to_string(),
4102            _delegate: Default::default(),
4103            _additional_params: Default::default(),
4104            _scopes: Default::default(),
4105        }
4106    }
4107
4108    /// Create a builder to help you perform the following task:
4109    ///
4110    /// Lists remote commands of a Chrome browser profile.
4111    ///
4112    /// # Arguments
4113    ///
4114    /// * `parent` - Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
4115    pub fn profiles_commands_list(&self, parent: &str) -> CustomerProfileCommandListCall<'a, C> {
4116        CustomerProfileCommandListCall {
4117            hub: self.hub,
4118            _parent: parent.to_string(),
4119            _page_token: Default::default(),
4120            _page_size: Default::default(),
4121            _delegate: Default::default(),
4122            _additional_params: Default::default(),
4123            _scopes: Default::default(),
4124        }
4125    }
4126
4127    /// Create a builder to help you perform the following task:
4128    ///
4129    /// Deletes the data collected from a Chrome browser profile.
4130    ///
4131    /// # Arguments
4132    ///
4133    /// * `name` - Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
4134    pub fn profiles_delete(&self, name: &str) -> CustomerProfileDeleteCall<'a, C> {
4135        CustomerProfileDeleteCall {
4136            hub: self.hub,
4137            _name: name.to_string(),
4138            _delegate: Default::default(),
4139            _additional_params: Default::default(),
4140            _scopes: Default::default(),
4141        }
4142    }
4143
4144    /// Create a builder to help you perform the following task:
4145    ///
4146    /// Gets a Chrome browser profile with customer ID and profile permanent ID.
4147    ///
4148    /// # Arguments
4149    ///
4150    /// * `name` - Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
4151    pub fn profiles_get(&self, name: &str) -> CustomerProfileGetCall<'a, C> {
4152        CustomerProfileGetCall {
4153            hub: self.hub,
4154            _name: name.to_string(),
4155            _delegate: Default::default(),
4156            _additional_params: Default::default(),
4157            _scopes: Default::default(),
4158        }
4159    }
4160
4161    /// Create a builder to help you perform the following task:
4162    ///
4163    /// Lists Chrome browser profiles of a customer based on the given search and sorting criteria.
4164    ///
4165    /// # Arguments
4166    ///
4167    /// * `parent` - Required. Format: customers/{customer_id}
4168    pub fn profiles_list(&self, parent: &str) -> CustomerProfileListCall<'a, C> {
4169        CustomerProfileListCall {
4170            hub: self.hub,
4171            _parent: parent.to_string(),
4172            _page_token: Default::default(),
4173            _page_size: Default::default(),
4174            _order_by: Default::default(),
4175            _filter: Default::default(),
4176            _delegate: Default::default(),
4177            _additional_params: Default::default(),
4178            _scopes: Default::default(),
4179        }
4180    }
4181
4182    /// Create a builder to help you perform the following task:
4183    ///
4184    /// Get a count of active devices per set time frames.
4185    ///
4186    /// # Arguments
4187    ///
4188    /// * `customer` - Required. Obfuscated customer ID prefixed with "customers/C" or "customers/my_customer".
4189    pub fn reports_count_active_devices(
4190        &self,
4191        customer: &str,
4192    ) -> CustomerReportCountActiveDeviceCall<'a, C> {
4193        CustomerReportCountActiveDeviceCall {
4194            hub: self.hub,
4195            _customer: customer.to_string(),
4196            _date_year: Default::default(),
4197            _date_month: Default::default(),
4198            _date_day: Default::default(),
4199            _delegate: Default::default(),
4200            _additional_params: Default::default(),
4201            _scopes: Default::default(),
4202        }
4203    }
4204
4205    /// Create a builder to help you perform the following task:
4206    ///
4207    /// Count of Chrome Browsers that have been recently enrolled, have new policy to be synced, or have no recent activity.
4208    ///
4209    /// # Arguments
4210    ///
4211    /// * `customer` - Required. The customer ID or "my_customer" prefixed with "customers/".
4212    pub fn reports_count_chrome_browsers_needing_attention(
4213        &self,
4214        customer: &str,
4215    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C> {
4216        CustomerReportCountChromeBrowsersNeedingAttentionCall {
4217            hub: self.hub,
4218            _customer: customer.to_string(),
4219            _org_unit_id: Default::default(),
4220            _delegate: Default::default(),
4221            _additional_params: Default::default(),
4222            _scopes: Default::default(),
4223        }
4224    }
4225
4226    /// Create a builder to help you perform the following task:
4227    ///
4228    /// Get a count of Chrome crash events.
4229    ///
4230    /// # Arguments
4231    ///
4232    /// * `customer` - Customer ID.
4233    pub fn reports_count_chrome_crash_events(
4234        &self,
4235        customer: &str,
4236    ) -> CustomerReportCountChromeCrashEventCall<'a, C> {
4237        CustomerReportCountChromeCrashEventCall {
4238            hub: self.hub,
4239            _customer: customer.to_string(),
4240            _org_unit_id: Default::default(),
4241            _order_by: Default::default(),
4242            _filter: Default::default(),
4243            _delegate: Default::default(),
4244            _additional_params: Default::default(),
4245            _scopes: Default::default(),
4246        }
4247    }
4248
4249    /// Create a builder to help you perform the following task:
4250    ///
4251    /// Generate report of the number of devices expiring in each month of the selected time frame. Devices are grouped by auto update expiration date and model. Further information can be found [here](https://support.google.com/chrome/a/answer/10564947).
4252    ///
4253    /// # Arguments
4254    ///
4255    /// * `customer` - Required. The customer ID or "my_customer" prefixed with "customers/".
4256    pub fn reports_count_chrome_devices_reaching_auto_expiration_date(
4257        &self,
4258        customer: &str,
4259    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
4260        CustomerReportCountChromeDevicesReachingAutoExpirationDateCall {
4261            hub: self.hub,
4262            _customer: customer.to_string(),
4263            _org_unit_id: Default::default(),
4264            _min_aue_date: Default::default(),
4265            _max_aue_date: Default::default(),
4266            _delegate: Default::default(),
4267            _additional_params: Default::default(),
4268            _scopes: Default::default(),
4269        }
4270    }
4271
4272    /// Create a builder to help you perform the following task:
4273    ///
4274    /// Counts of ChromeOS devices that have not synced policies or have lacked user activity in the past 28 days, are out of date, or are not complaint. Further information can be found here https://support.google.com/chrome/a/answer/10564947
4275    ///
4276    /// # Arguments
4277    ///
4278    /// * `customer` - Required. The customer ID or "my_customer" prefixed with "customers/".
4279    pub fn reports_count_chrome_devices_that_need_attention(
4280        &self,
4281        customer: &str,
4282    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {
4283        CustomerReportCountChromeDevicesThatNeedAttentionCall {
4284            hub: self.hub,
4285            _customer: customer.to_string(),
4286            _read_mask: Default::default(),
4287            _org_unit_id: Default::default(),
4288            _delegate: Default::default(),
4289            _additional_params: Default::default(),
4290            _scopes: Default::default(),
4291        }
4292    }
4293
4294    /// Create a builder to help you perform the following task:
4295    ///
4296    /// Counts of devices with a specific hardware specification from the requested hardware type (for example model name, processor type). Further information can be found here https://support.google.com/chrome/a/answer/10564947
4297    ///
4298    /// # Arguments
4299    ///
4300    /// * `customer` - Required. The customer ID or "my_customer".
4301    pub fn reports_count_chrome_hardware_fleet_devices(
4302        &self,
4303        customer: &str,
4304    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {
4305        CustomerReportCountChromeHardwareFleetDeviceCall {
4306            hub: self.hub,
4307            _customer: customer.to_string(),
4308            _read_mask: Default::default(),
4309            _org_unit_id: Default::default(),
4310            _delegate: Default::default(),
4311            _additional_params: Default::default(),
4312            _scopes: Default::default(),
4313        }
4314    }
4315
4316    /// Create a builder to help you perform the following task:
4317    ///
4318    /// Generate report of installed Chrome versions.
4319    ///
4320    /// # Arguments
4321    ///
4322    /// * `customer` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
4323    pub fn reports_count_chrome_versions(
4324        &self,
4325        customer: &str,
4326    ) -> CustomerReportCountChromeVersionCall<'a, C> {
4327        CustomerReportCountChromeVersionCall {
4328            hub: self.hub,
4329            _customer: customer.to_string(),
4330            _page_token: Default::default(),
4331            _page_size: Default::default(),
4332            _org_unit_id: Default::default(),
4333            _filter: Default::default(),
4334            _delegate: Default::default(),
4335            _additional_params: Default::default(),
4336            _scopes: Default::default(),
4337        }
4338    }
4339
4340    /// Create a builder to help you perform the following task:
4341    ///
4342    /// Get a count of devices per boot type.
4343    ///
4344    /// # Arguments
4345    ///
4346    /// * `customer` - Required. Obfuscated customer ID prefixed with "customers/C" or "customers/my_customer".
4347    pub fn reports_count_devices_per_boot_type(
4348        &self,
4349        customer: &str,
4350    ) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
4351        CustomerReportCountDevicesPerBootTypeCall {
4352            hub: self.hub,
4353            _customer: customer.to_string(),
4354            _date_year: Default::default(),
4355            _date_month: Default::default(),
4356            _date_day: Default::default(),
4357            _delegate: Default::default(),
4358            _additional_params: Default::default(),
4359            _scopes: Default::default(),
4360        }
4361    }
4362
4363    /// Create a builder to help you perform the following task:
4364    ///
4365    /// Get a count of devices per channel.
4366    ///
4367    /// # Arguments
4368    ///
4369    /// * `customer` - Required. Obfuscated customer ID prefixed with "customers/C" or "customers/my_customer".
4370    pub fn reports_count_devices_per_release_channel(
4371        &self,
4372        customer: &str,
4373    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
4374        CustomerReportCountDevicesPerReleaseChannelCall {
4375            hub: self.hub,
4376            _customer: customer.to_string(),
4377            _date_year: Default::default(),
4378            _date_month: Default::default(),
4379            _date_day: Default::default(),
4380            _delegate: Default::default(),
4381            _additional_params: Default::default(),
4382            _scopes: Default::default(),
4383        }
4384    }
4385
4386    /// Create a builder to help you perform the following task:
4387    ///
4388    /// Generate report of app installations.
4389    ///
4390    /// # Arguments
4391    ///
4392    /// * `customer` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
4393    pub fn reports_count_installed_apps(
4394        &self,
4395        customer: &str,
4396    ) -> CustomerReportCountInstalledAppCall<'a, C> {
4397        CustomerReportCountInstalledAppCall {
4398            hub: self.hub,
4399            _customer: customer.to_string(),
4400            _page_token: Default::default(),
4401            _page_size: Default::default(),
4402            _org_unit_id: Default::default(),
4403            _order_by: Default::default(),
4404            _filter: Default::default(),
4405            _delegate: Default::default(),
4406            _additional_params: Default::default(),
4407            _scopes: Default::default(),
4408        }
4409    }
4410
4411    /// Create a builder to help you perform the following task:
4412    ///
4413    /// Get a summary of printing done by each printer.
4414    ///
4415    /// # Arguments
4416    ///
4417    /// * `customer` - Required. Customer ID prefixed with "customers/" or "customers/my_customer" to use the customer associated to the account making the request.
4418    pub fn reports_count_print_jobs_by_printer(
4419        &self,
4420        customer: &str,
4421    ) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
4422        CustomerReportCountPrintJobsByPrinterCall {
4423            hub: self.hub,
4424            _customer: customer.to_string(),
4425            _printer_org_unit_id: Default::default(),
4426            _page_token: Default::default(),
4427            _page_size: Default::default(),
4428            _order_by: Default::default(),
4429            _filter: Default::default(),
4430            _delegate: Default::default(),
4431            _additional_params: Default::default(),
4432            _scopes: Default::default(),
4433        }
4434    }
4435
4436    /// Create a builder to help you perform the following task:
4437    ///
4438    /// Get a summary of printing done by each user.
4439    ///
4440    /// # Arguments
4441    ///
4442    /// * `customer` - Required. Customer ID prefixed with "customers/" or "customers/my_customer" to use the customer associated to the account making the request.
4443    pub fn reports_count_print_jobs_by_user(
4444        &self,
4445        customer: &str,
4446    ) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
4447        CustomerReportCountPrintJobsByUserCall {
4448            hub: self.hub,
4449            _customer: customer.to_string(),
4450            _printer_org_unit_id: Default::default(),
4451            _page_token: Default::default(),
4452            _page_size: Default::default(),
4453            _order_by: Default::default(),
4454            _filter: Default::default(),
4455            _delegate: Default::default(),
4456            _additional_params: Default::default(),
4457            _scopes: Default::default(),
4458        }
4459    }
4460
4461    /// Create a builder to help you perform the following task:
4462    ///
4463    /// Get a list of print jobs.
4464    ///
4465    /// # Arguments
4466    ///
4467    /// * `customer` - Required. Customer ID prefixed with "customers/" or "customers/my_customer" to use the customer associated to the account making the request.
4468    pub fn reports_enumerate_print_jobs(
4469        &self,
4470        customer: &str,
4471    ) -> CustomerReportEnumeratePrintJobCall<'a, C> {
4472        CustomerReportEnumeratePrintJobCall {
4473            hub: self.hub,
4474            _customer: customer.to_string(),
4475            _printer_org_unit_id: Default::default(),
4476            _page_token: Default::default(),
4477            _page_size: Default::default(),
4478            _order_by: Default::default(),
4479            _filter: Default::default(),
4480            _delegate: Default::default(),
4481            _additional_params: Default::default(),
4482            _scopes: Default::default(),
4483        }
4484    }
4485
4486    /// Create a builder to help you perform the following task:
4487    ///
4488    /// Generate report of managed Chrome browser devices that have a specified app installed.
4489    ///
4490    /// # Arguments
4491    ///
4492    /// * `customer` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
4493    pub fn reports_find_installed_app_devices(
4494        &self,
4495        customer: &str,
4496    ) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
4497        CustomerReportFindInstalledAppDeviceCall {
4498            hub: self.hub,
4499            _customer: customer.to_string(),
4500            _page_token: Default::default(),
4501            _page_size: Default::default(),
4502            _org_unit_id: Default::default(),
4503            _order_by: Default::default(),
4504            _filter: Default::default(),
4505            _app_type: Default::default(),
4506            _app_id: Default::default(),
4507            _delegate: Default::default(),
4508            _additional_params: Default::default(),
4509            _scopes: Default::default(),
4510        }
4511    }
4512
4513    /// Create a builder to help you perform the following task:
4514    ///
4515    /// Get telemetry device.
4516    ///
4517    /// # Arguments
4518    ///
4519    /// * `name` - Required. Name of the `TelemetryDevice` to return.
4520    pub fn telemetry_devices_get(&self, name: &str) -> CustomerTelemetryDeviceGetCall<'a, C> {
4521        CustomerTelemetryDeviceGetCall {
4522            hub: self.hub,
4523            _name: name.to_string(),
4524            _read_mask: Default::default(),
4525            _delegate: Default::default(),
4526            _additional_params: Default::default(),
4527            _scopes: Default::default(),
4528        }
4529    }
4530
4531    /// Create a builder to help you perform the following task:
4532    ///
4533    /// List all telemetry devices.
4534    ///
4535    /// # Arguments
4536    ///
4537    /// * `parent` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
4538    pub fn telemetry_devices_list(&self, parent: &str) -> CustomerTelemetryDeviceListCall<'a, C> {
4539        CustomerTelemetryDeviceListCall {
4540            hub: self.hub,
4541            _parent: parent.to_string(),
4542            _read_mask: Default::default(),
4543            _page_token: Default::default(),
4544            _page_size: Default::default(),
4545            _filter: Default::default(),
4546            _delegate: Default::default(),
4547            _additional_params: Default::default(),
4548            _scopes: Default::default(),
4549        }
4550    }
4551
4552    /// Create a builder to help you perform the following task:
4553    ///
4554    /// List telemetry events.
4555    ///
4556    /// # Arguments
4557    ///
4558    /// * `parent` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
4559    pub fn telemetry_events_list(&self, parent: &str) -> CustomerTelemetryEventListCall<'a, C> {
4560        CustomerTelemetryEventListCall {
4561            hub: self.hub,
4562            _parent: parent.to_string(),
4563            _read_mask: Default::default(),
4564            _page_token: Default::default(),
4565            _page_size: Default::default(),
4566            _filter: Default::default(),
4567            _delegate: Default::default(),
4568            _additional_params: Default::default(),
4569            _scopes: Default::default(),
4570        }
4571    }
4572
4573    /// Create a builder to help you perform the following task:
4574    ///
4575    /// Create a telemetry notification config.
4576    ///
4577    /// # Arguments
4578    ///
4579    /// * `request` - No description provided.
4580    /// * `parent` - Required. The parent resource where this notification config will be created. Format: `customers/{customer}`
4581    pub fn telemetry_notification_configs_create(
4582        &self,
4583        request: GoogleChromeManagementV1TelemetryNotificationConfig,
4584        parent: &str,
4585    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C> {
4586        CustomerTelemetryNotificationConfigCreateCall {
4587            hub: self.hub,
4588            _request: request,
4589            _parent: parent.to_string(),
4590            _delegate: Default::default(),
4591            _additional_params: Default::default(),
4592            _scopes: Default::default(),
4593        }
4594    }
4595
4596    /// Create a builder to help you perform the following task:
4597    ///
4598    /// Delete a telemetry notification config.
4599    ///
4600    /// # Arguments
4601    ///
4602    /// * `name` - Required. The name of the notification config to delete. Format: `customers/{customer}/telemetry/notificationConfigs/{notification_config}`
4603    pub fn telemetry_notification_configs_delete(
4604        &self,
4605        name: &str,
4606    ) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C> {
4607        CustomerTelemetryNotificationConfigDeleteCall {
4608            hub: self.hub,
4609            _name: name.to_string(),
4610            _delegate: Default::default(),
4611            _additional_params: Default::default(),
4612            _scopes: Default::default(),
4613        }
4614    }
4615
4616    /// Create a builder to help you perform the following task:
4617    ///
4618    /// List all telemetry notification configs.
4619    ///
4620    /// # Arguments
4621    ///
4622    /// * `parent` - Required. The parent which owns the notification configs.
4623    pub fn telemetry_notification_configs_list(
4624        &self,
4625        parent: &str,
4626    ) -> CustomerTelemetryNotificationConfigListCall<'a, C> {
4627        CustomerTelemetryNotificationConfigListCall {
4628            hub: self.hub,
4629            _parent: parent.to_string(),
4630            _page_token: Default::default(),
4631            _page_size: Default::default(),
4632            _delegate: Default::default(),
4633            _additional_params: Default::default(),
4634            _scopes: Default::default(),
4635        }
4636    }
4637
4638    /// Create a builder to help you perform the following task:
4639    ///
4640    /// Get telemetry user.
4641    ///
4642    /// # Arguments
4643    ///
4644    /// * `name` - Required. Name of the `TelemetryUser` to return.
4645    pub fn telemetry_users_get(&self, name: &str) -> CustomerTelemetryUserGetCall<'a, C> {
4646        CustomerTelemetryUserGetCall {
4647            hub: self.hub,
4648            _name: name.to_string(),
4649            _read_mask: Default::default(),
4650            _delegate: Default::default(),
4651            _additional_params: Default::default(),
4652            _scopes: Default::default(),
4653        }
4654    }
4655
4656    /// Create a builder to help you perform the following task:
4657    ///
4658    /// List all telemetry users.
4659    ///
4660    /// # Arguments
4661    ///
4662    /// * `parent` - Required. Customer id or "my_customer" to use the customer associated to the account making the request.
4663    pub fn telemetry_users_list(&self, parent: &str) -> CustomerTelemetryUserListCall<'a, C> {
4664        CustomerTelemetryUserListCall {
4665            hub: self.hub,
4666            _parent: parent.to_string(),
4667            _read_mask: Default::default(),
4668            _page_token: Default::default(),
4669            _page_size: Default::default(),
4670            _filter: Default::default(),
4671            _delegate: Default::default(),
4672            _additional_params: Default::default(),
4673            _scopes: Default::default(),
4674        }
4675    }
4676
4677    /// Create a builder to help you perform the following task:
4678    ///
4679    /// Moves a third party chrome profile user to a destination OU. All profiles associated to that user will be moved to the destination OU.
4680    ///
4681    /// # Arguments
4682    ///
4683    /// * `request` - No description provided.
4684    /// * `name` - Required. Format: customers/{customer_id}/thirdPartyProfileUsers/{third_party_profile_user_id}
4685    pub fn third_party_profile_users_move(
4686        &self,
4687        request: GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest,
4688        name: &str,
4689    ) -> CustomerThirdPartyProfileUserMoveCall<'a, C> {
4690        CustomerThirdPartyProfileUserMoveCall {
4691            hub: self.hub,
4692            _request: request,
4693            _name: name.to_string(),
4694            _delegate: Default::default(),
4695            _additional_params: Default::default(),
4696            _scopes: Default::default(),
4697        }
4698    }
4699}
4700
4701/// A builder providing access to all methods supported on *operation* resources.
4702/// It is not used directly, but through the [`ChromeManagement`] hub.
4703///
4704/// # Example
4705///
4706/// Instantiate a resource builder
4707///
4708/// ```test_harness,no_run
4709/// extern crate hyper;
4710/// extern crate hyper_rustls;
4711/// extern crate google_chromemanagement1 as chromemanagement1;
4712///
4713/// # async fn dox() {
4714/// use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4715///
4716/// let secret: yup_oauth2::ApplicationSecret = Default::default();
4717/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
4718///     .with_native_roots()
4719///     .unwrap()
4720///     .https_only()
4721///     .enable_http2()
4722///     .build();
4723///
4724/// let executor = hyper_util::rt::TokioExecutor::new();
4725/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
4726///     secret,
4727///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4728///     yup_oauth2::client::CustomHyperClientBuilder::from(
4729///         hyper_util::client::legacy::Client::builder(executor).build(connector),
4730///     ),
4731/// ).build().await.unwrap();
4732///
4733/// let client = hyper_util::client::legacy::Client::builder(
4734///     hyper_util::rt::TokioExecutor::new()
4735/// )
4736/// .build(
4737///     hyper_rustls::HttpsConnectorBuilder::new()
4738///         .with_native_roots()
4739///         .unwrap()
4740///         .https_or_http()
4741///         .enable_http2()
4742///         .build()
4743/// );
4744/// let mut hub = ChromeManagement::new(client, auth);
4745/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
4746/// // like `cancel(...)`, `delete(...)` and `list(...)`
4747/// // to build up your call.
4748/// let rb = hub.operations();
4749/// # }
4750/// ```
4751pub struct OperationMethods<'a, C>
4752where
4753    C: 'a,
4754{
4755    hub: &'a ChromeManagement<C>,
4756}
4757
4758impl<'a, C> common::MethodsBuilder for OperationMethods<'a, C> {}
4759
4760impl<'a, C> OperationMethods<'a, C> {
4761    /// Create a builder to help you perform the following task:
4762    ///
4763    /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
4764    ///
4765    /// # Arguments
4766    ///
4767    /// * `request` - No description provided.
4768    /// * `name` - The name of the operation resource to be cancelled.
4769    pub fn cancel(
4770        &self,
4771        request: GoogleLongrunningCancelOperationRequest,
4772        name: &str,
4773    ) -> OperationCancelCall<'a, C> {
4774        OperationCancelCall {
4775            hub: self.hub,
4776            _request: request,
4777            _name: name.to_string(),
4778            _delegate: Default::default(),
4779            _additional_params: Default::default(),
4780        }
4781    }
4782
4783    /// Create a builder to help you perform the following task:
4784    ///
4785    /// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
4786    ///
4787    /// # Arguments
4788    ///
4789    /// * `name` - The name of the operation resource to be deleted.
4790    pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C> {
4791        OperationDeleteCall {
4792            hub: self.hub,
4793            _name: name.to_string(),
4794            _delegate: Default::default(),
4795            _additional_params: Default::default(),
4796        }
4797    }
4798
4799    /// Create a builder to help you perform the following task:
4800    ///
4801    /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
4802    ///
4803    /// # Arguments
4804    ///
4805    /// * `name` - The name of the operation's parent resource.
4806    pub fn list(&self, name: &str) -> OperationListCall<'a, C> {
4807        OperationListCall {
4808            hub: self.hub,
4809            _name: name.to_string(),
4810            _return_partial_success: Default::default(),
4811            _page_token: Default::default(),
4812            _page_size: Default::default(),
4813            _filter: Default::default(),
4814            _delegate: Default::default(),
4815            _additional_params: Default::default(),
4816        }
4817    }
4818}
4819
4820// ###################
4821// CallBuilders   ###
4822// #################
4823
4824/// Get a specific app for a customer by its resource name.
4825///
4826/// A builder for the *apps.android.get* method supported by a *customer* resource.
4827/// It is not used directly, but through a [`CustomerMethods`] instance.
4828///
4829/// # Example
4830///
4831/// Instantiate a resource method builder
4832///
4833/// ```test_harness,no_run
4834/// # extern crate hyper;
4835/// # extern crate hyper_rustls;
4836/// # extern crate google_chromemanagement1 as chromemanagement1;
4837/// # async fn dox() {
4838/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4839///
4840/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4841/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
4842/// #     .with_native_roots()
4843/// #     .unwrap()
4844/// #     .https_only()
4845/// #     .enable_http2()
4846/// #     .build();
4847///
4848/// # let executor = hyper_util::rt::TokioExecutor::new();
4849/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
4850/// #     secret,
4851/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4852/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
4853/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
4854/// #     ),
4855/// # ).build().await.unwrap();
4856///
4857/// # let client = hyper_util::client::legacy::Client::builder(
4858/// #     hyper_util::rt::TokioExecutor::new()
4859/// # )
4860/// # .build(
4861/// #     hyper_rustls::HttpsConnectorBuilder::new()
4862/// #         .with_native_roots()
4863/// #         .unwrap()
4864/// #         .https_or_http()
4865/// #         .enable_http2()
4866/// #         .build()
4867/// # );
4868/// # let mut hub = ChromeManagement::new(client, auth);
4869/// // You can configure optional parameters by calling the respective setters at will, and
4870/// // execute the final call using `doit()`.
4871/// // Values shown here are possibly random and not representative !
4872/// let result = hub.customers().apps_android_get("name")
4873///              .doit().await;
4874/// # }
4875/// ```
4876pub struct CustomerAppAndroidGetCall<'a, C>
4877where
4878    C: 'a,
4879{
4880    hub: &'a ChromeManagement<C>,
4881    _name: String,
4882    _delegate: Option<&'a mut dyn common::Delegate>,
4883    _additional_params: HashMap<String, String>,
4884    _scopes: BTreeSet<String>,
4885}
4886
4887impl<'a, C> common::CallBuilder for CustomerAppAndroidGetCall<'a, C> {}
4888
4889impl<'a, C> CustomerAppAndroidGetCall<'a, C>
4890where
4891    C: common::Connector,
4892{
4893    /// Perform the operation you have build so far.
4894    pub async fn doit(
4895        mut self,
4896    ) -> common::Result<(common::Response, GoogleChromeManagementV1AppDetails)> {
4897        use std::borrow::Cow;
4898        use std::io::{Read, Seek};
4899
4900        use common::{url::Params, ToParts};
4901        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4902
4903        let mut dd = common::DefaultDelegate;
4904        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4905        dlg.begin(common::MethodInfo {
4906            id: "chromemanagement.customers.apps.android.get",
4907            http_method: hyper::Method::GET,
4908        });
4909
4910        for &field in ["alt", "name"].iter() {
4911            if self._additional_params.contains_key(field) {
4912                dlg.finished(false);
4913                return Err(common::Error::FieldClash(field));
4914            }
4915        }
4916
4917        let mut params = Params::with_capacity(3 + self._additional_params.len());
4918        params.push("name", self._name);
4919
4920        params.extend(self._additional_params.iter());
4921
4922        params.push("alt", "json");
4923        let mut url = self.hub._base_url.clone() + "v1/{+name}";
4924        if self._scopes.is_empty() {
4925            self._scopes.insert(
4926                Scope::ChromeManagementAppdetailReadonly
4927                    .as_ref()
4928                    .to_string(),
4929            );
4930        }
4931
4932        #[allow(clippy::single_element_loop)]
4933        for &(find_this, param_name) in [("{+name}", "name")].iter() {
4934            url = params.uri_replacement(url, param_name, find_this, true);
4935        }
4936        {
4937            let to_remove = ["name"];
4938            params.remove_params(&to_remove);
4939        }
4940
4941        let url = params.parse_with_url(&url);
4942
4943        loop {
4944            let token = match self
4945                .hub
4946                .auth
4947                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4948                .await
4949            {
4950                Ok(token) => token,
4951                Err(e) => match dlg.token(e) {
4952                    Ok(token) => token,
4953                    Err(e) => {
4954                        dlg.finished(false);
4955                        return Err(common::Error::MissingToken(e));
4956                    }
4957                },
4958            };
4959            let mut req_result = {
4960                let client = &self.hub.client;
4961                dlg.pre_request();
4962                let mut req_builder = hyper::Request::builder()
4963                    .method(hyper::Method::GET)
4964                    .uri(url.as_str())
4965                    .header(USER_AGENT, self.hub._user_agent.clone());
4966
4967                if let Some(token) = token.as_ref() {
4968                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4969                }
4970
4971                let request = req_builder
4972                    .header(CONTENT_LENGTH, 0_u64)
4973                    .body(common::to_body::<String>(None));
4974
4975                client.request(request.unwrap()).await
4976            };
4977
4978            match req_result {
4979                Err(err) => {
4980                    if let common::Retry::After(d) = dlg.http_error(&err) {
4981                        sleep(d).await;
4982                        continue;
4983                    }
4984                    dlg.finished(false);
4985                    return Err(common::Error::HttpError(err));
4986                }
4987                Ok(res) => {
4988                    let (mut parts, body) = res.into_parts();
4989                    let mut body = common::Body::new(body);
4990                    if !parts.status.is_success() {
4991                        let bytes = common::to_bytes(body).await.unwrap_or_default();
4992                        let error = serde_json::from_str(&common::to_string(&bytes));
4993                        let response = common::to_response(parts, bytes.into());
4994
4995                        if let common::Retry::After(d) =
4996                            dlg.http_failure(&response, error.as_ref().ok())
4997                        {
4998                            sleep(d).await;
4999                            continue;
5000                        }
5001
5002                        dlg.finished(false);
5003
5004                        return Err(match error {
5005                            Ok(value) => common::Error::BadRequest(value),
5006                            _ => common::Error::Failure(response),
5007                        });
5008                    }
5009                    let response = {
5010                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5011                        let encoded = common::to_string(&bytes);
5012                        match serde_json::from_str(&encoded) {
5013                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5014                            Err(error) => {
5015                                dlg.response_json_decode_error(&encoded, &error);
5016                                return Err(common::Error::JsonDecodeError(
5017                                    encoded.to_string(),
5018                                    error,
5019                                ));
5020                            }
5021                        }
5022                    };
5023
5024                    dlg.finished(true);
5025                    return Ok(response);
5026                }
5027            }
5028        }
5029    }
5030
5031    /// Required. The app for which details are being queried. Examples: "customers/my_customer/apps/chrome/gmbmikajjgmnabiglmofipeabaddhgne@2.1.2" for the Save to Google Drive Chrome extension version 2.1.2, "customers/my_customer/apps/android/com.google.android.apps.docs" for the Google Drive Android app's latest version.
5032    ///
5033    /// Sets the *name* path property to the given value.
5034    ///
5035    /// Even though the property as already been set when instantiating this call,
5036    /// we provide this method for API completeness.
5037    pub fn name(mut self, new_value: &str) -> CustomerAppAndroidGetCall<'a, C> {
5038        self._name = new_value.to_string();
5039        self
5040    }
5041    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5042    /// while executing the actual API request.
5043    ///
5044    /// ````text
5045    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
5046    /// ````
5047    ///
5048    /// Sets the *delegate* property to the given value.
5049    pub fn delegate(
5050        mut self,
5051        new_value: &'a mut dyn common::Delegate,
5052    ) -> CustomerAppAndroidGetCall<'a, C> {
5053        self._delegate = Some(new_value);
5054        self
5055    }
5056
5057    /// Set any additional parameter of the query string used in the request.
5058    /// It should be used to set parameters which are not yet available through their own
5059    /// setters.
5060    ///
5061    /// Please note that this method must not be used to set any of the known parameters
5062    /// which have their own setter method. If done anyway, the request will fail.
5063    ///
5064    /// # Additional Parameters
5065    ///
5066    /// * *$.xgafv* (query-string) - V1 error format.
5067    /// * *access_token* (query-string) - OAuth access token.
5068    /// * *alt* (query-string) - Data format for response.
5069    /// * *callback* (query-string) - JSONP
5070    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5071    /// * *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.
5072    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5073    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5074    /// * *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.
5075    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5076    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5077    pub fn param<T>(mut self, name: T, value: T) -> CustomerAppAndroidGetCall<'a, C>
5078    where
5079        T: AsRef<str>,
5080    {
5081        self._additional_params
5082            .insert(name.as_ref().to_string(), value.as_ref().to_string());
5083        self
5084    }
5085
5086    /// Identifies the authorization scope for the method you are building.
5087    ///
5088    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5089    /// [`Scope::ChromeManagementAppdetailReadonly`].
5090    ///
5091    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5092    /// tokens for more than one scope.
5093    ///
5094    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5095    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5096    /// sufficient, a read-write scope will do as well.
5097    pub fn add_scope<St>(mut self, scope: St) -> CustomerAppAndroidGetCall<'a, C>
5098    where
5099        St: AsRef<str>,
5100    {
5101        self._scopes.insert(String::from(scope.as_ref()));
5102        self
5103    }
5104    /// Identifies the authorization scope(s) for the method you are building.
5105    ///
5106    /// See [`Self::add_scope()`] for details.
5107    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerAppAndroidGetCall<'a, C>
5108    where
5109        I: IntoIterator<Item = St>,
5110        St: AsRef<str>,
5111    {
5112        self._scopes
5113            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5114        self
5115    }
5116
5117    /// Removes all scopes, and no default scope will be used either.
5118    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5119    /// for details).
5120    pub fn clear_scopes(mut self) -> CustomerAppAndroidGetCall<'a, C> {
5121        self._scopes.clear();
5122        self
5123    }
5124}
5125
5126/// Get a specific app for a customer by its resource name.
5127///
5128/// A builder for the *apps.chrome.get* method supported by a *customer* resource.
5129/// It is not used directly, but through a [`CustomerMethods`] instance.
5130///
5131/// # Example
5132///
5133/// Instantiate a resource method builder
5134///
5135/// ```test_harness,no_run
5136/// # extern crate hyper;
5137/// # extern crate hyper_rustls;
5138/// # extern crate google_chromemanagement1 as chromemanagement1;
5139/// # async fn dox() {
5140/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5141///
5142/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5143/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
5144/// #     .with_native_roots()
5145/// #     .unwrap()
5146/// #     .https_only()
5147/// #     .enable_http2()
5148/// #     .build();
5149///
5150/// # let executor = hyper_util::rt::TokioExecutor::new();
5151/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
5152/// #     secret,
5153/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5154/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
5155/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
5156/// #     ),
5157/// # ).build().await.unwrap();
5158///
5159/// # let client = hyper_util::client::legacy::Client::builder(
5160/// #     hyper_util::rt::TokioExecutor::new()
5161/// # )
5162/// # .build(
5163/// #     hyper_rustls::HttpsConnectorBuilder::new()
5164/// #         .with_native_roots()
5165/// #         .unwrap()
5166/// #         .https_or_http()
5167/// #         .enable_http2()
5168/// #         .build()
5169/// # );
5170/// # let mut hub = ChromeManagement::new(client, auth);
5171/// // You can configure optional parameters by calling the respective setters at will, and
5172/// // execute the final call using `doit()`.
5173/// // Values shown here are possibly random and not representative !
5174/// let result = hub.customers().apps_chrome_get("name")
5175///              .doit().await;
5176/// # }
5177/// ```
5178pub struct CustomerAppChromeGetCall<'a, C>
5179where
5180    C: 'a,
5181{
5182    hub: &'a ChromeManagement<C>,
5183    _name: String,
5184    _delegate: Option<&'a mut dyn common::Delegate>,
5185    _additional_params: HashMap<String, String>,
5186    _scopes: BTreeSet<String>,
5187}
5188
5189impl<'a, C> common::CallBuilder for CustomerAppChromeGetCall<'a, C> {}
5190
5191impl<'a, C> CustomerAppChromeGetCall<'a, C>
5192where
5193    C: common::Connector,
5194{
5195    /// Perform the operation you have build so far.
5196    pub async fn doit(
5197        mut self,
5198    ) -> common::Result<(common::Response, GoogleChromeManagementV1AppDetails)> {
5199        use std::borrow::Cow;
5200        use std::io::{Read, Seek};
5201
5202        use common::{url::Params, ToParts};
5203        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5204
5205        let mut dd = common::DefaultDelegate;
5206        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5207        dlg.begin(common::MethodInfo {
5208            id: "chromemanagement.customers.apps.chrome.get",
5209            http_method: hyper::Method::GET,
5210        });
5211
5212        for &field in ["alt", "name"].iter() {
5213            if self._additional_params.contains_key(field) {
5214                dlg.finished(false);
5215                return Err(common::Error::FieldClash(field));
5216            }
5217        }
5218
5219        let mut params = Params::with_capacity(3 + self._additional_params.len());
5220        params.push("name", self._name);
5221
5222        params.extend(self._additional_params.iter());
5223
5224        params.push("alt", "json");
5225        let mut url = self.hub._base_url.clone() + "v1/{+name}";
5226        if self._scopes.is_empty() {
5227            self._scopes.insert(
5228                Scope::ChromeManagementAppdetailReadonly
5229                    .as_ref()
5230                    .to_string(),
5231            );
5232        }
5233
5234        #[allow(clippy::single_element_loop)]
5235        for &(find_this, param_name) in [("{+name}", "name")].iter() {
5236            url = params.uri_replacement(url, param_name, find_this, true);
5237        }
5238        {
5239            let to_remove = ["name"];
5240            params.remove_params(&to_remove);
5241        }
5242
5243        let url = params.parse_with_url(&url);
5244
5245        loop {
5246            let token = match self
5247                .hub
5248                .auth
5249                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5250                .await
5251            {
5252                Ok(token) => token,
5253                Err(e) => match dlg.token(e) {
5254                    Ok(token) => token,
5255                    Err(e) => {
5256                        dlg.finished(false);
5257                        return Err(common::Error::MissingToken(e));
5258                    }
5259                },
5260            };
5261            let mut req_result = {
5262                let client = &self.hub.client;
5263                dlg.pre_request();
5264                let mut req_builder = hyper::Request::builder()
5265                    .method(hyper::Method::GET)
5266                    .uri(url.as_str())
5267                    .header(USER_AGENT, self.hub._user_agent.clone());
5268
5269                if let Some(token) = token.as_ref() {
5270                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5271                }
5272
5273                let request = req_builder
5274                    .header(CONTENT_LENGTH, 0_u64)
5275                    .body(common::to_body::<String>(None));
5276
5277                client.request(request.unwrap()).await
5278            };
5279
5280            match req_result {
5281                Err(err) => {
5282                    if let common::Retry::After(d) = dlg.http_error(&err) {
5283                        sleep(d).await;
5284                        continue;
5285                    }
5286                    dlg.finished(false);
5287                    return Err(common::Error::HttpError(err));
5288                }
5289                Ok(res) => {
5290                    let (mut parts, body) = res.into_parts();
5291                    let mut body = common::Body::new(body);
5292                    if !parts.status.is_success() {
5293                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5294                        let error = serde_json::from_str(&common::to_string(&bytes));
5295                        let response = common::to_response(parts, bytes.into());
5296
5297                        if let common::Retry::After(d) =
5298                            dlg.http_failure(&response, error.as_ref().ok())
5299                        {
5300                            sleep(d).await;
5301                            continue;
5302                        }
5303
5304                        dlg.finished(false);
5305
5306                        return Err(match error {
5307                            Ok(value) => common::Error::BadRequest(value),
5308                            _ => common::Error::Failure(response),
5309                        });
5310                    }
5311                    let response = {
5312                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5313                        let encoded = common::to_string(&bytes);
5314                        match serde_json::from_str(&encoded) {
5315                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5316                            Err(error) => {
5317                                dlg.response_json_decode_error(&encoded, &error);
5318                                return Err(common::Error::JsonDecodeError(
5319                                    encoded.to_string(),
5320                                    error,
5321                                ));
5322                            }
5323                        }
5324                    };
5325
5326                    dlg.finished(true);
5327                    return Ok(response);
5328                }
5329            }
5330        }
5331    }
5332
5333    /// Required. The app for which details are being queried. Examples: "customers/my_customer/apps/chrome/gmbmikajjgmnabiglmofipeabaddhgne@2.1.2" for the Save to Google Drive Chrome extension version 2.1.2, "customers/my_customer/apps/android/com.google.android.apps.docs" for the Google Drive Android app's latest version.
5334    ///
5335    /// Sets the *name* path property to the given value.
5336    ///
5337    /// Even though the property as already been set when instantiating this call,
5338    /// we provide this method for API completeness.
5339    pub fn name(mut self, new_value: &str) -> CustomerAppChromeGetCall<'a, C> {
5340        self._name = new_value.to_string();
5341        self
5342    }
5343    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5344    /// while executing the actual API request.
5345    ///
5346    /// ````text
5347    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
5348    /// ````
5349    ///
5350    /// Sets the *delegate* property to the given value.
5351    pub fn delegate(
5352        mut self,
5353        new_value: &'a mut dyn common::Delegate,
5354    ) -> CustomerAppChromeGetCall<'a, C> {
5355        self._delegate = Some(new_value);
5356        self
5357    }
5358
5359    /// Set any additional parameter of the query string used in the request.
5360    /// It should be used to set parameters which are not yet available through their own
5361    /// setters.
5362    ///
5363    /// Please note that this method must not be used to set any of the known parameters
5364    /// which have their own setter method. If done anyway, the request will fail.
5365    ///
5366    /// # Additional Parameters
5367    ///
5368    /// * *$.xgafv* (query-string) - V1 error format.
5369    /// * *access_token* (query-string) - OAuth access token.
5370    /// * *alt* (query-string) - Data format for response.
5371    /// * *callback* (query-string) - JSONP
5372    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5373    /// * *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.
5374    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5375    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5376    /// * *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.
5377    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5378    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5379    pub fn param<T>(mut self, name: T, value: T) -> CustomerAppChromeGetCall<'a, C>
5380    where
5381        T: AsRef<str>,
5382    {
5383        self._additional_params
5384            .insert(name.as_ref().to_string(), value.as_ref().to_string());
5385        self
5386    }
5387
5388    /// Identifies the authorization scope for the method you are building.
5389    ///
5390    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5391    /// [`Scope::ChromeManagementAppdetailReadonly`].
5392    ///
5393    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5394    /// tokens for more than one scope.
5395    ///
5396    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5397    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5398    /// sufficient, a read-write scope will do as well.
5399    pub fn add_scope<St>(mut self, scope: St) -> CustomerAppChromeGetCall<'a, C>
5400    where
5401        St: AsRef<str>,
5402    {
5403        self._scopes.insert(String::from(scope.as_ref()));
5404        self
5405    }
5406    /// Identifies the authorization scope(s) for the method you are building.
5407    ///
5408    /// See [`Self::add_scope()`] for details.
5409    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerAppChromeGetCall<'a, C>
5410    where
5411        I: IntoIterator<Item = St>,
5412        St: AsRef<str>,
5413    {
5414        self._scopes
5415            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5416        self
5417    }
5418
5419    /// Removes all scopes, and no default scope will be used either.
5420    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5421    /// for details).
5422    pub fn clear_scopes(mut self) -> CustomerAppChromeGetCall<'a, C> {
5423        self._scopes.clear();
5424        self
5425    }
5426}
5427
5428/// Get a specific app for a customer by its resource name.
5429///
5430/// A builder for the *apps.web.get* method supported by a *customer* resource.
5431/// It is not used directly, but through a [`CustomerMethods`] instance.
5432///
5433/// # Example
5434///
5435/// Instantiate a resource method builder
5436///
5437/// ```test_harness,no_run
5438/// # extern crate hyper;
5439/// # extern crate hyper_rustls;
5440/// # extern crate google_chromemanagement1 as chromemanagement1;
5441/// # async fn dox() {
5442/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5443///
5444/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5445/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
5446/// #     .with_native_roots()
5447/// #     .unwrap()
5448/// #     .https_only()
5449/// #     .enable_http2()
5450/// #     .build();
5451///
5452/// # let executor = hyper_util::rt::TokioExecutor::new();
5453/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
5454/// #     secret,
5455/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5456/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
5457/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
5458/// #     ),
5459/// # ).build().await.unwrap();
5460///
5461/// # let client = hyper_util::client::legacy::Client::builder(
5462/// #     hyper_util::rt::TokioExecutor::new()
5463/// # )
5464/// # .build(
5465/// #     hyper_rustls::HttpsConnectorBuilder::new()
5466/// #         .with_native_roots()
5467/// #         .unwrap()
5468/// #         .https_or_http()
5469/// #         .enable_http2()
5470/// #         .build()
5471/// # );
5472/// # let mut hub = ChromeManagement::new(client, auth);
5473/// // You can configure optional parameters by calling the respective setters at will, and
5474/// // execute the final call using `doit()`.
5475/// // Values shown here are possibly random and not representative !
5476/// let result = hub.customers().apps_web_get("name")
5477///              .doit().await;
5478/// # }
5479/// ```
5480pub struct CustomerAppWebGetCall<'a, C>
5481where
5482    C: 'a,
5483{
5484    hub: &'a ChromeManagement<C>,
5485    _name: String,
5486    _delegate: Option<&'a mut dyn common::Delegate>,
5487    _additional_params: HashMap<String, String>,
5488    _scopes: BTreeSet<String>,
5489}
5490
5491impl<'a, C> common::CallBuilder for CustomerAppWebGetCall<'a, C> {}
5492
5493impl<'a, C> CustomerAppWebGetCall<'a, C>
5494where
5495    C: common::Connector,
5496{
5497    /// Perform the operation you have build so far.
5498    pub async fn doit(
5499        mut self,
5500    ) -> common::Result<(common::Response, GoogleChromeManagementV1AppDetails)> {
5501        use std::borrow::Cow;
5502        use std::io::{Read, Seek};
5503
5504        use common::{url::Params, ToParts};
5505        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5506
5507        let mut dd = common::DefaultDelegate;
5508        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5509        dlg.begin(common::MethodInfo {
5510            id: "chromemanagement.customers.apps.web.get",
5511            http_method: hyper::Method::GET,
5512        });
5513
5514        for &field in ["alt", "name"].iter() {
5515            if self._additional_params.contains_key(field) {
5516                dlg.finished(false);
5517                return Err(common::Error::FieldClash(field));
5518            }
5519        }
5520
5521        let mut params = Params::with_capacity(3 + self._additional_params.len());
5522        params.push("name", self._name);
5523
5524        params.extend(self._additional_params.iter());
5525
5526        params.push("alt", "json");
5527        let mut url = self.hub._base_url.clone() + "v1/{+name}";
5528        if self._scopes.is_empty() {
5529            self._scopes.insert(
5530                Scope::ChromeManagementAppdetailReadonly
5531                    .as_ref()
5532                    .to_string(),
5533            );
5534        }
5535
5536        #[allow(clippy::single_element_loop)]
5537        for &(find_this, param_name) in [("{+name}", "name")].iter() {
5538            url = params.uri_replacement(url, param_name, find_this, true);
5539        }
5540        {
5541            let to_remove = ["name"];
5542            params.remove_params(&to_remove);
5543        }
5544
5545        let url = params.parse_with_url(&url);
5546
5547        loop {
5548            let token = match self
5549                .hub
5550                .auth
5551                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5552                .await
5553            {
5554                Ok(token) => token,
5555                Err(e) => match dlg.token(e) {
5556                    Ok(token) => token,
5557                    Err(e) => {
5558                        dlg.finished(false);
5559                        return Err(common::Error::MissingToken(e));
5560                    }
5561                },
5562            };
5563            let mut req_result = {
5564                let client = &self.hub.client;
5565                dlg.pre_request();
5566                let mut req_builder = hyper::Request::builder()
5567                    .method(hyper::Method::GET)
5568                    .uri(url.as_str())
5569                    .header(USER_AGENT, self.hub._user_agent.clone());
5570
5571                if let Some(token) = token.as_ref() {
5572                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5573                }
5574
5575                let request = req_builder
5576                    .header(CONTENT_LENGTH, 0_u64)
5577                    .body(common::to_body::<String>(None));
5578
5579                client.request(request.unwrap()).await
5580            };
5581
5582            match req_result {
5583                Err(err) => {
5584                    if let common::Retry::After(d) = dlg.http_error(&err) {
5585                        sleep(d).await;
5586                        continue;
5587                    }
5588                    dlg.finished(false);
5589                    return Err(common::Error::HttpError(err));
5590                }
5591                Ok(res) => {
5592                    let (mut parts, body) = res.into_parts();
5593                    let mut body = common::Body::new(body);
5594                    if !parts.status.is_success() {
5595                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5596                        let error = serde_json::from_str(&common::to_string(&bytes));
5597                        let response = common::to_response(parts, bytes.into());
5598
5599                        if let common::Retry::After(d) =
5600                            dlg.http_failure(&response, error.as_ref().ok())
5601                        {
5602                            sleep(d).await;
5603                            continue;
5604                        }
5605
5606                        dlg.finished(false);
5607
5608                        return Err(match error {
5609                            Ok(value) => common::Error::BadRequest(value),
5610                            _ => common::Error::Failure(response),
5611                        });
5612                    }
5613                    let response = {
5614                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5615                        let encoded = common::to_string(&bytes);
5616                        match serde_json::from_str(&encoded) {
5617                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5618                            Err(error) => {
5619                                dlg.response_json_decode_error(&encoded, &error);
5620                                return Err(common::Error::JsonDecodeError(
5621                                    encoded.to_string(),
5622                                    error,
5623                                ));
5624                            }
5625                        }
5626                    };
5627
5628                    dlg.finished(true);
5629                    return Ok(response);
5630                }
5631            }
5632        }
5633    }
5634
5635    /// Required. The app for which details are being queried. Examples: "customers/my_customer/apps/chrome/gmbmikajjgmnabiglmofipeabaddhgne@2.1.2" for the Save to Google Drive Chrome extension version 2.1.2, "customers/my_customer/apps/android/com.google.android.apps.docs" for the Google Drive Android app's latest version.
5636    ///
5637    /// Sets the *name* path property to the given value.
5638    ///
5639    /// Even though the property as already been set when instantiating this call,
5640    /// we provide this method for API completeness.
5641    pub fn name(mut self, new_value: &str) -> CustomerAppWebGetCall<'a, C> {
5642        self._name = new_value.to_string();
5643        self
5644    }
5645    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
5646    /// while executing the actual API request.
5647    ///
5648    /// ````text
5649    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
5650    /// ````
5651    ///
5652    /// Sets the *delegate* property to the given value.
5653    pub fn delegate(
5654        mut self,
5655        new_value: &'a mut dyn common::Delegate,
5656    ) -> CustomerAppWebGetCall<'a, C> {
5657        self._delegate = Some(new_value);
5658        self
5659    }
5660
5661    /// Set any additional parameter of the query string used in the request.
5662    /// It should be used to set parameters which are not yet available through their own
5663    /// setters.
5664    ///
5665    /// Please note that this method must not be used to set any of the known parameters
5666    /// which have their own setter method. If done anyway, the request will fail.
5667    ///
5668    /// # Additional Parameters
5669    ///
5670    /// * *$.xgafv* (query-string) - V1 error format.
5671    /// * *access_token* (query-string) - OAuth access token.
5672    /// * *alt* (query-string) - Data format for response.
5673    /// * *callback* (query-string) - JSONP
5674    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
5675    /// * *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.
5676    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
5677    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
5678    /// * *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.
5679    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
5680    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
5681    pub fn param<T>(mut self, name: T, value: T) -> CustomerAppWebGetCall<'a, C>
5682    where
5683        T: AsRef<str>,
5684    {
5685        self._additional_params
5686            .insert(name.as_ref().to_string(), value.as_ref().to_string());
5687        self
5688    }
5689
5690    /// Identifies the authorization scope for the method you are building.
5691    ///
5692    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
5693    /// [`Scope::ChromeManagementAppdetailReadonly`].
5694    ///
5695    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
5696    /// tokens for more than one scope.
5697    ///
5698    /// Usually there is more than one suitable scope to authorize an operation, some of which may
5699    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
5700    /// sufficient, a read-write scope will do as well.
5701    pub fn add_scope<St>(mut self, scope: St) -> CustomerAppWebGetCall<'a, C>
5702    where
5703        St: AsRef<str>,
5704    {
5705        self._scopes.insert(String::from(scope.as_ref()));
5706        self
5707    }
5708    /// Identifies the authorization scope(s) for the method you are building.
5709    ///
5710    /// See [`Self::add_scope()`] for details.
5711    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerAppWebGetCall<'a, C>
5712    where
5713        I: IntoIterator<Item = St>,
5714        St: AsRef<str>,
5715    {
5716        self._scopes
5717            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
5718        self
5719    }
5720
5721    /// Removes all scopes, and no default scope will be used either.
5722    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
5723    /// for details).
5724    pub fn clear_scopes(mut self) -> CustomerAppWebGetCall<'a, C> {
5725        self._scopes.clear();
5726        self
5727    }
5728}
5729
5730/// Generate summary of app installation requests.
5731///
5732/// A builder for the *apps.countChromeAppRequests* method supported by a *customer* resource.
5733/// It is not used directly, but through a [`CustomerMethods`] instance.
5734///
5735/// # Example
5736///
5737/// Instantiate a resource method builder
5738///
5739/// ```test_harness,no_run
5740/// # extern crate hyper;
5741/// # extern crate hyper_rustls;
5742/// # extern crate google_chromemanagement1 as chromemanagement1;
5743/// # async fn dox() {
5744/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
5745///
5746/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
5747/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
5748/// #     .with_native_roots()
5749/// #     .unwrap()
5750/// #     .https_only()
5751/// #     .enable_http2()
5752/// #     .build();
5753///
5754/// # let executor = hyper_util::rt::TokioExecutor::new();
5755/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
5756/// #     secret,
5757/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
5758/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
5759/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
5760/// #     ),
5761/// # ).build().await.unwrap();
5762///
5763/// # let client = hyper_util::client::legacy::Client::builder(
5764/// #     hyper_util::rt::TokioExecutor::new()
5765/// # )
5766/// # .build(
5767/// #     hyper_rustls::HttpsConnectorBuilder::new()
5768/// #         .with_native_roots()
5769/// #         .unwrap()
5770/// #         .https_or_http()
5771/// #         .enable_http2()
5772/// #         .build()
5773/// # );
5774/// # let mut hub = ChromeManagement::new(client, auth);
5775/// // You can configure optional parameters by calling the respective setters at will, and
5776/// // execute the final call using `doit()`.
5777/// // Values shown here are possibly random and not representative !
5778/// let result = hub.customers().apps_count_chrome_app_requests("customer")
5779///              .page_token("sed")
5780///              .page_size(-2)
5781///              .org_unit_id("takimata")
5782///              .order_by("amet.")
5783///              .doit().await;
5784/// # }
5785/// ```
5786pub struct CustomerAppCountChromeAppRequestCall<'a, C>
5787where
5788    C: 'a,
5789{
5790    hub: &'a ChromeManagement<C>,
5791    _customer: String,
5792    _page_token: Option<String>,
5793    _page_size: Option<i32>,
5794    _org_unit_id: Option<String>,
5795    _order_by: Option<String>,
5796    _delegate: Option<&'a mut dyn common::Delegate>,
5797    _additional_params: HashMap<String, String>,
5798    _scopes: BTreeSet<String>,
5799}
5800
5801impl<'a, C> common::CallBuilder for CustomerAppCountChromeAppRequestCall<'a, C> {}
5802
5803impl<'a, C> CustomerAppCountChromeAppRequestCall<'a, C>
5804where
5805    C: common::Connector,
5806{
5807    /// Perform the operation you have build so far.
5808    pub async fn doit(
5809        mut self,
5810    ) -> common::Result<(
5811        common::Response,
5812        GoogleChromeManagementV1CountChromeAppRequestsResponse,
5813    )> {
5814        use std::borrow::Cow;
5815        use std::io::{Read, Seek};
5816
5817        use common::{url::Params, ToParts};
5818        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
5819
5820        let mut dd = common::DefaultDelegate;
5821        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
5822        dlg.begin(common::MethodInfo {
5823            id: "chromemanagement.customers.apps.countChromeAppRequests",
5824            http_method: hyper::Method::GET,
5825        });
5826
5827        for &field in [
5828            "alt",
5829            "customer",
5830            "pageToken",
5831            "pageSize",
5832            "orgUnitId",
5833            "orderBy",
5834        ]
5835        .iter()
5836        {
5837            if self._additional_params.contains_key(field) {
5838                dlg.finished(false);
5839                return Err(common::Error::FieldClash(field));
5840            }
5841        }
5842
5843        let mut params = Params::with_capacity(7 + self._additional_params.len());
5844        params.push("customer", self._customer);
5845        if let Some(value) = self._page_token.as_ref() {
5846            params.push("pageToken", value);
5847        }
5848        if let Some(value) = self._page_size.as_ref() {
5849            params.push("pageSize", value.to_string());
5850        }
5851        if let Some(value) = self._org_unit_id.as_ref() {
5852            params.push("orgUnitId", value);
5853        }
5854        if let Some(value) = self._order_by.as_ref() {
5855            params.push("orderBy", value);
5856        }
5857
5858        params.extend(self._additional_params.iter());
5859
5860        params.push("alt", "json");
5861        let mut url = self.hub._base_url.clone() + "v1/{+customer}/apps:countChromeAppRequests";
5862        if self._scopes.is_empty() {
5863            self._scopes.insert(
5864                Scope::ChromeManagementAppdetailReadonly
5865                    .as_ref()
5866                    .to_string(),
5867            );
5868        }
5869
5870        #[allow(clippy::single_element_loop)]
5871        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
5872            url = params.uri_replacement(url, param_name, find_this, true);
5873        }
5874        {
5875            let to_remove = ["customer"];
5876            params.remove_params(&to_remove);
5877        }
5878
5879        let url = params.parse_with_url(&url);
5880
5881        loop {
5882            let token = match self
5883                .hub
5884                .auth
5885                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
5886                .await
5887            {
5888                Ok(token) => token,
5889                Err(e) => match dlg.token(e) {
5890                    Ok(token) => token,
5891                    Err(e) => {
5892                        dlg.finished(false);
5893                        return Err(common::Error::MissingToken(e));
5894                    }
5895                },
5896            };
5897            let mut req_result = {
5898                let client = &self.hub.client;
5899                dlg.pre_request();
5900                let mut req_builder = hyper::Request::builder()
5901                    .method(hyper::Method::GET)
5902                    .uri(url.as_str())
5903                    .header(USER_AGENT, self.hub._user_agent.clone());
5904
5905                if let Some(token) = token.as_ref() {
5906                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
5907                }
5908
5909                let request = req_builder
5910                    .header(CONTENT_LENGTH, 0_u64)
5911                    .body(common::to_body::<String>(None));
5912
5913                client.request(request.unwrap()).await
5914            };
5915
5916            match req_result {
5917                Err(err) => {
5918                    if let common::Retry::After(d) = dlg.http_error(&err) {
5919                        sleep(d).await;
5920                        continue;
5921                    }
5922                    dlg.finished(false);
5923                    return Err(common::Error::HttpError(err));
5924                }
5925                Ok(res) => {
5926                    let (mut parts, body) = res.into_parts();
5927                    let mut body = common::Body::new(body);
5928                    if !parts.status.is_success() {
5929                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5930                        let error = serde_json::from_str(&common::to_string(&bytes));
5931                        let response = common::to_response(parts, bytes.into());
5932
5933                        if let common::Retry::After(d) =
5934                            dlg.http_failure(&response, error.as_ref().ok())
5935                        {
5936                            sleep(d).await;
5937                            continue;
5938                        }
5939
5940                        dlg.finished(false);
5941
5942                        return Err(match error {
5943                            Ok(value) => common::Error::BadRequest(value),
5944                            _ => common::Error::Failure(response),
5945                        });
5946                    }
5947                    let response = {
5948                        let bytes = common::to_bytes(body).await.unwrap_or_default();
5949                        let encoded = common::to_string(&bytes);
5950                        match serde_json::from_str(&encoded) {
5951                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
5952                            Err(error) => {
5953                                dlg.response_json_decode_error(&encoded, &error);
5954                                return Err(common::Error::JsonDecodeError(
5955                                    encoded.to_string(),
5956                                    error,
5957                                ));
5958                            }
5959                        }
5960                    };
5961
5962                    dlg.finished(true);
5963                    return Ok(response);
5964                }
5965            }
5966        }
5967    }
5968
5969    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
5970    ///
5971    /// Sets the *customer* path property to the given value.
5972    ///
5973    /// Even though the property as already been set when instantiating this call,
5974    /// we provide this method for API completeness.
5975    pub fn customer(mut self, new_value: &str) -> CustomerAppCountChromeAppRequestCall<'a, C> {
5976        self._customer = new_value.to_string();
5977        self
5978    }
5979    /// Token to specify the page of the request to be returned.
5980    ///
5981    /// Sets the *page token* query property to the given value.
5982    pub fn page_token(mut self, new_value: &str) -> CustomerAppCountChromeAppRequestCall<'a, C> {
5983        self._page_token = Some(new_value.to_string());
5984        self
5985    }
5986    /// Maximum number of results to return. Maximum and default are 50, anything above will be coerced to 50.
5987    ///
5988    /// Sets the *page size* query property to the given value.
5989    pub fn page_size(mut self, new_value: i32) -> CustomerAppCountChromeAppRequestCall<'a, C> {
5990        self._page_size = Some(new_value);
5991        self
5992    }
5993    /// The ID of the organizational unit.
5994    ///
5995    /// Sets the *org unit id* query property to the given value.
5996    pub fn org_unit_id(mut self, new_value: &str) -> CustomerAppCountChromeAppRequestCall<'a, C> {
5997        self._org_unit_id = Some(new_value.to_string());
5998        self
5999    }
6000    /// Field used to order results. Supported fields: * request_count * latest_request_time
6001    ///
6002    /// Sets the *order by* query property to the given value.
6003    pub fn order_by(mut self, new_value: &str) -> CustomerAppCountChromeAppRequestCall<'a, C> {
6004        self._order_by = Some(new_value.to_string());
6005        self
6006    }
6007    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6008    /// while executing the actual API request.
6009    ///
6010    /// ````text
6011    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
6012    /// ````
6013    ///
6014    /// Sets the *delegate* property to the given value.
6015    pub fn delegate(
6016        mut self,
6017        new_value: &'a mut dyn common::Delegate,
6018    ) -> CustomerAppCountChromeAppRequestCall<'a, C> {
6019        self._delegate = Some(new_value);
6020        self
6021    }
6022
6023    /// Set any additional parameter of the query string used in the request.
6024    /// It should be used to set parameters which are not yet available through their own
6025    /// setters.
6026    ///
6027    /// Please note that this method must not be used to set any of the known parameters
6028    /// which have their own setter method. If done anyway, the request will fail.
6029    ///
6030    /// # Additional Parameters
6031    ///
6032    /// * *$.xgafv* (query-string) - V1 error format.
6033    /// * *access_token* (query-string) - OAuth access token.
6034    /// * *alt* (query-string) - Data format for response.
6035    /// * *callback* (query-string) - JSONP
6036    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6037    /// * *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.
6038    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6039    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6040    /// * *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.
6041    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6042    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6043    pub fn param<T>(mut self, name: T, value: T) -> CustomerAppCountChromeAppRequestCall<'a, C>
6044    where
6045        T: AsRef<str>,
6046    {
6047        self._additional_params
6048            .insert(name.as_ref().to_string(), value.as_ref().to_string());
6049        self
6050    }
6051
6052    /// Identifies the authorization scope for the method you are building.
6053    ///
6054    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6055    /// [`Scope::ChromeManagementAppdetailReadonly`].
6056    ///
6057    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6058    /// tokens for more than one scope.
6059    ///
6060    /// Usually there is more than one suitable scope to authorize an operation, some of which may
6061    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6062    /// sufficient, a read-write scope will do as well.
6063    pub fn add_scope<St>(mut self, scope: St) -> CustomerAppCountChromeAppRequestCall<'a, C>
6064    where
6065        St: AsRef<str>,
6066    {
6067        self._scopes.insert(String::from(scope.as_ref()));
6068        self
6069    }
6070    /// Identifies the authorization scope(s) for the method you are building.
6071    ///
6072    /// See [`Self::add_scope()`] for details.
6073    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerAppCountChromeAppRequestCall<'a, C>
6074    where
6075        I: IntoIterator<Item = St>,
6076        St: AsRef<str>,
6077    {
6078        self._scopes
6079            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6080        self
6081    }
6082
6083    /// Removes all scopes, and no default scope will be used either.
6084    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6085    /// for details).
6086    pub fn clear_scopes(mut self) -> CustomerAppCountChromeAppRequestCall<'a, C> {
6087        self._scopes.clear();
6088        self
6089    }
6090}
6091
6092/// Get a list of devices that have requested to install an extension.
6093///
6094/// A builder for the *apps.fetchDevicesRequestingExtension* method supported by a *customer* resource.
6095/// It is not used directly, but through a [`CustomerMethods`] instance.
6096///
6097/// # Example
6098///
6099/// Instantiate a resource method builder
6100///
6101/// ```test_harness,no_run
6102/// # extern crate hyper;
6103/// # extern crate hyper_rustls;
6104/// # extern crate google_chromemanagement1 as chromemanagement1;
6105/// # async fn dox() {
6106/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6107///
6108/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6109/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
6110/// #     .with_native_roots()
6111/// #     .unwrap()
6112/// #     .https_only()
6113/// #     .enable_http2()
6114/// #     .build();
6115///
6116/// # let executor = hyper_util::rt::TokioExecutor::new();
6117/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
6118/// #     secret,
6119/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6120/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
6121/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
6122/// #     ),
6123/// # ).build().await.unwrap();
6124///
6125/// # let client = hyper_util::client::legacy::Client::builder(
6126/// #     hyper_util::rt::TokioExecutor::new()
6127/// # )
6128/// # .build(
6129/// #     hyper_rustls::HttpsConnectorBuilder::new()
6130/// #         .with_native_roots()
6131/// #         .unwrap()
6132/// #         .https_or_http()
6133/// #         .enable_http2()
6134/// #         .build()
6135/// # );
6136/// # let mut hub = ChromeManagement::new(client, auth);
6137/// // You can configure optional parameters by calling the respective setters at will, and
6138/// // execute the final call using `doit()`.
6139/// // Values shown here are possibly random and not representative !
6140/// let result = hub.customers().apps_fetch_devices_requesting_extension("customer")
6141///              .page_token("ipsum")
6142///              .page_size(-62)
6143///              .org_unit_id("Lorem")
6144///              .extension_id("gubergren")
6145///              .doit().await;
6146/// # }
6147/// ```
6148pub struct CustomerAppFetchDevicesRequestingExtensionCall<'a, C>
6149where
6150    C: 'a,
6151{
6152    hub: &'a ChromeManagement<C>,
6153    _customer: String,
6154    _page_token: Option<String>,
6155    _page_size: Option<i32>,
6156    _org_unit_id: Option<String>,
6157    _extension_id: Option<String>,
6158    _delegate: Option<&'a mut dyn common::Delegate>,
6159    _additional_params: HashMap<String, String>,
6160    _scopes: BTreeSet<String>,
6161}
6162
6163impl<'a, C> common::CallBuilder for CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {}
6164
6165impl<'a, C> CustomerAppFetchDevicesRequestingExtensionCall<'a, C>
6166where
6167    C: common::Connector,
6168{
6169    /// Perform the operation you have build so far.
6170    pub async fn doit(
6171        mut self,
6172    ) -> common::Result<(
6173        common::Response,
6174        GoogleChromeManagementV1FetchDevicesRequestingExtensionResponse,
6175    )> {
6176        use std::borrow::Cow;
6177        use std::io::{Read, Seek};
6178
6179        use common::{url::Params, ToParts};
6180        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6181
6182        let mut dd = common::DefaultDelegate;
6183        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6184        dlg.begin(common::MethodInfo {
6185            id: "chromemanagement.customers.apps.fetchDevicesRequestingExtension",
6186            http_method: hyper::Method::GET,
6187        });
6188
6189        for &field in [
6190            "alt",
6191            "customer",
6192            "pageToken",
6193            "pageSize",
6194            "orgUnitId",
6195            "extensionId",
6196        ]
6197        .iter()
6198        {
6199            if self._additional_params.contains_key(field) {
6200                dlg.finished(false);
6201                return Err(common::Error::FieldClash(field));
6202            }
6203        }
6204
6205        let mut params = Params::with_capacity(7 + self._additional_params.len());
6206        params.push("customer", self._customer);
6207        if let Some(value) = self._page_token.as_ref() {
6208            params.push("pageToken", value);
6209        }
6210        if let Some(value) = self._page_size.as_ref() {
6211            params.push("pageSize", value.to_string());
6212        }
6213        if let Some(value) = self._org_unit_id.as_ref() {
6214            params.push("orgUnitId", value);
6215        }
6216        if let Some(value) = self._extension_id.as_ref() {
6217            params.push("extensionId", value);
6218        }
6219
6220        params.extend(self._additional_params.iter());
6221
6222        params.push("alt", "json");
6223        let mut url =
6224            self.hub._base_url.clone() + "v1/{+customer}/apps:fetchDevicesRequestingExtension";
6225        if self._scopes.is_empty() {
6226            self._scopes.insert(
6227                Scope::ChromeManagementAppdetailReadonly
6228                    .as_ref()
6229                    .to_string(),
6230            );
6231        }
6232
6233        #[allow(clippy::single_element_loop)]
6234        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
6235            url = params.uri_replacement(url, param_name, find_this, true);
6236        }
6237        {
6238            let to_remove = ["customer"];
6239            params.remove_params(&to_remove);
6240        }
6241
6242        let url = params.parse_with_url(&url);
6243
6244        loop {
6245            let token = match self
6246                .hub
6247                .auth
6248                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6249                .await
6250            {
6251                Ok(token) => token,
6252                Err(e) => match dlg.token(e) {
6253                    Ok(token) => token,
6254                    Err(e) => {
6255                        dlg.finished(false);
6256                        return Err(common::Error::MissingToken(e));
6257                    }
6258                },
6259            };
6260            let mut req_result = {
6261                let client = &self.hub.client;
6262                dlg.pre_request();
6263                let mut req_builder = hyper::Request::builder()
6264                    .method(hyper::Method::GET)
6265                    .uri(url.as_str())
6266                    .header(USER_AGENT, self.hub._user_agent.clone());
6267
6268                if let Some(token) = token.as_ref() {
6269                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6270                }
6271
6272                let request = req_builder
6273                    .header(CONTENT_LENGTH, 0_u64)
6274                    .body(common::to_body::<String>(None));
6275
6276                client.request(request.unwrap()).await
6277            };
6278
6279            match req_result {
6280                Err(err) => {
6281                    if let common::Retry::After(d) = dlg.http_error(&err) {
6282                        sleep(d).await;
6283                        continue;
6284                    }
6285                    dlg.finished(false);
6286                    return Err(common::Error::HttpError(err));
6287                }
6288                Ok(res) => {
6289                    let (mut parts, body) = res.into_parts();
6290                    let mut body = common::Body::new(body);
6291                    if !parts.status.is_success() {
6292                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6293                        let error = serde_json::from_str(&common::to_string(&bytes));
6294                        let response = common::to_response(parts, bytes.into());
6295
6296                        if let common::Retry::After(d) =
6297                            dlg.http_failure(&response, error.as_ref().ok())
6298                        {
6299                            sleep(d).await;
6300                            continue;
6301                        }
6302
6303                        dlg.finished(false);
6304
6305                        return Err(match error {
6306                            Ok(value) => common::Error::BadRequest(value),
6307                            _ => common::Error::Failure(response),
6308                        });
6309                    }
6310                    let response = {
6311                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6312                        let encoded = common::to_string(&bytes);
6313                        match serde_json::from_str(&encoded) {
6314                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6315                            Err(error) => {
6316                                dlg.response_json_decode_error(&encoded, &error);
6317                                return Err(common::Error::JsonDecodeError(
6318                                    encoded.to_string(),
6319                                    error,
6320                                ));
6321                            }
6322                        }
6323                    };
6324
6325                    dlg.finished(true);
6326                    return Ok(response);
6327                }
6328            }
6329        }
6330    }
6331
6332    /// Required. The customer ID or "my_customer" prefixed with "customers/".
6333    ///
6334    /// Sets the *customer* path property to the given value.
6335    ///
6336    /// Even though the property as already been set when instantiating this call,
6337    /// we provide this method for API completeness.
6338    pub fn customer(
6339        mut self,
6340        new_value: &str,
6341    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6342        self._customer = new_value.to_string();
6343        self
6344    }
6345    /// Optional. Token to specify the page of the request to be returned. Token expires after 1 day.
6346    ///
6347    /// Sets the *page token* query property to the given value.
6348    pub fn page_token(
6349        mut self,
6350        new_value: &str,
6351    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6352        self._page_token = Some(new_value.to_string());
6353        self
6354    }
6355    /// Optional. Maximum number of results to return. Maximum and default are 50. Any page size larger than 50 will be coerced to 50.
6356    ///
6357    /// Sets the *page size* query property to the given value.
6358    pub fn page_size(
6359        mut self,
6360        new_value: i32,
6361    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6362        self._page_size = Some(new_value);
6363        self
6364    }
6365    /// The ID of the organizational unit. Only consider devices that directly belong to this org unit, i.e. sub-orgunits are not counted. If omitted, all data will be returned.
6366    ///
6367    /// Sets the *org unit id* query property to the given value.
6368    pub fn org_unit_id(
6369        mut self,
6370        new_value: &str,
6371    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6372        self._org_unit_id = Some(new_value.to_string());
6373        self
6374    }
6375    /// Required. The extension for which we want to find requesting devices.
6376    ///
6377    /// Sets the *extension id* query property to the given value.
6378    pub fn extension_id(
6379        mut self,
6380        new_value: &str,
6381    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6382        self._extension_id = Some(new_value.to_string());
6383        self
6384    }
6385    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6386    /// while executing the actual API request.
6387    ///
6388    /// ````text
6389    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
6390    /// ````
6391    ///
6392    /// Sets the *delegate* property to the given value.
6393    pub fn delegate(
6394        mut self,
6395        new_value: &'a mut dyn common::Delegate,
6396    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6397        self._delegate = Some(new_value);
6398        self
6399    }
6400
6401    /// Set any additional parameter of the query string used in the request.
6402    /// It should be used to set parameters which are not yet available through their own
6403    /// setters.
6404    ///
6405    /// Please note that this method must not be used to set any of the known parameters
6406    /// which have their own setter method. If done anyway, the request will fail.
6407    ///
6408    /// # Additional Parameters
6409    ///
6410    /// * *$.xgafv* (query-string) - V1 error format.
6411    /// * *access_token* (query-string) - OAuth access token.
6412    /// * *alt* (query-string) - Data format for response.
6413    /// * *callback* (query-string) - JSONP
6414    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6415    /// * *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.
6416    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6417    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6418    /// * *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.
6419    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6420    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6421    pub fn param<T>(
6422        mut self,
6423        name: T,
6424        value: T,
6425    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C>
6426    where
6427        T: AsRef<str>,
6428    {
6429        self._additional_params
6430            .insert(name.as_ref().to_string(), value.as_ref().to_string());
6431        self
6432    }
6433
6434    /// Identifies the authorization scope for the method you are building.
6435    ///
6436    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6437    /// [`Scope::ChromeManagementAppdetailReadonly`].
6438    ///
6439    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6440    /// tokens for more than one scope.
6441    ///
6442    /// Usually there is more than one suitable scope to authorize an operation, some of which may
6443    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6444    /// sufficient, a read-write scope will do as well.
6445    pub fn add_scope<St>(
6446        mut self,
6447        scope: St,
6448    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C>
6449    where
6450        St: AsRef<str>,
6451    {
6452        self._scopes.insert(String::from(scope.as_ref()));
6453        self
6454    }
6455    /// Identifies the authorization scope(s) for the method you are building.
6456    ///
6457    /// See [`Self::add_scope()`] for details.
6458    pub fn add_scopes<I, St>(
6459        mut self,
6460        scopes: I,
6461    ) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C>
6462    where
6463        I: IntoIterator<Item = St>,
6464        St: AsRef<str>,
6465    {
6466        self._scopes
6467            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6468        self
6469    }
6470
6471    /// Removes all scopes, and no default scope will be used either.
6472    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6473    /// for details).
6474    pub fn clear_scopes(mut self) -> CustomerAppFetchDevicesRequestingExtensionCall<'a, C> {
6475        self._scopes.clear();
6476        self
6477    }
6478}
6479
6480/// Get a list of users that have requested to install an extension.
6481///
6482/// A builder for the *apps.fetchUsersRequestingExtension* method supported by a *customer* resource.
6483/// It is not used directly, but through a [`CustomerMethods`] instance.
6484///
6485/// # Example
6486///
6487/// Instantiate a resource method builder
6488///
6489/// ```test_harness,no_run
6490/// # extern crate hyper;
6491/// # extern crate hyper_rustls;
6492/// # extern crate google_chromemanagement1 as chromemanagement1;
6493/// # async fn dox() {
6494/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6495///
6496/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6497/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
6498/// #     .with_native_roots()
6499/// #     .unwrap()
6500/// #     .https_only()
6501/// #     .enable_http2()
6502/// #     .build();
6503///
6504/// # let executor = hyper_util::rt::TokioExecutor::new();
6505/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
6506/// #     secret,
6507/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6508/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
6509/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
6510/// #     ),
6511/// # ).build().await.unwrap();
6512///
6513/// # let client = hyper_util::client::legacy::Client::builder(
6514/// #     hyper_util::rt::TokioExecutor::new()
6515/// # )
6516/// # .build(
6517/// #     hyper_rustls::HttpsConnectorBuilder::new()
6518/// #         .with_native_roots()
6519/// #         .unwrap()
6520/// #         .https_or_http()
6521/// #         .enable_http2()
6522/// #         .build()
6523/// # );
6524/// # let mut hub = ChromeManagement::new(client, auth);
6525/// // You can configure optional parameters by calling the respective setters at will, and
6526/// // execute the final call using `doit()`.
6527/// // Values shown here are possibly random and not representative !
6528/// let result = hub.customers().apps_fetch_users_requesting_extension("customer")
6529///              .page_token("dolor")
6530///              .page_size(-17)
6531///              .org_unit_id("ipsum")
6532///              .extension_id("invidunt")
6533///              .doit().await;
6534/// # }
6535/// ```
6536pub struct CustomerAppFetchUsersRequestingExtensionCall<'a, C>
6537where
6538    C: 'a,
6539{
6540    hub: &'a ChromeManagement<C>,
6541    _customer: String,
6542    _page_token: Option<String>,
6543    _page_size: Option<i32>,
6544    _org_unit_id: Option<String>,
6545    _extension_id: Option<String>,
6546    _delegate: Option<&'a mut dyn common::Delegate>,
6547    _additional_params: HashMap<String, String>,
6548    _scopes: BTreeSet<String>,
6549}
6550
6551impl<'a, C> common::CallBuilder for CustomerAppFetchUsersRequestingExtensionCall<'a, C> {}
6552
6553impl<'a, C> CustomerAppFetchUsersRequestingExtensionCall<'a, C>
6554where
6555    C: common::Connector,
6556{
6557    /// Perform the operation you have build so far.
6558    pub async fn doit(
6559        mut self,
6560    ) -> common::Result<(
6561        common::Response,
6562        GoogleChromeManagementV1FetchUsersRequestingExtensionResponse,
6563    )> {
6564        use std::borrow::Cow;
6565        use std::io::{Read, Seek};
6566
6567        use common::{url::Params, ToParts};
6568        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6569
6570        let mut dd = common::DefaultDelegate;
6571        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6572        dlg.begin(common::MethodInfo {
6573            id: "chromemanagement.customers.apps.fetchUsersRequestingExtension",
6574            http_method: hyper::Method::GET,
6575        });
6576
6577        for &field in [
6578            "alt",
6579            "customer",
6580            "pageToken",
6581            "pageSize",
6582            "orgUnitId",
6583            "extensionId",
6584        ]
6585        .iter()
6586        {
6587            if self._additional_params.contains_key(field) {
6588                dlg.finished(false);
6589                return Err(common::Error::FieldClash(field));
6590            }
6591        }
6592
6593        let mut params = Params::with_capacity(7 + self._additional_params.len());
6594        params.push("customer", self._customer);
6595        if let Some(value) = self._page_token.as_ref() {
6596            params.push("pageToken", value);
6597        }
6598        if let Some(value) = self._page_size.as_ref() {
6599            params.push("pageSize", value.to_string());
6600        }
6601        if let Some(value) = self._org_unit_id.as_ref() {
6602            params.push("orgUnitId", value);
6603        }
6604        if let Some(value) = self._extension_id.as_ref() {
6605            params.push("extensionId", value);
6606        }
6607
6608        params.extend(self._additional_params.iter());
6609
6610        params.push("alt", "json");
6611        let mut url =
6612            self.hub._base_url.clone() + "v1/{+customer}/apps:fetchUsersRequestingExtension";
6613        if self._scopes.is_empty() {
6614            self._scopes.insert(
6615                Scope::ChromeManagementAppdetailReadonly
6616                    .as_ref()
6617                    .to_string(),
6618            );
6619        }
6620
6621        #[allow(clippy::single_element_loop)]
6622        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
6623            url = params.uri_replacement(url, param_name, find_this, true);
6624        }
6625        {
6626            let to_remove = ["customer"];
6627            params.remove_params(&to_remove);
6628        }
6629
6630        let url = params.parse_with_url(&url);
6631
6632        loop {
6633            let token = match self
6634                .hub
6635                .auth
6636                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
6637                .await
6638            {
6639                Ok(token) => token,
6640                Err(e) => match dlg.token(e) {
6641                    Ok(token) => token,
6642                    Err(e) => {
6643                        dlg.finished(false);
6644                        return Err(common::Error::MissingToken(e));
6645                    }
6646                },
6647            };
6648            let mut req_result = {
6649                let client = &self.hub.client;
6650                dlg.pre_request();
6651                let mut req_builder = hyper::Request::builder()
6652                    .method(hyper::Method::GET)
6653                    .uri(url.as_str())
6654                    .header(USER_AGENT, self.hub._user_agent.clone());
6655
6656                if let Some(token) = token.as_ref() {
6657                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
6658                }
6659
6660                let request = req_builder
6661                    .header(CONTENT_LENGTH, 0_u64)
6662                    .body(common::to_body::<String>(None));
6663
6664                client.request(request.unwrap()).await
6665            };
6666
6667            match req_result {
6668                Err(err) => {
6669                    if let common::Retry::After(d) = dlg.http_error(&err) {
6670                        sleep(d).await;
6671                        continue;
6672                    }
6673                    dlg.finished(false);
6674                    return Err(common::Error::HttpError(err));
6675                }
6676                Ok(res) => {
6677                    let (mut parts, body) = res.into_parts();
6678                    let mut body = common::Body::new(body);
6679                    if !parts.status.is_success() {
6680                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6681                        let error = serde_json::from_str(&common::to_string(&bytes));
6682                        let response = common::to_response(parts, bytes.into());
6683
6684                        if let common::Retry::After(d) =
6685                            dlg.http_failure(&response, error.as_ref().ok())
6686                        {
6687                            sleep(d).await;
6688                            continue;
6689                        }
6690
6691                        dlg.finished(false);
6692
6693                        return Err(match error {
6694                            Ok(value) => common::Error::BadRequest(value),
6695                            _ => common::Error::Failure(response),
6696                        });
6697                    }
6698                    let response = {
6699                        let bytes = common::to_bytes(body).await.unwrap_or_default();
6700                        let encoded = common::to_string(&bytes);
6701                        match serde_json::from_str(&encoded) {
6702                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
6703                            Err(error) => {
6704                                dlg.response_json_decode_error(&encoded, &error);
6705                                return Err(common::Error::JsonDecodeError(
6706                                    encoded.to_string(),
6707                                    error,
6708                                ));
6709                            }
6710                        }
6711                    };
6712
6713                    dlg.finished(true);
6714                    return Ok(response);
6715                }
6716            }
6717        }
6718    }
6719
6720    /// Required. The customer ID or "my_customer" prefixed with "customers/".
6721    ///
6722    /// Sets the *customer* path property to the given value.
6723    ///
6724    /// Even though the property as already been set when instantiating this call,
6725    /// we provide this method for API completeness.
6726    pub fn customer(
6727        mut self,
6728        new_value: &str,
6729    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6730        self._customer = new_value.to_string();
6731        self
6732    }
6733    /// Optional. Token to specify the page of the request to be returned. Token expires after 1 day.
6734    ///
6735    /// Sets the *page token* query property to the given value.
6736    pub fn page_token(
6737        mut self,
6738        new_value: &str,
6739    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6740        self._page_token = Some(new_value.to_string());
6741        self
6742    }
6743    /// Optional. Maximum number of results to return. Maximum and default are 50. Any page size larger than 50 will be coerced to 50.
6744    ///
6745    /// Sets the *page size* query property to the given value.
6746    pub fn page_size(
6747        mut self,
6748        new_value: i32,
6749    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6750        self._page_size = Some(new_value);
6751        self
6752    }
6753    /// The ID of the organizational unit. Only consider devices that directly belong to this org unit, i.e. sub-orgunits are not counted. If omitted, all data will be returned.
6754    ///
6755    /// Sets the *org unit id* query property to the given value.
6756    pub fn org_unit_id(
6757        mut self,
6758        new_value: &str,
6759    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6760        self._org_unit_id = Some(new_value.to_string());
6761        self
6762    }
6763    /// Required. The extension for which we want to find the requesting users.
6764    ///
6765    /// Sets the *extension id* query property to the given value.
6766    pub fn extension_id(
6767        mut self,
6768        new_value: &str,
6769    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6770        self._extension_id = Some(new_value.to_string());
6771        self
6772    }
6773    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
6774    /// while executing the actual API request.
6775    ///
6776    /// ````text
6777    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
6778    /// ````
6779    ///
6780    /// Sets the *delegate* property to the given value.
6781    pub fn delegate(
6782        mut self,
6783        new_value: &'a mut dyn common::Delegate,
6784    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6785        self._delegate = Some(new_value);
6786        self
6787    }
6788
6789    /// Set any additional parameter of the query string used in the request.
6790    /// It should be used to set parameters which are not yet available through their own
6791    /// setters.
6792    ///
6793    /// Please note that this method must not be used to set any of the known parameters
6794    /// which have their own setter method. If done anyway, the request will fail.
6795    ///
6796    /// # Additional Parameters
6797    ///
6798    /// * *$.xgafv* (query-string) - V1 error format.
6799    /// * *access_token* (query-string) - OAuth access token.
6800    /// * *alt* (query-string) - Data format for response.
6801    /// * *callback* (query-string) - JSONP
6802    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
6803    /// * *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.
6804    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
6805    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
6806    /// * *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.
6807    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
6808    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
6809    pub fn param<T>(
6810        mut self,
6811        name: T,
6812        value: T,
6813    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C>
6814    where
6815        T: AsRef<str>,
6816    {
6817        self._additional_params
6818            .insert(name.as_ref().to_string(), value.as_ref().to_string());
6819        self
6820    }
6821
6822    /// Identifies the authorization scope for the method you are building.
6823    ///
6824    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
6825    /// [`Scope::ChromeManagementAppdetailReadonly`].
6826    ///
6827    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
6828    /// tokens for more than one scope.
6829    ///
6830    /// Usually there is more than one suitable scope to authorize an operation, some of which may
6831    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
6832    /// sufficient, a read-write scope will do as well.
6833    pub fn add_scope<St>(mut self, scope: St) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C>
6834    where
6835        St: AsRef<str>,
6836    {
6837        self._scopes.insert(String::from(scope.as_ref()));
6838        self
6839    }
6840    /// Identifies the authorization scope(s) for the method you are building.
6841    ///
6842    /// See [`Self::add_scope()`] for details.
6843    pub fn add_scopes<I, St>(
6844        mut self,
6845        scopes: I,
6846    ) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C>
6847    where
6848        I: IntoIterator<Item = St>,
6849        St: AsRef<str>,
6850    {
6851        self._scopes
6852            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
6853        self
6854    }
6855
6856    /// Removes all scopes, and no default scope will be used either.
6857    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
6858    /// for details).
6859    pub fn clear_scopes(mut self) -> CustomerAppFetchUsersRequestingExtensionCall<'a, C> {
6860        self._scopes.clear();
6861        self
6862    }
6863}
6864
6865/// 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.
6866///
6867/// A builder for the *certificateProvisioningProcesses.operations.get* method supported by a *customer* resource.
6868/// It is not used directly, but through a [`CustomerMethods`] instance.
6869///
6870/// # Example
6871///
6872/// Instantiate a resource method builder
6873///
6874/// ```test_harness,no_run
6875/// # extern crate hyper;
6876/// # extern crate hyper_rustls;
6877/// # extern crate google_chromemanagement1 as chromemanagement1;
6878/// # async fn dox() {
6879/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
6880///
6881/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
6882/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
6883/// #     .with_native_roots()
6884/// #     .unwrap()
6885/// #     .https_only()
6886/// #     .enable_http2()
6887/// #     .build();
6888///
6889/// # let executor = hyper_util::rt::TokioExecutor::new();
6890/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
6891/// #     secret,
6892/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
6893/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
6894/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
6895/// #     ),
6896/// # ).build().await.unwrap();
6897///
6898/// # let client = hyper_util::client::legacy::Client::builder(
6899/// #     hyper_util::rt::TokioExecutor::new()
6900/// # )
6901/// # .build(
6902/// #     hyper_rustls::HttpsConnectorBuilder::new()
6903/// #         .with_native_roots()
6904/// #         .unwrap()
6905/// #         .https_or_http()
6906/// #         .enable_http2()
6907/// #         .build()
6908/// # );
6909/// # let mut hub = ChromeManagement::new(client, auth);
6910/// // You can configure optional parameters by calling the respective setters at will, and
6911/// // execute the final call using `doit()`.
6912/// // Values shown here are possibly random and not representative !
6913/// let result = hub.customers().certificate_provisioning_processes_operations_get("name")
6914///              .doit().await;
6915/// # }
6916/// ```
6917pub struct CustomerCertificateProvisioningProcessOperationGetCall<'a, C>
6918where
6919    C: 'a,
6920{
6921    hub: &'a ChromeManagement<C>,
6922    _name: String,
6923    _delegate: Option<&'a mut dyn common::Delegate>,
6924    _additional_params: HashMap<String, String>,
6925}
6926
6927impl<'a, C> common::CallBuilder for CustomerCertificateProvisioningProcessOperationGetCall<'a, C> {}
6928
6929impl<'a, C> CustomerCertificateProvisioningProcessOperationGetCall<'a, C>
6930where
6931    C: common::Connector,
6932{
6933    /// Perform the operation you have build so far.
6934    pub async fn doit(mut self) -> common::Result<(common::Response, GoogleLongrunningOperation)> {
6935        use std::borrow::Cow;
6936        use std::io::{Read, Seek};
6937
6938        use common::{url::Params, ToParts};
6939        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
6940
6941        let mut dd = common::DefaultDelegate;
6942        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
6943        dlg.begin(common::MethodInfo {
6944            id: "chromemanagement.customers.certificateProvisioningProcesses.operations.get",
6945            http_method: hyper::Method::GET,
6946        });
6947
6948        for &field in ["alt", "name"].iter() {
6949            if self._additional_params.contains_key(field) {
6950                dlg.finished(false);
6951                return Err(common::Error::FieldClash(field));
6952            }
6953        }
6954
6955        let mut params = Params::with_capacity(3 + self._additional_params.len());
6956        params.push("name", self._name);
6957
6958        params.extend(self._additional_params.iter());
6959
6960        params.push("alt", "json");
6961        let mut url = self.hub._base_url.clone() + "v1/{+name}";
6962
6963        match dlg.api_key() {
6964            Some(value) => params.push("key", value),
6965            None => {
6966                dlg.finished(false);
6967                return Err(common::Error::MissingAPIKey);
6968            }
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 mut req_result = {
6984                let client = &self.hub.client;
6985                dlg.pre_request();
6986                let mut req_builder = hyper::Request::builder()
6987                    .method(hyper::Method::GET)
6988                    .uri(url.as_str())
6989                    .header(USER_AGENT, self.hub._user_agent.clone());
6990
6991                let request = req_builder
6992                    .header(CONTENT_LENGTH, 0_u64)
6993                    .body(common::to_body::<String>(None));
6994
6995                client.request(request.unwrap()).await
6996            };
6997
6998            match req_result {
6999                Err(err) => {
7000                    if let common::Retry::After(d) = dlg.http_error(&err) {
7001                        sleep(d).await;
7002                        continue;
7003                    }
7004                    dlg.finished(false);
7005                    return Err(common::Error::HttpError(err));
7006                }
7007                Ok(res) => {
7008                    let (mut parts, body) = res.into_parts();
7009                    let mut body = common::Body::new(body);
7010                    if !parts.status.is_success() {
7011                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7012                        let error = serde_json::from_str(&common::to_string(&bytes));
7013                        let response = common::to_response(parts, bytes.into());
7014
7015                        if let common::Retry::After(d) =
7016                            dlg.http_failure(&response, error.as_ref().ok())
7017                        {
7018                            sleep(d).await;
7019                            continue;
7020                        }
7021
7022                        dlg.finished(false);
7023
7024                        return Err(match error {
7025                            Ok(value) => common::Error::BadRequest(value),
7026                            _ => common::Error::Failure(response),
7027                        });
7028                    }
7029                    let response = {
7030                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7031                        let encoded = common::to_string(&bytes);
7032                        match serde_json::from_str(&encoded) {
7033                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7034                            Err(error) => {
7035                                dlg.response_json_decode_error(&encoded, &error);
7036                                return Err(common::Error::JsonDecodeError(
7037                                    encoded.to_string(),
7038                                    error,
7039                                ));
7040                            }
7041                        }
7042                    };
7043
7044                    dlg.finished(true);
7045                    return Ok(response);
7046                }
7047            }
7048        }
7049    }
7050
7051    /// The name of the operation resource.
7052    ///
7053    /// Sets the *name* path property to the given value.
7054    ///
7055    /// Even though the property as already been set when instantiating this call,
7056    /// we provide this method for API completeness.
7057    pub fn name(
7058        mut self,
7059        new_value: &str,
7060    ) -> CustomerCertificateProvisioningProcessOperationGetCall<'a, C> {
7061        self._name = new_value.to_string();
7062        self
7063    }
7064    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7065    /// while executing the actual API request.
7066    ///
7067    /// ````text
7068    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7069    /// ````
7070    ///
7071    /// Sets the *delegate* property to the given value.
7072    pub fn delegate(
7073        mut self,
7074        new_value: &'a mut dyn common::Delegate,
7075    ) -> CustomerCertificateProvisioningProcessOperationGetCall<'a, C> {
7076        self._delegate = Some(new_value);
7077        self
7078    }
7079
7080    /// Set any additional parameter of the query string used in the request.
7081    /// It should be used to set parameters which are not yet available through their own
7082    /// setters.
7083    ///
7084    /// Please note that this method must not be used to set any of the known parameters
7085    /// which have their own setter method. If done anyway, the request will fail.
7086    ///
7087    /// # Additional Parameters
7088    ///
7089    /// * *$.xgafv* (query-string) - V1 error format.
7090    /// * *access_token* (query-string) - OAuth access token.
7091    /// * *alt* (query-string) - Data format for response.
7092    /// * *callback* (query-string) - JSONP
7093    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7094    /// * *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.
7095    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7096    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7097    /// * *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.
7098    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7099    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7100    pub fn param<T>(
7101        mut self,
7102        name: T,
7103        value: T,
7104    ) -> CustomerCertificateProvisioningProcessOperationGetCall<'a, C>
7105    where
7106        T: AsRef<str>,
7107    {
7108        self._additional_params
7109            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7110        self
7111    }
7112}
7113
7114/// Claims a certificate provisioning process. For each certificate provisioning process, this operation can succeed only for one `caller_instance_id`.
7115///
7116/// A builder for the *certificateProvisioningProcesses.claim* method supported by a *customer* resource.
7117/// It is not used directly, but through a [`CustomerMethods`] instance.
7118///
7119/// # Example
7120///
7121/// Instantiate a resource method builder
7122///
7123/// ```test_harness,no_run
7124/// # extern crate hyper;
7125/// # extern crate hyper_rustls;
7126/// # extern crate google_chromemanagement1 as chromemanagement1;
7127/// use chromemanagement1::api::GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest;
7128/// # async fn dox() {
7129/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7130///
7131/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7132/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7133/// #     .with_native_roots()
7134/// #     .unwrap()
7135/// #     .https_only()
7136/// #     .enable_http2()
7137/// #     .build();
7138///
7139/// # let executor = hyper_util::rt::TokioExecutor::new();
7140/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7141/// #     secret,
7142/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7143/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
7144/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
7145/// #     ),
7146/// # ).build().await.unwrap();
7147///
7148/// # let client = hyper_util::client::legacy::Client::builder(
7149/// #     hyper_util::rt::TokioExecutor::new()
7150/// # )
7151/// # .build(
7152/// #     hyper_rustls::HttpsConnectorBuilder::new()
7153/// #         .with_native_roots()
7154/// #         .unwrap()
7155/// #         .https_or_http()
7156/// #         .enable_http2()
7157/// #         .build()
7158/// # );
7159/// # let mut hub = ChromeManagement::new(client, auth);
7160/// // As the method needs a request, you would usually fill it with the desired information
7161/// // into the respective structure. Some of the parts shown here might not be applicable !
7162/// // Values shown here are possibly random and not representative !
7163/// let mut req = GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest::default();
7164///
7165/// // You can configure optional parameters by calling the respective setters at will, and
7166/// // execute the final call using `doit()`.
7167/// // Values shown here are possibly random and not representative !
7168/// let result = hub.customers().certificate_provisioning_processes_claim(req, "name")
7169///              .doit().await;
7170/// # }
7171/// ```
7172pub struct CustomerCertificateProvisioningProcessClaimCall<'a, C>
7173where
7174    C: 'a,
7175{
7176    hub: &'a ChromeManagement<C>,
7177    _request: GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest,
7178    _name: String,
7179    _delegate: Option<&'a mut dyn common::Delegate>,
7180    _additional_params: HashMap<String, String>,
7181}
7182
7183impl<'a, C> common::CallBuilder for CustomerCertificateProvisioningProcessClaimCall<'a, C> {}
7184
7185impl<'a, C> CustomerCertificateProvisioningProcessClaimCall<'a, C>
7186where
7187    C: common::Connector,
7188{
7189    /// Perform the operation you have build so far.
7190    pub async fn doit(
7191        mut self,
7192    ) -> common::Result<(
7193        common::Response,
7194        GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessResponse,
7195    )> {
7196        use std::borrow::Cow;
7197        use std::io::{Read, Seek};
7198
7199        use common::{url::Params, ToParts};
7200        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7201
7202        let mut dd = common::DefaultDelegate;
7203        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7204        dlg.begin(common::MethodInfo {
7205            id: "chromemanagement.customers.certificateProvisioningProcesses.claim",
7206            http_method: hyper::Method::POST,
7207        });
7208
7209        for &field in ["alt", "name"].iter() {
7210            if self._additional_params.contains_key(field) {
7211                dlg.finished(false);
7212                return Err(common::Error::FieldClash(field));
7213            }
7214        }
7215
7216        let mut params = Params::with_capacity(4 + self._additional_params.len());
7217        params.push("name", self._name);
7218
7219        params.extend(self._additional_params.iter());
7220
7221        params.push("alt", "json");
7222        let mut url = self.hub._base_url.clone() + "v1/{+name}:claim";
7223
7224        match dlg.api_key() {
7225            Some(value) => params.push("key", value),
7226            None => {
7227                dlg.finished(false);
7228                return Err(common::Error::MissingAPIKey);
7229            }
7230        }
7231
7232        #[allow(clippy::single_element_loop)]
7233        for &(find_this, param_name) in [("{+name}", "name")].iter() {
7234            url = params.uri_replacement(url, param_name, find_this, true);
7235        }
7236        {
7237            let to_remove = ["name"];
7238            params.remove_params(&to_remove);
7239        }
7240
7241        let url = params.parse_with_url(&url);
7242
7243        let mut json_mime_type = mime::APPLICATION_JSON;
7244        let mut request_value_reader = {
7245            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7246            common::remove_json_null_values(&mut value);
7247            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7248            serde_json::to_writer(&mut dst, &value).unwrap();
7249            dst
7250        };
7251        let request_size = request_value_reader
7252            .seek(std::io::SeekFrom::End(0))
7253            .unwrap();
7254        request_value_reader
7255            .seek(std::io::SeekFrom::Start(0))
7256            .unwrap();
7257
7258        loop {
7259            request_value_reader
7260                .seek(std::io::SeekFrom::Start(0))
7261                .unwrap();
7262            let mut req_result = {
7263                let client = &self.hub.client;
7264                dlg.pre_request();
7265                let mut req_builder = hyper::Request::builder()
7266                    .method(hyper::Method::POST)
7267                    .uri(url.as_str())
7268                    .header(USER_AGENT, self.hub._user_agent.clone());
7269
7270                let request = req_builder
7271                    .header(CONTENT_TYPE, json_mime_type.to_string())
7272                    .header(CONTENT_LENGTH, request_size as u64)
7273                    .body(common::to_body(
7274                        request_value_reader.get_ref().clone().into(),
7275                    ));
7276
7277                client.request(request.unwrap()).await
7278            };
7279
7280            match req_result {
7281                Err(err) => {
7282                    if let common::Retry::After(d) = dlg.http_error(&err) {
7283                        sleep(d).await;
7284                        continue;
7285                    }
7286                    dlg.finished(false);
7287                    return Err(common::Error::HttpError(err));
7288                }
7289                Ok(res) => {
7290                    let (mut parts, body) = res.into_parts();
7291                    let mut body = common::Body::new(body);
7292                    if !parts.status.is_success() {
7293                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7294                        let error = serde_json::from_str(&common::to_string(&bytes));
7295                        let response = common::to_response(parts, bytes.into());
7296
7297                        if let common::Retry::After(d) =
7298                            dlg.http_failure(&response, error.as_ref().ok())
7299                        {
7300                            sleep(d).await;
7301                            continue;
7302                        }
7303
7304                        dlg.finished(false);
7305
7306                        return Err(match error {
7307                            Ok(value) => common::Error::BadRequest(value),
7308                            _ => common::Error::Failure(response),
7309                        });
7310                    }
7311                    let response = {
7312                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7313                        let encoded = common::to_string(&bytes);
7314                        match serde_json::from_str(&encoded) {
7315                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7316                            Err(error) => {
7317                                dlg.response_json_decode_error(&encoded, &error);
7318                                return Err(common::Error::JsonDecodeError(
7319                                    encoded.to_string(),
7320                                    error,
7321                                ));
7322                            }
7323                        }
7324                    };
7325
7326                    dlg.finished(true);
7327                    return Ok(response);
7328                }
7329            }
7330        }
7331    }
7332
7333    ///
7334    /// Sets the *request* property to the given value.
7335    ///
7336    /// Even though the property as already been set when instantiating this call,
7337    /// we provide this method for API completeness.
7338    pub fn request(
7339        mut self,
7340        new_value: GoogleChromeManagementVersionsV1ClaimCertificateProvisioningProcessRequest,
7341    ) -> CustomerCertificateProvisioningProcessClaimCall<'a, C> {
7342        self._request = new_value;
7343        self
7344    }
7345    /// Required. Resource name of the `CertificateProvisioningProcess` to claim. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
7346    ///
7347    /// Sets the *name* path property to the given value.
7348    ///
7349    /// Even though the property as already been set when instantiating this call,
7350    /// we provide this method for API completeness.
7351    pub fn name(
7352        mut self,
7353        new_value: &str,
7354    ) -> CustomerCertificateProvisioningProcessClaimCall<'a, C> {
7355        self._name = new_value.to_string();
7356        self
7357    }
7358    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7359    /// while executing the actual API request.
7360    ///
7361    /// ````text
7362    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7363    /// ````
7364    ///
7365    /// Sets the *delegate* property to the given value.
7366    pub fn delegate(
7367        mut self,
7368        new_value: &'a mut dyn common::Delegate,
7369    ) -> CustomerCertificateProvisioningProcessClaimCall<'a, C> {
7370        self._delegate = Some(new_value);
7371        self
7372    }
7373
7374    /// Set any additional parameter of the query string used in the request.
7375    /// It should be used to set parameters which are not yet available through their own
7376    /// setters.
7377    ///
7378    /// Please note that this method must not be used to set any of the known parameters
7379    /// which have their own setter method. If done anyway, the request will fail.
7380    ///
7381    /// # Additional Parameters
7382    ///
7383    /// * *$.xgafv* (query-string) - V1 error format.
7384    /// * *access_token* (query-string) - OAuth access token.
7385    /// * *alt* (query-string) - Data format for response.
7386    /// * *callback* (query-string) - JSONP
7387    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7388    /// * *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.
7389    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7390    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7391    /// * *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.
7392    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7393    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7394    pub fn param<T>(
7395        mut self,
7396        name: T,
7397        value: T,
7398    ) -> CustomerCertificateProvisioningProcessClaimCall<'a, C>
7399    where
7400        T: AsRef<str>,
7401    {
7402        self._additional_params
7403            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7404        self
7405    }
7406}
7407
7408/// Retrieves a certificate provisioning process.
7409///
7410/// A builder for the *certificateProvisioningProcesses.get* method supported by a *customer* resource.
7411/// It is not used directly, but through a [`CustomerMethods`] instance.
7412///
7413/// # Example
7414///
7415/// Instantiate a resource method builder
7416///
7417/// ```test_harness,no_run
7418/// # extern crate hyper;
7419/// # extern crate hyper_rustls;
7420/// # extern crate google_chromemanagement1 as chromemanagement1;
7421/// # async fn dox() {
7422/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7423///
7424/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7425/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7426/// #     .with_native_roots()
7427/// #     .unwrap()
7428/// #     .https_only()
7429/// #     .enable_http2()
7430/// #     .build();
7431///
7432/// # let executor = hyper_util::rt::TokioExecutor::new();
7433/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7434/// #     secret,
7435/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7436/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
7437/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
7438/// #     ),
7439/// # ).build().await.unwrap();
7440///
7441/// # let client = hyper_util::client::legacy::Client::builder(
7442/// #     hyper_util::rt::TokioExecutor::new()
7443/// # )
7444/// # .build(
7445/// #     hyper_rustls::HttpsConnectorBuilder::new()
7446/// #         .with_native_roots()
7447/// #         .unwrap()
7448/// #         .https_or_http()
7449/// #         .enable_http2()
7450/// #         .build()
7451/// # );
7452/// # let mut hub = ChromeManagement::new(client, auth);
7453/// // You can configure optional parameters by calling the respective setters at will, and
7454/// // execute the final call using `doit()`.
7455/// // Values shown here are possibly random and not representative !
7456/// let result = hub.customers().certificate_provisioning_processes_get("name")
7457///              .doit().await;
7458/// # }
7459/// ```
7460pub struct CustomerCertificateProvisioningProcessGetCall<'a, C>
7461where
7462    C: 'a,
7463{
7464    hub: &'a ChromeManagement<C>,
7465    _name: String,
7466    _delegate: Option<&'a mut dyn common::Delegate>,
7467    _additional_params: HashMap<String, String>,
7468}
7469
7470impl<'a, C> common::CallBuilder for CustomerCertificateProvisioningProcessGetCall<'a, C> {}
7471
7472impl<'a, C> CustomerCertificateProvisioningProcessGetCall<'a, C>
7473where
7474    C: common::Connector,
7475{
7476    /// Perform the operation you have build so far.
7477    pub async fn doit(
7478        mut self,
7479    ) -> common::Result<(
7480        common::Response,
7481        GoogleChromeManagementVersionsV1CertificateProvisioningProcess,
7482    )> {
7483        use std::borrow::Cow;
7484        use std::io::{Read, Seek};
7485
7486        use common::{url::Params, ToParts};
7487        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7488
7489        let mut dd = common::DefaultDelegate;
7490        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7491        dlg.begin(common::MethodInfo {
7492            id: "chromemanagement.customers.certificateProvisioningProcesses.get",
7493            http_method: hyper::Method::GET,
7494        });
7495
7496        for &field in ["alt", "name"].iter() {
7497            if self._additional_params.contains_key(field) {
7498                dlg.finished(false);
7499                return Err(common::Error::FieldClash(field));
7500            }
7501        }
7502
7503        let mut params = Params::with_capacity(3 + self._additional_params.len());
7504        params.push("name", self._name);
7505
7506        params.extend(self._additional_params.iter());
7507
7508        params.push("alt", "json");
7509        let mut url = self.hub._base_url.clone() + "v1/{+name}";
7510
7511        match dlg.api_key() {
7512            Some(value) => params.push("key", value),
7513            None => {
7514                dlg.finished(false);
7515                return Err(common::Error::MissingAPIKey);
7516            }
7517        }
7518
7519        #[allow(clippy::single_element_loop)]
7520        for &(find_this, param_name) in [("{+name}", "name")].iter() {
7521            url = params.uri_replacement(url, param_name, find_this, true);
7522        }
7523        {
7524            let to_remove = ["name"];
7525            params.remove_params(&to_remove);
7526        }
7527
7528        let url = params.parse_with_url(&url);
7529
7530        loop {
7531            let mut req_result = {
7532                let client = &self.hub.client;
7533                dlg.pre_request();
7534                let mut req_builder = hyper::Request::builder()
7535                    .method(hyper::Method::GET)
7536                    .uri(url.as_str())
7537                    .header(USER_AGENT, self.hub._user_agent.clone());
7538
7539                let request = req_builder
7540                    .header(CONTENT_LENGTH, 0_u64)
7541                    .body(common::to_body::<String>(None));
7542
7543                client.request(request.unwrap()).await
7544            };
7545
7546            match req_result {
7547                Err(err) => {
7548                    if let common::Retry::After(d) = dlg.http_error(&err) {
7549                        sleep(d).await;
7550                        continue;
7551                    }
7552                    dlg.finished(false);
7553                    return Err(common::Error::HttpError(err));
7554                }
7555                Ok(res) => {
7556                    let (mut parts, body) = res.into_parts();
7557                    let mut body = common::Body::new(body);
7558                    if !parts.status.is_success() {
7559                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7560                        let error = serde_json::from_str(&common::to_string(&bytes));
7561                        let response = common::to_response(parts, bytes.into());
7562
7563                        if let common::Retry::After(d) =
7564                            dlg.http_failure(&response, error.as_ref().ok())
7565                        {
7566                            sleep(d).await;
7567                            continue;
7568                        }
7569
7570                        dlg.finished(false);
7571
7572                        return Err(match error {
7573                            Ok(value) => common::Error::BadRequest(value),
7574                            _ => common::Error::Failure(response),
7575                        });
7576                    }
7577                    let response = {
7578                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7579                        let encoded = common::to_string(&bytes);
7580                        match serde_json::from_str(&encoded) {
7581                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7582                            Err(error) => {
7583                                dlg.response_json_decode_error(&encoded, &error);
7584                                return Err(common::Error::JsonDecodeError(
7585                                    encoded.to_string(),
7586                                    error,
7587                                ));
7588                            }
7589                        }
7590                    };
7591
7592                    dlg.finished(true);
7593                    return Ok(response);
7594                }
7595            }
7596        }
7597    }
7598
7599    /// Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
7600    ///
7601    /// Sets the *name* path property to the given value.
7602    ///
7603    /// Even though the property as already been set when instantiating this call,
7604    /// we provide this method for API completeness.
7605    pub fn name(mut self, new_value: &str) -> CustomerCertificateProvisioningProcessGetCall<'a, C> {
7606        self._name = new_value.to_string();
7607        self
7608    }
7609    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7610    /// while executing the actual API request.
7611    ///
7612    /// ````text
7613    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7614    /// ````
7615    ///
7616    /// Sets the *delegate* property to the given value.
7617    pub fn delegate(
7618        mut self,
7619        new_value: &'a mut dyn common::Delegate,
7620    ) -> CustomerCertificateProvisioningProcessGetCall<'a, C> {
7621        self._delegate = Some(new_value);
7622        self
7623    }
7624
7625    /// Set any additional parameter of the query string used in the request.
7626    /// It should be used to set parameters which are not yet available through their own
7627    /// setters.
7628    ///
7629    /// Please note that this method must not be used to set any of the known parameters
7630    /// which have their own setter method. If done anyway, the request will fail.
7631    ///
7632    /// # Additional Parameters
7633    ///
7634    /// * *$.xgafv* (query-string) - V1 error format.
7635    /// * *access_token* (query-string) - OAuth access token.
7636    /// * *alt* (query-string) - Data format for response.
7637    /// * *callback* (query-string) - JSONP
7638    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7639    /// * *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.
7640    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7641    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7642    /// * *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.
7643    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7644    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7645    pub fn param<T>(
7646        mut self,
7647        name: T,
7648        value: T,
7649    ) -> CustomerCertificateProvisioningProcessGetCall<'a, C>
7650    where
7651        T: AsRef<str>,
7652    {
7653        self._additional_params
7654            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7655        self
7656    }
7657}
7658
7659/// Marks a certificate provisioning process as failed.
7660///
7661/// A builder for the *certificateProvisioningProcesses.setFailure* method supported by a *customer* resource.
7662/// It is not used directly, but through a [`CustomerMethods`] instance.
7663///
7664/// # Example
7665///
7666/// Instantiate a resource method builder
7667///
7668/// ```test_harness,no_run
7669/// # extern crate hyper;
7670/// # extern crate hyper_rustls;
7671/// # extern crate google_chromemanagement1 as chromemanagement1;
7672/// use chromemanagement1::api::GoogleChromeManagementVersionsV1SetFailureRequest;
7673/// # async fn dox() {
7674/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7675///
7676/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7677/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7678/// #     .with_native_roots()
7679/// #     .unwrap()
7680/// #     .https_only()
7681/// #     .enable_http2()
7682/// #     .build();
7683///
7684/// # let executor = hyper_util::rt::TokioExecutor::new();
7685/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7686/// #     secret,
7687/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7688/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
7689/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
7690/// #     ),
7691/// # ).build().await.unwrap();
7692///
7693/// # let client = hyper_util::client::legacy::Client::builder(
7694/// #     hyper_util::rt::TokioExecutor::new()
7695/// # )
7696/// # .build(
7697/// #     hyper_rustls::HttpsConnectorBuilder::new()
7698/// #         .with_native_roots()
7699/// #         .unwrap()
7700/// #         .https_or_http()
7701/// #         .enable_http2()
7702/// #         .build()
7703/// # );
7704/// # let mut hub = ChromeManagement::new(client, auth);
7705/// // As the method needs a request, you would usually fill it with the desired information
7706/// // into the respective structure. Some of the parts shown here might not be applicable !
7707/// // Values shown here are possibly random and not representative !
7708/// let mut req = GoogleChromeManagementVersionsV1SetFailureRequest::default();
7709///
7710/// // You can configure optional parameters by calling the respective setters at will, and
7711/// // execute the final call using `doit()`.
7712/// // Values shown here are possibly random and not representative !
7713/// let result = hub.customers().certificate_provisioning_processes_set_failure(req, "name")
7714///              .doit().await;
7715/// # }
7716/// ```
7717pub struct CustomerCertificateProvisioningProcessSetFailureCall<'a, C>
7718where
7719    C: 'a,
7720{
7721    hub: &'a ChromeManagement<C>,
7722    _request: GoogleChromeManagementVersionsV1SetFailureRequest,
7723    _name: String,
7724    _delegate: Option<&'a mut dyn common::Delegate>,
7725    _additional_params: HashMap<String, String>,
7726}
7727
7728impl<'a, C> common::CallBuilder for CustomerCertificateProvisioningProcessSetFailureCall<'a, C> {}
7729
7730impl<'a, C> CustomerCertificateProvisioningProcessSetFailureCall<'a, C>
7731where
7732    C: common::Connector,
7733{
7734    /// Perform the operation you have build so far.
7735    pub async fn doit(
7736        mut self,
7737    ) -> common::Result<(
7738        common::Response,
7739        GoogleChromeManagementVersionsV1SetFailureResponse,
7740    )> {
7741        use std::borrow::Cow;
7742        use std::io::{Read, Seek};
7743
7744        use common::{url::Params, ToParts};
7745        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
7746
7747        let mut dd = common::DefaultDelegate;
7748        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
7749        dlg.begin(common::MethodInfo {
7750            id: "chromemanagement.customers.certificateProvisioningProcesses.setFailure",
7751            http_method: hyper::Method::POST,
7752        });
7753
7754        for &field in ["alt", "name"].iter() {
7755            if self._additional_params.contains_key(field) {
7756                dlg.finished(false);
7757                return Err(common::Error::FieldClash(field));
7758            }
7759        }
7760
7761        let mut params = Params::with_capacity(4 + self._additional_params.len());
7762        params.push("name", self._name);
7763
7764        params.extend(self._additional_params.iter());
7765
7766        params.push("alt", "json");
7767        let mut url = self.hub._base_url.clone() + "v1/{+name}:setFailure";
7768
7769        match dlg.api_key() {
7770            Some(value) => params.push("key", value),
7771            None => {
7772                dlg.finished(false);
7773                return Err(common::Error::MissingAPIKey);
7774            }
7775        }
7776
7777        #[allow(clippy::single_element_loop)]
7778        for &(find_this, param_name) in [("{+name}", "name")].iter() {
7779            url = params.uri_replacement(url, param_name, find_this, true);
7780        }
7781        {
7782            let to_remove = ["name"];
7783            params.remove_params(&to_remove);
7784        }
7785
7786        let url = params.parse_with_url(&url);
7787
7788        let mut json_mime_type = mime::APPLICATION_JSON;
7789        let mut request_value_reader = {
7790            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
7791            common::remove_json_null_values(&mut value);
7792            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
7793            serde_json::to_writer(&mut dst, &value).unwrap();
7794            dst
7795        };
7796        let request_size = request_value_reader
7797            .seek(std::io::SeekFrom::End(0))
7798            .unwrap();
7799        request_value_reader
7800            .seek(std::io::SeekFrom::Start(0))
7801            .unwrap();
7802
7803        loop {
7804            request_value_reader
7805                .seek(std::io::SeekFrom::Start(0))
7806                .unwrap();
7807            let mut req_result = {
7808                let client = &self.hub.client;
7809                dlg.pre_request();
7810                let mut req_builder = hyper::Request::builder()
7811                    .method(hyper::Method::POST)
7812                    .uri(url.as_str())
7813                    .header(USER_AGENT, self.hub._user_agent.clone());
7814
7815                let request = req_builder
7816                    .header(CONTENT_TYPE, json_mime_type.to_string())
7817                    .header(CONTENT_LENGTH, request_size as u64)
7818                    .body(common::to_body(
7819                        request_value_reader.get_ref().clone().into(),
7820                    ));
7821
7822                client.request(request.unwrap()).await
7823            };
7824
7825            match req_result {
7826                Err(err) => {
7827                    if let common::Retry::After(d) = dlg.http_error(&err) {
7828                        sleep(d).await;
7829                        continue;
7830                    }
7831                    dlg.finished(false);
7832                    return Err(common::Error::HttpError(err));
7833                }
7834                Ok(res) => {
7835                    let (mut parts, body) = res.into_parts();
7836                    let mut body = common::Body::new(body);
7837                    if !parts.status.is_success() {
7838                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7839                        let error = serde_json::from_str(&common::to_string(&bytes));
7840                        let response = common::to_response(parts, bytes.into());
7841
7842                        if let common::Retry::After(d) =
7843                            dlg.http_failure(&response, error.as_ref().ok())
7844                        {
7845                            sleep(d).await;
7846                            continue;
7847                        }
7848
7849                        dlg.finished(false);
7850
7851                        return Err(match error {
7852                            Ok(value) => common::Error::BadRequest(value),
7853                            _ => common::Error::Failure(response),
7854                        });
7855                    }
7856                    let response = {
7857                        let bytes = common::to_bytes(body).await.unwrap_or_default();
7858                        let encoded = common::to_string(&bytes);
7859                        match serde_json::from_str(&encoded) {
7860                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
7861                            Err(error) => {
7862                                dlg.response_json_decode_error(&encoded, &error);
7863                                return Err(common::Error::JsonDecodeError(
7864                                    encoded.to_string(),
7865                                    error,
7866                                ));
7867                            }
7868                        }
7869                    };
7870
7871                    dlg.finished(true);
7872                    return Ok(response);
7873                }
7874            }
7875        }
7876    }
7877
7878    ///
7879    /// Sets the *request* property to the given value.
7880    ///
7881    /// Even though the property as already been set when instantiating this call,
7882    /// we provide this method for API completeness.
7883    pub fn request(
7884        mut self,
7885        new_value: GoogleChromeManagementVersionsV1SetFailureRequest,
7886    ) -> CustomerCertificateProvisioningProcessSetFailureCall<'a, C> {
7887        self._request = new_value;
7888        self
7889    }
7890    /// Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
7891    ///
7892    /// Sets the *name* path property to the given value.
7893    ///
7894    /// Even though the property as already been set when instantiating this call,
7895    /// we provide this method for API completeness.
7896    pub fn name(
7897        mut self,
7898        new_value: &str,
7899    ) -> CustomerCertificateProvisioningProcessSetFailureCall<'a, C> {
7900        self._name = new_value.to_string();
7901        self
7902    }
7903    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
7904    /// while executing the actual API request.
7905    ///
7906    /// ````text
7907    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
7908    /// ````
7909    ///
7910    /// Sets the *delegate* property to the given value.
7911    pub fn delegate(
7912        mut self,
7913        new_value: &'a mut dyn common::Delegate,
7914    ) -> CustomerCertificateProvisioningProcessSetFailureCall<'a, C> {
7915        self._delegate = Some(new_value);
7916        self
7917    }
7918
7919    /// Set any additional parameter of the query string used in the request.
7920    /// It should be used to set parameters which are not yet available through their own
7921    /// setters.
7922    ///
7923    /// Please note that this method must not be used to set any of the known parameters
7924    /// which have their own setter method. If done anyway, the request will fail.
7925    ///
7926    /// # Additional Parameters
7927    ///
7928    /// * *$.xgafv* (query-string) - V1 error format.
7929    /// * *access_token* (query-string) - OAuth access token.
7930    /// * *alt* (query-string) - Data format for response.
7931    /// * *callback* (query-string) - JSONP
7932    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
7933    /// * *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.
7934    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
7935    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
7936    /// * *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.
7937    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
7938    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
7939    pub fn param<T>(
7940        mut self,
7941        name: T,
7942        value: T,
7943    ) -> CustomerCertificateProvisioningProcessSetFailureCall<'a, C>
7944    where
7945        T: AsRef<str>,
7946    {
7947        self._additional_params
7948            .insert(name.as_ref().to_string(), value.as_ref().to_string());
7949        self
7950    }
7951}
7952
7953/// Requests the client that initiated a certificate provisioning process to sign data. This should only be called after `ClaimCertificateProvisioningProcess` has been successfully executed.
7954///
7955/// A builder for the *certificateProvisioningProcesses.signData* method supported by a *customer* resource.
7956/// It is not used directly, but through a [`CustomerMethods`] instance.
7957///
7958/// # Example
7959///
7960/// Instantiate a resource method builder
7961///
7962/// ```test_harness,no_run
7963/// # extern crate hyper;
7964/// # extern crate hyper_rustls;
7965/// # extern crate google_chromemanagement1 as chromemanagement1;
7966/// use chromemanagement1::api::GoogleChromeManagementVersionsV1SignDataRequest;
7967/// # async fn dox() {
7968/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
7969///
7970/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
7971/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
7972/// #     .with_native_roots()
7973/// #     .unwrap()
7974/// #     .https_only()
7975/// #     .enable_http2()
7976/// #     .build();
7977///
7978/// # let executor = hyper_util::rt::TokioExecutor::new();
7979/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
7980/// #     secret,
7981/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
7982/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
7983/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
7984/// #     ),
7985/// # ).build().await.unwrap();
7986///
7987/// # let client = hyper_util::client::legacy::Client::builder(
7988/// #     hyper_util::rt::TokioExecutor::new()
7989/// # )
7990/// # .build(
7991/// #     hyper_rustls::HttpsConnectorBuilder::new()
7992/// #         .with_native_roots()
7993/// #         .unwrap()
7994/// #         .https_or_http()
7995/// #         .enable_http2()
7996/// #         .build()
7997/// # );
7998/// # let mut hub = ChromeManagement::new(client, auth);
7999/// // As the method needs a request, you would usually fill it with the desired information
8000/// // into the respective structure. Some of the parts shown here might not be applicable !
8001/// // Values shown here are possibly random and not representative !
8002/// let mut req = GoogleChromeManagementVersionsV1SignDataRequest::default();
8003///
8004/// // You can configure optional parameters by calling the respective setters at will, and
8005/// // execute the final call using `doit()`.
8006/// // Values shown here are possibly random and not representative !
8007/// let result = hub.customers().certificate_provisioning_processes_sign_data(req, "name")
8008///              .doit().await;
8009/// # }
8010/// ```
8011pub struct CustomerCertificateProvisioningProcessSignDataCall<'a, C>
8012where
8013    C: 'a,
8014{
8015    hub: &'a ChromeManagement<C>,
8016    _request: GoogleChromeManagementVersionsV1SignDataRequest,
8017    _name: String,
8018    _delegate: Option<&'a mut dyn common::Delegate>,
8019    _additional_params: HashMap<String, String>,
8020}
8021
8022impl<'a, C> common::CallBuilder for CustomerCertificateProvisioningProcessSignDataCall<'a, C> {}
8023
8024impl<'a, C> CustomerCertificateProvisioningProcessSignDataCall<'a, C>
8025where
8026    C: common::Connector,
8027{
8028    /// Perform the operation you have build so far.
8029    pub async fn doit(mut self) -> common::Result<(common::Response, GoogleLongrunningOperation)> {
8030        use std::borrow::Cow;
8031        use std::io::{Read, Seek};
8032
8033        use common::{url::Params, ToParts};
8034        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8035
8036        let mut dd = common::DefaultDelegate;
8037        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8038        dlg.begin(common::MethodInfo {
8039            id: "chromemanagement.customers.certificateProvisioningProcesses.signData",
8040            http_method: hyper::Method::POST,
8041        });
8042
8043        for &field in ["alt", "name"].iter() {
8044            if self._additional_params.contains_key(field) {
8045                dlg.finished(false);
8046                return Err(common::Error::FieldClash(field));
8047            }
8048        }
8049
8050        let mut params = Params::with_capacity(4 + self._additional_params.len());
8051        params.push("name", self._name);
8052
8053        params.extend(self._additional_params.iter());
8054
8055        params.push("alt", "json");
8056        let mut url = self.hub._base_url.clone() + "v1/{+name}:signData";
8057
8058        match dlg.api_key() {
8059            Some(value) => params.push("key", value),
8060            None => {
8061                dlg.finished(false);
8062                return Err(common::Error::MissingAPIKey);
8063            }
8064        }
8065
8066        #[allow(clippy::single_element_loop)]
8067        for &(find_this, param_name) in [("{+name}", "name")].iter() {
8068            url = params.uri_replacement(url, param_name, find_this, true);
8069        }
8070        {
8071            let to_remove = ["name"];
8072            params.remove_params(&to_remove);
8073        }
8074
8075        let url = params.parse_with_url(&url);
8076
8077        let mut json_mime_type = mime::APPLICATION_JSON;
8078        let mut request_value_reader = {
8079            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8080            common::remove_json_null_values(&mut value);
8081            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8082            serde_json::to_writer(&mut dst, &value).unwrap();
8083            dst
8084        };
8085        let request_size = request_value_reader
8086            .seek(std::io::SeekFrom::End(0))
8087            .unwrap();
8088        request_value_reader
8089            .seek(std::io::SeekFrom::Start(0))
8090            .unwrap();
8091
8092        loop {
8093            request_value_reader
8094                .seek(std::io::SeekFrom::Start(0))
8095                .unwrap();
8096            let mut req_result = {
8097                let client = &self.hub.client;
8098                dlg.pre_request();
8099                let mut req_builder = hyper::Request::builder()
8100                    .method(hyper::Method::POST)
8101                    .uri(url.as_str())
8102                    .header(USER_AGENT, self.hub._user_agent.clone());
8103
8104                let request = req_builder
8105                    .header(CONTENT_TYPE, json_mime_type.to_string())
8106                    .header(CONTENT_LENGTH, request_size as u64)
8107                    .body(common::to_body(
8108                        request_value_reader.get_ref().clone().into(),
8109                    ));
8110
8111                client.request(request.unwrap()).await
8112            };
8113
8114            match req_result {
8115                Err(err) => {
8116                    if let common::Retry::After(d) = dlg.http_error(&err) {
8117                        sleep(d).await;
8118                        continue;
8119                    }
8120                    dlg.finished(false);
8121                    return Err(common::Error::HttpError(err));
8122                }
8123                Ok(res) => {
8124                    let (mut parts, body) = res.into_parts();
8125                    let mut body = common::Body::new(body);
8126                    if !parts.status.is_success() {
8127                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8128                        let error = serde_json::from_str(&common::to_string(&bytes));
8129                        let response = common::to_response(parts, bytes.into());
8130
8131                        if let common::Retry::After(d) =
8132                            dlg.http_failure(&response, error.as_ref().ok())
8133                        {
8134                            sleep(d).await;
8135                            continue;
8136                        }
8137
8138                        dlg.finished(false);
8139
8140                        return Err(match error {
8141                            Ok(value) => common::Error::BadRequest(value),
8142                            _ => common::Error::Failure(response),
8143                        });
8144                    }
8145                    let response = {
8146                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8147                        let encoded = common::to_string(&bytes);
8148                        match serde_json::from_str(&encoded) {
8149                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8150                            Err(error) => {
8151                                dlg.response_json_decode_error(&encoded, &error);
8152                                return Err(common::Error::JsonDecodeError(
8153                                    encoded.to_string(),
8154                                    error,
8155                                ));
8156                            }
8157                        }
8158                    };
8159
8160                    dlg.finished(true);
8161                    return Ok(response);
8162                }
8163            }
8164        }
8165    }
8166
8167    ///
8168    /// Sets the *request* property to the given value.
8169    ///
8170    /// Even though the property as already been set when instantiating this call,
8171    /// we provide this method for API completeness.
8172    pub fn request(
8173        mut self,
8174        new_value: GoogleChromeManagementVersionsV1SignDataRequest,
8175    ) -> CustomerCertificateProvisioningProcessSignDataCall<'a, C> {
8176        self._request = new_value;
8177        self
8178    }
8179    /// Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
8180    ///
8181    /// Sets the *name* path property to the given value.
8182    ///
8183    /// Even though the property as already been set when instantiating this call,
8184    /// we provide this method for API completeness.
8185    pub fn name(
8186        mut self,
8187        new_value: &str,
8188    ) -> CustomerCertificateProvisioningProcessSignDataCall<'a, C> {
8189        self._name = new_value.to_string();
8190        self
8191    }
8192    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8193    /// while executing the actual API request.
8194    ///
8195    /// ````text
8196    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
8197    /// ````
8198    ///
8199    /// Sets the *delegate* property to the given value.
8200    pub fn delegate(
8201        mut self,
8202        new_value: &'a mut dyn common::Delegate,
8203    ) -> CustomerCertificateProvisioningProcessSignDataCall<'a, C> {
8204        self._delegate = Some(new_value);
8205        self
8206    }
8207
8208    /// Set any additional parameter of the query string used in the request.
8209    /// It should be used to set parameters which are not yet available through their own
8210    /// setters.
8211    ///
8212    /// Please note that this method must not be used to set any of the known parameters
8213    /// which have their own setter method. If done anyway, the request will fail.
8214    ///
8215    /// # Additional Parameters
8216    ///
8217    /// * *$.xgafv* (query-string) - V1 error format.
8218    /// * *access_token* (query-string) - OAuth access token.
8219    /// * *alt* (query-string) - Data format for response.
8220    /// * *callback* (query-string) - JSONP
8221    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8222    /// * *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.
8223    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8224    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8225    /// * *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.
8226    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8227    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8228    pub fn param<T>(
8229        mut self,
8230        name: T,
8231        value: T,
8232    ) -> CustomerCertificateProvisioningProcessSignDataCall<'a, C>
8233    where
8234        T: AsRef<str>,
8235    {
8236        self._additional_params
8237            .insert(name.as_ref().to_string(), value.as_ref().to_string());
8238        self
8239    }
8240}
8241
8242/// Uploads a successfully issued certificate for a certificate provisioning process.
8243///
8244/// A builder for the *certificateProvisioningProcesses.uploadCertificate* method supported by a *customer* resource.
8245/// It is not used directly, but through a [`CustomerMethods`] instance.
8246///
8247/// # Example
8248///
8249/// Instantiate a resource method builder
8250///
8251/// ```test_harness,no_run
8252/// # extern crate hyper;
8253/// # extern crate hyper_rustls;
8254/// # extern crate google_chromemanagement1 as chromemanagement1;
8255/// use chromemanagement1::api::GoogleChromeManagementVersionsV1UploadCertificateRequest;
8256/// # async fn dox() {
8257/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8258///
8259/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8260/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
8261/// #     .with_native_roots()
8262/// #     .unwrap()
8263/// #     .https_only()
8264/// #     .enable_http2()
8265/// #     .build();
8266///
8267/// # let executor = hyper_util::rt::TokioExecutor::new();
8268/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
8269/// #     secret,
8270/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8271/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
8272/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
8273/// #     ),
8274/// # ).build().await.unwrap();
8275///
8276/// # let client = hyper_util::client::legacy::Client::builder(
8277/// #     hyper_util::rt::TokioExecutor::new()
8278/// # )
8279/// # .build(
8280/// #     hyper_rustls::HttpsConnectorBuilder::new()
8281/// #         .with_native_roots()
8282/// #         .unwrap()
8283/// #         .https_or_http()
8284/// #         .enable_http2()
8285/// #         .build()
8286/// # );
8287/// # let mut hub = ChromeManagement::new(client, auth);
8288/// // As the method needs a request, you would usually fill it with the desired information
8289/// // into the respective structure. Some of the parts shown here might not be applicable !
8290/// // Values shown here are possibly random and not representative !
8291/// let mut req = GoogleChromeManagementVersionsV1UploadCertificateRequest::default();
8292///
8293/// // You can configure optional parameters by calling the respective setters at will, and
8294/// // execute the final call using `doit()`.
8295/// // Values shown here are possibly random and not representative !
8296/// let result = hub.customers().certificate_provisioning_processes_upload_certificate(req, "name")
8297///              .doit().await;
8298/// # }
8299/// ```
8300pub struct CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C>
8301where
8302    C: 'a,
8303{
8304    hub: &'a ChromeManagement<C>,
8305    _request: GoogleChromeManagementVersionsV1UploadCertificateRequest,
8306    _name: String,
8307    _delegate: Option<&'a mut dyn common::Delegate>,
8308    _additional_params: HashMap<String, String>,
8309}
8310
8311impl<'a, C> common::CallBuilder
8312    for CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C>
8313{
8314}
8315
8316impl<'a, C> CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C>
8317where
8318    C: common::Connector,
8319{
8320    /// Perform the operation you have build so far.
8321    pub async fn doit(
8322        mut self,
8323    ) -> common::Result<(
8324        common::Response,
8325        GoogleChromeManagementVersionsV1UploadCertificateResponse,
8326    )> {
8327        use std::borrow::Cow;
8328        use std::io::{Read, Seek};
8329
8330        use common::{url::Params, ToParts};
8331        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8332
8333        let mut dd = common::DefaultDelegate;
8334        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8335        dlg.begin(common::MethodInfo {
8336            id: "chromemanagement.customers.certificateProvisioningProcesses.uploadCertificate",
8337            http_method: hyper::Method::POST,
8338        });
8339
8340        for &field in ["alt", "name"].iter() {
8341            if self._additional_params.contains_key(field) {
8342                dlg.finished(false);
8343                return Err(common::Error::FieldClash(field));
8344            }
8345        }
8346
8347        let mut params = Params::with_capacity(4 + self._additional_params.len());
8348        params.push("name", self._name);
8349
8350        params.extend(self._additional_params.iter());
8351
8352        params.push("alt", "json");
8353        let mut url = self.hub._base_url.clone() + "v1/{+name}:uploadCertificate";
8354
8355        match dlg.api_key() {
8356            Some(value) => params.push("key", value),
8357            None => {
8358                dlg.finished(false);
8359                return Err(common::Error::MissingAPIKey);
8360            }
8361        }
8362
8363        #[allow(clippy::single_element_loop)]
8364        for &(find_this, param_name) in [("{+name}", "name")].iter() {
8365            url = params.uri_replacement(url, param_name, find_this, true);
8366        }
8367        {
8368            let to_remove = ["name"];
8369            params.remove_params(&to_remove);
8370        }
8371
8372        let url = params.parse_with_url(&url);
8373
8374        let mut json_mime_type = mime::APPLICATION_JSON;
8375        let mut request_value_reader = {
8376            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8377            common::remove_json_null_values(&mut value);
8378            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8379            serde_json::to_writer(&mut dst, &value).unwrap();
8380            dst
8381        };
8382        let request_size = request_value_reader
8383            .seek(std::io::SeekFrom::End(0))
8384            .unwrap();
8385        request_value_reader
8386            .seek(std::io::SeekFrom::Start(0))
8387            .unwrap();
8388
8389        loop {
8390            request_value_reader
8391                .seek(std::io::SeekFrom::Start(0))
8392                .unwrap();
8393            let mut req_result = {
8394                let client = &self.hub.client;
8395                dlg.pre_request();
8396                let mut req_builder = hyper::Request::builder()
8397                    .method(hyper::Method::POST)
8398                    .uri(url.as_str())
8399                    .header(USER_AGENT, self.hub._user_agent.clone());
8400
8401                let request = req_builder
8402                    .header(CONTENT_TYPE, json_mime_type.to_string())
8403                    .header(CONTENT_LENGTH, request_size as u64)
8404                    .body(common::to_body(
8405                        request_value_reader.get_ref().clone().into(),
8406                    ));
8407
8408                client.request(request.unwrap()).await
8409            };
8410
8411            match req_result {
8412                Err(err) => {
8413                    if let common::Retry::After(d) = dlg.http_error(&err) {
8414                        sleep(d).await;
8415                        continue;
8416                    }
8417                    dlg.finished(false);
8418                    return Err(common::Error::HttpError(err));
8419                }
8420                Ok(res) => {
8421                    let (mut parts, body) = res.into_parts();
8422                    let mut body = common::Body::new(body);
8423                    if !parts.status.is_success() {
8424                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8425                        let error = serde_json::from_str(&common::to_string(&bytes));
8426                        let response = common::to_response(parts, bytes.into());
8427
8428                        if let common::Retry::After(d) =
8429                            dlg.http_failure(&response, error.as_ref().ok())
8430                        {
8431                            sleep(d).await;
8432                            continue;
8433                        }
8434
8435                        dlg.finished(false);
8436
8437                        return Err(match error {
8438                            Ok(value) => common::Error::BadRequest(value),
8439                            _ => common::Error::Failure(response),
8440                        });
8441                    }
8442                    let response = {
8443                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8444                        let encoded = common::to_string(&bytes);
8445                        match serde_json::from_str(&encoded) {
8446                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8447                            Err(error) => {
8448                                dlg.response_json_decode_error(&encoded, &error);
8449                                return Err(common::Error::JsonDecodeError(
8450                                    encoded.to_string(),
8451                                    error,
8452                                ));
8453                            }
8454                        }
8455                    };
8456
8457                    dlg.finished(true);
8458                    return Ok(response);
8459                }
8460            }
8461        }
8462    }
8463
8464    ///
8465    /// Sets the *request* property to the given value.
8466    ///
8467    /// Even though the property as already been set when instantiating this call,
8468    /// we provide this method for API completeness.
8469    pub fn request(
8470        mut self,
8471        new_value: GoogleChromeManagementVersionsV1UploadCertificateRequest,
8472    ) -> CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C> {
8473        self._request = new_value;
8474        self
8475    }
8476    /// Required. Resource name of the `CertificateProvisioningProcess` to return. The name pattern is given as `customers/{customer}/certificateProvisioningProcesses/{certificate_provisioning_process}` with `{customer}` being the obfuscated customer id and `{certificate_provisioning_process}` being the certificate provisioning process id.
8477    ///
8478    /// Sets the *name* path property to the given value.
8479    ///
8480    /// Even though the property as already been set when instantiating this call,
8481    /// we provide this method for API completeness.
8482    pub fn name(
8483        mut self,
8484        new_value: &str,
8485    ) -> CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C> {
8486        self._name = new_value.to_string();
8487        self
8488    }
8489    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8490    /// while executing the actual API request.
8491    ///
8492    /// ````text
8493    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
8494    /// ````
8495    ///
8496    /// Sets the *delegate* property to the given value.
8497    pub fn delegate(
8498        mut self,
8499        new_value: &'a mut dyn common::Delegate,
8500    ) -> CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C> {
8501        self._delegate = Some(new_value);
8502        self
8503    }
8504
8505    /// Set any additional parameter of the query string used in the request.
8506    /// It should be used to set parameters which are not yet available through their own
8507    /// setters.
8508    ///
8509    /// Please note that this method must not be used to set any of the known parameters
8510    /// which have their own setter method. If done anyway, the request will fail.
8511    ///
8512    /// # Additional Parameters
8513    ///
8514    /// * *$.xgafv* (query-string) - V1 error format.
8515    /// * *access_token* (query-string) - OAuth access token.
8516    /// * *alt* (query-string) - Data format for response.
8517    /// * *callback* (query-string) - JSONP
8518    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8519    /// * *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.
8520    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8521    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8522    /// * *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.
8523    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8524    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8525    pub fn param<T>(
8526        mut self,
8527        name: T,
8528        value: T,
8529    ) -> CustomerCertificateProvisioningProcessUploadCertificateCall<'a, C>
8530    where
8531        T: AsRef<str>,
8532    {
8533        self._additional_params
8534            .insert(name.as_ref().to_string(), value.as_ref().to_string());
8535        self
8536    }
8537}
8538
8539/// Creates a Chrome browser profile remote command.
8540///
8541/// A builder for the *profiles.commands.create* method supported by a *customer* resource.
8542/// It is not used directly, but through a [`CustomerMethods`] instance.
8543///
8544/// # Example
8545///
8546/// Instantiate a resource method builder
8547///
8548/// ```test_harness,no_run
8549/// # extern crate hyper;
8550/// # extern crate hyper_rustls;
8551/// # extern crate google_chromemanagement1 as chromemanagement1;
8552/// use chromemanagement1::api::GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand;
8553/// # async fn dox() {
8554/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8555///
8556/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8557/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
8558/// #     .with_native_roots()
8559/// #     .unwrap()
8560/// #     .https_only()
8561/// #     .enable_http2()
8562/// #     .build();
8563///
8564/// # let executor = hyper_util::rt::TokioExecutor::new();
8565/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
8566/// #     secret,
8567/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8568/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
8569/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
8570/// #     ),
8571/// # ).build().await.unwrap();
8572///
8573/// # let client = hyper_util::client::legacy::Client::builder(
8574/// #     hyper_util::rt::TokioExecutor::new()
8575/// # )
8576/// # .build(
8577/// #     hyper_rustls::HttpsConnectorBuilder::new()
8578/// #         .with_native_roots()
8579/// #         .unwrap()
8580/// #         .https_or_http()
8581/// #         .enable_http2()
8582/// #         .build()
8583/// # );
8584/// # let mut hub = ChromeManagement::new(client, auth);
8585/// // As the method needs a request, you would usually fill it with the desired information
8586/// // into the respective structure. Some of the parts shown here might not be applicable !
8587/// // Values shown here are possibly random and not representative !
8588/// let mut req = GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand::default();
8589///
8590/// // You can configure optional parameters by calling the respective setters at will, and
8591/// // execute the final call using `doit()`.
8592/// // Values shown here are possibly random and not representative !
8593/// let result = hub.customers().profiles_commands_create(req, "parent")
8594///              .doit().await;
8595/// # }
8596/// ```
8597pub struct CustomerProfileCommandCreateCall<'a, C>
8598where
8599    C: 'a,
8600{
8601    hub: &'a ChromeManagement<C>,
8602    _request: GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand,
8603    _parent: String,
8604    _delegate: Option<&'a mut dyn common::Delegate>,
8605    _additional_params: HashMap<String, String>,
8606    _scopes: BTreeSet<String>,
8607}
8608
8609impl<'a, C> common::CallBuilder for CustomerProfileCommandCreateCall<'a, C> {}
8610
8611impl<'a, C> CustomerProfileCommandCreateCall<'a, C>
8612where
8613    C: common::Connector,
8614{
8615    /// Perform the operation you have build so far.
8616    pub async fn doit(
8617        mut self,
8618    ) -> common::Result<(
8619        common::Response,
8620        GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand,
8621    )> {
8622        use std::borrow::Cow;
8623        use std::io::{Read, Seek};
8624
8625        use common::{url::Params, ToParts};
8626        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8627
8628        let mut dd = common::DefaultDelegate;
8629        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8630        dlg.begin(common::MethodInfo {
8631            id: "chromemanagement.customers.profiles.commands.create",
8632            http_method: hyper::Method::POST,
8633        });
8634
8635        for &field in ["alt", "parent"].iter() {
8636            if self._additional_params.contains_key(field) {
8637                dlg.finished(false);
8638                return Err(common::Error::FieldClash(field));
8639            }
8640        }
8641
8642        let mut params = Params::with_capacity(4 + self._additional_params.len());
8643        params.push("parent", self._parent);
8644
8645        params.extend(self._additional_params.iter());
8646
8647        params.push("alt", "json");
8648        let mut url = self.hub._base_url.clone() + "v1/{+parent}/commands";
8649        if self._scopes.is_empty() {
8650            self._scopes
8651                .insert(Scope::ChromeManagementProfile.as_ref().to_string());
8652        }
8653
8654        #[allow(clippy::single_element_loop)]
8655        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
8656            url = params.uri_replacement(url, param_name, find_this, true);
8657        }
8658        {
8659            let to_remove = ["parent"];
8660            params.remove_params(&to_remove);
8661        }
8662
8663        let url = params.parse_with_url(&url);
8664
8665        let mut json_mime_type = mime::APPLICATION_JSON;
8666        let mut request_value_reader = {
8667            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
8668            common::remove_json_null_values(&mut value);
8669            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
8670            serde_json::to_writer(&mut dst, &value).unwrap();
8671            dst
8672        };
8673        let request_size = request_value_reader
8674            .seek(std::io::SeekFrom::End(0))
8675            .unwrap();
8676        request_value_reader
8677            .seek(std::io::SeekFrom::Start(0))
8678            .unwrap();
8679
8680        loop {
8681            let token = match self
8682                .hub
8683                .auth
8684                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
8685                .await
8686            {
8687                Ok(token) => token,
8688                Err(e) => match dlg.token(e) {
8689                    Ok(token) => token,
8690                    Err(e) => {
8691                        dlg.finished(false);
8692                        return Err(common::Error::MissingToken(e));
8693                    }
8694                },
8695            };
8696            request_value_reader
8697                .seek(std::io::SeekFrom::Start(0))
8698                .unwrap();
8699            let mut req_result = {
8700                let client = &self.hub.client;
8701                dlg.pre_request();
8702                let mut req_builder = hyper::Request::builder()
8703                    .method(hyper::Method::POST)
8704                    .uri(url.as_str())
8705                    .header(USER_AGENT, self.hub._user_agent.clone());
8706
8707                if let Some(token) = token.as_ref() {
8708                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
8709                }
8710
8711                let request = req_builder
8712                    .header(CONTENT_TYPE, json_mime_type.to_string())
8713                    .header(CONTENT_LENGTH, request_size as u64)
8714                    .body(common::to_body(
8715                        request_value_reader.get_ref().clone().into(),
8716                    ));
8717
8718                client.request(request.unwrap()).await
8719            };
8720
8721            match req_result {
8722                Err(err) => {
8723                    if let common::Retry::After(d) = dlg.http_error(&err) {
8724                        sleep(d).await;
8725                        continue;
8726                    }
8727                    dlg.finished(false);
8728                    return Err(common::Error::HttpError(err));
8729                }
8730                Ok(res) => {
8731                    let (mut parts, body) = res.into_parts();
8732                    let mut body = common::Body::new(body);
8733                    if !parts.status.is_success() {
8734                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8735                        let error = serde_json::from_str(&common::to_string(&bytes));
8736                        let response = common::to_response(parts, bytes.into());
8737
8738                        if let common::Retry::After(d) =
8739                            dlg.http_failure(&response, error.as_ref().ok())
8740                        {
8741                            sleep(d).await;
8742                            continue;
8743                        }
8744
8745                        dlg.finished(false);
8746
8747                        return Err(match error {
8748                            Ok(value) => common::Error::BadRequest(value),
8749                            _ => common::Error::Failure(response),
8750                        });
8751                    }
8752                    let response = {
8753                        let bytes = common::to_bytes(body).await.unwrap_or_default();
8754                        let encoded = common::to_string(&bytes);
8755                        match serde_json::from_str(&encoded) {
8756                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
8757                            Err(error) => {
8758                                dlg.response_json_decode_error(&encoded, &error);
8759                                return Err(common::Error::JsonDecodeError(
8760                                    encoded.to_string(),
8761                                    error,
8762                                ));
8763                            }
8764                        }
8765                    };
8766
8767                    dlg.finished(true);
8768                    return Ok(response);
8769                }
8770            }
8771        }
8772    }
8773
8774    ///
8775    /// Sets the *request* property to the given value.
8776    ///
8777    /// Even though the property as already been set when instantiating this call,
8778    /// we provide this method for API completeness.
8779    pub fn request(
8780        mut self,
8781        new_value: GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand,
8782    ) -> CustomerProfileCommandCreateCall<'a, C> {
8783        self._request = new_value;
8784        self
8785    }
8786    /// Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
8787    ///
8788    /// Sets the *parent* path property to the given value.
8789    ///
8790    /// Even though the property as already been set when instantiating this call,
8791    /// we provide this method for API completeness.
8792    pub fn parent(mut self, new_value: &str) -> CustomerProfileCommandCreateCall<'a, C> {
8793        self._parent = new_value.to_string();
8794        self
8795    }
8796    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
8797    /// while executing the actual API request.
8798    ///
8799    /// ````text
8800    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
8801    /// ````
8802    ///
8803    /// Sets the *delegate* property to the given value.
8804    pub fn delegate(
8805        mut self,
8806        new_value: &'a mut dyn common::Delegate,
8807    ) -> CustomerProfileCommandCreateCall<'a, C> {
8808        self._delegate = Some(new_value);
8809        self
8810    }
8811
8812    /// Set any additional parameter of the query string used in the request.
8813    /// It should be used to set parameters which are not yet available through their own
8814    /// setters.
8815    ///
8816    /// Please note that this method must not be used to set any of the known parameters
8817    /// which have their own setter method. If done anyway, the request will fail.
8818    ///
8819    /// # Additional Parameters
8820    ///
8821    /// * *$.xgafv* (query-string) - V1 error format.
8822    /// * *access_token* (query-string) - OAuth access token.
8823    /// * *alt* (query-string) - Data format for response.
8824    /// * *callback* (query-string) - JSONP
8825    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
8826    /// * *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.
8827    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
8828    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
8829    /// * *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.
8830    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
8831    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
8832    pub fn param<T>(mut self, name: T, value: T) -> CustomerProfileCommandCreateCall<'a, C>
8833    where
8834        T: AsRef<str>,
8835    {
8836        self._additional_params
8837            .insert(name.as_ref().to_string(), value.as_ref().to_string());
8838        self
8839    }
8840
8841    /// Identifies the authorization scope for the method you are building.
8842    ///
8843    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
8844    /// [`Scope::ChromeManagementProfile`].
8845    ///
8846    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
8847    /// tokens for more than one scope.
8848    ///
8849    /// Usually there is more than one suitable scope to authorize an operation, some of which may
8850    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
8851    /// sufficient, a read-write scope will do as well.
8852    pub fn add_scope<St>(mut self, scope: St) -> CustomerProfileCommandCreateCall<'a, C>
8853    where
8854        St: AsRef<str>,
8855    {
8856        self._scopes.insert(String::from(scope.as_ref()));
8857        self
8858    }
8859    /// Identifies the authorization scope(s) for the method you are building.
8860    ///
8861    /// See [`Self::add_scope()`] for details.
8862    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerProfileCommandCreateCall<'a, C>
8863    where
8864        I: IntoIterator<Item = St>,
8865        St: AsRef<str>,
8866    {
8867        self._scopes
8868            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
8869        self
8870    }
8871
8872    /// Removes all scopes, and no default scope will be used either.
8873    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
8874    /// for details).
8875    pub fn clear_scopes(mut self) -> CustomerProfileCommandCreateCall<'a, C> {
8876        self._scopes.clear();
8877        self
8878    }
8879}
8880
8881/// Gets a Chrome browser profile remote command.
8882///
8883/// A builder for the *profiles.commands.get* method supported by a *customer* resource.
8884/// It is not used directly, but through a [`CustomerMethods`] instance.
8885///
8886/// # Example
8887///
8888/// Instantiate a resource method builder
8889///
8890/// ```test_harness,no_run
8891/// # extern crate hyper;
8892/// # extern crate hyper_rustls;
8893/// # extern crate google_chromemanagement1 as chromemanagement1;
8894/// # async fn dox() {
8895/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
8896///
8897/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
8898/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
8899/// #     .with_native_roots()
8900/// #     .unwrap()
8901/// #     .https_only()
8902/// #     .enable_http2()
8903/// #     .build();
8904///
8905/// # let executor = hyper_util::rt::TokioExecutor::new();
8906/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
8907/// #     secret,
8908/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
8909/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
8910/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
8911/// #     ),
8912/// # ).build().await.unwrap();
8913///
8914/// # let client = hyper_util::client::legacy::Client::builder(
8915/// #     hyper_util::rt::TokioExecutor::new()
8916/// # )
8917/// # .build(
8918/// #     hyper_rustls::HttpsConnectorBuilder::new()
8919/// #         .with_native_roots()
8920/// #         .unwrap()
8921/// #         .https_or_http()
8922/// #         .enable_http2()
8923/// #         .build()
8924/// # );
8925/// # let mut hub = ChromeManagement::new(client, auth);
8926/// // You can configure optional parameters by calling the respective setters at will, and
8927/// // execute the final call using `doit()`.
8928/// // Values shown here are possibly random and not representative !
8929/// let result = hub.customers().profiles_commands_get("name")
8930///              .doit().await;
8931/// # }
8932/// ```
8933pub struct CustomerProfileCommandGetCall<'a, C>
8934where
8935    C: 'a,
8936{
8937    hub: &'a ChromeManagement<C>,
8938    _name: String,
8939    _delegate: Option<&'a mut dyn common::Delegate>,
8940    _additional_params: HashMap<String, String>,
8941    _scopes: BTreeSet<String>,
8942}
8943
8944impl<'a, C> common::CallBuilder for CustomerProfileCommandGetCall<'a, C> {}
8945
8946impl<'a, C> CustomerProfileCommandGetCall<'a, C>
8947where
8948    C: common::Connector,
8949{
8950    /// Perform the operation you have build so far.
8951    pub async fn doit(
8952        mut self,
8953    ) -> common::Result<(
8954        common::Response,
8955        GoogleChromeManagementVersionsV1ChromeBrowserProfileCommand,
8956    )> {
8957        use std::borrow::Cow;
8958        use std::io::{Read, Seek};
8959
8960        use common::{url::Params, ToParts};
8961        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
8962
8963        let mut dd = common::DefaultDelegate;
8964        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
8965        dlg.begin(common::MethodInfo {
8966            id: "chromemanagement.customers.profiles.commands.get",
8967            http_method: hyper::Method::GET,
8968        });
8969
8970        for &field in ["alt", "name"].iter() {
8971            if self._additional_params.contains_key(field) {
8972                dlg.finished(false);
8973                return Err(common::Error::FieldClash(field));
8974            }
8975        }
8976
8977        let mut params = Params::with_capacity(3 + self._additional_params.len());
8978        params.push("name", self._name);
8979
8980        params.extend(self._additional_params.iter());
8981
8982        params.push("alt", "json");
8983        let mut url = self.hub._base_url.clone() + "v1/{+name}";
8984        if self._scopes.is_empty() {
8985            self._scopes
8986                .insert(Scope::ChromeManagementProfileReadonly.as_ref().to_string());
8987        }
8988
8989        #[allow(clippy::single_element_loop)]
8990        for &(find_this, param_name) in [("{+name}", "name")].iter() {
8991            url = params.uri_replacement(url, param_name, find_this, true);
8992        }
8993        {
8994            let to_remove = ["name"];
8995            params.remove_params(&to_remove);
8996        }
8997
8998        let url = params.parse_with_url(&url);
8999
9000        loop {
9001            let token = match self
9002                .hub
9003                .auth
9004                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9005                .await
9006            {
9007                Ok(token) => token,
9008                Err(e) => match dlg.token(e) {
9009                    Ok(token) => token,
9010                    Err(e) => {
9011                        dlg.finished(false);
9012                        return Err(common::Error::MissingToken(e));
9013                    }
9014                },
9015            };
9016            let mut req_result = {
9017                let client = &self.hub.client;
9018                dlg.pre_request();
9019                let mut req_builder = hyper::Request::builder()
9020                    .method(hyper::Method::GET)
9021                    .uri(url.as_str())
9022                    .header(USER_AGENT, self.hub._user_agent.clone());
9023
9024                if let Some(token) = token.as_ref() {
9025                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9026                }
9027
9028                let request = req_builder
9029                    .header(CONTENT_LENGTH, 0_u64)
9030                    .body(common::to_body::<String>(None));
9031
9032                client.request(request.unwrap()).await
9033            };
9034
9035            match req_result {
9036                Err(err) => {
9037                    if let common::Retry::After(d) = dlg.http_error(&err) {
9038                        sleep(d).await;
9039                        continue;
9040                    }
9041                    dlg.finished(false);
9042                    return Err(common::Error::HttpError(err));
9043                }
9044                Ok(res) => {
9045                    let (mut parts, body) = res.into_parts();
9046                    let mut body = common::Body::new(body);
9047                    if !parts.status.is_success() {
9048                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9049                        let error = serde_json::from_str(&common::to_string(&bytes));
9050                        let response = common::to_response(parts, bytes.into());
9051
9052                        if let common::Retry::After(d) =
9053                            dlg.http_failure(&response, error.as_ref().ok())
9054                        {
9055                            sleep(d).await;
9056                            continue;
9057                        }
9058
9059                        dlg.finished(false);
9060
9061                        return Err(match error {
9062                            Ok(value) => common::Error::BadRequest(value),
9063                            _ => common::Error::Failure(response),
9064                        });
9065                    }
9066                    let response = {
9067                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9068                        let encoded = common::to_string(&bytes);
9069                        match serde_json::from_str(&encoded) {
9070                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9071                            Err(error) => {
9072                                dlg.response_json_decode_error(&encoded, &error);
9073                                return Err(common::Error::JsonDecodeError(
9074                                    encoded.to_string(),
9075                                    error,
9076                                ));
9077                            }
9078                        }
9079                    };
9080
9081                    dlg.finished(true);
9082                    return Ok(response);
9083                }
9084            }
9085        }
9086    }
9087
9088    /// Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}/commands/{command_id}
9089    ///
9090    /// Sets the *name* path property to the given value.
9091    ///
9092    /// Even though the property as already been set when instantiating this call,
9093    /// we provide this method for API completeness.
9094    pub fn name(mut self, new_value: &str) -> CustomerProfileCommandGetCall<'a, C> {
9095        self._name = new_value.to_string();
9096        self
9097    }
9098    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9099    /// while executing the actual API request.
9100    ///
9101    /// ````text
9102    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9103    /// ````
9104    ///
9105    /// Sets the *delegate* property to the given value.
9106    pub fn delegate(
9107        mut self,
9108        new_value: &'a mut dyn common::Delegate,
9109    ) -> CustomerProfileCommandGetCall<'a, C> {
9110        self._delegate = Some(new_value);
9111        self
9112    }
9113
9114    /// Set any additional parameter of the query string used in the request.
9115    /// It should be used to set parameters which are not yet available through their own
9116    /// setters.
9117    ///
9118    /// Please note that this method must not be used to set any of the known parameters
9119    /// which have their own setter method. If done anyway, the request will fail.
9120    ///
9121    /// # Additional Parameters
9122    ///
9123    /// * *$.xgafv* (query-string) - V1 error format.
9124    /// * *access_token* (query-string) - OAuth access token.
9125    /// * *alt* (query-string) - Data format for response.
9126    /// * *callback* (query-string) - JSONP
9127    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9128    /// * *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.
9129    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9130    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9131    /// * *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.
9132    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9133    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9134    pub fn param<T>(mut self, name: T, value: T) -> CustomerProfileCommandGetCall<'a, C>
9135    where
9136        T: AsRef<str>,
9137    {
9138        self._additional_params
9139            .insert(name.as_ref().to_string(), value.as_ref().to_string());
9140        self
9141    }
9142
9143    /// Identifies the authorization scope for the method you are building.
9144    ///
9145    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9146    /// [`Scope::ChromeManagementProfileReadonly`].
9147    ///
9148    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9149    /// tokens for more than one scope.
9150    ///
9151    /// Usually there is more than one suitable scope to authorize an operation, some of which may
9152    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9153    /// sufficient, a read-write scope will do as well.
9154    pub fn add_scope<St>(mut self, scope: St) -> CustomerProfileCommandGetCall<'a, C>
9155    where
9156        St: AsRef<str>,
9157    {
9158        self._scopes.insert(String::from(scope.as_ref()));
9159        self
9160    }
9161    /// Identifies the authorization scope(s) for the method you are building.
9162    ///
9163    /// See [`Self::add_scope()`] for details.
9164    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerProfileCommandGetCall<'a, C>
9165    where
9166        I: IntoIterator<Item = St>,
9167        St: AsRef<str>,
9168    {
9169        self._scopes
9170            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9171        self
9172    }
9173
9174    /// Removes all scopes, and no default scope will be used either.
9175    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9176    /// for details).
9177    pub fn clear_scopes(mut self) -> CustomerProfileCommandGetCall<'a, C> {
9178        self._scopes.clear();
9179        self
9180    }
9181}
9182
9183/// Lists remote commands of a Chrome browser profile.
9184///
9185/// A builder for the *profiles.commands.list* method supported by a *customer* resource.
9186/// It is not used directly, but through a [`CustomerMethods`] instance.
9187///
9188/// # Example
9189///
9190/// Instantiate a resource method builder
9191///
9192/// ```test_harness,no_run
9193/// # extern crate hyper;
9194/// # extern crate hyper_rustls;
9195/// # extern crate google_chromemanagement1 as chromemanagement1;
9196/// # async fn dox() {
9197/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9198///
9199/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9200/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
9201/// #     .with_native_roots()
9202/// #     .unwrap()
9203/// #     .https_only()
9204/// #     .enable_http2()
9205/// #     .build();
9206///
9207/// # let executor = hyper_util::rt::TokioExecutor::new();
9208/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
9209/// #     secret,
9210/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9211/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
9212/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
9213/// #     ),
9214/// # ).build().await.unwrap();
9215///
9216/// # let client = hyper_util::client::legacy::Client::builder(
9217/// #     hyper_util::rt::TokioExecutor::new()
9218/// # )
9219/// # .build(
9220/// #     hyper_rustls::HttpsConnectorBuilder::new()
9221/// #         .with_native_roots()
9222/// #         .unwrap()
9223/// #         .https_or_http()
9224/// #         .enable_http2()
9225/// #         .build()
9226/// # );
9227/// # let mut hub = ChromeManagement::new(client, auth);
9228/// // You can configure optional parameters by calling the respective setters at will, and
9229/// // execute the final call using `doit()`.
9230/// // Values shown here are possibly random and not representative !
9231/// let result = hub.customers().profiles_commands_list("parent")
9232///              .page_token("ipsum")
9233///              .page_size(-7)
9234///              .doit().await;
9235/// # }
9236/// ```
9237pub struct CustomerProfileCommandListCall<'a, C>
9238where
9239    C: 'a,
9240{
9241    hub: &'a ChromeManagement<C>,
9242    _parent: String,
9243    _page_token: Option<String>,
9244    _page_size: Option<i32>,
9245    _delegate: Option<&'a mut dyn common::Delegate>,
9246    _additional_params: HashMap<String, String>,
9247    _scopes: BTreeSet<String>,
9248}
9249
9250impl<'a, C> common::CallBuilder for CustomerProfileCommandListCall<'a, C> {}
9251
9252impl<'a, C> CustomerProfileCommandListCall<'a, C>
9253where
9254    C: common::Connector,
9255{
9256    /// Perform the operation you have build so far.
9257    pub async fn doit(
9258        mut self,
9259    ) -> common::Result<(
9260        common::Response,
9261        GoogleChromeManagementVersionsV1ListChromeBrowserProfileCommandsResponse,
9262    )> {
9263        use std::borrow::Cow;
9264        use std::io::{Read, Seek};
9265
9266        use common::{url::Params, ToParts};
9267        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9268
9269        let mut dd = common::DefaultDelegate;
9270        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9271        dlg.begin(common::MethodInfo {
9272            id: "chromemanagement.customers.profiles.commands.list",
9273            http_method: hyper::Method::GET,
9274        });
9275
9276        for &field in ["alt", "parent", "pageToken", "pageSize"].iter() {
9277            if self._additional_params.contains_key(field) {
9278                dlg.finished(false);
9279                return Err(common::Error::FieldClash(field));
9280            }
9281        }
9282
9283        let mut params = Params::with_capacity(5 + self._additional_params.len());
9284        params.push("parent", self._parent);
9285        if let Some(value) = self._page_token.as_ref() {
9286            params.push("pageToken", value);
9287        }
9288        if let Some(value) = self._page_size.as_ref() {
9289            params.push("pageSize", value.to_string());
9290        }
9291
9292        params.extend(self._additional_params.iter());
9293
9294        params.push("alt", "json");
9295        let mut url = self.hub._base_url.clone() + "v1/{+parent}/commands";
9296        if self._scopes.is_empty() {
9297            self._scopes
9298                .insert(Scope::ChromeManagementProfileReadonly.as_ref().to_string());
9299        }
9300
9301        #[allow(clippy::single_element_loop)]
9302        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
9303            url = params.uri_replacement(url, param_name, find_this, true);
9304        }
9305        {
9306            let to_remove = ["parent"];
9307            params.remove_params(&to_remove);
9308        }
9309
9310        let url = params.parse_with_url(&url);
9311
9312        loop {
9313            let token = match self
9314                .hub
9315                .auth
9316                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9317                .await
9318            {
9319                Ok(token) => token,
9320                Err(e) => match dlg.token(e) {
9321                    Ok(token) => token,
9322                    Err(e) => {
9323                        dlg.finished(false);
9324                        return Err(common::Error::MissingToken(e));
9325                    }
9326                },
9327            };
9328            let mut req_result = {
9329                let client = &self.hub.client;
9330                dlg.pre_request();
9331                let mut req_builder = hyper::Request::builder()
9332                    .method(hyper::Method::GET)
9333                    .uri(url.as_str())
9334                    .header(USER_AGENT, self.hub._user_agent.clone());
9335
9336                if let Some(token) = token.as_ref() {
9337                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9338                }
9339
9340                let request = req_builder
9341                    .header(CONTENT_LENGTH, 0_u64)
9342                    .body(common::to_body::<String>(None));
9343
9344                client.request(request.unwrap()).await
9345            };
9346
9347            match req_result {
9348                Err(err) => {
9349                    if let common::Retry::After(d) = dlg.http_error(&err) {
9350                        sleep(d).await;
9351                        continue;
9352                    }
9353                    dlg.finished(false);
9354                    return Err(common::Error::HttpError(err));
9355                }
9356                Ok(res) => {
9357                    let (mut parts, body) = res.into_parts();
9358                    let mut body = common::Body::new(body);
9359                    if !parts.status.is_success() {
9360                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9361                        let error = serde_json::from_str(&common::to_string(&bytes));
9362                        let response = common::to_response(parts, bytes.into());
9363
9364                        if let common::Retry::After(d) =
9365                            dlg.http_failure(&response, error.as_ref().ok())
9366                        {
9367                            sleep(d).await;
9368                            continue;
9369                        }
9370
9371                        dlg.finished(false);
9372
9373                        return Err(match error {
9374                            Ok(value) => common::Error::BadRequest(value),
9375                            _ => common::Error::Failure(response),
9376                        });
9377                    }
9378                    let response = {
9379                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9380                        let encoded = common::to_string(&bytes);
9381                        match serde_json::from_str(&encoded) {
9382                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9383                            Err(error) => {
9384                                dlg.response_json_decode_error(&encoded, &error);
9385                                return Err(common::Error::JsonDecodeError(
9386                                    encoded.to_string(),
9387                                    error,
9388                                ));
9389                            }
9390                        }
9391                    };
9392
9393                    dlg.finished(true);
9394                    return Ok(response);
9395                }
9396            }
9397        }
9398    }
9399
9400    /// Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
9401    ///
9402    /// Sets the *parent* path property to the given value.
9403    ///
9404    /// Even though the property as already been set when instantiating this call,
9405    /// we provide this method for API completeness.
9406    pub fn parent(mut self, new_value: &str) -> CustomerProfileCommandListCall<'a, C> {
9407        self._parent = new_value.to_string();
9408        self
9409    }
9410    /// Optional. The page token used to retrieve a specific page of the listing request.
9411    ///
9412    /// Sets the *page token* query property to the given value.
9413    pub fn page_token(mut self, new_value: &str) -> CustomerProfileCommandListCall<'a, C> {
9414        self._page_token = Some(new_value.to_string());
9415        self
9416    }
9417    /// Optional. The maximum number of commands to return. The default page size is 100 if page_size is unspecified, and the maximum page size allowed is 100.
9418    ///
9419    /// Sets the *page size* query property to the given value.
9420    pub fn page_size(mut self, new_value: i32) -> CustomerProfileCommandListCall<'a, C> {
9421        self._page_size = Some(new_value);
9422        self
9423    }
9424    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9425    /// while executing the actual API request.
9426    ///
9427    /// ````text
9428    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9429    /// ````
9430    ///
9431    /// Sets the *delegate* property to the given value.
9432    pub fn delegate(
9433        mut self,
9434        new_value: &'a mut dyn common::Delegate,
9435    ) -> CustomerProfileCommandListCall<'a, C> {
9436        self._delegate = Some(new_value);
9437        self
9438    }
9439
9440    /// Set any additional parameter of the query string used in the request.
9441    /// It should be used to set parameters which are not yet available through their own
9442    /// setters.
9443    ///
9444    /// Please note that this method must not be used to set any of the known parameters
9445    /// which have their own setter method. If done anyway, the request will fail.
9446    ///
9447    /// # Additional Parameters
9448    ///
9449    /// * *$.xgafv* (query-string) - V1 error format.
9450    /// * *access_token* (query-string) - OAuth access token.
9451    /// * *alt* (query-string) - Data format for response.
9452    /// * *callback* (query-string) - JSONP
9453    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9454    /// * *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.
9455    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9456    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9457    /// * *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.
9458    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9459    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9460    pub fn param<T>(mut self, name: T, value: T) -> CustomerProfileCommandListCall<'a, C>
9461    where
9462        T: AsRef<str>,
9463    {
9464        self._additional_params
9465            .insert(name.as_ref().to_string(), value.as_ref().to_string());
9466        self
9467    }
9468
9469    /// Identifies the authorization scope for the method you are building.
9470    ///
9471    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9472    /// [`Scope::ChromeManagementProfileReadonly`].
9473    ///
9474    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9475    /// tokens for more than one scope.
9476    ///
9477    /// Usually there is more than one suitable scope to authorize an operation, some of which may
9478    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9479    /// sufficient, a read-write scope will do as well.
9480    pub fn add_scope<St>(mut self, scope: St) -> CustomerProfileCommandListCall<'a, C>
9481    where
9482        St: AsRef<str>,
9483    {
9484        self._scopes.insert(String::from(scope.as_ref()));
9485        self
9486    }
9487    /// Identifies the authorization scope(s) for the method you are building.
9488    ///
9489    /// See [`Self::add_scope()`] for details.
9490    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerProfileCommandListCall<'a, C>
9491    where
9492        I: IntoIterator<Item = St>,
9493        St: AsRef<str>,
9494    {
9495        self._scopes
9496            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9497        self
9498    }
9499
9500    /// Removes all scopes, and no default scope will be used either.
9501    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9502    /// for details).
9503    pub fn clear_scopes(mut self) -> CustomerProfileCommandListCall<'a, C> {
9504        self._scopes.clear();
9505        self
9506    }
9507}
9508
9509/// Deletes the data collected from a Chrome browser profile.
9510///
9511/// A builder for the *profiles.delete* method supported by a *customer* resource.
9512/// It is not used directly, but through a [`CustomerMethods`] instance.
9513///
9514/// # Example
9515///
9516/// Instantiate a resource method builder
9517///
9518/// ```test_harness,no_run
9519/// # extern crate hyper;
9520/// # extern crate hyper_rustls;
9521/// # extern crate google_chromemanagement1 as chromemanagement1;
9522/// # async fn dox() {
9523/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9524///
9525/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9526/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
9527/// #     .with_native_roots()
9528/// #     .unwrap()
9529/// #     .https_only()
9530/// #     .enable_http2()
9531/// #     .build();
9532///
9533/// # let executor = hyper_util::rt::TokioExecutor::new();
9534/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
9535/// #     secret,
9536/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9537/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
9538/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
9539/// #     ),
9540/// # ).build().await.unwrap();
9541///
9542/// # let client = hyper_util::client::legacy::Client::builder(
9543/// #     hyper_util::rt::TokioExecutor::new()
9544/// # )
9545/// # .build(
9546/// #     hyper_rustls::HttpsConnectorBuilder::new()
9547/// #         .with_native_roots()
9548/// #         .unwrap()
9549/// #         .https_or_http()
9550/// #         .enable_http2()
9551/// #         .build()
9552/// # );
9553/// # let mut hub = ChromeManagement::new(client, auth);
9554/// // You can configure optional parameters by calling the respective setters at will, and
9555/// // execute the final call using `doit()`.
9556/// // Values shown here are possibly random and not representative !
9557/// let result = hub.customers().profiles_delete("name")
9558///              .doit().await;
9559/// # }
9560/// ```
9561pub struct CustomerProfileDeleteCall<'a, C>
9562where
9563    C: 'a,
9564{
9565    hub: &'a ChromeManagement<C>,
9566    _name: String,
9567    _delegate: Option<&'a mut dyn common::Delegate>,
9568    _additional_params: HashMap<String, String>,
9569    _scopes: BTreeSet<String>,
9570}
9571
9572impl<'a, C> common::CallBuilder for CustomerProfileDeleteCall<'a, C> {}
9573
9574impl<'a, C> CustomerProfileDeleteCall<'a, C>
9575where
9576    C: common::Connector,
9577{
9578    /// Perform the operation you have build so far.
9579    pub async fn doit(mut self) -> common::Result<(common::Response, GoogleProtobufEmpty)> {
9580        use std::borrow::Cow;
9581        use std::io::{Read, Seek};
9582
9583        use common::{url::Params, ToParts};
9584        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9585
9586        let mut dd = common::DefaultDelegate;
9587        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9588        dlg.begin(common::MethodInfo {
9589            id: "chromemanagement.customers.profiles.delete",
9590            http_method: hyper::Method::DELETE,
9591        });
9592
9593        for &field in ["alt", "name"].iter() {
9594            if self._additional_params.contains_key(field) {
9595                dlg.finished(false);
9596                return Err(common::Error::FieldClash(field));
9597            }
9598        }
9599
9600        let mut params = Params::with_capacity(3 + self._additional_params.len());
9601        params.push("name", self._name);
9602
9603        params.extend(self._additional_params.iter());
9604
9605        params.push("alt", "json");
9606        let mut url = self.hub._base_url.clone() + "v1/{+name}";
9607        if self._scopes.is_empty() {
9608            self._scopes
9609                .insert(Scope::ChromeManagementProfile.as_ref().to_string());
9610        }
9611
9612        #[allow(clippy::single_element_loop)]
9613        for &(find_this, param_name) in [("{+name}", "name")].iter() {
9614            url = params.uri_replacement(url, param_name, find_this, true);
9615        }
9616        {
9617            let to_remove = ["name"];
9618            params.remove_params(&to_remove);
9619        }
9620
9621        let url = params.parse_with_url(&url);
9622
9623        loop {
9624            let token = match self
9625                .hub
9626                .auth
9627                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9628                .await
9629            {
9630                Ok(token) => token,
9631                Err(e) => match dlg.token(e) {
9632                    Ok(token) => token,
9633                    Err(e) => {
9634                        dlg.finished(false);
9635                        return Err(common::Error::MissingToken(e));
9636                    }
9637                },
9638            };
9639            let mut req_result = {
9640                let client = &self.hub.client;
9641                dlg.pre_request();
9642                let mut req_builder = hyper::Request::builder()
9643                    .method(hyper::Method::DELETE)
9644                    .uri(url.as_str())
9645                    .header(USER_AGENT, self.hub._user_agent.clone());
9646
9647                if let Some(token) = token.as_ref() {
9648                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9649                }
9650
9651                let request = req_builder
9652                    .header(CONTENT_LENGTH, 0_u64)
9653                    .body(common::to_body::<String>(None));
9654
9655                client.request(request.unwrap()).await
9656            };
9657
9658            match req_result {
9659                Err(err) => {
9660                    if let common::Retry::After(d) = dlg.http_error(&err) {
9661                        sleep(d).await;
9662                        continue;
9663                    }
9664                    dlg.finished(false);
9665                    return Err(common::Error::HttpError(err));
9666                }
9667                Ok(res) => {
9668                    let (mut parts, body) = res.into_parts();
9669                    let mut body = common::Body::new(body);
9670                    if !parts.status.is_success() {
9671                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9672                        let error = serde_json::from_str(&common::to_string(&bytes));
9673                        let response = common::to_response(parts, bytes.into());
9674
9675                        if let common::Retry::After(d) =
9676                            dlg.http_failure(&response, error.as_ref().ok())
9677                        {
9678                            sleep(d).await;
9679                            continue;
9680                        }
9681
9682                        dlg.finished(false);
9683
9684                        return Err(match error {
9685                            Ok(value) => common::Error::BadRequest(value),
9686                            _ => common::Error::Failure(response),
9687                        });
9688                    }
9689                    let response = {
9690                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9691                        let encoded = common::to_string(&bytes);
9692                        match serde_json::from_str(&encoded) {
9693                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9694                            Err(error) => {
9695                                dlg.response_json_decode_error(&encoded, &error);
9696                                return Err(common::Error::JsonDecodeError(
9697                                    encoded.to_string(),
9698                                    error,
9699                                ));
9700                            }
9701                        }
9702                    };
9703
9704                    dlg.finished(true);
9705                    return Ok(response);
9706                }
9707            }
9708        }
9709    }
9710
9711    /// Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
9712    ///
9713    /// Sets the *name* path property to the given value.
9714    ///
9715    /// Even though the property as already been set when instantiating this call,
9716    /// we provide this method for API completeness.
9717    pub fn name(mut self, new_value: &str) -> CustomerProfileDeleteCall<'a, C> {
9718        self._name = new_value.to_string();
9719        self
9720    }
9721    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
9722    /// while executing the actual API request.
9723    ///
9724    /// ````text
9725    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
9726    /// ````
9727    ///
9728    /// Sets the *delegate* property to the given value.
9729    pub fn delegate(
9730        mut self,
9731        new_value: &'a mut dyn common::Delegate,
9732    ) -> CustomerProfileDeleteCall<'a, C> {
9733        self._delegate = Some(new_value);
9734        self
9735    }
9736
9737    /// Set any additional parameter of the query string used in the request.
9738    /// It should be used to set parameters which are not yet available through their own
9739    /// setters.
9740    ///
9741    /// Please note that this method must not be used to set any of the known parameters
9742    /// which have their own setter method. If done anyway, the request will fail.
9743    ///
9744    /// # Additional Parameters
9745    ///
9746    /// * *$.xgafv* (query-string) - V1 error format.
9747    /// * *access_token* (query-string) - OAuth access token.
9748    /// * *alt* (query-string) - Data format for response.
9749    /// * *callback* (query-string) - JSONP
9750    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
9751    /// * *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.
9752    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
9753    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
9754    /// * *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.
9755    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
9756    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
9757    pub fn param<T>(mut self, name: T, value: T) -> CustomerProfileDeleteCall<'a, C>
9758    where
9759        T: AsRef<str>,
9760    {
9761        self._additional_params
9762            .insert(name.as_ref().to_string(), value.as_ref().to_string());
9763        self
9764    }
9765
9766    /// Identifies the authorization scope for the method you are building.
9767    ///
9768    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
9769    /// [`Scope::ChromeManagementProfile`].
9770    ///
9771    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
9772    /// tokens for more than one scope.
9773    ///
9774    /// Usually there is more than one suitable scope to authorize an operation, some of which may
9775    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
9776    /// sufficient, a read-write scope will do as well.
9777    pub fn add_scope<St>(mut self, scope: St) -> CustomerProfileDeleteCall<'a, C>
9778    where
9779        St: AsRef<str>,
9780    {
9781        self._scopes.insert(String::from(scope.as_ref()));
9782        self
9783    }
9784    /// Identifies the authorization scope(s) for the method you are building.
9785    ///
9786    /// See [`Self::add_scope()`] for details.
9787    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerProfileDeleteCall<'a, C>
9788    where
9789        I: IntoIterator<Item = St>,
9790        St: AsRef<str>,
9791    {
9792        self._scopes
9793            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
9794        self
9795    }
9796
9797    /// Removes all scopes, and no default scope will be used either.
9798    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
9799    /// for details).
9800    pub fn clear_scopes(mut self) -> CustomerProfileDeleteCall<'a, C> {
9801        self._scopes.clear();
9802        self
9803    }
9804}
9805
9806/// Gets a Chrome browser profile with customer ID and profile permanent ID.
9807///
9808/// A builder for the *profiles.get* method supported by a *customer* resource.
9809/// It is not used directly, but through a [`CustomerMethods`] instance.
9810///
9811/// # Example
9812///
9813/// Instantiate a resource method builder
9814///
9815/// ```test_harness,no_run
9816/// # extern crate hyper;
9817/// # extern crate hyper_rustls;
9818/// # extern crate google_chromemanagement1 as chromemanagement1;
9819/// # async fn dox() {
9820/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
9821///
9822/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
9823/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
9824/// #     .with_native_roots()
9825/// #     .unwrap()
9826/// #     .https_only()
9827/// #     .enable_http2()
9828/// #     .build();
9829///
9830/// # let executor = hyper_util::rt::TokioExecutor::new();
9831/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
9832/// #     secret,
9833/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
9834/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
9835/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
9836/// #     ),
9837/// # ).build().await.unwrap();
9838///
9839/// # let client = hyper_util::client::legacy::Client::builder(
9840/// #     hyper_util::rt::TokioExecutor::new()
9841/// # )
9842/// # .build(
9843/// #     hyper_rustls::HttpsConnectorBuilder::new()
9844/// #         .with_native_roots()
9845/// #         .unwrap()
9846/// #         .https_or_http()
9847/// #         .enable_http2()
9848/// #         .build()
9849/// # );
9850/// # let mut hub = ChromeManagement::new(client, auth);
9851/// // You can configure optional parameters by calling the respective setters at will, and
9852/// // execute the final call using `doit()`.
9853/// // Values shown here are possibly random and not representative !
9854/// let result = hub.customers().profiles_get("name")
9855///              .doit().await;
9856/// # }
9857/// ```
9858pub struct CustomerProfileGetCall<'a, C>
9859where
9860    C: 'a,
9861{
9862    hub: &'a ChromeManagement<C>,
9863    _name: String,
9864    _delegate: Option<&'a mut dyn common::Delegate>,
9865    _additional_params: HashMap<String, String>,
9866    _scopes: BTreeSet<String>,
9867}
9868
9869impl<'a, C> common::CallBuilder for CustomerProfileGetCall<'a, C> {}
9870
9871impl<'a, C> CustomerProfileGetCall<'a, C>
9872where
9873    C: common::Connector,
9874{
9875    /// Perform the operation you have build so far.
9876    pub async fn doit(
9877        mut self,
9878    ) -> common::Result<(
9879        common::Response,
9880        GoogleChromeManagementVersionsV1ChromeBrowserProfile,
9881    )> {
9882        use std::borrow::Cow;
9883        use std::io::{Read, Seek};
9884
9885        use common::{url::Params, ToParts};
9886        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
9887
9888        let mut dd = common::DefaultDelegate;
9889        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
9890        dlg.begin(common::MethodInfo {
9891            id: "chromemanagement.customers.profiles.get",
9892            http_method: hyper::Method::GET,
9893        });
9894
9895        for &field in ["alt", "name"].iter() {
9896            if self._additional_params.contains_key(field) {
9897                dlg.finished(false);
9898                return Err(common::Error::FieldClash(field));
9899            }
9900        }
9901
9902        let mut params = Params::with_capacity(3 + self._additional_params.len());
9903        params.push("name", self._name);
9904
9905        params.extend(self._additional_params.iter());
9906
9907        params.push("alt", "json");
9908        let mut url = self.hub._base_url.clone() + "v1/{+name}";
9909        if self._scopes.is_empty() {
9910            self._scopes
9911                .insert(Scope::ChromeManagementProfileReadonly.as_ref().to_string());
9912        }
9913
9914        #[allow(clippy::single_element_loop)]
9915        for &(find_this, param_name) in [("{+name}", "name")].iter() {
9916            url = params.uri_replacement(url, param_name, find_this, true);
9917        }
9918        {
9919            let to_remove = ["name"];
9920            params.remove_params(&to_remove);
9921        }
9922
9923        let url = params.parse_with_url(&url);
9924
9925        loop {
9926            let token = match self
9927                .hub
9928                .auth
9929                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
9930                .await
9931            {
9932                Ok(token) => token,
9933                Err(e) => match dlg.token(e) {
9934                    Ok(token) => token,
9935                    Err(e) => {
9936                        dlg.finished(false);
9937                        return Err(common::Error::MissingToken(e));
9938                    }
9939                },
9940            };
9941            let mut req_result = {
9942                let client = &self.hub.client;
9943                dlg.pre_request();
9944                let mut req_builder = hyper::Request::builder()
9945                    .method(hyper::Method::GET)
9946                    .uri(url.as_str())
9947                    .header(USER_AGENT, self.hub._user_agent.clone());
9948
9949                if let Some(token) = token.as_ref() {
9950                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
9951                }
9952
9953                let request = req_builder
9954                    .header(CONTENT_LENGTH, 0_u64)
9955                    .body(common::to_body::<String>(None));
9956
9957                client.request(request.unwrap()).await
9958            };
9959
9960            match req_result {
9961                Err(err) => {
9962                    if let common::Retry::After(d) = dlg.http_error(&err) {
9963                        sleep(d).await;
9964                        continue;
9965                    }
9966                    dlg.finished(false);
9967                    return Err(common::Error::HttpError(err));
9968                }
9969                Ok(res) => {
9970                    let (mut parts, body) = res.into_parts();
9971                    let mut body = common::Body::new(body);
9972                    if !parts.status.is_success() {
9973                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9974                        let error = serde_json::from_str(&common::to_string(&bytes));
9975                        let response = common::to_response(parts, bytes.into());
9976
9977                        if let common::Retry::After(d) =
9978                            dlg.http_failure(&response, error.as_ref().ok())
9979                        {
9980                            sleep(d).await;
9981                            continue;
9982                        }
9983
9984                        dlg.finished(false);
9985
9986                        return Err(match error {
9987                            Ok(value) => common::Error::BadRequest(value),
9988                            _ => common::Error::Failure(response),
9989                        });
9990                    }
9991                    let response = {
9992                        let bytes = common::to_bytes(body).await.unwrap_or_default();
9993                        let encoded = common::to_string(&bytes);
9994                        match serde_json::from_str(&encoded) {
9995                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
9996                            Err(error) => {
9997                                dlg.response_json_decode_error(&encoded, &error);
9998                                return Err(common::Error::JsonDecodeError(
9999                                    encoded.to_string(),
10000                                    error,
10001                                ));
10002                            }
10003                        }
10004                    };
10005
10006                    dlg.finished(true);
10007                    return Ok(response);
10008                }
10009            }
10010        }
10011    }
10012
10013    /// Required. Format: customers/{customer_id}/profiles/{profile_permanent_id}
10014    ///
10015    /// Sets the *name* path property to the given value.
10016    ///
10017    /// Even though the property as already been set when instantiating this call,
10018    /// we provide this method for API completeness.
10019    pub fn name(mut self, new_value: &str) -> CustomerProfileGetCall<'a, C> {
10020        self._name = new_value.to_string();
10021        self
10022    }
10023    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10024    /// while executing the actual API request.
10025    ///
10026    /// ````text
10027    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
10028    /// ````
10029    ///
10030    /// Sets the *delegate* property to the given value.
10031    pub fn delegate(
10032        mut self,
10033        new_value: &'a mut dyn common::Delegate,
10034    ) -> CustomerProfileGetCall<'a, C> {
10035        self._delegate = Some(new_value);
10036        self
10037    }
10038
10039    /// Set any additional parameter of the query string used in the request.
10040    /// It should be used to set parameters which are not yet available through their own
10041    /// setters.
10042    ///
10043    /// Please note that this method must not be used to set any of the known parameters
10044    /// which have their own setter method. If done anyway, the request will fail.
10045    ///
10046    /// # Additional Parameters
10047    ///
10048    /// * *$.xgafv* (query-string) - V1 error format.
10049    /// * *access_token* (query-string) - OAuth access token.
10050    /// * *alt* (query-string) - Data format for response.
10051    /// * *callback* (query-string) - JSONP
10052    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10053    /// * *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.
10054    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10055    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10056    /// * *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.
10057    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10058    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10059    pub fn param<T>(mut self, name: T, value: T) -> CustomerProfileGetCall<'a, C>
10060    where
10061        T: AsRef<str>,
10062    {
10063        self._additional_params
10064            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10065        self
10066    }
10067
10068    /// Identifies the authorization scope for the method you are building.
10069    ///
10070    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10071    /// [`Scope::ChromeManagementProfileReadonly`].
10072    ///
10073    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10074    /// tokens for more than one scope.
10075    ///
10076    /// Usually there is more than one suitable scope to authorize an operation, some of which may
10077    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10078    /// sufficient, a read-write scope will do as well.
10079    pub fn add_scope<St>(mut self, scope: St) -> CustomerProfileGetCall<'a, C>
10080    where
10081        St: AsRef<str>,
10082    {
10083        self._scopes.insert(String::from(scope.as_ref()));
10084        self
10085    }
10086    /// Identifies the authorization scope(s) for the method you are building.
10087    ///
10088    /// See [`Self::add_scope()`] for details.
10089    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerProfileGetCall<'a, C>
10090    where
10091        I: IntoIterator<Item = St>,
10092        St: AsRef<str>,
10093    {
10094        self._scopes
10095            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10096        self
10097    }
10098
10099    /// Removes all scopes, and no default scope will be used either.
10100    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10101    /// for details).
10102    pub fn clear_scopes(mut self) -> CustomerProfileGetCall<'a, C> {
10103        self._scopes.clear();
10104        self
10105    }
10106}
10107
10108/// Lists Chrome browser profiles of a customer based on the given search and sorting criteria.
10109///
10110/// A builder for the *profiles.list* method supported by a *customer* resource.
10111/// It is not used directly, but through a [`CustomerMethods`] instance.
10112///
10113/// # Example
10114///
10115/// Instantiate a resource method builder
10116///
10117/// ```test_harness,no_run
10118/// # extern crate hyper;
10119/// # extern crate hyper_rustls;
10120/// # extern crate google_chromemanagement1 as chromemanagement1;
10121/// # async fn dox() {
10122/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10123///
10124/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10125/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
10126/// #     .with_native_roots()
10127/// #     .unwrap()
10128/// #     .https_only()
10129/// #     .enable_http2()
10130/// #     .build();
10131///
10132/// # let executor = hyper_util::rt::TokioExecutor::new();
10133/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
10134/// #     secret,
10135/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10136/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
10137/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
10138/// #     ),
10139/// # ).build().await.unwrap();
10140///
10141/// # let client = hyper_util::client::legacy::Client::builder(
10142/// #     hyper_util::rt::TokioExecutor::new()
10143/// # )
10144/// # .build(
10145/// #     hyper_rustls::HttpsConnectorBuilder::new()
10146/// #         .with_native_roots()
10147/// #         .unwrap()
10148/// #         .https_or_http()
10149/// #         .enable_http2()
10150/// #         .build()
10151/// # );
10152/// # let mut hub = ChromeManagement::new(client, auth);
10153/// // You can configure optional parameters by calling the respective setters at will, and
10154/// // execute the final call using `doit()`.
10155/// // Values shown here are possibly random and not representative !
10156/// let result = hub.customers().profiles_list("parent")
10157///              .page_token("Lorem")
10158///              .page_size(-25)
10159///              .order_by("labore")
10160///              .filter("sed")
10161///              .doit().await;
10162/// # }
10163/// ```
10164pub struct CustomerProfileListCall<'a, C>
10165where
10166    C: 'a,
10167{
10168    hub: &'a ChromeManagement<C>,
10169    _parent: String,
10170    _page_token: Option<String>,
10171    _page_size: Option<i32>,
10172    _order_by: Option<String>,
10173    _filter: Option<String>,
10174    _delegate: Option<&'a mut dyn common::Delegate>,
10175    _additional_params: HashMap<String, String>,
10176    _scopes: BTreeSet<String>,
10177}
10178
10179impl<'a, C> common::CallBuilder for CustomerProfileListCall<'a, C> {}
10180
10181impl<'a, C> CustomerProfileListCall<'a, C>
10182where
10183    C: common::Connector,
10184{
10185    /// Perform the operation you have build so far.
10186    pub async fn doit(
10187        mut self,
10188    ) -> common::Result<(
10189        common::Response,
10190        GoogleChromeManagementVersionsV1ListChromeBrowserProfilesResponse,
10191    )> {
10192        use std::borrow::Cow;
10193        use std::io::{Read, Seek};
10194
10195        use common::{url::Params, ToParts};
10196        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10197
10198        let mut dd = common::DefaultDelegate;
10199        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10200        dlg.begin(common::MethodInfo {
10201            id: "chromemanagement.customers.profiles.list",
10202            http_method: hyper::Method::GET,
10203        });
10204
10205        for &field in [
10206            "alt",
10207            "parent",
10208            "pageToken",
10209            "pageSize",
10210            "orderBy",
10211            "filter",
10212        ]
10213        .iter()
10214        {
10215            if self._additional_params.contains_key(field) {
10216                dlg.finished(false);
10217                return Err(common::Error::FieldClash(field));
10218            }
10219        }
10220
10221        let mut params = Params::with_capacity(7 + self._additional_params.len());
10222        params.push("parent", self._parent);
10223        if let Some(value) = self._page_token.as_ref() {
10224            params.push("pageToken", value);
10225        }
10226        if let Some(value) = self._page_size.as_ref() {
10227            params.push("pageSize", value.to_string());
10228        }
10229        if let Some(value) = self._order_by.as_ref() {
10230            params.push("orderBy", value);
10231        }
10232        if let Some(value) = self._filter.as_ref() {
10233            params.push("filter", value);
10234        }
10235
10236        params.extend(self._additional_params.iter());
10237
10238        params.push("alt", "json");
10239        let mut url = self.hub._base_url.clone() + "v1/{+parent}/profiles";
10240        if self._scopes.is_empty() {
10241            self._scopes
10242                .insert(Scope::ChromeManagementProfileReadonly.as_ref().to_string());
10243        }
10244
10245        #[allow(clippy::single_element_loop)]
10246        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
10247            url = params.uri_replacement(url, param_name, find_this, true);
10248        }
10249        {
10250            let to_remove = ["parent"];
10251            params.remove_params(&to_remove);
10252        }
10253
10254        let url = params.parse_with_url(&url);
10255
10256        loop {
10257            let token = match self
10258                .hub
10259                .auth
10260                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10261                .await
10262            {
10263                Ok(token) => token,
10264                Err(e) => match dlg.token(e) {
10265                    Ok(token) => token,
10266                    Err(e) => {
10267                        dlg.finished(false);
10268                        return Err(common::Error::MissingToken(e));
10269                    }
10270                },
10271            };
10272            let mut req_result = {
10273                let client = &self.hub.client;
10274                dlg.pre_request();
10275                let mut req_builder = hyper::Request::builder()
10276                    .method(hyper::Method::GET)
10277                    .uri(url.as_str())
10278                    .header(USER_AGENT, self.hub._user_agent.clone());
10279
10280                if let Some(token) = token.as_ref() {
10281                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10282                }
10283
10284                let request = req_builder
10285                    .header(CONTENT_LENGTH, 0_u64)
10286                    .body(common::to_body::<String>(None));
10287
10288                client.request(request.unwrap()).await
10289            };
10290
10291            match req_result {
10292                Err(err) => {
10293                    if let common::Retry::After(d) = dlg.http_error(&err) {
10294                        sleep(d).await;
10295                        continue;
10296                    }
10297                    dlg.finished(false);
10298                    return Err(common::Error::HttpError(err));
10299                }
10300                Ok(res) => {
10301                    let (mut parts, body) = res.into_parts();
10302                    let mut body = common::Body::new(body);
10303                    if !parts.status.is_success() {
10304                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10305                        let error = serde_json::from_str(&common::to_string(&bytes));
10306                        let response = common::to_response(parts, bytes.into());
10307
10308                        if let common::Retry::After(d) =
10309                            dlg.http_failure(&response, error.as_ref().ok())
10310                        {
10311                            sleep(d).await;
10312                            continue;
10313                        }
10314
10315                        dlg.finished(false);
10316
10317                        return Err(match error {
10318                            Ok(value) => common::Error::BadRequest(value),
10319                            _ => common::Error::Failure(response),
10320                        });
10321                    }
10322                    let response = {
10323                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10324                        let encoded = common::to_string(&bytes);
10325                        match serde_json::from_str(&encoded) {
10326                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10327                            Err(error) => {
10328                                dlg.response_json_decode_error(&encoded, &error);
10329                                return Err(common::Error::JsonDecodeError(
10330                                    encoded.to_string(),
10331                                    error,
10332                                ));
10333                            }
10334                        }
10335                    };
10336
10337                    dlg.finished(true);
10338                    return Ok(response);
10339                }
10340            }
10341        }
10342    }
10343
10344    /// Required. Format: customers/{customer_id}
10345    ///
10346    /// Sets the *parent* path property to the given value.
10347    ///
10348    /// Even though the property as already been set when instantiating this call,
10349    /// we provide this method for API completeness.
10350    pub fn parent(mut self, new_value: &str) -> CustomerProfileListCall<'a, C> {
10351        self._parent = new_value.to_string();
10352        self
10353    }
10354    /// Optional. The page token used to retrieve a specific page of the listing request.
10355    ///
10356    /// Sets the *page token* query property to the given value.
10357    pub fn page_token(mut self, new_value: &str) -> CustomerProfileListCall<'a, C> {
10358        self._page_token = Some(new_value.to_string());
10359        self
10360    }
10361    /// Optional. The maximum number of profiles to return. The default page size is 100 if page_size is unspecified, and the maximum page size allowed is 200.
10362    ///
10363    /// Sets the *page size* query property to the given value.
10364    pub fn page_size(mut self, new_value: i32) -> CustomerProfileListCall<'a, C> {
10365        self._page_size = Some(new_value);
10366        self
10367    }
10368    /// Optional. The fields used to specify the ordering of the results. The supported fields are: - profile_id - display_name - user_email - last_activity_time - last_policy_sync_time - last_status_report_time - first_enrollment_time - os_platform_type - os_version - browser_version - browser_channel - policy_count - extension_count - identity_provider - affiliation_state - os_platform_version By default, sorting is in ascending order, to specify descending order for a field, a suffix " desc" should be added to the field name. The default ordering is the descending order of last_status_report_time.
10369    ///
10370    /// Sets the *order by* query property to the given value.
10371    pub fn order_by(mut self, new_value: &str) -> CustomerProfileListCall<'a, C> {
10372        self._order_by = Some(new_value.to_string());
10373        self
10374    }
10375    /// Optional. The filter used to filter profiles. The following fields can be used in the filter: - profile_id - display_name - user_email - last_activity_time - last_policy_sync_time - last_status_report_time - first_enrollment_time - os_platform_type - os_version - browser_version - browser_channel - policy_count - extension_count - identity_provider - affiliation_state - os_platform_version - ouId Any of the above fields can be used to specify a filter, and filtering by multiple fields is supported with AND operator. String type fields and enum type fields support '=' and '!=' operators. The integer type and the timestamp type fields support '=', '!=', '<', '>', '<=' and '>=' operators. Timestamps expect an RFC-3339 formatted string (e.g. 2012-04-21T11:30:00-04:00). Wildcard '*' can be used with a string type field filter. In addition, string literal filtering is also supported, for example, 'ABC' as a filter maps to a filter that checks if any of the filterable string type fields contains 'ABC'. Organization unit number can be used as a filtering criteria here by specifying 'ouId = ${your_org_unit_id}', please note that only single OU ID matching is supported.
10376    ///
10377    /// Sets the *filter* query property to the given value.
10378    pub fn filter(mut self, new_value: &str) -> CustomerProfileListCall<'a, C> {
10379        self._filter = Some(new_value.to_string());
10380        self
10381    }
10382    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10383    /// while executing the actual API request.
10384    ///
10385    /// ````text
10386    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
10387    /// ````
10388    ///
10389    /// Sets the *delegate* property to the given value.
10390    pub fn delegate(
10391        mut self,
10392        new_value: &'a mut dyn common::Delegate,
10393    ) -> CustomerProfileListCall<'a, C> {
10394        self._delegate = Some(new_value);
10395        self
10396    }
10397
10398    /// Set any additional parameter of the query string used in the request.
10399    /// It should be used to set parameters which are not yet available through their own
10400    /// setters.
10401    ///
10402    /// Please note that this method must not be used to set any of the known parameters
10403    /// which have their own setter method. If done anyway, the request will fail.
10404    ///
10405    /// # Additional Parameters
10406    ///
10407    /// * *$.xgafv* (query-string) - V1 error format.
10408    /// * *access_token* (query-string) - OAuth access token.
10409    /// * *alt* (query-string) - Data format for response.
10410    /// * *callback* (query-string) - JSONP
10411    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10412    /// * *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.
10413    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10414    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10415    /// * *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.
10416    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10417    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10418    pub fn param<T>(mut self, name: T, value: T) -> CustomerProfileListCall<'a, C>
10419    where
10420        T: AsRef<str>,
10421    {
10422        self._additional_params
10423            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10424        self
10425    }
10426
10427    /// Identifies the authorization scope for the method you are building.
10428    ///
10429    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10430    /// [`Scope::ChromeManagementProfileReadonly`].
10431    ///
10432    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10433    /// tokens for more than one scope.
10434    ///
10435    /// Usually there is more than one suitable scope to authorize an operation, some of which may
10436    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10437    /// sufficient, a read-write scope will do as well.
10438    pub fn add_scope<St>(mut self, scope: St) -> CustomerProfileListCall<'a, C>
10439    where
10440        St: AsRef<str>,
10441    {
10442        self._scopes.insert(String::from(scope.as_ref()));
10443        self
10444    }
10445    /// Identifies the authorization scope(s) for the method you are building.
10446    ///
10447    /// See [`Self::add_scope()`] for details.
10448    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerProfileListCall<'a, C>
10449    where
10450        I: IntoIterator<Item = St>,
10451        St: AsRef<str>,
10452    {
10453        self._scopes
10454            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10455        self
10456    }
10457
10458    /// Removes all scopes, and no default scope will be used either.
10459    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10460    /// for details).
10461    pub fn clear_scopes(mut self) -> CustomerProfileListCall<'a, C> {
10462        self._scopes.clear();
10463        self
10464    }
10465}
10466
10467/// Get a count of active devices per set time frames.
10468///
10469/// A builder for the *reports.countActiveDevices* method supported by a *customer* resource.
10470/// It is not used directly, but through a [`CustomerMethods`] instance.
10471///
10472/// # Example
10473///
10474/// Instantiate a resource method builder
10475///
10476/// ```test_harness,no_run
10477/// # extern crate hyper;
10478/// # extern crate hyper_rustls;
10479/// # extern crate google_chromemanagement1 as chromemanagement1;
10480/// # async fn dox() {
10481/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10482///
10483/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10484/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
10485/// #     .with_native_roots()
10486/// #     .unwrap()
10487/// #     .https_only()
10488/// #     .enable_http2()
10489/// #     .build();
10490///
10491/// # let executor = hyper_util::rt::TokioExecutor::new();
10492/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
10493/// #     secret,
10494/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10495/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
10496/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
10497/// #     ),
10498/// # ).build().await.unwrap();
10499///
10500/// # let client = hyper_util::client::legacy::Client::builder(
10501/// #     hyper_util::rt::TokioExecutor::new()
10502/// # )
10503/// # .build(
10504/// #     hyper_rustls::HttpsConnectorBuilder::new()
10505/// #         .with_native_roots()
10506/// #         .unwrap()
10507/// #         .https_or_http()
10508/// #         .enable_http2()
10509/// #         .build()
10510/// # );
10511/// # let mut hub = ChromeManagement::new(client, auth);
10512/// // You can configure optional parameters by calling the respective setters at will, and
10513/// // execute the final call using `doit()`.
10514/// // Values shown here are possibly random and not representative !
10515/// let result = hub.customers().reports_count_active_devices("customer")
10516///              .date_year(-80)
10517///              .date_month(-61)
10518///              .date_day(-15)
10519///              .doit().await;
10520/// # }
10521/// ```
10522pub struct CustomerReportCountActiveDeviceCall<'a, C>
10523where
10524    C: 'a,
10525{
10526    hub: &'a ChromeManagement<C>,
10527    _customer: String,
10528    _date_year: Option<i32>,
10529    _date_month: Option<i32>,
10530    _date_day: Option<i32>,
10531    _delegate: Option<&'a mut dyn common::Delegate>,
10532    _additional_params: HashMap<String, String>,
10533    _scopes: BTreeSet<String>,
10534}
10535
10536impl<'a, C> common::CallBuilder for CustomerReportCountActiveDeviceCall<'a, C> {}
10537
10538impl<'a, C> CustomerReportCountActiveDeviceCall<'a, C>
10539where
10540    C: common::Connector,
10541{
10542    /// Perform the operation you have build so far.
10543    pub async fn doit(
10544        mut self,
10545    ) -> common::Result<(
10546        common::Response,
10547        GoogleChromeManagementV1CountActiveDevicesResponse,
10548    )> {
10549        use std::borrow::Cow;
10550        use std::io::{Read, Seek};
10551
10552        use common::{url::Params, ToParts};
10553        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10554
10555        let mut dd = common::DefaultDelegate;
10556        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10557        dlg.begin(common::MethodInfo {
10558            id: "chromemanagement.customers.reports.countActiveDevices",
10559            http_method: hyper::Method::GET,
10560        });
10561
10562        for &field in ["alt", "customer", "date.year", "date.month", "date.day"].iter() {
10563            if self._additional_params.contains_key(field) {
10564                dlg.finished(false);
10565                return Err(common::Error::FieldClash(field));
10566            }
10567        }
10568
10569        let mut params = Params::with_capacity(6 + self._additional_params.len());
10570        params.push("customer", self._customer);
10571        if let Some(value) = self._date_year.as_ref() {
10572            params.push("date.year", value.to_string());
10573        }
10574        if let Some(value) = self._date_month.as_ref() {
10575            params.push("date.month", value.to_string());
10576        }
10577        if let Some(value) = self._date_day.as_ref() {
10578            params.push("date.day", value.to_string());
10579        }
10580
10581        params.extend(self._additional_params.iter());
10582
10583        params.push("alt", "json");
10584        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countActiveDevices";
10585        if self._scopes.is_empty() {
10586            self._scopes
10587                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
10588        }
10589
10590        #[allow(clippy::single_element_loop)]
10591        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
10592            url = params.uri_replacement(url, param_name, find_this, true);
10593        }
10594        {
10595            let to_remove = ["customer"];
10596            params.remove_params(&to_remove);
10597        }
10598
10599        let url = params.parse_with_url(&url);
10600
10601        loop {
10602            let token = match self
10603                .hub
10604                .auth
10605                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10606                .await
10607            {
10608                Ok(token) => token,
10609                Err(e) => match dlg.token(e) {
10610                    Ok(token) => token,
10611                    Err(e) => {
10612                        dlg.finished(false);
10613                        return Err(common::Error::MissingToken(e));
10614                    }
10615                },
10616            };
10617            let mut req_result = {
10618                let client = &self.hub.client;
10619                dlg.pre_request();
10620                let mut req_builder = hyper::Request::builder()
10621                    .method(hyper::Method::GET)
10622                    .uri(url.as_str())
10623                    .header(USER_AGENT, self.hub._user_agent.clone());
10624
10625                if let Some(token) = token.as_ref() {
10626                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10627                }
10628
10629                let request = req_builder
10630                    .header(CONTENT_LENGTH, 0_u64)
10631                    .body(common::to_body::<String>(None));
10632
10633                client.request(request.unwrap()).await
10634            };
10635
10636            match req_result {
10637                Err(err) => {
10638                    if let common::Retry::After(d) = dlg.http_error(&err) {
10639                        sleep(d).await;
10640                        continue;
10641                    }
10642                    dlg.finished(false);
10643                    return Err(common::Error::HttpError(err));
10644                }
10645                Ok(res) => {
10646                    let (mut parts, body) = res.into_parts();
10647                    let mut body = common::Body::new(body);
10648                    if !parts.status.is_success() {
10649                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10650                        let error = serde_json::from_str(&common::to_string(&bytes));
10651                        let response = common::to_response(parts, bytes.into());
10652
10653                        if let common::Retry::After(d) =
10654                            dlg.http_failure(&response, error.as_ref().ok())
10655                        {
10656                            sleep(d).await;
10657                            continue;
10658                        }
10659
10660                        dlg.finished(false);
10661
10662                        return Err(match error {
10663                            Ok(value) => common::Error::BadRequest(value),
10664                            _ => common::Error::Failure(response),
10665                        });
10666                    }
10667                    let response = {
10668                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10669                        let encoded = common::to_string(&bytes);
10670                        match serde_json::from_str(&encoded) {
10671                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
10672                            Err(error) => {
10673                                dlg.response_json_decode_error(&encoded, &error);
10674                                return Err(common::Error::JsonDecodeError(
10675                                    encoded.to_string(),
10676                                    error,
10677                                ));
10678                            }
10679                        }
10680                    };
10681
10682                    dlg.finished(true);
10683                    return Ok(response);
10684                }
10685            }
10686        }
10687    }
10688
10689    /// Required. Obfuscated customer ID prefixed with "customers/C" or "customers/my_customer".
10690    ///
10691    /// Sets the *customer* path property to the given value.
10692    ///
10693    /// Even though the property as already been set when instantiating this call,
10694    /// we provide this method for API completeness.
10695    pub fn customer(mut self, new_value: &str) -> CustomerReportCountActiveDeviceCall<'a, C> {
10696        self._customer = new_value.to_string();
10697        self
10698    }
10699    /// Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
10700    ///
10701    /// Sets the *date.year* query property to the given value.
10702    pub fn date_year(mut self, new_value: i32) -> CustomerReportCountActiveDeviceCall<'a, C> {
10703        self._date_year = Some(new_value);
10704        self
10705    }
10706    /// Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
10707    ///
10708    /// Sets the *date.month* query property to the given value.
10709    pub fn date_month(mut self, new_value: i32) -> CustomerReportCountActiveDeviceCall<'a, C> {
10710        self._date_month = Some(new_value);
10711        self
10712    }
10713    /// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
10714    ///
10715    /// Sets the *date.day* query property to the given value.
10716    pub fn date_day(mut self, new_value: i32) -> CustomerReportCountActiveDeviceCall<'a, C> {
10717        self._date_day = Some(new_value);
10718        self
10719    }
10720    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
10721    /// while executing the actual API request.
10722    ///
10723    /// ````text
10724    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
10725    /// ````
10726    ///
10727    /// Sets the *delegate* property to the given value.
10728    pub fn delegate(
10729        mut self,
10730        new_value: &'a mut dyn common::Delegate,
10731    ) -> CustomerReportCountActiveDeviceCall<'a, C> {
10732        self._delegate = Some(new_value);
10733        self
10734    }
10735
10736    /// Set any additional parameter of the query string used in the request.
10737    /// It should be used to set parameters which are not yet available through their own
10738    /// setters.
10739    ///
10740    /// Please note that this method must not be used to set any of the known parameters
10741    /// which have their own setter method. If done anyway, the request will fail.
10742    ///
10743    /// # Additional Parameters
10744    ///
10745    /// * *$.xgafv* (query-string) - V1 error format.
10746    /// * *access_token* (query-string) - OAuth access token.
10747    /// * *alt* (query-string) - Data format for response.
10748    /// * *callback* (query-string) - JSONP
10749    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
10750    /// * *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.
10751    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
10752    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
10753    /// * *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.
10754    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
10755    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
10756    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountActiveDeviceCall<'a, C>
10757    where
10758        T: AsRef<str>,
10759    {
10760        self._additional_params
10761            .insert(name.as_ref().to_string(), value.as_ref().to_string());
10762        self
10763    }
10764
10765    /// Identifies the authorization scope for the method you are building.
10766    ///
10767    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
10768    /// [`Scope::ChromeManagementReportReadonly`].
10769    ///
10770    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
10771    /// tokens for more than one scope.
10772    ///
10773    /// Usually there is more than one suitable scope to authorize an operation, some of which may
10774    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
10775    /// sufficient, a read-write scope will do as well.
10776    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountActiveDeviceCall<'a, C>
10777    where
10778        St: AsRef<str>,
10779    {
10780        self._scopes.insert(String::from(scope.as_ref()));
10781        self
10782    }
10783    /// Identifies the authorization scope(s) for the method you are building.
10784    ///
10785    /// See [`Self::add_scope()`] for details.
10786    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportCountActiveDeviceCall<'a, C>
10787    where
10788        I: IntoIterator<Item = St>,
10789        St: AsRef<str>,
10790    {
10791        self._scopes
10792            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
10793        self
10794    }
10795
10796    /// Removes all scopes, and no default scope will be used either.
10797    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
10798    /// for details).
10799    pub fn clear_scopes(mut self) -> CustomerReportCountActiveDeviceCall<'a, C> {
10800        self._scopes.clear();
10801        self
10802    }
10803}
10804
10805/// Count of Chrome Browsers that have been recently enrolled, have new policy to be synced, or have no recent activity.
10806///
10807/// A builder for the *reports.countChromeBrowsersNeedingAttention* method supported by a *customer* resource.
10808/// It is not used directly, but through a [`CustomerMethods`] instance.
10809///
10810/// # Example
10811///
10812/// Instantiate a resource method builder
10813///
10814/// ```test_harness,no_run
10815/// # extern crate hyper;
10816/// # extern crate hyper_rustls;
10817/// # extern crate google_chromemanagement1 as chromemanagement1;
10818/// # async fn dox() {
10819/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
10820///
10821/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
10822/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
10823/// #     .with_native_roots()
10824/// #     .unwrap()
10825/// #     .https_only()
10826/// #     .enable_http2()
10827/// #     .build();
10828///
10829/// # let executor = hyper_util::rt::TokioExecutor::new();
10830/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
10831/// #     secret,
10832/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
10833/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
10834/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
10835/// #     ),
10836/// # ).build().await.unwrap();
10837///
10838/// # let client = hyper_util::client::legacy::Client::builder(
10839/// #     hyper_util::rt::TokioExecutor::new()
10840/// # )
10841/// # .build(
10842/// #     hyper_rustls::HttpsConnectorBuilder::new()
10843/// #         .with_native_roots()
10844/// #         .unwrap()
10845/// #         .https_or_http()
10846/// #         .enable_http2()
10847/// #         .build()
10848/// # );
10849/// # let mut hub = ChromeManagement::new(client, auth);
10850/// // You can configure optional parameters by calling the respective setters at will, and
10851/// // execute the final call using `doit()`.
10852/// // Values shown here are possibly random and not representative !
10853/// let result = hub.customers().reports_count_chrome_browsers_needing_attention("customer")
10854///              .org_unit_id("et")
10855///              .doit().await;
10856/// # }
10857/// ```
10858pub struct CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C>
10859where
10860    C: 'a,
10861{
10862    hub: &'a ChromeManagement<C>,
10863    _customer: String,
10864    _org_unit_id: Option<String>,
10865    _delegate: Option<&'a mut dyn common::Delegate>,
10866    _additional_params: HashMap<String, String>,
10867    _scopes: BTreeSet<String>,
10868}
10869
10870impl<'a, C> common::CallBuilder for CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C> {}
10871
10872impl<'a, C> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C>
10873where
10874    C: common::Connector,
10875{
10876    /// Perform the operation you have build so far.
10877    pub async fn doit(
10878        mut self,
10879    ) -> common::Result<(
10880        common::Response,
10881        GoogleChromeManagementV1CountChromeBrowsersNeedingAttentionResponse,
10882    )> {
10883        use std::borrow::Cow;
10884        use std::io::{Read, Seek};
10885
10886        use common::{url::Params, ToParts};
10887        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
10888
10889        let mut dd = common::DefaultDelegate;
10890        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
10891        dlg.begin(common::MethodInfo {
10892            id: "chromemanagement.customers.reports.countChromeBrowsersNeedingAttention",
10893            http_method: hyper::Method::GET,
10894        });
10895
10896        for &field in ["alt", "customer", "orgUnitId"].iter() {
10897            if self._additional_params.contains_key(field) {
10898                dlg.finished(false);
10899                return Err(common::Error::FieldClash(field));
10900            }
10901        }
10902
10903        let mut params = Params::with_capacity(4 + self._additional_params.len());
10904        params.push("customer", self._customer);
10905        if let Some(value) = self._org_unit_id.as_ref() {
10906            params.push("orgUnitId", value);
10907        }
10908
10909        params.extend(self._additional_params.iter());
10910
10911        params.push("alt", "json");
10912        let mut url = self.hub._base_url.clone()
10913            + "v1/{+customer}/reports:countChromeBrowsersNeedingAttention";
10914        if self._scopes.is_empty() {
10915            self._scopes
10916                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
10917        }
10918
10919        #[allow(clippy::single_element_loop)]
10920        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
10921            url = params.uri_replacement(url, param_name, find_this, true);
10922        }
10923        {
10924            let to_remove = ["customer"];
10925            params.remove_params(&to_remove);
10926        }
10927
10928        let url = params.parse_with_url(&url);
10929
10930        loop {
10931            let token = match self
10932                .hub
10933                .auth
10934                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
10935                .await
10936            {
10937                Ok(token) => token,
10938                Err(e) => match dlg.token(e) {
10939                    Ok(token) => token,
10940                    Err(e) => {
10941                        dlg.finished(false);
10942                        return Err(common::Error::MissingToken(e));
10943                    }
10944                },
10945            };
10946            let mut req_result = {
10947                let client = &self.hub.client;
10948                dlg.pre_request();
10949                let mut req_builder = hyper::Request::builder()
10950                    .method(hyper::Method::GET)
10951                    .uri(url.as_str())
10952                    .header(USER_AGENT, self.hub._user_agent.clone());
10953
10954                if let Some(token) = token.as_ref() {
10955                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
10956                }
10957
10958                let request = req_builder
10959                    .header(CONTENT_LENGTH, 0_u64)
10960                    .body(common::to_body::<String>(None));
10961
10962                client.request(request.unwrap()).await
10963            };
10964
10965            match req_result {
10966                Err(err) => {
10967                    if let common::Retry::After(d) = dlg.http_error(&err) {
10968                        sleep(d).await;
10969                        continue;
10970                    }
10971                    dlg.finished(false);
10972                    return Err(common::Error::HttpError(err));
10973                }
10974                Ok(res) => {
10975                    let (mut parts, body) = res.into_parts();
10976                    let mut body = common::Body::new(body);
10977                    if !parts.status.is_success() {
10978                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10979                        let error = serde_json::from_str(&common::to_string(&bytes));
10980                        let response = common::to_response(parts, bytes.into());
10981
10982                        if let common::Retry::After(d) =
10983                            dlg.http_failure(&response, error.as_ref().ok())
10984                        {
10985                            sleep(d).await;
10986                            continue;
10987                        }
10988
10989                        dlg.finished(false);
10990
10991                        return Err(match error {
10992                            Ok(value) => common::Error::BadRequest(value),
10993                            _ => common::Error::Failure(response),
10994                        });
10995                    }
10996                    let response = {
10997                        let bytes = common::to_bytes(body).await.unwrap_or_default();
10998                        let encoded = common::to_string(&bytes);
10999                        match serde_json::from_str(&encoded) {
11000                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11001                            Err(error) => {
11002                                dlg.response_json_decode_error(&encoded, &error);
11003                                return Err(common::Error::JsonDecodeError(
11004                                    encoded.to_string(),
11005                                    error,
11006                                ));
11007                            }
11008                        }
11009                    };
11010
11011                    dlg.finished(true);
11012                    return Ok(response);
11013                }
11014            }
11015        }
11016    }
11017
11018    /// Required. The customer ID or "my_customer" prefixed with "customers/".
11019    ///
11020    /// Sets the *customer* path property to the given value.
11021    ///
11022    /// Even though the property as already been set when instantiating this call,
11023    /// we provide this method for API completeness.
11024    pub fn customer(
11025        mut self,
11026        new_value: &str,
11027    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C> {
11028        self._customer = new_value.to_string();
11029        self
11030    }
11031    /// Optional. The ID of the organizational unit. If omitted, all data will be returned.
11032    ///
11033    /// Sets the *org unit id* query property to the given value.
11034    pub fn org_unit_id(
11035        mut self,
11036        new_value: &str,
11037    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C> {
11038        self._org_unit_id = Some(new_value.to_string());
11039        self
11040    }
11041    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11042    /// while executing the actual API request.
11043    ///
11044    /// ````text
11045    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
11046    /// ````
11047    ///
11048    /// Sets the *delegate* property to the given value.
11049    pub fn delegate(
11050        mut self,
11051        new_value: &'a mut dyn common::Delegate,
11052    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C> {
11053        self._delegate = Some(new_value);
11054        self
11055    }
11056
11057    /// Set any additional parameter of the query string used in the request.
11058    /// It should be used to set parameters which are not yet available through their own
11059    /// setters.
11060    ///
11061    /// Please note that this method must not be used to set any of the known parameters
11062    /// which have their own setter method. If done anyway, the request will fail.
11063    ///
11064    /// # Additional Parameters
11065    ///
11066    /// * *$.xgafv* (query-string) - V1 error format.
11067    /// * *access_token* (query-string) - OAuth access token.
11068    /// * *alt* (query-string) - Data format for response.
11069    /// * *callback* (query-string) - JSONP
11070    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11071    /// * *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.
11072    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11073    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11074    /// * *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.
11075    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11076    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11077    pub fn param<T>(
11078        mut self,
11079        name: T,
11080        value: T,
11081    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C>
11082    where
11083        T: AsRef<str>,
11084    {
11085        self._additional_params
11086            .insert(name.as_ref().to_string(), value.as_ref().to_string());
11087        self
11088    }
11089
11090    /// Identifies the authorization scope for the method you are building.
11091    ///
11092    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11093    /// [`Scope::ChromeManagementReportReadonly`].
11094    ///
11095    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11096    /// tokens for more than one scope.
11097    ///
11098    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11099    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11100    /// sufficient, a read-write scope will do as well.
11101    pub fn add_scope<St>(
11102        mut self,
11103        scope: St,
11104    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C>
11105    where
11106        St: AsRef<str>,
11107    {
11108        self._scopes.insert(String::from(scope.as_ref()));
11109        self
11110    }
11111    /// Identifies the authorization scope(s) for the method you are building.
11112    ///
11113    /// See [`Self::add_scope()`] for details.
11114    pub fn add_scopes<I, St>(
11115        mut self,
11116        scopes: I,
11117    ) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C>
11118    where
11119        I: IntoIterator<Item = St>,
11120        St: AsRef<str>,
11121    {
11122        self._scopes
11123            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11124        self
11125    }
11126
11127    /// Removes all scopes, and no default scope will be used either.
11128    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11129    /// for details).
11130    pub fn clear_scopes(mut self) -> CustomerReportCountChromeBrowsersNeedingAttentionCall<'a, C> {
11131        self._scopes.clear();
11132        self
11133    }
11134}
11135
11136/// Get a count of Chrome crash events.
11137///
11138/// A builder for the *reports.countChromeCrashEvents* method supported by a *customer* resource.
11139/// It is not used directly, but through a [`CustomerMethods`] instance.
11140///
11141/// # Example
11142///
11143/// Instantiate a resource method builder
11144///
11145/// ```test_harness,no_run
11146/// # extern crate hyper;
11147/// # extern crate hyper_rustls;
11148/// # extern crate google_chromemanagement1 as chromemanagement1;
11149/// # async fn dox() {
11150/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11151///
11152/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11153/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
11154/// #     .with_native_roots()
11155/// #     .unwrap()
11156/// #     .https_only()
11157/// #     .enable_http2()
11158/// #     .build();
11159///
11160/// # let executor = hyper_util::rt::TokioExecutor::new();
11161/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
11162/// #     secret,
11163/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11164/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
11165/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
11166/// #     ),
11167/// # ).build().await.unwrap();
11168///
11169/// # let client = hyper_util::client::legacy::Client::builder(
11170/// #     hyper_util::rt::TokioExecutor::new()
11171/// # )
11172/// # .build(
11173/// #     hyper_rustls::HttpsConnectorBuilder::new()
11174/// #         .with_native_roots()
11175/// #         .unwrap()
11176/// #         .https_or_http()
11177/// #         .enable_http2()
11178/// #         .build()
11179/// # );
11180/// # let mut hub = ChromeManagement::new(client, auth);
11181/// // You can configure optional parameters by calling the respective setters at will, and
11182/// // execute the final call using `doit()`.
11183/// // Values shown here are possibly random and not representative !
11184/// let result = hub.customers().reports_count_chrome_crash_events("customer")
11185///              .org_unit_id("et")
11186///              .order_by("et")
11187///              .filter("vero")
11188///              .doit().await;
11189/// # }
11190/// ```
11191pub struct CustomerReportCountChromeCrashEventCall<'a, C>
11192where
11193    C: 'a,
11194{
11195    hub: &'a ChromeManagement<C>,
11196    _customer: String,
11197    _org_unit_id: Option<String>,
11198    _order_by: Option<String>,
11199    _filter: Option<String>,
11200    _delegate: Option<&'a mut dyn common::Delegate>,
11201    _additional_params: HashMap<String, String>,
11202    _scopes: BTreeSet<String>,
11203}
11204
11205impl<'a, C> common::CallBuilder for CustomerReportCountChromeCrashEventCall<'a, C> {}
11206
11207impl<'a, C> CustomerReportCountChromeCrashEventCall<'a, C>
11208where
11209    C: common::Connector,
11210{
11211    /// Perform the operation you have build so far.
11212    pub async fn doit(
11213        mut self,
11214    ) -> common::Result<(
11215        common::Response,
11216        GoogleChromeManagementV1CountChromeCrashEventsResponse,
11217    )> {
11218        use std::borrow::Cow;
11219        use std::io::{Read, Seek};
11220
11221        use common::{url::Params, ToParts};
11222        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11223
11224        let mut dd = common::DefaultDelegate;
11225        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11226        dlg.begin(common::MethodInfo {
11227            id: "chromemanagement.customers.reports.countChromeCrashEvents",
11228            http_method: hyper::Method::GET,
11229        });
11230
11231        for &field in ["alt", "customer", "orgUnitId", "orderBy", "filter"].iter() {
11232            if self._additional_params.contains_key(field) {
11233                dlg.finished(false);
11234                return Err(common::Error::FieldClash(field));
11235            }
11236        }
11237
11238        let mut params = Params::with_capacity(6 + self._additional_params.len());
11239        params.push("customer", self._customer);
11240        if let Some(value) = self._org_unit_id.as_ref() {
11241            params.push("orgUnitId", value);
11242        }
11243        if let Some(value) = self._order_by.as_ref() {
11244            params.push("orderBy", value);
11245        }
11246        if let Some(value) = self._filter.as_ref() {
11247            params.push("filter", value);
11248        }
11249
11250        params.extend(self._additional_params.iter());
11251
11252        params.push("alt", "json");
11253        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countChromeCrashEvents";
11254        if self._scopes.is_empty() {
11255            self._scopes
11256                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
11257        }
11258
11259        #[allow(clippy::single_element_loop)]
11260        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
11261            url = params.uri_replacement(url, param_name, find_this, true);
11262        }
11263        {
11264            let to_remove = ["customer"];
11265            params.remove_params(&to_remove);
11266        }
11267
11268        let url = params.parse_with_url(&url);
11269
11270        loop {
11271            let token = match self
11272                .hub
11273                .auth
11274                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11275                .await
11276            {
11277                Ok(token) => token,
11278                Err(e) => match dlg.token(e) {
11279                    Ok(token) => token,
11280                    Err(e) => {
11281                        dlg.finished(false);
11282                        return Err(common::Error::MissingToken(e));
11283                    }
11284                },
11285            };
11286            let mut req_result = {
11287                let client = &self.hub.client;
11288                dlg.pre_request();
11289                let mut req_builder = hyper::Request::builder()
11290                    .method(hyper::Method::GET)
11291                    .uri(url.as_str())
11292                    .header(USER_AGENT, self.hub._user_agent.clone());
11293
11294                if let Some(token) = token.as_ref() {
11295                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11296                }
11297
11298                let request = req_builder
11299                    .header(CONTENT_LENGTH, 0_u64)
11300                    .body(common::to_body::<String>(None));
11301
11302                client.request(request.unwrap()).await
11303            };
11304
11305            match req_result {
11306                Err(err) => {
11307                    if let common::Retry::After(d) = dlg.http_error(&err) {
11308                        sleep(d).await;
11309                        continue;
11310                    }
11311                    dlg.finished(false);
11312                    return Err(common::Error::HttpError(err));
11313                }
11314                Ok(res) => {
11315                    let (mut parts, body) = res.into_parts();
11316                    let mut body = common::Body::new(body);
11317                    if !parts.status.is_success() {
11318                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11319                        let error = serde_json::from_str(&common::to_string(&bytes));
11320                        let response = common::to_response(parts, bytes.into());
11321
11322                        if let common::Retry::After(d) =
11323                            dlg.http_failure(&response, error.as_ref().ok())
11324                        {
11325                            sleep(d).await;
11326                            continue;
11327                        }
11328
11329                        dlg.finished(false);
11330
11331                        return Err(match error {
11332                            Ok(value) => common::Error::BadRequest(value),
11333                            _ => common::Error::Failure(response),
11334                        });
11335                    }
11336                    let response = {
11337                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11338                        let encoded = common::to_string(&bytes);
11339                        match serde_json::from_str(&encoded) {
11340                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11341                            Err(error) => {
11342                                dlg.response_json_decode_error(&encoded, &error);
11343                                return Err(common::Error::JsonDecodeError(
11344                                    encoded.to_string(),
11345                                    error,
11346                                ));
11347                            }
11348                        }
11349                    };
11350
11351                    dlg.finished(true);
11352                    return Ok(response);
11353                }
11354            }
11355        }
11356    }
11357
11358    /// Customer ID.
11359    ///
11360    /// Sets the *customer* path property to the given value.
11361    ///
11362    /// Even though the property as already been set when instantiating this call,
11363    /// we provide this method for API completeness.
11364    pub fn customer(mut self, new_value: &str) -> CustomerReportCountChromeCrashEventCall<'a, C> {
11365        self._customer = new_value.to_string();
11366        self
11367    }
11368    /// If specified, only count the number of crash events of the devices in this organizational unit.
11369    ///
11370    /// Sets the *org unit id* query property to the given value.
11371    pub fn org_unit_id(
11372        mut self,
11373        new_value: &str,
11374    ) -> CustomerReportCountChromeCrashEventCall<'a, C> {
11375        self._org_unit_id = Some(new_value.to_string());
11376        self
11377    }
11378    /// Field used to order results. Supported order by fields: * browser_version * count * date
11379    ///
11380    /// Sets the *order by* query property to the given value.
11381    pub fn order_by(mut self, new_value: &str) -> CustomerReportCountChromeCrashEventCall<'a, C> {
11382        self._order_by = Some(new_value.to_string());
11383        self
11384    }
11385    /// Query string to filter results, AND-separated fields in EBNF syntax. Supported filter fields: * major_browser_version * minor_browser_version * browser_channel * device_platform * past_number_days Example: `major_browser_version = 'M115' AND past_number_days = '28'`.
11386    ///
11387    /// Sets the *filter* query property to the given value.
11388    pub fn filter(mut self, new_value: &str) -> CustomerReportCountChromeCrashEventCall<'a, C> {
11389        self._filter = Some(new_value.to_string());
11390        self
11391    }
11392    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11393    /// while executing the actual API request.
11394    ///
11395    /// ````text
11396    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
11397    /// ````
11398    ///
11399    /// Sets the *delegate* property to the given value.
11400    pub fn delegate(
11401        mut self,
11402        new_value: &'a mut dyn common::Delegate,
11403    ) -> CustomerReportCountChromeCrashEventCall<'a, C> {
11404        self._delegate = Some(new_value);
11405        self
11406    }
11407
11408    /// Set any additional parameter of the query string used in the request.
11409    /// It should be used to set parameters which are not yet available through their own
11410    /// setters.
11411    ///
11412    /// Please note that this method must not be used to set any of the known parameters
11413    /// which have their own setter method. If done anyway, the request will fail.
11414    ///
11415    /// # Additional Parameters
11416    ///
11417    /// * *$.xgafv* (query-string) - V1 error format.
11418    /// * *access_token* (query-string) - OAuth access token.
11419    /// * *alt* (query-string) - Data format for response.
11420    /// * *callback* (query-string) - JSONP
11421    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11422    /// * *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.
11423    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11424    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11425    /// * *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.
11426    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11427    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11428    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountChromeCrashEventCall<'a, C>
11429    where
11430        T: AsRef<str>,
11431    {
11432        self._additional_params
11433            .insert(name.as_ref().to_string(), value.as_ref().to_string());
11434        self
11435    }
11436
11437    /// Identifies the authorization scope for the method you are building.
11438    ///
11439    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11440    /// [`Scope::ChromeManagementReportReadonly`].
11441    ///
11442    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11443    /// tokens for more than one scope.
11444    ///
11445    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11446    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11447    /// sufficient, a read-write scope will do as well.
11448    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountChromeCrashEventCall<'a, C>
11449    where
11450        St: AsRef<str>,
11451    {
11452        self._scopes.insert(String::from(scope.as_ref()));
11453        self
11454    }
11455    /// Identifies the authorization scope(s) for the method you are building.
11456    ///
11457    /// See [`Self::add_scope()`] for details.
11458    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportCountChromeCrashEventCall<'a, C>
11459    where
11460        I: IntoIterator<Item = St>,
11461        St: AsRef<str>,
11462    {
11463        self._scopes
11464            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11465        self
11466    }
11467
11468    /// Removes all scopes, and no default scope will be used either.
11469    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11470    /// for details).
11471    pub fn clear_scopes(mut self) -> CustomerReportCountChromeCrashEventCall<'a, C> {
11472        self._scopes.clear();
11473        self
11474    }
11475}
11476
11477/// Generate report of the number of devices expiring in each month of the selected time frame. Devices are grouped by auto update expiration date and model. Further information can be found [here](https://support.google.com/chrome/a/answer/10564947).
11478///
11479/// A builder for the *reports.countChromeDevicesReachingAutoExpirationDate* method supported by a *customer* resource.
11480/// It is not used directly, but through a [`CustomerMethods`] instance.
11481///
11482/// # Example
11483///
11484/// Instantiate a resource method builder
11485///
11486/// ```test_harness,no_run
11487/// # extern crate hyper;
11488/// # extern crate hyper_rustls;
11489/// # extern crate google_chromemanagement1 as chromemanagement1;
11490/// # async fn dox() {
11491/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11492///
11493/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11494/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
11495/// #     .with_native_roots()
11496/// #     .unwrap()
11497/// #     .https_only()
11498/// #     .enable_http2()
11499/// #     .build();
11500///
11501/// # let executor = hyper_util::rt::TokioExecutor::new();
11502/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
11503/// #     secret,
11504/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11505/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
11506/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
11507/// #     ),
11508/// # ).build().await.unwrap();
11509///
11510/// # let client = hyper_util::client::legacy::Client::builder(
11511/// #     hyper_util::rt::TokioExecutor::new()
11512/// # )
11513/// # .build(
11514/// #     hyper_rustls::HttpsConnectorBuilder::new()
11515/// #         .with_native_roots()
11516/// #         .unwrap()
11517/// #         .https_or_http()
11518/// #         .enable_http2()
11519/// #         .build()
11520/// # );
11521/// # let mut hub = ChromeManagement::new(client, auth);
11522/// // You can configure optional parameters by calling the respective setters at will, and
11523/// // execute the final call using `doit()`.
11524/// // Values shown here are possibly random and not representative !
11525/// let result = hub.customers().reports_count_chrome_devices_reaching_auto_expiration_date("customer")
11526///              .org_unit_id("sed")
11527///              .min_aue_date("duo")
11528///              .max_aue_date("dolore")
11529///              .doit().await;
11530/// # }
11531/// ```
11532pub struct CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C>
11533where
11534    C: 'a,
11535{
11536    hub: &'a ChromeManagement<C>,
11537    _customer: String,
11538    _org_unit_id: Option<String>,
11539    _min_aue_date: Option<String>,
11540    _max_aue_date: Option<String>,
11541    _delegate: Option<&'a mut dyn common::Delegate>,
11542    _additional_params: HashMap<String, String>,
11543    _scopes: BTreeSet<String>,
11544}
11545
11546impl<'a, C> common::CallBuilder
11547    for CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C>
11548{
11549}
11550
11551impl<'a, C> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C>
11552where
11553    C: common::Connector,
11554{
11555    /// Perform the operation you have build so far.
11556    pub async fn doit(
11557        mut self,
11558    ) -> common::Result<(
11559        common::Response,
11560        GoogleChromeManagementV1CountChromeDevicesReachingAutoExpirationDateResponse,
11561    )> {
11562        use std::borrow::Cow;
11563        use std::io::{Read, Seek};
11564
11565        use common::{url::Params, ToParts};
11566        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11567
11568        let mut dd = common::DefaultDelegate;
11569        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11570        dlg.begin(common::MethodInfo {
11571            id: "chromemanagement.customers.reports.countChromeDevicesReachingAutoExpirationDate",
11572            http_method: hyper::Method::GET,
11573        });
11574
11575        for &field in ["alt", "customer", "orgUnitId", "minAueDate", "maxAueDate"].iter() {
11576            if self._additional_params.contains_key(field) {
11577                dlg.finished(false);
11578                return Err(common::Error::FieldClash(field));
11579            }
11580        }
11581
11582        let mut params = Params::with_capacity(6 + self._additional_params.len());
11583        params.push("customer", self._customer);
11584        if let Some(value) = self._org_unit_id.as_ref() {
11585            params.push("orgUnitId", value);
11586        }
11587        if let Some(value) = self._min_aue_date.as_ref() {
11588            params.push("minAueDate", value);
11589        }
11590        if let Some(value) = self._max_aue_date.as_ref() {
11591            params.push("maxAueDate", value);
11592        }
11593
11594        params.extend(self._additional_params.iter());
11595
11596        params.push("alt", "json");
11597        let mut url = self.hub._base_url.clone()
11598            + "v1/{+customer}/reports:countChromeDevicesReachingAutoExpirationDate";
11599        if self._scopes.is_empty() {
11600            self._scopes
11601                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
11602        }
11603
11604        #[allow(clippy::single_element_loop)]
11605        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
11606            url = params.uri_replacement(url, param_name, find_this, true);
11607        }
11608        {
11609            let to_remove = ["customer"];
11610            params.remove_params(&to_remove);
11611        }
11612
11613        let url = params.parse_with_url(&url);
11614
11615        loop {
11616            let token = match self
11617                .hub
11618                .auth
11619                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11620                .await
11621            {
11622                Ok(token) => token,
11623                Err(e) => match dlg.token(e) {
11624                    Ok(token) => token,
11625                    Err(e) => {
11626                        dlg.finished(false);
11627                        return Err(common::Error::MissingToken(e));
11628                    }
11629                },
11630            };
11631            let mut req_result = {
11632                let client = &self.hub.client;
11633                dlg.pre_request();
11634                let mut req_builder = hyper::Request::builder()
11635                    .method(hyper::Method::GET)
11636                    .uri(url.as_str())
11637                    .header(USER_AGENT, self.hub._user_agent.clone());
11638
11639                if let Some(token) = token.as_ref() {
11640                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11641                }
11642
11643                let request = req_builder
11644                    .header(CONTENT_LENGTH, 0_u64)
11645                    .body(common::to_body::<String>(None));
11646
11647                client.request(request.unwrap()).await
11648            };
11649
11650            match req_result {
11651                Err(err) => {
11652                    if let common::Retry::After(d) = dlg.http_error(&err) {
11653                        sleep(d).await;
11654                        continue;
11655                    }
11656                    dlg.finished(false);
11657                    return Err(common::Error::HttpError(err));
11658                }
11659                Ok(res) => {
11660                    let (mut parts, body) = res.into_parts();
11661                    let mut body = common::Body::new(body);
11662                    if !parts.status.is_success() {
11663                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11664                        let error = serde_json::from_str(&common::to_string(&bytes));
11665                        let response = common::to_response(parts, bytes.into());
11666
11667                        if let common::Retry::After(d) =
11668                            dlg.http_failure(&response, error.as_ref().ok())
11669                        {
11670                            sleep(d).await;
11671                            continue;
11672                        }
11673
11674                        dlg.finished(false);
11675
11676                        return Err(match error {
11677                            Ok(value) => common::Error::BadRequest(value),
11678                            _ => common::Error::Failure(response),
11679                        });
11680                    }
11681                    let response = {
11682                        let bytes = common::to_bytes(body).await.unwrap_or_default();
11683                        let encoded = common::to_string(&bytes);
11684                        match serde_json::from_str(&encoded) {
11685                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
11686                            Err(error) => {
11687                                dlg.response_json_decode_error(&encoded, &error);
11688                                return Err(common::Error::JsonDecodeError(
11689                                    encoded.to_string(),
11690                                    error,
11691                                ));
11692                            }
11693                        }
11694                    };
11695
11696                    dlg.finished(true);
11697                    return Ok(response);
11698                }
11699            }
11700        }
11701    }
11702
11703    /// Required. The customer ID or "my_customer" prefixed with "customers/".
11704    ///
11705    /// Sets the *customer* path property to the given value.
11706    ///
11707    /// Even though the property as already been set when instantiating this call,
11708    /// we provide this method for API completeness.
11709    pub fn customer(
11710        mut self,
11711        new_value: &str,
11712    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
11713        self._customer = new_value.to_string();
11714        self
11715    }
11716    /// Optional. The organizational unit ID, if omitted, will return data for all organizational units.
11717    ///
11718    /// Sets the *org unit id* query property to the given value.
11719    pub fn org_unit_id(
11720        mut self,
11721        new_value: &str,
11722    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
11723        self._org_unit_id = Some(new_value.to_string());
11724        self
11725    }
11726    /// Optional. Maximum expiration date in format yyyy-mm-dd in UTC timezone. If included returns all devices that have already expired and devices with auto expiration date equal to or later than the minimum date.
11727    ///
11728    /// Sets the *min aue date* query property to the given value.
11729    pub fn min_aue_date(
11730        mut self,
11731        new_value: &str,
11732    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
11733        self._min_aue_date = Some(new_value.to_string());
11734        self
11735    }
11736    /// Optional. Maximum expiration date in format yyyy-mm-dd in UTC timezone. If included returns all devices that have already expired and devices with auto expiration date equal to or earlier than the maximum date.
11737    ///
11738    /// Sets the *max aue date* query property to the given value.
11739    pub fn max_aue_date(
11740        mut self,
11741        new_value: &str,
11742    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
11743        self._max_aue_date = Some(new_value.to_string());
11744        self
11745    }
11746    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
11747    /// while executing the actual API request.
11748    ///
11749    /// ````text
11750    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
11751    /// ````
11752    ///
11753    /// Sets the *delegate* property to the given value.
11754    pub fn delegate(
11755        mut self,
11756        new_value: &'a mut dyn common::Delegate,
11757    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
11758        self._delegate = Some(new_value);
11759        self
11760    }
11761
11762    /// Set any additional parameter of the query string used in the request.
11763    /// It should be used to set parameters which are not yet available through their own
11764    /// setters.
11765    ///
11766    /// Please note that this method must not be used to set any of the known parameters
11767    /// which have their own setter method. If done anyway, the request will fail.
11768    ///
11769    /// # Additional Parameters
11770    ///
11771    /// * *$.xgafv* (query-string) - V1 error format.
11772    /// * *access_token* (query-string) - OAuth access token.
11773    /// * *alt* (query-string) - Data format for response.
11774    /// * *callback* (query-string) - JSONP
11775    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
11776    /// * *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.
11777    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
11778    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
11779    /// * *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.
11780    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
11781    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
11782    pub fn param<T>(
11783        mut self,
11784        name: T,
11785        value: T,
11786    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C>
11787    where
11788        T: AsRef<str>,
11789    {
11790        self._additional_params
11791            .insert(name.as_ref().to_string(), value.as_ref().to_string());
11792        self
11793    }
11794
11795    /// Identifies the authorization scope for the method you are building.
11796    ///
11797    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
11798    /// [`Scope::ChromeManagementReportReadonly`].
11799    ///
11800    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
11801    /// tokens for more than one scope.
11802    ///
11803    /// Usually there is more than one suitable scope to authorize an operation, some of which may
11804    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
11805    /// sufficient, a read-write scope will do as well.
11806    pub fn add_scope<St>(
11807        mut self,
11808        scope: St,
11809    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C>
11810    where
11811        St: AsRef<str>,
11812    {
11813        self._scopes.insert(String::from(scope.as_ref()));
11814        self
11815    }
11816    /// Identifies the authorization scope(s) for the method you are building.
11817    ///
11818    /// See [`Self::add_scope()`] for details.
11819    pub fn add_scopes<I, St>(
11820        mut self,
11821        scopes: I,
11822    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C>
11823    where
11824        I: IntoIterator<Item = St>,
11825        St: AsRef<str>,
11826    {
11827        self._scopes
11828            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
11829        self
11830    }
11831
11832    /// Removes all scopes, and no default scope will be used either.
11833    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
11834    /// for details).
11835    pub fn clear_scopes(
11836        mut self,
11837    ) -> CustomerReportCountChromeDevicesReachingAutoExpirationDateCall<'a, C> {
11838        self._scopes.clear();
11839        self
11840    }
11841}
11842
11843/// Counts of ChromeOS devices that have not synced policies or have lacked user activity in the past 28 days, are out of date, or are not complaint. Further information can be found here https://support.google.com/chrome/a/answer/10564947
11844///
11845/// A builder for the *reports.countChromeDevicesThatNeedAttention* method supported by a *customer* resource.
11846/// It is not used directly, but through a [`CustomerMethods`] instance.
11847///
11848/// # Example
11849///
11850/// Instantiate a resource method builder
11851///
11852/// ```test_harness,no_run
11853/// # extern crate hyper;
11854/// # extern crate hyper_rustls;
11855/// # extern crate google_chromemanagement1 as chromemanagement1;
11856/// # async fn dox() {
11857/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
11858///
11859/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
11860/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
11861/// #     .with_native_roots()
11862/// #     .unwrap()
11863/// #     .https_only()
11864/// #     .enable_http2()
11865/// #     .build();
11866///
11867/// # let executor = hyper_util::rt::TokioExecutor::new();
11868/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
11869/// #     secret,
11870/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
11871/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
11872/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
11873/// #     ),
11874/// # ).build().await.unwrap();
11875///
11876/// # let client = hyper_util::client::legacy::Client::builder(
11877/// #     hyper_util::rt::TokioExecutor::new()
11878/// # )
11879/// # .build(
11880/// #     hyper_rustls::HttpsConnectorBuilder::new()
11881/// #         .with_native_roots()
11882/// #         .unwrap()
11883/// #         .https_or_http()
11884/// #         .enable_http2()
11885/// #         .build()
11886/// # );
11887/// # let mut hub = ChromeManagement::new(client, auth);
11888/// // You can configure optional parameters by calling the respective setters at will, and
11889/// // execute the final call using `doit()`.
11890/// // Values shown here are possibly random and not representative !
11891/// let result = hub.customers().reports_count_chrome_devices_that_need_attention("customer")
11892///              .read_mask(FieldMask::new::<&str>(&[]))
11893///              .org_unit_id("voluptua.")
11894///              .doit().await;
11895/// # }
11896/// ```
11897pub struct CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C>
11898where
11899    C: 'a,
11900{
11901    hub: &'a ChromeManagement<C>,
11902    _customer: String,
11903    _read_mask: Option<common::FieldMask>,
11904    _org_unit_id: Option<String>,
11905    _delegate: Option<&'a mut dyn common::Delegate>,
11906    _additional_params: HashMap<String, String>,
11907    _scopes: BTreeSet<String>,
11908}
11909
11910impl<'a, C> common::CallBuilder for CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {}
11911
11912impl<'a, C> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C>
11913where
11914    C: common::Connector,
11915{
11916    /// Perform the operation you have build so far.
11917    pub async fn doit(
11918        mut self,
11919    ) -> common::Result<(
11920        common::Response,
11921        GoogleChromeManagementV1CountChromeDevicesThatNeedAttentionResponse,
11922    )> {
11923        use std::borrow::Cow;
11924        use std::io::{Read, Seek};
11925
11926        use common::{url::Params, ToParts};
11927        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
11928
11929        let mut dd = common::DefaultDelegate;
11930        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
11931        dlg.begin(common::MethodInfo {
11932            id: "chromemanagement.customers.reports.countChromeDevicesThatNeedAttention",
11933            http_method: hyper::Method::GET,
11934        });
11935
11936        for &field in ["alt", "customer", "readMask", "orgUnitId"].iter() {
11937            if self._additional_params.contains_key(field) {
11938                dlg.finished(false);
11939                return Err(common::Error::FieldClash(field));
11940            }
11941        }
11942
11943        let mut params = Params::with_capacity(5 + self._additional_params.len());
11944        params.push("customer", self._customer);
11945        if let Some(value) = self._read_mask.as_ref() {
11946            params.push("readMask", value.to_string());
11947        }
11948        if let Some(value) = self._org_unit_id.as_ref() {
11949            params.push("orgUnitId", value);
11950        }
11951
11952        params.extend(self._additional_params.iter());
11953
11954        params.push("alt", "json");
11955        let mut url = self.hub._base_url.clone()
11956            + "v1/{+customer}/reports:countChromeDevicesThatNeedAttention";
11957        if self._scopes.is_empty() {
11958            self._scopes
11959                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
11960        }
11961
11962        #[allow(clippy::single_element_loop)]
11963        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
11964            url = params.uri_replacement(url, param_name, find_this, true);
11965        }
11966        {
11967            let to_remove = ["customer"];
11968            params.remove_params(&to_remove);
11969        }
11970
11971        let url = params.parse_with_url(&url);
11972
11973        loop {
11974            let token = match self
11975                .hub
11976                .auth
11977                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
11978                .await
11979            {
11980                Ok(token) => token,
11981                Err(e) => match dlg.token(e) {
11982                    Ok(token) => token,
11983                    Err(e) => {
11984                        dlg.finished(false);
11985                        return Err(common::Error::MissingToken(e));
11986                    }
11987                },
11988            };
11989            let mut req_result = {
11990                let client = &self.hub.client;
11991                dlg.pre_request();
11992                let mut req_builder = hyper::Request::builder()
11993                    .method(hyper::Method::GET)
11994                    .uri(url.as_str())
11995                    .header(USER_AGENT, self.hub._user_agent.clone());
11996
11997                if let Some(token) = token.as_ref() {
11998                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
11999                }
12000
12001                let request = req_builder
12002                    .header(CONTENT_LENGTH, 0_u64)
12003                    .body(common::to_body::<String>(None));
12004
12005                client.request(request.unwrap()).await
12006            };
12007
12008            match req_result {
12009                Err(err) => {
12010                    if let common::Retry::After(d) = dlg.http_error(&err) {
12011                        sleep(d).await;
12012                        continue;
12013                    }
12014                    dlg.finished(false);
12015                    return Err(common::Error::HttpError(err));
12016                }
12017                Ok(res) => {
12018                    let (mut parts, body) = res.into_parts();
12019                    let mut body = common::Body::new(body);
12020                    if !parts.status.is_success() {
12021                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12022                        let error = serde_json::from_str(&common::to_string(&bytes));
12023                        let response = common::to_response(parts, bytes.into());
12024
12025                        if let common::Retry::After(d) =
12026                            dlg.http_failure(&response, error.as_ref().ok())
12027                        {
12028                            sleep(d).await;
12029                            continue;
12030                        }
12031
12032                        dlg.finished(false);
12033
12034                        return Err(match error {
12035                            Ok(value) => common::Error::BadRequest(value),
12036                            _ => common::Error::Failure(response),
12037                        });
12038                    }
12039                    let response = {
12040                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12041                        let encoded = common::to_string(&bytes);
12042                        match serde_json::from_str(&encoded) {
12043                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12044                            Err(error) => {
12045                                dlg.response_json_decode_error(&encoded, &error);
12046                                return Err(common::Error::JsonDecodeError(
12047                                    encoded.to_string(),
12048                                    error,
12049                                ));
12050                            }
12051                        }
12052                    };
12053
12054                    dlg.finished(true);
12055                    return Ok(response);
12056                }
12057            }
12058        }
12059    }
12060
12061    /// Required. The customer ID or "my_customer" prefixed with "customers/".
12062    ///
12063    /// Sets the *customer* path property to the given value.
12064    ///
12065    /// Even though the property as already been set when instantiating this call,
12066    /// we provide this method for API completeness.
12067    pub fn customer(
12068        mut self,
12069        new_value: &str,
12070    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {
12071        self._customer = new_value.to_string();
12072        self
12073    }
12074    /// Required. Mask of the fields that should be populated in the returned report.
12075    ///
12076    /// Sets the *read mask* query property to the given value.
12077    pub fn read_mask(
12078        mut self,
12079        new_value: common::FieldMask,
12080    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {
12081        self._read_mask = Some(new_value);
12082        self
12083    }
12084    /// Optional. The ID of the organizational unit. If omitted, all data will be returned.
12085    ///
12086    /// Sets the *org unit id* query property to the given value.
12087    pub fn org_unit_id(
12088        mut self,
12089        new_value: &str,
12090    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {
12091        self._org_unit_id = Some(new_value.to_string());
12092        self
12093    }
12094    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12095    /// while executing the actual API request.
12096    ///
12097    /// ````text
12098    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
12099    /// ````
12100    ///
12101    /// Sets the *delegate* property to the given value.
12102    pub fn delegate(
12103        mut self,
12104        new_value: &'a mut dyn common::Delegate,
12105    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {
12106        self._delegate = Some(new_value);
12107        self
12108    }
12109
12110    /// Set any additional parameter of the query string used in the request.
12111    /// It should be used to set parameters which are not yet available through their own
12112    /// setters.
12113    ///
12114    /// Please note that this method must not be used to set any of the known parameters
12115    /// which have their own setter method. If done anyway, the request will fail.
12116    ///
12117    /// # Additional Parameters
12118    ///
12119    /// * *$.xgafv* (query-string) - V1 error format.
12120    /// * *access_token* (query-string) - OAuth access token.
12121    /// * *alt* (query-string) - Data format for response.
12122    /// * *callback* (query-string) - JSONP
12123    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12124    /// * *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.
12125    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12126    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12127    /// * *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.
12128    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12129    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12130    pub fn param<T>(
12131        mut self,
12132        name: T,
12133        value: T,
12134    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C>
12135    where
12136        T: AsRef<str>,
12137    {
12138        self._additional_params
12139            .insert(name.as_ref().to_string(), value.as_ref().to_string());
12140        self
12141    }
12142
12143    /// Identifies the authorization scope for the method you are building.
12144    ///
12145    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12146    /// [`Scope::ChromeManagementReportReadonly`].
12147    ///
12148    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12149    /// tokens for more than one scope.
12150    ///
12151    /// Usually there is more than one suitable scope to authorize an operation, some of which may
12152    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12153    /// sufficient, a read-write scope will do as well.
12154    pub fn add_scope<St>(
12155        mut self,
12156        scope: St,
12157    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C>
12158    where
12159        St: AsRef<str>,
12160    {
12161        self._scopes.insert(String::from(scope.as_ref()));
12162        self
12163    }
12164    /// Identifies the authorization scope(s) for the method you are building.
12165    ///
12166    /// See [`Self::add_scope()`] for details.
12167    pub fn add_scopes<I, St>(
12168        mut self,
12169        scopes: I,
12170    ) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C>
12171    where
12172        I: IntoIterator<Item = St>,
12173        St: AsRef<str>,
12174    {
12175        self._scopes
12176            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12177        self
12178    }
12179
12180    /// Removes all scopes, and no default scope will be used either.
12181    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12182    /// for details).
12183    pub fn clear_scopes(mut self) -> CustomerReportCountChromeDevicesThatNeedAttentionCall<'a, C> {
12184        self._scopes.clear();
12185        self
12186    }
12187}
12188
12189/// Counts of devices with a specific hardware specification from the requested hardware type (for example model name, processor type). Further information can be found here https://support.google.com/chrome/a/answer/10564947
12190///
12191/// A builder for the *reports.countChromeHardwareFleetDevices* method supported by a *customer* resource.
12192/// It is not used directly, but through a [`CustomerMethods`] instance.
12193///
12194/// # Example
12195///
12196/// Instantiate a resource method builder
12197///
12198/// ```test_harness,no_run
12199/// # extern crate hyper;
12200/// # extern crate hyper_rustls;
12201/// # extern crate google_chromemanagement1 as chromemanagement1;
12202/// # async fn dox() {
12203/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12204///
12205/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12206/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12207/// #     .with_native_roots()
12208/// #     .unwrap()
12209/// #     .https_only()
12210/// #     .enable_http2()
12211/// #     .build();
12212///
12213/// # let executor = hyper_util::rt::TokioExecutor::new();
12214/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12215/// #     secret,
12216/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12217/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
12218/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
12219/// #     ),
12220/// # ).build().await.unwrap();
12221///
12222/// # let client = hyper_util::client::legacy::Client::builder(
12223/// #     hyper_util::rt::TokioExecutor::new()
12224/// # )
12225/// # .build(
12226/// #     hyper_rustls::HttpsConnectorBuilder::new()
12227/// #         .with_native_roots()
12228/// #         .unwrap()
12229/// #         .https_or_http()
12230/// #         .enable_http2()
12231/// #         .build()
12232/// # );
12233/// # let mut hub = ChromeManagement::new(client, auth);
12234/// // You can configure optional parameters by calling the respective setters at will, and
12235/// // execute the final call using `doit()`.
12236/// // Values shown here are possibly random and not representative !
12237/// let result = hub.customers().reports_count_chrome_hardware_fleet_devices("customer")
12238///              .read_mask(FieldMask::new::<&str>(&[]))
12239///              .org_unit_id("consetetur")
12240///              .doit().await;
12241/// # }
12242/// ```
12243pub struct CustomerReportCountChromeHardwareFleetDeviceCall<'a, C>
12244where
12245    C: 'a,
12246{
12247    hub: &'a ChromeManagement<C>,
12248    _customer: String,
12249    _read_mask: Option<common::FieldMask>,
12250    _org_unit_id: Option<String>,
12251    _delegate: Option<&'a mut dyn common::Delegate>,
12252    _additional_params: HashMap<String, String>,
12253    _scopes: BTreeSet<String>,
12254}
12255
12256impl<'a, C> common::CallBuilder for CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {}
12257
12258impl<'a, C> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C>
12259where
12260    C: common::Connector,
12261{
12262    /// Perform the operation you have build so far.
12263    pub async fn doit(
12264        mut self,
12265    ) -> common::Result<(
12266        common::Response,
12267        GoogleChromeManagementV1CountChromeHardwareFleetDevicesResponse,
12268    )> {
12269        use std::borrow::Cow;
12270        use std::io::{Read, Seek};
12271
12272        use common::{url::Params, ToParts};
12273        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12274
12275        let mut dd = common::DefaultDelegate;
12276        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12277        dlg.begin(common::MethodInfo {
12278            id: "chromemanagement.customers.reports.countChromeHardwareFleetDevices",
12279            http_method: hyper::Method::GET,
12280        });
12281
12282        for &field in ["alt", "customer", "readMask", "orgUnitId"].iter() {
12283            if self._additional_params.contains_key(field) {
12284                dlg.finished(false);
12285                return Err(common::Error::FieldClash(field));
12286            }
12287        }
12288
12289        let mut params = Params::with_capacity(5 + self._additional_params.len());
12290        params.push("customer", self._customer);
12291        if let Some(value) = self._read_mask.as_ref() {
12292            params.push("readMask", value.to_string());
12293        }
12294        if let Some(value) = self._org_unit_id.as_ref() {
12295            params.push("orgUnitId", value);
12296        }
12297
12298        params.extend(self._additional_params.iter());
12299
12300        params.push("alt", "json");
12301        let mut url =
12302            self.hub._base_url.clone() + "v1/{+customer}/reports:countChromeHardwareFleetDevices";
12303        if self._scopes.is_empty() {
12304            self._scopes
12305                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
12306        }
12307
12308        #[allow(clippy::single_element_loop)]
12309        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
12310            url = params.uri_replacement(url, param_name, find_this, true);
12311        }
12312        {
12313            let to_remove = ["customer"];
12314            params.remove_params(&to_remove);
12315        }
12316
12317        let url = params.parse_with_url(&url);
12318
12319        loop {
12320            let token = match self
12321                .hub
12322                .auth
12323                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12324                .await
12325            {
12326                Ok(token) => token,
12327                Err(e) => match dlg.token(e) {
12328                    Ok(token) => token,
12329                    Err(e) => {
12330                        dlg.finished(false);
12331                        return Err(common::Error::MissingToken(e));
12332                    }
12333                },
12334            };
12335            let mut req_result = {
12336                let client = &self.hub.client;
12337                dlg.pre_request();
12338                let mut req_builder = hyper::Request::builder()
12339                    .method(hyper::Method::GET)
12340                    .uri(url.as_str())
12341                    .header(USER_AGENT, self.hub._user_agent.clone());
12342
12343                if let Some(token) = token.as_ref() {
12344                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12345                }
12346
12347                let request = req_builder
12348                    .header(CONTENT_LENGTH, 0_u64)
12349                    .body(common::to_body::<String>(None));
12350
12351                client.request(request.unwrap()).await
12352            };
12353
12354            match req_result {
12355                Err(err) => {
12356                    if let common::Retry::After(d) = dlg.http_error(&err) {
12357                        sleep(d).await;
12358                        continue;
12359                    }
12360                    dlg.finished(false);
12361                    return Err(common::Error::HttpError(err));
12362                }
12363                Ok(res) => {
12364                    let (mut parts, body) = res.into_parts();
12365                    let mut body = common::Body::new(body);
12366                    if !parts.status.is_success() {
12367                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12368                        let error = serde_json::from_str(&common::to_string(&bytes));
12369                        let response = common::to_response(parts, bytes.into());
12370
12371                        if let common::Retry::After(d) =
12372                            dlg.http_failure(&response, error.as_ref().ok())
12373                        {
12374                            sleep(d).await;
12375                            continue;
12376                        }
12377
12378                        dlg.finished(false);
12379
12380                        return Err(match error {
12381                            Ok(value) => common::Error::BadRequest(value),
12382                            _ => common::Error::Failure(response),
12383                        });
12384                    }
12385                    let response = {
12386                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12387                        let encoded = common::to_string(&bytes);
12388                        match serde_json::from_str(&encoded) {
12389                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12390                            Err(error) => {
12391                                dlg.response_json_decode_error(&encoded, &error);
12392                                return Err(common::Error::JsonDecodeError(
12393                                    encoded.to_string(),
12394                                    error,
12395                                ));
12396                            }
12397                        }
12398                    };
12399
12400                    dlg.finished(true);
12401                    return Ok(response);
12402                }
12403            }
12404        }
12405    }
12406
12407    /// Required. The customer ID or "my_customer".
12408    ///
12409    /// Sets the *customer* path property to the given value.
12410    ///
12411    /// Even though the property as already been set when instantiating this call,
12412    /// we provide this method for API completeness.
12413    pub fn customer(
12414        mut self,
12415        new_value: &str,
12416    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {
12417        self._customer = new_value.to_string();
12418        self
12419    }
12420    /// Required. Mask of the fields that should be populated in the returned report.
12421    ///
12422    /// Sets the *read mask* query property to the given value.
12423    pub fn read_mask(
12424        mut self,
12425        new_value: common::FieldMask,
12426    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {
12427        self._read_mask = Some(new_value);
12428        self
12429    }
12430    /// Optional. The ID of the organizational unit. If omitted, all data will be returned.
12431    ///
12432    /// Sets the *org unit id* query property to the given value.
12433    pub fn org_unit_id(
12434        mut self,
12435        new_value: &str,
12436    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {
12437        self._org_unit_id = Some(new_value.to_string());
12438        self
12439    }
12440    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12441    /// while executing the actual API request.
12442    ///
12443    /// ````text
12444    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
12445    /// ````
12446    ///
12447    /// Sets the *delegate* property to the given value.
12448    pub fn delegate(
12449        mut self,
12450        new_value: &'a mut dyn common::Delegate,
12451    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {
12452        self._delegate = Some(new_value);
12453        self
12454    }
12455
12456    /// Set any additional parameter of the query string used in the request.
12457    /// It should be used to set parameters which are not yet available through their own
12458    /// setters.
12459    ///
12460    /// Please note that this method must not be used to set any of the known parameters
12461    /// which have their own setter method. If done anyway, the request will fail.
12462    ///
12463    /// # Additional Parameters
12464    ///
12465    /// * *$.xgafv* (query-string) - V1 error format.
12466    /// * *access_token* (query-string) - OAuth access token.
12467    /// * *alt* (query-string) - Data format for response.
12468    /// * *callback* (query-string) - JSONP
12469    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12470    /// * *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.
12471    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12472    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12473    /// * *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.
12474    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12475    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12476    pub fn param<T>(
12477        mut self,
12478        name: T,
12479        value: T,
12480    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C>
12481    where
12482        T: AsRef<str>,
12483    {
12484        self._additional_params
12485            .insert(name.as_ref().to_string(), value.as_ref().to_string());
12486        self
12487    }
12488
12489    /// Identifies the authorization scope for the method you are building.
12490    ///
12491    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12492    /// [`Scope::ChromeManagementReportReadonly`].
12493    ///
12494    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12495    /// tokens for more than one scope.
12496    ///
12497    /// Usually there is more than one suitable scope to authorize an operation, some of which may
12498    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12499    /// sufficient, a read-write scope will do as well.
12500    pub fn add_scope<St>(
12501        mut self,
12502        scope: St,
12503    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C>
12504    where
12505        St: AsRef<str>,
12506    {
12507        self._scopes.insert(String::from(scope.as_ref()));
12508        self
12509    }
12510    /// Identifies the authorization scope(s) for the method you are building.
12511    ///
12512    /// See [`Self::add_scope()`] for details.
12513    pub fn add_scopes<I, St>(
12514        mut self,
12515        scopes: I,
12516    ) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C>
12517    where
12518        I: IntoIterator<Item = St>,
12519        St: AsRef<str>,
12520    {
12521        self._scopes
12522            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12523        self
12524    }
12525
12526    /// Removes all scopes, and no default scope will be used either.
12527    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12528    /// for details).
12529    pub fn clear_scopes(mut self) -> CustomerReportCountChromeHardwareFleetDeviceCall<'a, C> {
12530        self._scopes.clear();
12531        self
12532    }
12533}
12534
12535/// Generate report of installed Chrome versions.
12536///
12537/// A builder for the *reports.countChromeVersions* method supported by a *customer* resource.
12538/// It is not used directly, but through a [`CustomerMethods`] instance.
12539///
12540/// # Example
12541///
12542/// Instantiate a resource method builder
12543///
12544/// ```test_harness,no_run
12545/// # extern crate hyper;
12546/// # extern crate hyper_rustls;
12547/// # extern crate google_chromemanagement1 as chromemanagement1;
12548/// # async fn dox() {
12549/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12550///
12551/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12552/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12553/// #     .with_native_roots()
12554/// #     .unwrap()
12555/// #     .https_only()
12556/// #     .enable_http2()
12557/// #     .build();
12558///
12559/// # let executor = hyper_util::rt::TokioExecutor::new();
12560/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12561/// #     secret,
12562/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12563/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
12564/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
12565/// #     ),
12566/// # ).build().await.unwrap();
12567///
12568/// # let client = hyper_util::client::legacy::Client::builder(
12569/// #     hyper_util::rt::TokioExecutor::new()
12570/// # )
12571/// # .build(
12572/// #     hyper_rustls::HttpsConnectorBuilder::new()
12573/// #         .with_native_roots()
12574/// #         .unwrap()
12575/// #         .https_or_http()
12576/// #         .enable_http2()
12577/// #         .build()
12578/// # );
12579/// # let mut hub = ChromeManagement::new(client, auth);
12580/// // You can configure optional parameters by calling the respective setters at will, and
12581/// // execute the final call using `doit()`.
12582/// // Values shown here are possibly random and not representative !
12583/// let result = hub.customers().reports_count_chrome_versions("customer")
12584///              .page_token("dolor")
12585///              .page_size(-18)
12586///              .org_unit_id("et")
12587///              .filter("sadipscing")
12588///              .doit().await;
12589/// # }
12590/// ```
12591pub struct CustomerReportCountChromeVersionCall<'a, C>
12592where
12593    C: 'a,
12594{
12595    hub: &'a ChromeManagement<C>,
12596    _customer: String,
12597    _page_token: Option<String>,
12598    _page_size: Option<i32>,
12599    _org_unit_id: Option<String>,
12600    _filter: Option<String>,
12601    _delegate: Option<&'a mut dyn common::Delegate>,
12602    _additional_params: HashMap<String, String>,
12603    _scopes: BTreeSet<String>,
12604}
12605
12606impl<'a, C> common::CallBuilder for CustomerReportCountChromeVersionCall<'a, C> {}
12607
12608impl<'a, C> CustomerReportCountChromeVersionCall<'a, C>
12609where
12610    C: common::Connector,
12611{
12612    /// Perform the operation you have build so far.
12613    pub async fn doit(
12614        mut self,
12615    ) -> common::Result<(
12616        common::Response,
12617        GoogleChromeManagementV1CountChromeVersionsResponse,
12618    )> {
12619        use std::borrow::Cow;
12620        use std::io::{Read, Seek};
12621
12622        use common::{url::Params, ToParts};
12623        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12624
12625        let mut dd = common::DefaultDelegate;
12626        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12627        dlg.begin(common::MethodInfo {
12628            id: "chromemanagement.customers.reports.countChromeVersions",
12629            http_method: hyper::Method::GET,
12630        });
12631
12632        for &field in [
12633            "alt",
12634            "customer",
12635            "pageToken",
12636            "pageSize",
12637            "orgUnitId",
12638            "filter",
12639        ]
12640        .iter()
12641        {
12642            if self._additional_params.contains_key(field) {
12643                dlg.finished(false);
12644                return Err(common::Error::FieldClash(field));
12645            }
12646        }
12647
12648        let mut params = Params::with_capacity(7 + self._additional_params.len());
12649        params.push("customer", self._customer);
12650        if let Some(value) = self._page_token.as_ref() {
12651            params.push("pageToken", value);
12652        }
12653        if let Some(value) = self._page_size.as_ref() {
12654            params.push("pageSize", value.to_string());
12655        }
12656        if let Some(value) = self._org_unit_id.as_ref() {
12657            params.push("orgUnitId", value);
12658        }
12659        if let Some(value) = self._filter.as_ref() {
12660            params.push("filter", value);
12661        }
12662
12663        params.extend(self._additional_params.iter());
12664
12665        params.push("alt", "json");
12666        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countChromeVersions";
12667        if self._scopes.is_empty() {
12668            self._scopes
12669                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
12670        }
12671
12672        #[allow(clippy::single_element_loop)]
12673        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
12674            url = params.uri_replacement(url, param_name, find_this, true);
12675        }
12676        {
12677            let to_remove = ["customer"];
12678            params.remove_params(&to_remove);
12679        }
12680
12681        let url = params.parse_with_url(&url);
12682
12683        loop {
12684            let token = match self
12685                .hub
12686                .auth
12687                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
12688                .await
12689            {
12690                Ok(token) => token,
12691                Err(e) => match dlg.token(e) {
12692                    Ok(token) => token,
12693                    Err(e) => {
12694                        dlg.finished(false);
12695                        return Err(common::Error::MissingToken(e));
12696                    }
12697                },
12698            };
12699            let mut req_result = {
12700                let client = &self.hub.client;
12701                dlg.pre_request();
12702                let mut req_builder = hyper::Request::builder()
12703                    .method(hyper::Method::GET)
12704                    .uri(url.as_str())
12705                    .header(USER_AGENT, self.hub._user_agent.clone());
12706
12707                if let Some(token) = token.as_ref() {
12708                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
12709                }
12710
12711                let request = req_builder
12712                    .header(CONTENT_LENGTH, 0_u64)
12713                    .body(common::to_body::<String>(None));
12714
12715                client.request(request.unwrap()).await
12716            };
12717
12718            match req_result {
12719                Err(err) => {
12720                    if let common::Retry::After(d) = dlg.http_error(&err) {
12721                        sleep(d).await;
12722                        continue;
12723                    }
12724                    dlg.finished(false);
12725                    return Err(common::Error::HttpError(err));
12726                }
12727                Ok(res) => {
12728                    let (mut parts, body) = res.into_parts();
12729                    let mut body = common::Body::new(body);
12730                    if !parts.status.is_success() {
12731                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12732                        let error = serde_json::from_str(&common::to_string(&bytes));
12733                        let response = common::to_response(parts, bytes.into());
12734
12735                        if let common::Retry::After(d) =
12736                            dlg.http_failure(&response, error.as_ref().ok())
12737                        {
12738                            sleep(d).await;
12739                            continue;
12740                        }
12741
12742                        dlg.finished(false);
12743
12744                        return Err(match error {
12745                            Ok(value) => common::Error::BadRequest(value),
12746                            _ => common::Error::Failure(response),
12747                        });
12748                    }
12749                    let response = {
12750                        let bytes = common::to_bytes(body).await.unwrap_or_default();
12751                        let encoded = common::to_string(&bytes);
12752                        match serde_json::from_str(&encoded) {
12753                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
12754                            Err(error) => {
12755                                dlg.response_json_decode_error(&encoded, &error);
12756                                return Err(common::Error::JsonDecodeError(
12757                                    encoded.to_string(),
12758                                    error,
12759                                ));
12760                            }
12761                        }
12762                    };
12763
12764                    dlg.finished(true);
12765                    return Ok(response);
12766                }
12767            }
12768        }
12769    }
12770
12771    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
12772    ///
12773    /// Sets the *customer* path property to the given value.
12774    ///
12775    /// Even though the property as already been set when instantiating this call,
12776    /// we provide this method for API completeness.
12777    pub fn customer(mut self, new_value: &str) -> CustomerReportCountChromeVersionCall<'a, C> {
12778        self._customer = new_value.to_string();
12779        self
12780    }
12781    /// Token to specify the page of the request to be returned.
12782    ///
12783    /// Sets the *page token* query property to the given value.
12784    pub fn page_token(mut self, new_value: &str) -> CustomerReportCountChromeVersionCall<'a, C> {
12785        self._page_token = Some(new_value.to_string());
12786        self
12787    }
12788    /// Maximum number of results to return. Maximum and default are 100.
12789    ///
12790    /// Sets the *page size* query property to the given value.
12791    pub fn page_size(mut self, new_value: i32) -> CustomerReportCountChromeVersionCall<'a, C> {
12792        self._page_size = Some(new_value);
12793        self
12794    }
12795    /// The ID of the organizational unit.
12796    ///
12797    /// Sets the *org unit id* query property to the given value.
12798    pub fn org_unit_id(mut self, new_value: &str) -> CustomerReportCountChromeVersionCall<'a, C> {
12799        self._org_unit_id = Some(new_value.to_string());
12800        self
12801    }
12802    /// Query string to filter results, AND-separated fields in EBNF syntax. Note: OR operations are not supported in this filter. Supported filter fields: * last_active_date
12803    ///
12804    /// Sets the *filter* query property to the given value.
12805    pub fn filter(mut self, new_value: &str) -> CustomerReportCountChromeVersionCall<'a, C> {
12806        self._filter = Some(new_value.to_string());
12807        self
12808    }
12809    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
12810    /// while executing the actual API request.
12811    ///
12812    /// ````text
12813    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
12814    /// ````
12815    ///
12816    /// Sets the *delegate* property to the given value.
12817    pub fn delegate(
12818        mut self,
12819        new_value: &'a mut dyn common::Delegate,
12820    ) -> CustomerReportCountChromeVersionCall<'a, C> {
12821        self._delegate = Some(new_value);
12822        self
12823    }
12824
12825    /// Set any additional parameter of the query string used in the request.
12826    /// It should be used to set parameters which are not yet available through their own
12827    /// setters.
12828    ///
12829    /// Please note that this method must not be used to set any of the known parameters
12830    /// which have their own setter method. If done anyway, the request will fail.
12831    ///
12832    /// # Additional Parameters
12833    ///
12834    /// * *$.xgafv* (query-string) - V1 error format.
12835    /// * *access_token* (query-string) - OAuth access token.
12836    /// * *alt* (query-string) - Data format for response.
12837    /// * *callback* (query-string) - JSONP
12838    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
12839    /// * *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.
12840    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
12841    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
12842    /// * *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.
12843    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
12844    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
12845    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountChromeVersionCall<'a, C>
12846    where
12847        T: AsRef<str>,
12848    {
12849        self._additional_params
12850            .insert(name.as_ref().to_string(), value.as_ref().to_string());
12851        self
12852    }
12853
12854    /// Identifies the authorization scope for the method you are building.
12855    ///
12856    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
12857    /// [`Scope::ChromeManagementReportReadonly`].
12858    ///
12859    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
12860    /// tokens for more than one scope.
12861    ///
12862    /// Usually there is more than one suitable scope to authorize an operation, some of which may
12863    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
12864    /// sufficient, a read-write scope will do as well.
12865    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountChromeVersionCall<'a, C>
12866    where
12867        St: AsRef<str>,
12868    {
12869        self._scopes.insert(String::from(scope.as_ref()));
12870        self
12871    }
12872    /// Identifies the authorization scope(s) for the method you are building.
12873    ///
12874    /// See [`Self::add_scope()`] for details.
12875    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportCountChromeVersionCall<'a, C>
12876    where
12877        I: IntoIterator<Item = St>,
12878        St: AsRef<str>,
12879    {
12880        self._scopes
12881            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
12882        self
12883    }
12884
12885    /// Removes all scopes, and no default scope will be used either.
12886    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
12887    /// for details).
12888    pub fn clear_scopes(mut self) -> CustomerReportCountChromeVersionCall<'a, C> {
12889        self._scopes.clear();
12890        self
12891    }
12892}
12893
12894/// Get a count of devices per boot type.
12895///
12896/// A builder for the *reports.countDevicesPerBootType* method supported by a *customer* resource.
12897/// It is not used directly, but through a [`CustomerMethods`] instance.
12898///
12899/// # Example
12900///
12901/// Instantiate a resource method builder
12902///
12903/// ```test_harness,no_run
12904/// # extern crate hyper;
12905/// # extern crate hyper_rustls;
12906/// # extern crate google_chromemanagement1 as chromemanagement1;
12907/// # async fn dox() {
12908/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
12909///
12910/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
12911/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
12912/// #     .with_native_roots()
12913/// #     .unwrap()
12914/// #     .https_only()
12915/// #     .enable_http2()
12916/// #     .build();
12917///
12918/// # let executor = hyper_util::rt::TokioExecutor::new();
12919/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
12920/// #     secret,
12921/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
12922/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
12923/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
12924/// #     ),
12925/// # ).build().await.unwrap();
12926///
12927/// # let client = hyper_util::client::legacy::Client::builder(
12928/// #     hyper_util::rt::TokioExecutor::new()
12929/// # )
12930/// # .build(
12931/// #     hyper_rustls::HttpsConnectorBuilder::new()
12932/// #         .with_native_roots()
12933/// #         .unwrap()
12934/// #         .https_or_http()
12935/// #         .enable_http2()
12936/// #         .build()
12937/// # );
12938/// # let mut hub = ChromeManagement::new(client, auth);
12939/// // You can configure optional parameters by calling the respective setters at will, and
12940/// // execute the final call using `doit()`.
12941/// // Values shown here are possibly random and not representative !
12942/// let result = hub.customers().reports_count_devices_per_boot_type("customer")
12943///              .date_year(-99)
12944///              .date_month(-20)
12945///              .date_day(-76)
12946///              .doit().await;
12947/// # }
12948/// ```
12949pub struct CustomerReportCountDevicesPerBootTypeCall<'a, C>
12950where
12951    C: 'a,
12952{
12953    hub: &'a ChromeManagement<C>,
12954    _customer: String,
12955    _date_year: Option<i32>,
12956    _date_month: Option<i32>,
12957    _date_day: Option<i32>,
12958    _delegate: Option<&'a mut dyn common::Delegate>,
12959    _additional_params: HashMap<String, String>,
12960    _scopes: BTreeSet<String>,
12961}
12962
12963impl<'a, C> common::CallBuilder for CustomerReportCountDevicesPerBootTypeCall<'a, C> {}
12964
12965impl<'a, C> CustomerReportCountDevicesPerBootTypeCall<'a, C>
12966where
12967    C: common::Connector,
12968{
12969    /// Perform the operation you have build so far.
12970    pub async fn doit(
12971        mut self,
12972    ) -> common::Result<(
12973        common::Response,
12974        GoogleChromeManagementV1CountDevicesPerBootTypeResponse,
12975    )> {
12976        use std::borrow::Cow;
12977        use std::io::{Read, Seek};
12978
12979        use common::{url::Params, ToParts};
12980        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
12981
12982        let mut dd = common::DefaultDelegate;
12983        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
12984        dlg.begin(common::MethodInfo {
12985            id: "chromemanagement.customers.reports.countDevicesPerBootType",
12986            http_method: hyper::Method::GET,
12987        });
12988
12989        for &field in ["alt", "customer", "date.year", "date.month", "date.day"].iter() {
12990            if self._additional_params.contains_key(field) {
12991                dlg.finished(false);
12992                return Err(common::Error::FieldClash(field));
12993            }
12994        }
12995
12996        let mut params = Params::with_capacity(6 + self._additional_params.len());
12997        params.push("customer", self._customer);
12998        if let Some(value) = self._date_year.as_ref() {
12999            params.push("date.year", value.to_string());
13000        }
13001        if let Some(value) = self._date_month.as_ref() {
13002            params.push("date.month", value.to_string());
13003        }
13004        if let Some(value) = self._date_day.as_ref() {
13005            params.push("date.day", value.to_string());
13006        }
13007
13008        params.extend(self._additional_params.iter());
13009
13010        params.push("alt", "json");
13011        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countDevicesPerBootType";
13012        if self._scopes.is_empty() {
13013            self._scopes
13014                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
13015        }
13016
13017        #[allow(clippy::single_element_loop)]
13018        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
13019            url = params.uri_replacement(url, param_name, find_this, true);
13020        }
13021        {
13022            let to_remove = ["customer"];
13023            params.remove_params(&to_remove);
13024        }
13025
13026        let url = params.parse_with_url(&url);
13027
13028        loop {
13029            let token = match self
13030                .hub
13031                .auth
13032                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13033                .await
13034            {
13035                Ok(token) => token,
13036                Err(e) => match dlg.token(e) {
13037                    Ok(token) => token,
13038                    Err(e) => {
13039                        dlg.finished(false);
13040                        return Err(common::Error::MissingToken(e));
13041                    }
13042                },
13043            };
13044            let mut req_result = {
13045                let client = &self.hub.client;
13046                dlg.pre_request();
13047                let mut req_builder = hyper::Request::builder()
13048                    .method(hyper::Method::GET)
13049                    .uri(url.as_str())
13050                    .header(USER_AGENT, self.hub._user_agent.clone());
13051
13052                if let Some(token) = token.as_ref() {
13053                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13054                }
13055
13056                let request = req_builder
13057                    .header(CONTENT_LENGTH, 0_u64)
13058                    .body(common::to_body::<String>(None));
13059
13060                client.request(request.unwrap()).await
13061            };
13062
13063            match req_result {
13064                Err(err) => {
13065                    if let common::Retry::After(d) = dlg.http_error(&err) {
13066                        sleep(d).await;
13067                        continue;
13068                    }
13069                    dlg.finished(false);
13070                    return Err(common::Error::HttpError(err));
13071                }
13072                Ok(res) => {
13073                    let (mut parts, body) = res.into_parts();
13074                    let mut body = common::Body::new(body);
13075                    if !parts.status.is_success() {
13076                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13077                        let error = serde_json::from_str(&common::to_string(&bytes));
13078                        let response = common::to_response(parts, bytes.into());
13079
13080                        if let common::Retry::After(d) =
13081                            dlg.http_failure(&response, error.as_ref().ok())
13082                        {
13083                            sleep(d).await;
13084                            continue;
13085                        }
13086
13087                        dlg.finished(false);
13088
13089                        return Err(match error {
13090                            Ok(value) => common::Error::BadRequest(value),
13091                            _ => common::Error::Failure(response),
13092                        });
13093                    }
13094                    let response = {
13095                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13096                        let encoded = common::to_string(&bytes);
13097                        match serde_json::from_str(&encoded) {
13098                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13099                            Err(error) => {
13100                                dlg.response_json_decode_error(&encoded, &error);
13101                                return Err(common::Error::JsonDecodeError(
13102                                    encoded.to_string(),
13103                                    error,
13104                                ));
13105                            }
13106                        }
13107                    };
13108
13109                    dlg.finished(true);
13110                    return Ok(response);
13111                }
13112            }
13113        }
13114    }
13115
13116    /// Required. Obfuscated customer ID prefixed with "customers/C" or "customers/my_customer".
13117    ///
13118    /// Sets the *customer* path property to the given value.
13119    ///
13120    /// Even though the property as already been set when instantiating this call,
13121    /// we provide this method for API completeness.
13122    pub fn customer(mut self, new_value: &str) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
13123        self._customer = new_value.to_string();
13124        self
13125    }
13126    /// Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
13127    ///
13128    /// Sets the *date.year* query property to the given value.
13129    pub fn date_year(mut self, new_value: i32) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
13130        self._date_year = Some(new_value);
13131        self
13132    }
13133    /// Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
13134    ///
13135    /// Sets the *date.month* query property to the given value.
13136    pub fn date_month(
13137        mut self,
13138        new_value: i32,
13139    ) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
13140        self._date_month = Some(new_value);
13141        self
13142    }
13143    /// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
13144    ///
13145    /// Sets the *date.day* query property to the given value.
13146    pub fn date_day(mut self, new_value: i32) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
13147        self._date_day = Some(new_value);
13148        self
13149    }
13150    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13151    /// while executing the actual API request.
13152    ///
13153    /// ````text
13154    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
13155    /// ````
13156    ///
13157    /// Sets the *delegate* property to the given value.
13158    pub fn delegate(
13159        mut self,
13160        new_value: &'a mut dyn common::Delegate,
13161    ) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
13162        self._delegate = Some(new_value);
13163        self
13164    }
13165
13166    /// Set any additional parameter of the query string used in the request.
13167    /// It should be used to set parameters which are not yet available through their own
13168    /// setters.
13169    ///
13170    /// Please note that this method must not be used to set any of the known parameters
13171    /// which have their own setter method. If done anyway, the request will fail.
13172    ///
13173    /// # Additional Parameters
13174    ///
13175    /// * *$.xgafv* (query-string) - V1 error format.
13176    /// * *access_token* (query-string) - OAuth access token.
13177    /// * *alt* (query-string) - Data format for response.
13178    /// * *callback* (query-string) - JSONP
13179    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13180    /// * *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.
13181    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13182    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13183    /// * *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.
13184    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13185    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13186    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountDevicesPerBootTypeCall<'a, C>
13187    where
13188        T: AsRef<str>,
13189    {
13190        self._additional_params
13191            .insert(name.as_ref().to_string(), value.as_ref().to_string());
13192        self
13193    }
13194
13195    /// Identifies the authorization scope for the method you are building.
13196    ///
13197    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13198    /// [`Scope::ChromeManagementReportReadonly`].
13199    ///
13200    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13201    /// tokens for more than one scope.
13202    ///
13203    /// Usually there is more than one suitable scope to authorize an operation, some of which may
13204    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13205    /// sufficient, a read-write scope will do as well.
13206    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountDevicesPerBootTypeCall<'a, C>
13207    where
13208        St: AsRef<str>,
13209    {
13210        self._scopes.insert(String::from(scope.as_ref()));
13211        self
13212    }
13213    /// Identifies the authorization scope(s) for the method you are building.
13214    ///
13215    /// See [`Self::add_scope()`] for details.
13216    pub fn add_scopes<I, St>(
13217        mut self,
13218        scopes: I,
13219    ) -> CustomerReportCountDevicesPerBootTypeCall<'a, C>
13220    where
13221        I: IntoIterator<Item = St>,
13222        St: AsRef<str>,
13223    {
13224        self._scopes
13225            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13226        self
13227    }
13228
13229    /// Removes all scopes, and no default scope will be used either.
13230    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13231    /// for details).
13232    pub fn clear_scopes(mut self) -> CustomerReportCountDevicesPerBootTypeCall<'a, C> {
13233        self._scopes.clear();
13234        self
13235    }
13236}
13237
13238/// Get a count of devices per channel.
13239///
13240/// A builder for the *reports.countDevicesPerReleaseChannel* method supported by a *customer* resource.
13241/// It is not used directly, but through a [`CustomerMethods`] instance.
13242///
13243/// # Example
13244///
13245/// Instantiate a resource method builder
13246///
13247/// ```test_harness,no_run
13248/// # extern crate hyper;
13249/// # extern crate hyper_rustls;
13250/// # extern crate google_chromemanagement1 as chromemanagement1;
13251/// # async fn dox() {
13252/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
13253///
13254/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
13255/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
13256/// #     .with_native_roots()
13257/// #     .unwrap()
13258/// #     .https_only()
13259/// #     .enable_http2()
13260/// #     .build();
13261///
13262/// # let executor = hyper_util::rt::TokioExecutor::new();
13263/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
13264/// #     secret,
13265/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13266/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
13267/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
13268/// #     ),
13269/// # ).build().await.unwrap();
13270///
13271/// # let client = hyper_util::client::legacy::Client::builder(
13272/// #     hyper_util::rt::TokioExecutor::new()
13273/// # )
13274/// # .build(
13275/// #     hyper_rustls::HttpsConnectorBuilder::new()
13276/// #         .with_native_roots()
13277/// #         .unwrap()
13278/// #         .https_or_http()
13279/// #         .enable_http2()
13280/// #         .build()
13281/// # );
13282/// # let mut hub = ChromeManagement::new(client, auth);
13283/// // You can configure optional parameters by calling the respective setters at will, and
13284/// // execute the final call using `doit()`.
13285/// // Values shown here are possibly random and not representative !
13286/// let result = hub.customers().reports_count_devices_per_release_channel("customer")
13287///              .date_year(-88)
13288///              .date_month(-65)
13289///              .date_day(-76)
13290///              .doit().await;
13291/// # }
13292/// ```
13293pub struct CustomerReportCountDevicesPerReleaseChannelCall<'a, C>
13294where
13295    C: 'a,
13296{
13297    hub: &'a ChromeManagement<C>,
13298    _customer: String,
13299    _date_year: Option<i32>,
13300    _date_month: Option<i32>,
13301    _date_day: Option<i32>,
13302    _delegate: Option<&'a mut dyn common::Delegate>,
13303    _additional_params: HashMap<String, String>,
13304    _scopes: BTreeSet<String>,
13305}
13306
13307impl<'a, C> common::CallBuilder for CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {}
13308
13309impl<'a, C> CustomerReportCountDevicesPerReleaseChannelCall<'a, C>
13310where
13311    C: common::Connector,
13312{
13313    /// Perform the operation you have build so far.
13314    pub async fn doit(
13315        mut self,
13316    ) -> common::Result<(
13317        common::Response,
13318        GoogleChromeManagementV1CountDevicesPerReleaseChannelResponse,
13319    )> {
13320        use std::borrow::Cow;
13321        use std::io::{Read, Seek};
13322
13323        use common::{url::Params, ToParts};
13324        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
13325
13326        let mut dd = common::DefaultDelegate;
13327        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
13328        dlg.begin(common::MethodInfo {
13329            id: "chromemanagement.customers.reports.countDevicesPerReleaseChannel",
13330            http_method: hyper::Method::GET,
13331        });
13332
13333        for &field in ["alt", "customer", "date.year", "date.month", "date.day"].iter() {
13334            if self._additional_params.contains_key(field) {
13335                dlg.finished(false);
13336                return Err(common::Error::FieldClash(field));
13337            }
13338        }
13339
13340        let mut params = Params::with_capacity(6 + self._additional_params.len());
13341        params.push("customer", self._customer);
13342        if let Some(value) = self._date_year.as_ref() {
13343            params.push("date.year", value.to_string());
13344        }
13345        if let Some(value) = self._date_month.as_ref() {
13346            params.push("date.month", value.to_string());
13347        }
13348        if let Some(value) = self._date_day.as_ref() {
13349            params.push("date.day", value.to_string());
13350        }
13351
13352        params.extend(self._additional_params.iter());
13353
13354        params.push("alt", "json");
13355        let mut url =
13356            self.hub._base_url.clone() + "v1/{+customer}/reports:countDevicesPerReleaseChannel";
13357        if self._scopes.is_empty() {
13358            self._scopes
13359                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
13360        }
13361
13362        #[allow(clippy::single_element_loop)]
13363        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
13364            url = params.uri_replacement(url, param_name, find_this, true);
13365        }
13366        {
13367            let to_remove = ["customer"];
13368            params.remove_params(&to_remove);
13369        }
13370
13371        let url = params.parse_with_url(&url);
13372
13373        loop {
13374            let token = match self
13375                .hub
13376                .auth
13377                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13378                .await
13379            {
13380                Ok(token) => token,
13381                Err(e) => match dlg.token(e) {
13382                    Ok(token) => token,
13383                    Err(e) => {
13384                        dlg.finished(false);
13385                        return Err(common::Error::MissingToken(e));
13386                    }
13387                },
13388            };
13389            let mut req_result = {
13390                let client = &self.hub.client;
13391                dlg.pre_request();
13392                let mut req_builder = hyper::Request::builder()
13393                    .method(hyper::Method::GET)
13394                    .uri(url.as_str())
13395                    .header(USER_AGENT, self.hub._user_agent.clone());
13396
13397                if let Some(token) = token.as_ref() {
13398                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13399                }
13400
13401                let request = req_builder
13402                    .header(CONTENT_LENGTH, 0_u64)
13403                    .body(common::to_body::<String>(None));
13404
13405                client.request(request.unwrap()).await
13406            };
13407
13408            match req_result {
13409                Err(err) => {
13410                    if let common::Retry::After(d) = dlg.http_error(&err) {
13411                        sleep(d).await;
13412                        continue;
13413                    }
13414                    dlg.finished(false);
13415                    return Err(common::Error::HttpError(err));
13416                }
13417                Ok(res) => {
13418                    let (mut parts, body) = res.into_parts();
13419                    let mut body = common::Body::new(body);
13420                    if !parts.status.is_success() {
13421                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13422                        let error = serde_json::from_str(&common::to_string(&bytes));
13423                        let response = common::to_response(parts, bytes.into());
13424
13425                        if let common::Retry::After(d) =
13426                            dlg.http_failure(&response, error.as_ref().ok())
13427                        {
13428                            sleep(d).await;
13429                            continue;
13430                        }
13431
13432                        dlg.finished(false);
13433
13434                        return Err(match error {
13435                            Ok(value) => common::Error::BadRequest(value),
13436                            _ => common::Error::Failure(response),
13437                        });
13438                    }
13439                    let response = {
13440                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13441                        let encoded = common::to_string(&bytes);
13442                        match serde_json::from_str(&encoded) {
13443                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13444                            Err(error) => {
13445                                dlg.response_json_decode_error(&encoded, &error);
13446                                return Err(common::Error::JsonDecodeError(
13447                                    encoded.to_string(),
13448                                    error,
13449                                ));
13450                            }
13451                        }
13452                    };
13453
13454                    dlg.finished(true);
13455                    return Ok(response);
13456                }
13457            }
13458        }
13459    }
13460
13461    /// Required. Obfuscated customer ID prefixed with "customers/C" or "customers/my_customer".
13462    ///
13463    /// Sets the *customer* path property to the given value.
13464    ///
13465    /// Even though the property as already been set when instantiating this call,
13466    /// we provide this method for API completeness.
13467    pub fn customer(
13468        mut self,
13469        new_value: &str,
13470    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
13471        self._customer = new_value.to_string();
13472        self
13473    }
13474    /// Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
13475    ///
13476    /// Sets the *date.year* query property to the given value.
13477    pub fn date_year(
13478        mut self,
13479        new_value: i32,
13480    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
13481        self._date_year = Some(new_value);
13482        self
13483    }
13484    /// Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
13485    ///
13486    /// Sets the *date.month* query property to the given value.
13487    pub fn date_month(
13488        mut self,
13489        new_value: i32,
13490    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
13491        self._date_month = Some(new_value);
13492        self
13493    }
13494    /// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
13495    ///
13496    /// Sets the *date.day* query property to the given value.
13497    pub fn date_day(
13498        mut self,
13499        new_value: i32,
13500    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
13501        self._date_day = Some(new_value);
13502        self
13503    }
13504    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13505    /// while executing the actual API request.
13506    ///
13507    /// ````text
13508    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
13509    /// ````
13510    ///
13511    /// Sets the *delegate* property to the given value.
13512    pub fn delegate(
13513        mut self,
13514        new_value: &'a mut dyn common::Delegate,
13515    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
13516        self._delegate = Some(new_value);
13517        self
13518    }
13519
13520    /// Set any additional parameter of the query string used in the request.
13521    /// It should be used to set parameters which are not yet available through their own
13522    /// setters.
13523    ///
13524    /// Please note that this method must not be used to set any of the known parameters
13525    /// which have their own setter method. If done anyway, the request will fail.
13526    ///
13527    /// # Additional Parameters
13528    ///
13529    /// * *$.xgafv* (query-string) - V1 error format.
13530    /// * *access_token* (query-string) - OAuth access token.
13531    /// * *alt* (query-string) - Data format for response.
13532    /// * *callback* (query-string) - JSONP
13533    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13534    /// * *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.
13535    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13536    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13537    /// * *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.
13538    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13539    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13540    pub fn param<T>(
13541        mut self,
13542        name: T,
13543        value: T,
13544    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C>
13545    where
13546        T: AsRef<str>,
13547    {
13548        self._additional_params
13549            .insert(name.as_ref().to_string(), value.as_ref().to_string());
13550        self
13551    }
13552
13553    /// Identifies the authorization scope for the method you are building.
13554    ///
13555    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13556    /// [`Scope::ChromeManagementReportReadonly`].
13557    ///
13558    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13559    /// tokens for more than one scope.
13560    ///
13561    /// Usually there is more than one suitable scope to authorize an operation, some of which may
13562    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13563    /// sufficient, a read-write scope will do as well.
13564    pub fn add_scope<St>(
13565        mut self,
13566        scope: St,
13567    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C>
13568    where
13569        St: AsRef<str>,
13570    {
13571        self._scopes.insert(String::from(scope.as_ref()));
13572        self
13573    }
13574    /// Identifies the authorization scope(s) for the method you are building.
13575    ///
13576    /// See [`Self::add_scope()`] for details.
13577    pub fn add_scopes<I, St>(
13578        mut self,
13579        scopes: I,
13580    ) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C>
13581    where
13582        I: IntoIterator<Item = St>,
13583        St: AsRef<str>,
13584    {
13585        self._scopes
13586            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13587        self
13588    }
13589
13590    /// Removes all scopes, and no default scope will be used either.
13591    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13592    /// for details).
13593    pub fn clear_scopes(mut self) -> CustomerReportCountDevicesPerReleaseChannelCall<'a, C> {
13594        self._scopes.clear();
13595        self
13596    }
13597}
13598
13599/// Generate report of app installations.
13600///
13601/// A builder for the *reports.countInstalledApps* method supported by a *customer* resource.
13602/// It is not used directly, but through a [`CustomerMethods`] instance.
13603///
13604/// # Example
13605///
13606/// Instantiate a resource method builder
13607///
13608/// ```test_harness,no_run
13609/// # extern crate hyper;
13610/// # extern crate hyper_rustls;
13611/// # extern crate google_chromemanagement1 as chromemanagement1;
13612/// # async fn dox() {
13613/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
13614///
13615/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
13616/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
13617/// #     .with_native_roots()
13618/// #     .unwrap()
13619/// #     .https_only()
13620/// #     .enable_http2()
13621/// #     .build();
13622///
13623/// # let executor = hyper_util::rt::TokioExecutor::new();
13624/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
13625/// #     secret,
13626/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13627/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
13628/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
13629/// #     ),
13630/// # ).build().await.unwrap();
13631///
13632/// # let client = hyper_util::client::legacy::Client::builder(
13633/// #     hyper_util::rt::TokioExecutor::new()
13634/// # )
13635/// # .build(
13636/// #     hyper_rustls::HttpsConnectorBuilder::new()
13637/// #         .with_native_roots()
13638/// #         .unwrap()
13639/// #         .https_or_http()
13640/// #         .enable_http2()
13641/// #         .build()
13642/// # );
13643/// # let mut hub = ChromeManagement::new(client, auth);
13644/// // You can configure optional parameters by calling the respective setters at will, and
13645/// // execute the final call using `doit()`.
13646/// // Values shown here are possibly random and not representative !
13647/// let result = hub.customers().reports_count_installed_apps("customer")
13648///              .page_token("Lorem")
13649///              .page_size(-29)
13650///              .org_unit_id("no")
13651///              .order_by("ipsum")
13652///              .filter("accusam")
13653///              .doit().await;
13654/// # }
13655/// ```
13656pub struct CustomerReportCountInstalledAppCall<'a, C>
13657where
13658    C: 'a,
13659{
13660    hub: &'a ChromeManagement<C>,
13661    _customer: String,
13662    _page_token: Option<String>,
13663    _page_size: Option<i32>,
13664    _org_unit_id: Option<String>,
13665    _order_by: Option<String>,
13666    _filter: Option<String>,
13667    _delegate: Option<&'a mut dyn common::Delegate>,
13668    _additional_params: HashMap<String, String>,
13669    _scopes: BTreeSet<String>,
13670}
13671
13672impl<'a, C> common::CallBuilder for CustomerReportCountInstalledAppCall<'a, C> {}
13673
13674impl<'a, C> CustomerReportCountInstalledAppCall<'a, C>
13675where
13676    C: common::Connector,
13677{
13678    /// Perform the operation you have build so far.
13679    pub async fn doit(
13680        mut self,
13681    ) -> common::Result<(
13682        common::Response,
13683        GoogleChromeManagementV1CountInstalledAppsResponse,
13684    )> {
13685        use std::borrow::Cow;
13686        use std::io::{Read, Seek};
13687
13688        use common::{url::Params, ToParts};
13689        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
13690
13691        let mut dd = common::DefaultDelegate;
13692        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
13693        dlg.begin(common::MethodInfo {
13694            id: "chromemanagement.customers.reports.countInstalledApps",
13695            http_method: hyper::Method::GET,
13696        });
13697
13698        for &field in [
13699            "alt",
13700            "customer",
13701            "pageToken",
13702            "pageSize",
13703            "orgUnitId",
13704            "orderBy",
13705            "filter",
13706        ]
13707        .iter()
13708        {
13709            if self._additional_params.contains_key(field) {
13710                dlg.finished(false);
13711                return Err(common::Error::FieldClash(field));
13712            }
13713        }
13714
13715        let mut params = Params::with_capacity(8 + self._additional_params.len());
13716        params.push("customer", self._customer);
13717        if let Some(value) = self._page_token.as_ref() {
13718            params.push("pageToken", value);
13719        }
13720        if let Some(value) = self._page_size.as_ref() {
13721            params.push("pageSize", value.to_string());
13722        }
13723        if let Some(value) = self._org_unit_id.as_ref() {
13724            params.push("orgUnitId", value);
13725        }
13726        if let Some(value) = self._order_by.as_ref() {
13727            params.push("orderBy", value);
13728        }
13729        if let Some(value) = self._filter.as_ref() {
13730            params.push("filter", value);
13731        }
13732
13733        params.extend(self._additional_params.iter());
13734
13735        params.push("alt", "json");
13736        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countInstalledApps";
13737        if self._scopes.is_empty() {
13738            self._scopes
13739                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
13740        }
13741
13742        #[allow(clippy::single_element_loop)]
13743        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
13744            url = params.uri_replacement(url, param_name, find_this, true);
13745        }
13746        {
13747            let to_remove = ["customer"];
13748            params.remove_params(&to_remove);
13749        }
13750
13751        let url = params.parse_with_url(&url);
13752
13753        loop {
13754            let token = match self
13755                .hub
13756                .auth
13757                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
13758                .await
13759            {
13760                Ok(token) => token,
13761                Err(e) => match dlg.token(e) {
13762                    Ok(token) => token,
13763                    Err(e) => {
13764                        dlg.finished(false);
13765                        return Err(common::Error::MissingToken(e));
13766                    }
13767                },
13768            };
13769            let mut req_result = {
13770                let client = &self.hub.client;
13771                dlg.pre_request();
13772                let mut req_builder = hyper::Request::builder()
13773                    .method(hyper::Method::GET)
13774                    .uri(url.as_str())
13775                    .header(USER_AGENT, self.hub._user_agent.clone());
13776
13777                if let Some(token) = token.as_ref() {
13778                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
13779                }
13780
13781                let request = req_builder
13782                    .header(CONTENT_LENGTH, 0_u64)
13783                    .body(common::to_body::<String>(None));
13784
13785                client.request(request.unwrap()).await
13786            };
13787
13788            match req_result {
13789                Err(err) => {
13790                    if let common::Retry::After(d) = dlg.http_error(&err) {
13791                        sleep(d).await;
13792                        continue;
13793                    }
13794                    dlg.finished(false);
13795                    return Err(common::Error::HttpError(err));
13796                }
13797                Ok(res) => {
13798                    let (mut parts, body) = res.into_parts();
13799                    let mut body = common::Body::new(body);
13800                    if !parts.status.is_success() {
13801                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13802                        let error = serde_json::from_str(&common::to_string(&bytes));
13803                        let response = common::to_response(parts, bytes.into());
13804
13805                        if let common::Retry::After(d) =
13806                            dlg.http_failure(&response, error.as_ref().ok())
13807                        {
13808                            sleep(d).await;
13809                            continue;
13810                        }
13811
13812                        dlg.finished(false);
13813
13814                        return Err(match error {
13815                            Ok(value) => common::Error::BadRequest(value),
13816                            _ => common::Error::Failure(response),
13817                        });
13818                    }
13819                    let response = {
13820                        let bytes = common::to_bytes(body).await.unwrap_or_default();
13821                        let encoded = common::to_string(&bytes);
13822                        match serde_json::from_str(&encoded) {
13823                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
13824                            Err(error) => {
13825                                dlg.response_json_decode_error(&encoded, &error);
13826                                return Err(common::Error::JsonDecodeError(
13827                                    encoded.to_string(),
13828                                    error,
13829                                ));
13830                            }
13831                        }
13832                    };
13833
13834                    dlg.finished(true);
13835                    return Ok(response);
13836                }
13837            }
13838        }
13839    }
13840
13841    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
13842    ///
13843    /// Sets the *customer* path property to the given value.
13844    ///
13845    /// Even though the property as already been set when instantiating this call,
13846    /// we provide this method for API completeness.
13847    pub fn customer(mut self, new_value: &str) -> CustomerReportCountInstalledAppCall<'a, C> {
13848        self._customer = new_value.to_string();
13849        self
13850    }
13851    /// Token to specify the page of the request to be returned.
13852    ///
13853    /// Sets the *page token* query property to the given value.
13854    pub fn page_token(mut self, new_value: &str) -> CustomerReportCountInstalledAppCall<'a, C> {
13855        self._page_token = Some(new_value.to_string());
13856        self
13857    }
13858    /// Maximum number of results to return. Maximum and default are 100.
13859    ///
13860    /// Sets the *page size* query property to the given value.
13861    pub fn page_size(mut self, new_value: i32) -> CustomerReportCountInstalledAppCall<'a, C> {
13862        self._page_size = Some(new_value);
13863        self
13864    }
13865    /// The ID of the organizational unit.
13866    ///
13867    /// Sets the *org unit id* query property to the given value.
13868    pub fn org_unit_id(mut self, new_value: &str) -> CustomerReportCountInstalledAppCall<'a, C> {
13869        self._org_unit_id = Some(new_value.to_string());
13870        self
13871    }
13872    /// Field used to order results. Supported order by fields: * app_name * app_type * install_type * number_of_permissions * total_install_count * app_id * manifest_versions * risk_score
13873    ///
13874    /// Sets the *order by* query property to the given value.
13875    pub fn order_by(mut self, new_value: &str) -> CustomerReportCountInstalledAppCall<'a, C> {
13876        self._order_by = Some(new_value.to_string());
13877        self
13878    }
13879    /// Query string to filter results, AND-separated fields in EBNF syntax. Note: OR operations are not supported in this filter. Supported filter fields: * app_name * app_type * install_type * number_of_permissions * total_install_count * latest_profile_active_date * permission_name * app_id * manifest_versions * risk_score
13880    ///
13881    /// Sets the *filter* query property to the given value.
13882    pub fn filter(mut self, new_value: &str) -> CustomerReportCountInstalledAppCall<'a, C> {
13883        self._filter = Some(new_value.to_string());
13884        self
13885    }
13886    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
13887    /// while executing the actual API request.
13888    ///
13889    /// ````text
13890    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
13891    /// ````
13892    ///
13893    /// Sets the *delegate* property to the given value.
13894    pub fn delegate(
13895        mut self,
13896        new_value: &'a mut dyn common::Delegate,
13897    ) -> CustomerReportCountInstalledAppCall<'a, C> {
13898        self._delegate = Some(new_value);
13899        self
13900    }
13901
13902    /// Set any additional parameter of the query string used in the request.
13903    /// It should be used to set parameters which are not yet available through their own
13904    /// setters.
13905    ///
13906    /// Please note that this method must not be used to set any of the known parameters
13907    /// which have their own setter method. If done anyway, the request will fail.
13908    ///
13909    /// # Additional Parameters
13910    ///
13911    /// * *$.xgafv* (query-string) - V1 error format.
13912    /// * *access_token* (query-string) - OAuth access token.
13913    /// * *alt* (query-string) - Data format for response.
13914    /// * *callback* (query-string) - JSONP
13915    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
13916    /// * *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.
13917    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
13918    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
13919    /// * *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.
13920    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
13921    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
13922    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountInstalledAppCall<'a, C>
13923    where
13924        T: AsRef<str>,
13925    {
13926        self._additional_params
13927            .insert(name.as_ref().to_string(), value.as_ref().to_string());
13928        self
13929    }
13930
13931    /// Identifies the authorization scope for the method you are building.
13932    ///
13933    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
13934    /// [`Scope::ChromeManagementReportReadonly`].
13935    ///
13936    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
13937    /// tokens for more than one scope.
13938    ///
13939    /// Usually there is more than one suitable scope to authorize an operation, some of which may
13940    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
13941    /// sufficient, a read-write scope will do as well.
13942    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountInstalledAppCall<'a, C>
13943    where
13944        St: AsRef<str>,
13945    {
13946        self._scopes.insert(String::from(scope.as_ref()));
13947        self
13948    }
13949    /// Identifies the authorization scope(s) for the method you are building.
13950    ///
13951    /// See [`Self::add_scope()`] for details.
13952    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportCountInstalledAppCall<'a, C>
13953    where
13954        I: IntoIterator<Item = St>,
13955        St: AsRef<str>,
13956    {
13957        self._scopes
13958            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
13959        self
13960    }
13961
13962    /// Removes all scopes, and no default scope will be used either.
13963    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
13964    /// for details).
13965    pub fn clear_scopes(mut self) -> CustomerReportCountInstalledAppCall<'a, C> {
13966        self._scopes.clear();
13967        self
13968    }
13969}
13970
13971/// Get a summary of printing done by each printer.
13972///
13973/// A builder for the *reports.countPrintJobsByPrinter* method supported by a *customer* resource.
13974/// It is not used directly, but through a [`CustomerMethods`] instance.
13975///
13976/// # Example
13977///
13978/// Instantiate a resource method builder
13979///
13980/// ```test_harness,no_run
13981/// # extern crate hyper;
13982/// # extern crate hyper_rustls;
13983/// # extern crate google_chromemanagement1 as chromemanagement1;
13984/// # async fn dox() {
13985/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
13986///
13987/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
13988/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
13989/// #     .with_native_roots()
13990/// #     .unwrap()
13991/// #     .https_only()
13992/// #     .enable_http2()
13993/// #     .build();
13994///
13995/// # let executor = hyper_util::rt::TokioExecutor::new();
13996/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
13997/// #     secret,
13998/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
13999/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
14000/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
14001/// #     ),
14002/// # ).build().await.unwrap();
14003///
14004/// # let client = hyper_util::client::legacy::Client::builder(
14005/// #     hyper_util::rt::TokioExecutor::new()
14006/// # )
14007/// # .build(
14008/// #     hyper_rustls::HttpsConnectorBuilder::new()
14009/// #         .with_native_roots()
14010/// #         .unwrap()
14011/// #         .https_or_http()
14012/// #         .enable_http2()
14013/// #         .build()
14014/// # );
14015/// # let mut hub = ChromeManagement::new(client, auth);
14016/// // You can configure optional parameters by calling the respective setters at will, and
14017/// // execute the final call using `doit()`.
14018/// // Values shown here are possibly random and not representative !
14019/// let result = hub.customers().reports_count_print_jobs_by_printer("customer")
14020///              .printer_org_unit_id("consetetur")
14021///              .page_token("voluptua.")
14022///              .page_size(-72)
14023///              .order_by("erat")
14024///              .filter("consetetur")
14025///              .doit().await;
14026/// # }
14027/// ```
14028pub struct CustomerReportCountPrintJobsByPrinterCall<'a, C>
14029where
14030    C: 'a,
14031{
14032    hub: &'a ChromeManagement<C>,
14033    _customer: String,
14034    _printer_org_unit_id: Option<String>,
14035    _page_token: Option<String>,
14036    _page_size: Option<i32>,
14037    _order_by: Option<String>,
14038    _filter: Option<String>,
14039    _delegate: Option<&'a mut dyn common::Delegate>,
14040    _additional_params: HashMap<String, String>,
14041    _scopes: BTreeSet<String>,
14042}
14043
14044impl<'a, C> common::CallBuilder for CustomerReportCountPrintJobsByPrinterCall<'a, C> {}
14045
14046impl<'a, C> CustomerReportCountPrintJobsByPrinterCall<'a, C>
14047where
14048    C: common::Connector,
14049{
14050    /// Perform the operation you have build so far.
14051    pub async fn doit(
14052        mut self,
14053    ) -> common::Result<(
14054        common::Response,
14055        GoogleChromeManagementV1CountPrintJobsByPrinterResponse,
14056    )> {
14057        use std::borrow::Cow;
14058        use std::io::{Read, Seek};
14059
14060        use common::{url::Params, ToParts};
14061        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
14062
14063        let mut dd = common::DefaultDelegate;
14064        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
14065        dlg.begin(common::MethodInfo {
14066            id: "chromemanagement.customers.reports.countPrintJobsByPrinter",
14067            http_method: hyper::Method::GET,
14068        });
14069
14070        for &field in [
14071            "alt",
14072            "customer",
14073            "printerOrgUnitId",
14074            "pageToken",
14075            "pageSize",
14076            "orderBy",
14077            "filter",
14078        ]
14079        .iter()
14080        {
14081            if self._additional_params.contains_key(field) {
14082                dlg.finished(false);
14083                return Err(common::Error::FieldClash(field));
14084            }
14085        }
14086
14087        let mut params = Params::with_capacity(8 + self._additional_params.len());
14088        params.push("customer", self._customer);
14089        if let Some(value) = self._printer_org_unit_id.as_ref() {
14090            params.push("printerOrgUnitId", value);
14091        }
14092        if let Some(value) = self._page_token.as_ref() {
14093            params.push("pageToken", value);
14094        }
14095        if let Some(value) = self._page_size.as_ref() {
14096            params.push("pageSize", value.to_string());
14097        }
14098        if let Some(value) = self._order_by.as_ref() {
14099            params.push("orderBy", value);
14100        }
14101        if let Some(value) = self._filter.as_ref() {
14102            params.push("filter", value);
14103        }
14104
14105        params.extend(self._additional_params.iter());
14106
14107        params.push("alt", "json");
14108        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countPrintJobsByPrinter";
14109        if self._scopes.is_empty() {
14110            self._scopes
14111                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
14112        }
14113
14114        #[allow(clippy::single_element_loop)]
14115        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
14116            url = params.uri_replacement(url, param_name, find_this, true);
14117        }
14118        {
14119            let to_remove = ["customer"];
14120            params.remove_params(&to_remove);
14121        }
14122
14123        let url = params.parse_with_url(&url);
14124
14125        loop {
14126            let token = match self
14127                .hub
14128                .auth
14129                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
14130                .await
14131            {
14132                Ok(token) => token,
14133                Err(e) => match dlg.token(e) {
14134                    Ok(token) => token,
14135                    Err(e) => {
14136                        dlg.finished(false);
14137                        return Err(common::Error::MissingToken(e));
14138                    }
14139                },
14140            };
14141            let mut req_result = {
14142                let client = &self.hub.client;
14143                dlg.pre_request();
14144                let mut req_builder = hyper::Request::builder()
14145                    .method(hyper::Method::GET)
14146                    .uri(url.as_str())
14147                    .header(USER_AGENT, self.hub._user_agent.clone());
14148
14149                if let Some(token) = token.as_ref() {
14150                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14151                }
14152
14153                let request = req_builder
14154                    .header(CONTENT_LENGTH, 0_u64)
14155                    .body(common::to_body::<String>(None));
14156
14157                client.request(request.unwrap()).await
14158            };
14159
14160            match req_result {
14161                Err(err) => {
14162                    if let common::Retry::After(d) = dlg.http_error(&err) {
14163                        sleep(d).await;
14164                        continue;
14165                    }
14166                    dlg.finished(false);
14167                    return Err(common::Error::HttpError(err));
14168                }
14169                Ok(res) => {
14170                    let (mut parts, body) = res.into_parts();
14171                    let mut body = common::Body::new(body);
14172                    if !parts.status.is_success() {
14173                        let bytes = common::to_bytes(body).await.unwrap_or_default();
14174                        let error = serde_json::from_str(&common::to_string(&bytes));
14175                        let response = common::to_response(parts, bytes.into());
14176
14177                        if let common::Retry::After(d) =
14178                            dlg.http_failure(&response, error.as_ref().ok())
14179                        {
14180                            sleep(d).await;
14181                            continue;
14182                        }
14183
14184                        dlg.finished(false);
14185
14186                        return Err(match error {
14187                            Ok(value) => common::Error::BadRequest(value),
14188                            _ => common::Error::Failure(response),
14189                        });
14190                    }
14191                    let response = {
14192                        let bytes = common::to_bytes(body).await.unwrap_or_default();
14193                        let encoded = common::to_string(&bytes);
14194                        match serde_json::from_str(&encoded) {
14195                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
14196                            Err(error) => {
14197                                dlg.response_json_decode_error(&encoded, &error);
14198                                return Err(common::Error::JsonDecodeError(
14199                                    encoded.to_string(),
14200                                    error,
14201                                ));
14202                            }
14203                        }
14204                    };
14205
14206                    dlg.finished(true);
14207                    return Ok(response);
14208                }
14209            }
14210        }
14211    }
14212
14213    /// Required. Customer ID prefixed with "customers/" or "customers/my_customer" to use the customer associated to the account making the request.
14214    ///
14215    /// Sets the *customer* path property to the given value.
14216    ///
14217    /// Even though the property as already been set when instantiating this call,
14218    /// we provide this method for API completeness.
14219    pub fn customer(mut self, new_value: &str) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14220        self._customer = new_value.to_string();
14221        self
14222    }
14223    /// The ID of the organizational unit for printers. If specified, only data for printers from the specified organizational unit will be returned. If omitted, data for printers from all organizational units will be returned.
14224    ///
14225    /// Sets the *printer org unit id* query property to the given value.
14226    pub fn printer_org_unit_id(
14227        mut self,
14228        new_value: &str,
14229    ) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14230        self._printer_org_unit_id = Some(new_value.to_string());
14231        self
14232    }
14233    /// Token to specify the page of the response to be returned.
14234    ///
14235    /// Sets the *page token* query property to the given value.
14236    pub fn page_token(
14237        mut self,
14238        new_value: &str,
14239    ) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14240        self._page_token = Some(new_value.to_string());
14241        self
14242    }
14243    /// Maximum number of results to return. Maximum and default are 100.
14244    ///
14245    /// Sets the *page size* query property to the given value.
14246    pub fn page_size(mut self, new_value: i32) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14247        self._page_size = Some(new_value);
14248        self
14249    }
14250    /// Field used to order results. If omitted, results will be ordered in ascending order of the 'printer' field. Supported order_by fields: * printer * job_count * device_count * user_count
14251    ///
14252    /// Sets the *order by* query property to the given value.
14253    pub fn order_by(mut self, new_value: &str) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14254        self._order_by = Some(new_value.to_string());
14255        self
14256    }
14257    /// Query string to filter results, AND-separated fields in EBNF syntax. Note: OR operations are not supported in this filter. Note: Only >= and <= comparators are supported in this filter. Supported filter fields: * complete_time
14258    ///
14259    /// Sets the *filter* query property to the given value.
14260    pub fn filter(mut self, new_value: &str) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14261        self._filter = Some(new_value.to_string());
14262        self
14263    }
14264    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
14265    /// while executing the actual API request.
14266    ///
14267    /// ````text
14268    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
14269    /// ````
14270    ///
14271    /// Sets the *delegate* property to the given value.
14272    pub fn delegate(
14273        mut self,
14274        new_value: &'a mut dyn common::Delegate,
14275    ) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14276        self._delegate = Some(new_value);
14277        self
14278    }
14279
14280    /// Set any additional parameter of the query string used in the request.
14281    /// It should be used to set parameters which are not yet available through their own
14282    /// setters.
14283    ///
14284    /// Please note that this method must not be used to set any of the known parameters
14285    /// which have their own setter method. If done anyway, the request will fail.
14286    ///
14287    /// # Additional Parameters
14288    ///
14289    /// * *$.xgafv* (query-string) - V1 error format.
14290    /// * *access_token* (query-string) - OAuth access token.
14291    /// * *alt* (query-string) - Data format for response.
14292    /// * *callback* (query-string) - JSONP
14293    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
14294    /// * *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.
14295    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
14296    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
14297    /// * *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.
14298    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
14299    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
14300    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountPrintJobsByPrinterCall<'a, C>
14301    where
14302        T: AsRef<str>,
14303    {
14304        self._additional_params
14305            .insert(name.as_ref().to_string(), value.as_ref().to_string());
14306        self
14307    }
14308
14309    /// Identifies the authorization scope for the method you are building.
14310    ///
14311    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
14312    /// [`Scope::ChromeManagementReportReadonly`].
14313    ///
14314    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
14315    /// tokens for more than one scope.
14316    ///
14317    /// Usually there is more than one suitable scope to authorize an operation, some of which may
14318    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
14319    /// sufficient, a read-write scope will do as well.
14320    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountPrintJobsByPrinterCall<'a, C>
14321    where
14322        St: AsRef<str>,
14323    {
14324        self._scopes.insert(String::from(scope.as_ref()));
14325        self
14326    }
14327    /// Identifies the authorization scope(s) for the method you are building.
14328    ///
14329    /// See [`Self::add_scope()`] for details.
14330    pub fn add_scopes<I, St>(
14331        mut self,
14332        scopes: I,
14333    ) -> CustomerReportCountPrintJobsByPrinterCall<'a, C>
14334    where
14335        I: IntoIterator<Item = St>,
14336        St: AsRef<str>,
14337    {
14338        self._scopes
14339            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
14340        self
14341    }
14342
14343    /// Removes all scopes, and no default scope will be used either.
14344    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
14345    /// for details).
14346    pub fn clear_scopes(mut self) -> CustomerReportCountPrintJobsByPrinterCall<'a, C> {
14347        self._scopes.clear();
14348        self
14349    }
14350}
14351
14352/// Get a summary of printing done by each user.
14353///
14354/// A builder for the *reports.countPrintJobsByUser* method supported by a *customer* resource.
14355/// It is not used directly, but through a [`CustomerMethods`] instance.
14356///
14357/// # Example
14358///
14359/// Instantiate a resource method builder
14360///
14361/// ```test_harness,no_run
14362/// # extern crate hyper;
14363/// # extern crate hyper_rustls;
14364/// # extern crate google_chromemanagement1 as chromemanagement1;
14365/// # async fn dox() {
14366/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
14367///
14368/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
14369/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
14370/// #     .with_native_roots()
14371/// #     .unwrap()
14372/// #     .https_only()
14373/// #     .enable_http2()
14374/// #     .build();
14375///
14376/// # let executor = hyper_util::rt::TokioExecutor::new();
14377/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
14378/// #     secret,
14379/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
14380/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
14381/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
14382/// #     ),
14383/// # ).build().await.unwrap();
14384///
14385/// # let client = hyper_util::client::legacy::Client::builder(
14386/// #     hyper_util::rt::TokioExecutor::new()
14387/// # )
14388/// # .build(
14389/// #     hyper_rustls::HttpsConnectorBuilder::new()
14390/// #         .with_native_roots()
14391/// #         .unwrap()
14392/// #         .https_or_http()
14393/// #         .enable_http2()
14394/// #         .build()
14395/// # );
14396/// # let mut hub = ChromeManagement::new(client, auth);
14397/// // You can configure optional parameters by calling the respective setters at will, and
14398/// // execute the final call using `doit()`.
14399/// // Values shown here are possibly random and not representative !
14400/// let result = hub.customers().reports_count_print_jobs_by_user("customer")
14401///              .printer_org_unit_id("sed")
14402///              .page_token("takimata")
14403///              .page_size(-19)
14404///              .order_by("gubergren")
14405///              .filter("et")
14406///              .doit().await;
14407/// # }
14408/// ```
14409pub struct CustomerReportCountPrintJobsByUserCall<'a, C>
14410where
14411    C: 'a,
14412{
14413    hub: &'a ChromeManagement<C>,
14414    _customer: String,
14415    _printer_org_unit_id: Option<String>,
14416    _page_token: Option<String>,
14417    _page_size: Option<i32>,
14418    _order_by: Option<String>,
14419    _filter: Option<String>,
14420    _delegate: Option<&'a mut dyn common::Delegate>,
14421    _additional_params: HashMap<String, String>,
14422    _scopes: BTreeSet<String>,
14423}
14424
14425impl<'a, C> common::CallBuilder for CustomerReportCountPrintJobsByUserCall<'a, C> {}
14426
14427impl<'a, C> CustomerReportCountPrintJobsByUserCall<'a, C>
14428where
14429    C: common::Connector,
14430{
14431    /// Perform the operation you have build so far.
14432    pub async fn doit(
14433        mut self,
14434    ) -> common::Result<(
14435        common::Response,
14436        GoogleChromeManagementV1CountPrintJobsByUserResponse,
14437    )> {
14438        use std::borrow::Cow;
14439        use std::io::{Read, Seek};
14440
14441        use common::{url::Params, ToParts};
14442        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
14443
14444        let mut dd = common::DefaultDelegate;
14445        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
14446        dlg.begin(common::MethodInfo {
14447            id: "chromemanagement.customers.reports.countPrintJobsByUser",
14448            http_method: hyper::Method::GET,
14449        });
14450
14451        for &field in [
14452            "alt",
14453            "customer",
14454            "printerOrgUnitId",
14455            "pageToken",
14456            "pageSize",
14457            "orderBy",
14458            "filter",
14459        ]
14460        .iter()
14461        {
14462            if self._additional_params.contains_key(field) {
14463                dlg.finished(false);
14464                return Err(common::Error::FieldClash(field));
14465            }
14466        }
14467
14468        let mut params = Params::with_capacity(8 + self._additional_params.len());
14469        params.push("customer", self._customer);
14470        if let Some(value) = self._printer_org_unit_id.as_ref() {
14471            params.push("printerOrgUnitId", value);
14472        }
14473        if let Some(value) = self._page_token.as_ref() {
14474            params.push("pageToken", value);
14475        }
14476        if let Some(value) = self._page_size.as_ref() {
14477            params.push("pageSize", value.to_string());
14478        }
14479        if let Some(value) = self._order_by.as_ref() {
14480            params.push("orderBy", value);
14481        }
14482        if let Some(value) = self._filter.as_ref() {
14483            params.push("filter", value);
14484        }
14485
14486        params.extend(self._additional_params.iter());
14487
14488        params.push("alt", "json");
14489        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:countPrintJobsByUser";
14490        if self._scopes.is_empty() {
14491            self._scopes
14492                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
14493        }
14494
14495        #[allow(clippy::single_element_loop)]
14496        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
14497            url = params.uri_replacement(url, param_name, find_this, true);
14498        }
14499        {
14500            let to_remove = ["customer"];
14501            params.remove_params(&to_remove);
14502        }
14503
14504        let url = params.parse_with_url(&url);
14505
14506        loop {
14507            let token = match self
14508                .hub
14509                .auth
14510                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
14511                .await
14512            {
14513                Ok(token) => token,
14514                Err(e) => match dlg.token(e) {
14515                    Ok(token) => token,
14516                    Err(e) => {
14517                        dlg.finished(false);
14518                        return Err(common::Error::MissingToken(e));
14519                    }
14520                },
14521            };
14522            let mut req_result = {
14523                let client = &self.hub.client;
14524                dlg.pre_request();
14525                let mut req_builder = hyper::Request::builder()
14526                    .method(hyper::Method::GET)
14527                    .uri(url.as_str())
14528                    .header(USER_AGENT, self.hub._user_agent.clone());
14529
14530                if let Some(token) = token.as_ref() {
14531                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14532                }
14533
14534                let request = req_builder
14535                    .header(CONTENT_LENGTH, 0_u64)
14536                    .body(common::to_body::<String>(None));
14537
14538                client.request(request.unwrap()).await
14539            };
14540
14541            match req_result {
14542                Err(err) => {
14543                    if let common::Retry::After(d) = dlg.http_error(&err) {
14544                        sleep(d).await;
14545                        continue;
14546                    }
14547                    dlg.finished(false);
14548                    return Err(common::Error::HttpError(err));
14549                }
14550                Ok(res) => {
14551                    let (mut parts, body) = res.into_parts();
14552                    let mut body = common::Body::new(body);
14553                    if !parts.status.is_success() {
14554                        let bytes = common::to_bytes(body).await.unwrap_or_default();
14555                        let error = serde_json::from_str(&common::to_string(&bytes));
14556                        let response = common::to_response(parts, bytes.into());
14557
14558                        if let common::Retry::After(d) =
14559                            dlg.http_failure(&response, error.as_ref().ok())
14560                        {
14561                            sleep(d).await;
14562                            continue;
14563                        }
14564
14565                        dlg.finished(false);
14566
14567                        return Err(match error {
14568                            Ok(value) => common::Error::BadRequest(value),
14569                            _ => common::Error::Failure(response),
14570                        });
14571                    }
14572                    let response = {
14573                        let bytes = common::to_bytes(body).await.unwrap_or_default();
14574                        let encoded = common::to_string(&bytes);
14575                        match serde_json::from_str(&encoded) {
14576                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
14577                            Err(error) => {
14578                                dlg.response_json_decode_error(&encoded, &error);
14579                                return Err(common::Error::JsonDecodeError(
14580                                    encoded.to_string(),
14581                                    error,
14582                                ));
14583                            }
14584                        }
14585                    };
14586
14587                    dlg.finished(true);
14588                    return Ok(response);
14589                }
14590            }
14591        }
14592    }
14593
14594    /// Required. Customer ID prefixed with "customers/" or "customers/my_customer" to use the customer associated to the account making the request.
14595    ///
14596    /// Sets the *customer* path property to the given value.
14597    ///
14598    /// Even though the property as already been set when instantiating this call,
14599    /// we provide this method for API completeness.
14600    pub fn customer(mut self, new_value: &str) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14601        self._customer = new_value.to_string();
14602        self
14603    }
14604    /// The ID of the organizational unit for printers. If specified, only print jobs initiated with printers from the specified organizational unit will be counted. If omitted, all print jobs will be counted.
14605    ///
14606    /// Sets the *printer org unit id* query property to the given value.
14607    pub fn printer_org_unit_id(
14608        mut self,
14609        new_value: &str,
14610    ) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14611        self._printer_org_unit_id = Some(new_value.to_string());
14612        self
14613    }
14614    /// Token to specify the page of the response to be returned.
14615    ///
14616    /// Sets the *page token* query property to the given value.
14617    pub fn page_token(mut self, new_value: &str) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14618        self._page_token = Some(new_value.to_string());
14619        self
14620    }
14621    /// Maximum number of results to return. Maximum and default are 100.
14622    ///
14623    /// Sets the *page size* query property to the given value.
14624    pub fn page_size(mut self, new_value: i32) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14625        self._page_size = Some(new_value);
14626        self
14627    }
14628    /// Field used to order results. If omitted, results will be ordered in ascending order of the 'user_email' field. Supported order_by fields: * user_email * job_count * printer_count * device_count
14629    ///
14630    /// Sets the *order by* query property to the given value.
14631    pub fn order_by(mut self, new_value: &str) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14632        self._order_by = Some(new_value.to_string());
14633        self
14634    }
14635    /// Query string to filter results, AND-separated fields in EBNF syntax. Note: OR operations are not supported in this filter. Note: Only >= and <= comparators are supported in this filter. Supported filter fields: * complete_time
14636    ///
14637    /// Sets the *filter* query property to the given value.
14638    pub fn filter(mut self, new_value: &str) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14639        self._filter = Some(new_value.to_string());
14640        self
14641    }
14642    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
14643    /// while executing the actual API request.
14644    ///
14645    /// ````text
14646    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
14647    /// ````
14648    ///
14649    /// Sets the *delegate* property to the given value.
14650    pub fn delegate(
14651        mut self,
14652        new_value: &'a mut dyn common::Delegate,
14653    ) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14654        self._delegate = Some(new_value);
14655        self
14656    }
14657
14658    /// Set any additional parameter of the query string used in the request.
14659    /// It should be used to set parameters which are not yet available through their own
14660    /// setters.
14661    ///
14662    /// Please note that this method must not be used to set any of the known parameters
14663    /// which have their own setter method. If done anyway, the request will fail.
14664    ///
14665    /// # Additional Parameters
14666    ///
14667    /// * *$.xgafv* (query-string) - V1 error format.
14668    /// * *access_token* (query-string) - OAuth access token.
14669    /// * *alt* (query-string) - Data format for response.
14670    /// * *callback* (query-string) - JSONP
14671    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
14672    /// * *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.
14673    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
14674    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
14675    /// * *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.
14676    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
14677    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
14678    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportCountPrintJobsByUserCall<'a, C>
14679    where
14680        T: AsRef<str>,
14681    {
14682        self._additional_params
14683            .insert(name.as_ref().to_string(), value.as_ref().to_string());
14684        self
14685    }
14686
14687    /// Identifies the authorization scope for the method you are building.
14688    ///
14689    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
14690    /// [`Scope::ChromeManagementReportReadonly`].
14691    ///
14692    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
14693    /// tokens for more than one scope.
14694    ///
14695    /// Usually there is more than one suitable scope to authorize an operation, some of which may
14696    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
14697    /// sufficient, a read-write scope will do as well.
14698    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportCountPrintJobsByUserCall<'a, C>
14699    where
14700        St: AsRef<str>,
14701    {
14702        self._scopes.insert(String::from(scope.as_ref()));
14703        self
14704    }
14705    /// Identifies the authorization scope(s) for the method you are building.
14706    ///
14707    /// See [`Self::add_scope()`] for details.
14708    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportCountPrintJobsByUserCall<'a, C>
14709    where
14710        I: IntoIterator<Item = St>,
14711        St: AsRef<str>,
14712    {
14713        self._scopes
14714            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
14715        self
14716    }
14717
14718    /// Removes all scopes, and no default scope will be used either.
14719    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
14720    /// for details).
14721    pub fn clear_scopes(mut self) -> CustomerReportCountPrintJobsByUserCall<'a, C> {
14722        self._scopes.clear();
14723        self
14724    }
14725}
14726
14727/// Get a list of print jobs.
14728///
14729/// A builder for the *reports.enumeratePrintJobs* method supported by a *customer* resource.
14730/// It is not used directly, but through a [`CustomerMethods`] instance.
14731///
14732/// # Example
14733///
14734/// Instantiate a resource method builder
14735///
14736/// ```test_harness,no_run
14737/// # extern crate hyper;
14738/// # extern crate hyper_rustls;
14739/// # extern crate google_chromemanagement1 as chromemanagement1;
14740/// # async fn dox() {
14741/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
14742///
14743/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
14744/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
14745/// #     .with_native_roots()
14746/// #     .unwrap()
14747/// #     .https_only()
14748/// #     .enable_http2()
14749/// #     .build();
14750///
14751/// # let executor = hyper_util::rt::TokioExecutor::new();
14752/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
14753/// #     secret,
14754/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
14755/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
14756/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
14757/// #     ),
14758/// # ).build().await.unwrap();
14759///
14760/// # let client = hyper_util::client::legacy::Client::builder(
14761/// #     hyper_util::rt::TokioExecutor::new()
14762/// # )
14763/// # .build(
14764/// #     hyper_rustls::HttpsConnectorBuilder::new()
14765/// #         .with_native_roots()
14766/// #         .unwrap()
14767/// #         .https_or_http()
14768/// #         .enable_http2()
14769/// #         .build()
14770/// # );
14771/// # let mut hub = ChromeManagement::new(client, auth);
14772/// // You can configure optional parameters by calling the respective setters at will, and
14773/// // execute the final call using `doit()`.
14774/// // Values shown here are possibly random and not representative !
14775/// let result = hub.customers().reports_enumerate_print_jobs("customer")
14776///              .printer_org_unit_id("voluptua.")
14777///              .page_token("dolore")
14778///              .page_size(-34)
14779///              .order_by("dolore")
14780///              .filter("voluptua.")
14781///              .doit().await;
14782/// # }
14783/// ```
14784pub struct CustomerReportEnumeratePrintJobCall<'a, C>
14785where
14786    C: 'a,
14787{
14788    hub: &'a ChromeManagement<C>,
14789    _customer: String,
14790    _printer_org_unit_id: Option<String>,
14791    _page_token: Option<String>,
14792    _page_size: Option<i32>,
14793    _order_by: Option<String>,
14794    _filter: Option<String>,
14795    _delegate: Option<&'a mut dyn common::Delegate>,
14796    _additional_params: HashMap<String, String>,
14797    _scopes: BTreeSet<String>,
14798}
14799
14800impl<'a, C> common::CallBuilder for CustomerReportEnumeratePrintJobCall<'a, C> {}
14801
14802impl<'a, C> CustomerReportEnumeratePrintJobCall<'a, C>
14803where
14804    C: common::Connector,
14805{
14806    /// Perform the operation you have build so far.
14807    pub async fn doit(
14808        mut self,
14809    ) -> common::Result<(
14810        common::Response,
14811        GoogleChromeManagementV1EnumeratePrintJobsResponse,
14812    )> {
14813        use std::borrow::Cow;
14814        use std::io::{Read, Seek};
14815
14816        use common::{url::Params, ToParts};
14817        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
14818
14819        let mut dd = common::DefaultDelegate;
14820        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
14821        dlg.begin(common::MethodInfo {
14822            id: "chromemanagement.customers.reports.enumeratePrintJobs",
14823            http_method: hyper::Method::GET,
14824        });
14825
14826        for &field in [
14827            "alt",
14828            "customer",
14829            "printerOrgUnitId",
14830            "pageToken",
14831            "pageSize",
14832            "orderBy",
14833            "filter",
14834        ]
14835        .iter()
14836        {
14837            if self._additional_params.contains_key(field) {
14838                dlg.finished(false);
14839                return Err(common::Error::FieldClash(field));
14840            }
14841        }
14842
14843        let mut params = Params::with_capacity(8 + self._additional_params.len());
14844        params.push("customer", self._customer);
14845        if let Some(value) = self._printer_org_unit_id.as_ref() {
14846            params.push("printerOrgUnitId", value);
14847        }
14848        if let Some(value) = self._page_token.as_ref() {
14849            params.push("pageToken", value);
14850        }
14851        if let Some(value) = self._page_size.as_ref() {
14852            params.push("pageSize", value.to_string());
14853        }
14854        if let Some(value) = self._order_by.as_ref() {
14855            params.push("orderBy", value);
14856        }
14857        if let Some(value) = self._filter.as_ref() {
14858            params.push("filter", value);
14859        }
14860
14861        params.extend(self._additional_params.iter());
14862
14863        params.push("alt", "json");
14864        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:enumeratePrintJobs";
14865        if self._scopes.is_empty() {
14866            self._scopes
14867                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
14868        }
14869
14870        #[allow(clippy::single_element_loop)]
14871        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
14872            url = params.uri_replacement(url, param_name, find_this, true);
14873        }
14874        {
14875            let to_remove = ["customer"];
14876            params.remove_params(&to_remove);
14877        }
14878
14879        let url = params.parse_with_url(&url);
14880
14881        loop {
14882            let token = match self
14883                .hub
14884                .auth
14885                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
14886                .await
14887            {
14888                Ok(token) => token,
14889                Err(e) => match dlg.token(e) {
14890                    Ok(token) => token,
14891                    Err(e) => {
14892                        dlg.finished(false);
14893                        return Err(common::Error::MissingToken(e));
14894                    }
14895                },
14896            };
14897            let mut req_result = {
14898                let client = &self.hub.client;
14899                dlg.pre_request();
14900                let mut req_builder = hyper::Request::builder()
14901                    .method(hyper::Method::GET)
14902                    .uri(url.as_str())
14903                    .header(USER_AGENT, self.hub._user_agent.clone());
14904
14905                if let Some(token) = token.as_ref() {
14906                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
14907                }
14908
14909                let request = req_builder
14910                    .header(CONTENT_LENGTH, 0_u64)
14911                    .body(common::to_body::<String>(None));
14912
14913                client.request(request.unwrap()).await
14914            };
14915
14916            match req_result {
14917                Err(err) => {
14918                    if let common::Retry::After(d) = dlg.http_error(&err) {
14919                        sleep(d).await;
14920                        continue;
14921                    }
14922                    dlg.finished(false);
14923                    return Err(common::Error::HttpError(err));
14924                }
14925                Ok(res) => {
14926                    let (mut parts, body) = res.into_parts();
14927                    let mut body = common::Body::new(body);
14928                    if !parts.status.is_success() {
14929                        let bytes = common::to_bytes(body).await.unwrap_or_default();
14930                        let error = serde_json::from_str(&common::to_string(&bytes));
14931                        let response = common::to_response(parts, bytes.into());
14932
14933                        if let common::Retry::After(d) =
14934                            dlg.http_failure(&response, error.as_ref().ok())
14935                        {
14936                            sleep(d).await;
14937                            continue;
14938                        }
14939
14940                        dlg.finished(false);
14941
14942                        return Err(match error {
14943                            Ok(value) => common::Error::BadRequest(value),
14944                            _ => common::Error::Failure(response),
14945                        });
14946                    }
14947                    let response = {
14948                        let bytes = common::to_bytes(body).await.unwrap_or_default();
14949                        let encoded = common::to_string(&bytes);
14950                        match serde_json::from_str(&encoded) {
14951                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
14952                            Err(error) => {
14953                                dlg.response_json_decode_error(&encoded, &error);
14954                                return Err(common::Error::JsonDecodeError(
14955                                    encoded.to_string(),
14956                                    error,
14957                                ));
14958                            }
14959                        }
14960                    };
14961
14962                    dlg.finished(true);
14963                    return Ok(response);
14964                }
14965            }
14966        }
14967    }
14968
14969    /// Required. Customer ID prefixed with "customers/" or "customers/my_customer" to use the customer associated to the account making the request.
14970    ///
14971    /// Sets the *customer* path property to the given value.
14972    ///
14973    /// Even though the property as already been set when instantiating this call,
14974    /// we provide this method for API completeness.
14975    pub fn customer(mut self, new_value: &str) -> CustomerReportEnumeratePrintJobCall<'a, C> {
14976        self._customer = new_value.to_string();
14977        self
14978    }
14979    /// The ID of the organizational unit for printers. If specified, only print jobs submitted to printers from the specified organizational unit will be returned.
14980    ///
14981    /// Sets the *printer org unit id* query property to the given value.
14982    pub fn printer_org_unit_id(
14983        mut self,
14984        new_value: &str,
14985    ) -> CustomerReportEnumeratePrintJobCall<'a, C> {
14986        self._printer_org_unit_id = Some(new_value.to_string());
14987        self
14988    }
14989    /// A page token received from a previous `EnumeratePrintJobs` call. Provide this to retrieve the subsequent page. If omitted, the first page of results will be returned. When paginating, all other parameters provided to `EnumeratePrintJobs` must match the call that provided the page token.
14990    ///
14991    /// Sets the *page token* query property to the given value.
14992    pub fn page_token(mut self, new_value: &str) -> CustomerReportEnumeratePrintJobCall<'a, C> {
14993        self._page_token = Some(new_value.to_string());
14994        self
14995    }
14996    /// The number of print jobs in the page from 0 to 100 inclusive, if page_size is not specified or zero, the size will be 50.
14997    ///
14998    /// Sets the *page size* query property to the given value.
14999    pub fn page_size(mut self, new_value: i32) -> CustomerReportEnumeratePrintJobCall<'a, C> {
15000        self._page_size = Some(new_value);
15001        self
15002    }
15003    /// Field used to order results. If not specified, results will be ordered in descending order of the `complete_time` field. Supported order by fields: * title * state * create_time * complete_time * document_page_count * color_mode * duplex_mode * printer * user_email
15004    ///
15005    /// Sets the *order by* query property to the given value.
15006    pub fn order_by(mut self, new_value: &str) -> CustomerReportEnumeratePrintJobCall<'a, C> {
15007        self._order_by = Some(new_value.to_string());
15008        self
15009    }
15010    /// Query string to filter results, AND-separated fields in EBNF syntax. Note: OR operations are not supported in this filter. Note: Only >= and <= comparators are supported for `complete_time`. Note: Only = comparator supported for `user_id` and `printer_id`. Supported filter fields: * complete_time * printer_id * user_id
15011    ///
15012    /// Sets the *filter* query property to the given value.
15013    pub fn filter(mut self, new_value: &str) -> CustomerReportEnumeratePrintJobCall<'a, C> {
15014        self._filter = Some(new_value.to_string());
15015        self
15016    }
15017    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
15018    /// while executing the actual API request.
15019    ///
15020    /// ````text
15021    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
15022    /// ````
15023    ///
15024    /// Sets the *delegate* property to the given value.
15025    pub fn delegate(
15026        mut self,
15027        new_value: &'a mut dyn common::Delegate,
15028    ) -> CustomerReportEnumeratePrintJobCall<'a, C> {
15029        self._delegate = Some(new_value);
15030        self
15031    }
15032
15033    /// Set any additional parameter of the query string used in the request.
15034    /// It should be used to set parameters which are not yet available through their own
15035    /// setters.
15036    ///
15037    /// Please note that this method must not be used to set any of the known parameters
15038    /// which have their own setter method. If done anyway, the request will fail.
15039    ///
15040    /// # Additional Parameters
15041    ///
15042    /// * *$.xgafv* (query-string) - V1 error format.
15043    /// * *access_token* (query-string) - OAuth access token.
15044    /// * *alt* (query-string) - Data format for response.
15045    /// * *callback* (query-string) - JSONP
15046    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
15047    /// * *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.
15048    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
15049    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
15050    /// * *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.
15051    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
15052    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
15053    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportEnumeratePrintJobCall<'a, C>
15054    where
15055        T: AsRef<str>,
15056    {
15057        self._additional_params
15058            .insert(name.as_ref().to_string(), value.as_ref().to_string());
15059        self
15060    }
15061
15062    /// Identifies the authorization scope for the method you are building.
15063    ///
15064    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15065    /// [`Scope::ChromeManagementReportReadonly`].
15066    ///
15067    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15068    /// tokens for more than one scope.
15069    ///
15070    /// Usually there is more than one suitable scope to authorize an operation, some of which may
15071    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15072    /// sufficient, a read-write scope will do as well.
15073    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportEnumeratePrintJobCall<'a, C>
15074    where
15075        St: AsRef<str>,
15076    {
15077        self._scopes.insert(String::from(scope.as_ref()));
15078        self
15079    }
15080    /// Identifies the authorization scope(s) for the method you are building.
15081    ///
15082    /// See [`Self::add_scope()`] for details.
15083    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportEnumeratePrintJobCall<'a, C>
15084    where
15085        I: IntoIterator<Item = St>,
15086        St: AsRef<str>,
15087    {
15088        self._scopes
15089            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15090        self
15091    }
15092
15093    /// Removes all scopes, and no default scope will be used either.
15094    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15095    /// for details).
15096    pub fn clear_scopes(mut self) -> CustomerReportEnumeratePrintJobCall<'a, C> {
15097        self._scopes.clear();
15098        self
15099    }
15100}
15101
15102/// Generate report of managed Chrome browser devices that have a specified app installed.
15103///
15104/// A builder for the *reports.findInstalledAppDevices* method supported by a *customer* resource.
15105/// It is not used directly, but through a [`CustomerMethods`] instance.
15106///
15107/// # Example
15108///
15109/// Instantiate a resource method builder
15110///
15111/// ```test_harness,no_run
15112/// # extern crate hyper;
15113/// # extern crate hyper_rustls;
15114/// # extern crate google_chromemanagement1 as chromemanagement1;
15115/// # async fn dox() {
15116/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
15117///
15118/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
15119/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
15120/// #     .with_native_roots()
15121/// #     .unwrap()
15122/// #     .https_only()
15123/// #     .enable_http2()
15124/// #     .build();
15125///
15126/// # let executor = hyper_util::rt::TokioExecutor::new();
15127/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
15128/// #     secret,
15129/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15130/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
15131/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
15132/// #     ),
15133/// # ).build().await.unwrap();
15134///
15135/// # let client = hyper_util::client::legacy::Client::builder(
15136/// #     hyper_util::rt::TokioExecutor::new()
15137/// # )
15138/// # .build(
15139/// #     hyper_rustls::HttpsConnectorBuilder::new()
15140/// #         .with_native_roots()
15141/// #         .unwrap()
15142/// #         .https_or_http()
15143/// #         .enable_http2()
15144/// #         .build()
15145/// # );
15146/// # let mut hub = ChromeManagement::new(client, auth);
15147/// // You can configure optional parameters by calling the respective setters at will, and
15148/// // execute the final call using `doit()`.
15149/// // Values shown here are possibly random and not representative !
15150/// let result = hub.customers().reports_find_installed_app_devices("customer")
15151///              .page_token("ea")
15152///              .page_size(-95)
15153///              .org_unit_id("Lorem")
15154///              .order_by("invidunt")
15155///              .filter("no")
15156///              .app_type("est")
15157///              .app_id("At")
15158///              .doit().await;
15159/// # }
15160/// ```
15161pub struct CustomerReportFindInstalledAppDeviceCall<'a, C>
15162where
15163    C: 'a,
15164{
15165    hub: &'a ChromeManagement<C>,
15166    _customer: String,
15167    _page_token: Option<String>,
15168    _page_size: Option<i32>,
15169    _org_unit_id: Option<String>,
15170    _order_by: Option<String>,
15171    _filter: Option<String>,
15172    _app_type: Option<String>,
15173    _app_id: Option<String>,
15174    _delegate: Option<&'a mut dyn common::Delegate>,
15175    _additional_params: HashMap<String, String>,
15176    _scopes: BTreeSet<String>,
15177}
15178
15179impl<'a, C> common::CallBuilder for CustomerReportFindInstalledAppDeviceCall<'a, C> {}
15180
15181impl<'a, C> CustomerReportFindInstalledAppDeviceCall<'a, C>
15182where
15183    C: common::Connector,
15184{
15185    /// Perform the operation you have build so far.
15186    pub async fn doit(
15187        mut self,
15188    ) -> common::Result<(
15189        common::Response,
15190        GoogleChromeManagementV1FindInstalledAppDevicesResponse,
15191    )> {
15192        use std::borrow::Cow;
15193        use std::io::{Read, Seek};
15194
15195        use common::{url::Params, ToParts};
15196        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
15197
15198        let mut dd = common::DefaultDelegate;
15199        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
15200        dlg.begin(common::MethodInfo {
15201            id: "chromemanagement.customers.reports.findInstalledAppDevices",
15202            http_method: hyper::Method::GET,
15203        });
15204
15205        for &field in [
15206            "alt",
15207            "customer",
15208            "pageToken",
15209            "pageSize",
15210            "orgUnitId",
15211            "orderBy",
15212            "filter",
15213            "appType",
15214            "appId",
15215        ]
15216        .iter()
15217        {
15218            if self._additional_params.contains_key(field) {
15219                dlg.finished(false);
15220                return Err(common::Error::FieldClash(field));
15221            }
15222        }
15223
15224        let mut params = Params::with_capacity(10 + self._additional_params.len());
15225        params.push("customer", self._customer);
15226        if let Some(value) = self._page_token.as_ref() {
15227            params.push("pageToken", value);
15228        }
15229        if let Some(value) = self._page_size.as_ref() {
15230            params.push("pageSize", value.to_string());
15231        }
15232        if let Some(value) = self._org_unit_id.as_ref() {
15233            params.push("orgUnitId", value);
15234        }
15235        if let Some(value) = self._order_by.as_ref() {
15236            params.push("orderBy", value);
15237        }
15238        if let Some(value) = self._filter.as_ref() {
15239            params.push("filter", value);
15240        }
15241        if let Some(value) = self._app_type.as_ref() {
15242            params.push("appType", value);
15243        }
15244        if let Some(value) = self._app_id.as_ref() {
15245            params.push("appId", value);
15246        }
15247
15248        params.extend(self._additional_params.iter());
15249
15250        params.push("alt", "json");
15251        let mut url = self.hub._base_url.clone() + "v1/{+customer}/reports:findInstalledAppDevices";
15252        if self._scopes.is_empty() {
15253            self._scopes
15254                .insert(Scope::ChromeManagementReportReadonly.as_ref().to_string());
15255        }
15256
15257        #[allow(clippy::single_element_loop)]
15258        for &(find_this, param_name) in [("{+customer}", "customer")].iter() {
15259            url = params.uri_replacement(url, param_name, find_this, true);
15260        }
15261        {
15262            let to_remove = ["customer"];
15263            params.remove_params(&to_remove);
15264        }
15265
15266        let url = params.parse_with_url(&url);
15267
15268        loop {
15269            let token = match self
15270                .hub
15271                .auth
15272                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
15273                .await
15274            {
15275                Ok(token) => token,
15276                Err(e) => match dlg.token(e) {
15277                    Ok(token) => token,
15278                    Err(e) => {
15279                        dlg.finished(false);
15280                        return Err(common::Error::MissingToken(e));
15281                    }
15282                },
15283            };
15284            let mut req_result = {
15285                let client = &self.hub.client;
15286                dlg.pre_request();
15287                let mut req_builder = hyper::Request::builder()
15288                    .method(hyper::Method::GET)
15289                    .uri(url.as_str())
15290                    .header(USER_AGENT, self.hub._user_agent.clone());
15291
15292                if let Some(token) = token.as_ref() {
15293                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
15294                }
15295
15296                let request = req_builder
15297                    .header(CONTENT_LENGTH, 0_u64)
15298                    .body(common::to_body::<String>(None));
15299
15300                client.request(request.unwrap()).await
15301            };
15302
15303            match req_result {
15304                Err(err) => {
15305                    if let common::Retry::After(d) = dlg.http_error(&err) {
15306                        sleep(d).await;
15307                        continue;
15308                    }
15309                    dlg.finished(false);
15310                    return Err(common::Error::HttpError(err));
15311                }
15312                Ok(res) => {
15313                    let (mut parts, body) = res.into_parts();
15314                    let mut body = common::Body::new(body);
15315                    if !parts.status.is_success() {
15316                        let bytes = common::to_bytes(body).await.unwrap_or_default();
15317                        let error = serde_json::from_str(&common::to_string(&bytes));
15318                        let response = common::to_response(parts, bytes.into());
15319
15320                        if let common::Retry::After(d) =
15321                            dlg.http_failure(&response, error.as_ref().ok())
15322                        {
15323                            sleep(d).await;
15324                            continue;
15325                        }
15326
15327                        dlg.finished(false);
15328
15329                        return Err(match error {
15330                            Ok(value) => common::Error::BadRequest(value),
15331                            _ => common::Error::Failure(response),
15332                        });
15333                    }
15334                    let response = {
15335                        let bytes = common::to_bytes(body).await.unwrap_or_default();
15336                        let encoded = common::to_string(&bytes);
15337                        match serde_json::from_str(&encoded) {
15338                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
15339                            Err(error) => {
15340                                dlg.response_json_decode_error(&encoded, &error);
15341                                return Err(common::Error::JsonDecodeError(
15342                                    encoded.to_string(),
15343                                    error,
15344                                ));
15345                            }
15346                        }
15347                    };
15348
15349                    dlg.finished(true);
15350                    return Ok(response);
15351                }
15352            }
15353        }
15354    }
15355
15356    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
15357    ///
15358    /// Sets the *customer* path property to the given value.
15359    ///
15360    /// Even though the property as already been set when instantiating this call,
15361    /// we provide this method for API completeness.
15362    pub fn customer(mut self, new_value: &str) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15363        self._customer = new_value.to_string();
15364        self
15365    }
15366    /// Token to specify the page of the request to be returned.
15367    ///
15368    /// Sets the *page token* query property to the given value.
15369    pub fn page_token(
15370        mut self,
15371        new_value: &str,
15372    ) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15373        self._page_token = Some(new_value.to_string());
15374        self
15375    }
15376    /// Maximum number of results to return. Maximum and default are 100.
15377    ///
15378    /// Sets the *page size* query property to the given value.
15379    pub fn page_size(mut self, new_value: i32) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15380        self._page_size = Some(new_value);
15381        self
15382    }
15383    /// The ID of the organizational unit.
15384    ///
15385    /// Sets the *org unit id* query property to the given value.
15386    pub fn org_unit_id(
15387        mut self,
15388        new_value: &str,
15389    ) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15390        self._org_unit_id = Some(new_value.to_string());
15391        self
15392    }
15393    /// Field used to order results. Supported order by fields: * machine * device_id
15394    ///
15395    /// Sets the *order by* query property to the given value.
15396    pub fn order_by(mut self, new_value: &str) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15397        self._order_by = Some(new_value.to_string());
15398        self
15399    }
15400    /// Query string to filter results, AND-separated fields in EBNF syntax. Note: OR operations are not supported in this filter. Supported filter fields: * last_active_date
15401    ///
15402    /// Sets the *filter* query property to the given value.
15403    pub fn filter(mut self, new_value: &str) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15404        self._filter = Some(new_value.to_string());
15405        self
15406    }
15407    /// Type of the app. Optional. If not provided, an app type will be inferred from the format of the app ID.
15408    ///
15409    /// Sets the *app type* query property to the given value.
15410    pub fn app_type(mut self, new_value: &str) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15411        self._app_type = Some(new_value.to_string());
15412        self
15413    }
15414    /// Unique identifier of the app. For Chrome apps and extensions, the 32-character id (e.g. ehoadneljpdggcbbknedodolkkjodefl). For Android apps, the package name (e.g. com.evernote).
15415    ///
15416    /// Sets the *app id* query property to the given value.
15417    pub fn app_id(mut self, new_value: &str) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15418        self._app_id = Some(new_value.to_string());
15419        self
15420    }
15421    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
15422    /// while executing the actual API request.
15423    ///
15424    /// ````text
15425    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
15426    /// ````
15427    ///
15428    /// Sets the *delegate* property to the given value.
15429    pub fn delegate(
15430        mut self,
15431        new_value: &'a mut dyn common::Delegate,
15432    ) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15433        self._delegate = Some(new_value);
15434        self
15435    }
15436
15437    /// Set any additional parameter of the query string used in the request.
15438    /// It should be used to set parameters which are not yet available through their own
15439    /// setters.
15440    ///
15441    /// Please note that this method must not be used to set any of the known parameters
15442    /// which have their own setter method. If done anyway, the request will fail.
15443    ///
15444    /// # Additional Parameters
15445    ///
15446    /// * *$.xgafv* (query-string) - V1 error format.
15447    /// * *access_token* (query-string) - OAuth access token.
15448    /// * *alt* (query-string) - Data format for response.
15449    /// * *callback* (query-string) - JSONP
15450    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
15451    /// * *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.
15452    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
15453    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
15454    /// * *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.
15455    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
15456    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
15457    pub fn param<T>(mut self, name: T, value: T) -> CustomerReportFindInstalledAppDeviceCall<'a, C>
15458    where
15459        T: AsRef<str>,
15460    {
15461        self._additional_params
15462            .insert(name.as_ref().to_string(), value.as_ref().to_string());
15463        self
15464    }
15465
15466    /// Identifies the authorization scope for the method you are building.
15467    ///
15468    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15469    /// [`Scope::ChromeManagementReportReadonly`].
15470    ///
15471    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15472    /// tokens for more than one scope.
15473    ///
15474    /// Usually there is more than one suitable scope to authorize an operation, some of which may
15475    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15476    /// sufficient, a read-write scope will do as well.
15477    pub fn add_scope<St>(mut self, scope: St) -> CustomerReportFindInstalledAppDeviceCall<'a, C>
15478    where
15479        St: AsRef<str>,
15480    {
15481        self._scopes.insert(String::from(scope.as_ref()));
15482        self
15483    }
15484    /// Identifies the authorization scope(s) for the method you are building.
15485    ///
15486    /// See [`Self::add_scope()`] for details.
15487    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerReportFindInstalledAppDeviceCall<'a, C>
15488    where
15489        I: IntoIterator<Item = St>,
15490        St: AsRef<str>,
15491    {
15492        self._scopes
15493            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15494        self
15495    }
15496
15497    /// Removes all scopes, and no default scope will be used either.
15498    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15499    /// for details).
15500    pub fn clear_scopes(mut self) -> CustomerReportFindInstalledAppDeviceCall<'a, C> {
15501        self._scopes.clear();
15502        self
15503    }
15504}
15505
15506/// Get telemetry device.
15507///
15508/// A builder for the *telemetry.devices.get* method supported by a *customer* resource.
15509/// It is not used directly, but through a [`CustomerMethods`] instance.
15510///
15511/// # Example
15512///
15513/// Instantiate a resource method builder
15514///
15515/// ```test_harness,no_run
15516/// # extern crate hyper;
15517/// # extern crate hyper_rustls;
15518/// # extern crate google_chromemanagement1 as chromemanagement1;
15519/// # async fn dox() {
15520/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
15521///
15522/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
15523/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
15524/// #     .with_native_roots()
15525/// #     .unwrap()
15526/// #     .https_only()
15527/// #     .enable_http2()
15528/// #     .build();
15529///
15530/// # let executor = hyper_util::rt::TokioExecutor::new();
15531/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
15532/// #     secret,
15533/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15534/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
15535/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
15536/// #     ),
15537/// # ).build().await.unwrap();
15538///
15539/// # let client = hyper_util::client::legacy::Client::builder(
15540/// #     hyper_util::rt::TokioExecutor::new()
15541/// # )
15542/// # .build(
15543/// #     hyper_rustls::HttpsConnectorBuilder::new()
15544/// #         .with_native_roots()
15545/// #         .unwrap()
15546/// #         .https_or_http()
15547/// #         .enable_http2()
15548/// #         .build()
15549/// # );
15550/// # let mut hub = ChromeManagement::new(client, auth);
15551/// // You can configure optional parameters by calling the respective setters at will, and
15552/// // execute the final call using `doit()`.
15553/// // Values shown here are possibly random and not representative !
15554/// let result = hub.customers().telemetry_devices_get("name")
15555///              .read_mask(FieldMask::new::<&str>(&[]))
15556///              .doit().await;
15557/// # }
15558/// ```
15559pub struct CustomerTelemetryDeviceGetCall<'a, C>
15560where
15561    C: 'a,
15562{
15563    hub: &'a ChromeManagement<C>,
15564    _name: String,
15565    _read_mask: Option<common::FieldMask>,
15566    _delegate: Option<&'a mut dyn common::Delegate>,
15567    _additional_params: HashMap<String, String>,
15568    _scopes: BTreeSet<String>,
15569}
15570
15571impl<'a, C> common::CallBuilder for CustomerTelemetryDeviceGetCall<'a, C> {}
15572
15573impl<'a, C> CustomerTelemetryDeviceGetCall<'a, C>
15574where
15575    C: common::Connector,
15576{
15577    /// Perform the operation you have build so far.
15578    pub async fn doit(
15579        mut self,
15580    ) -> common::Result<(common::Response, GoogleChromeManagementV1TelemetryDevice)> {
15581        use std::borrow::Cow;
15582        use std::io::{Read, Seek};
15583
15584        use common::{url::Params, ToParts};
15585        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
15586
15587        let mut dd = common::DefaultDelegate;
15588        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
15589        dlg.begin(common::MethodInfo {
15590            id: "chromemanagement.customers.telemetry.devices.get",
15591            http_method: hyper::Method::GET,
15592        });
15593
15594        for &field in ["alt", "name", "readMask"].iter() {
15595            if self._additional_params.contains_key(field) {
15596                dlg.finished(false);
15597                return Err(common::Error::FieldClash(field));
15598            }
15599        }
15600
15601        let mut params = Params::with_capacity(4 + self._additional_params.len());
15602        params.push("name", self._name);
15603        if let Some(value) = self._read_mask.as_ref() {
15604            params.push("readMask", value.to_string());
15605        }
15606
15607        params.extend(self._additional_params.iter());
15608
15609        params.push("alt", "json");
15610        let mut url = self.hub._base_url.clone() + "v1/{+name}";
15611        if self._scopes.is_empty() {
15612            self._scopes.insert(
15613                Scope::ChromeManagementTelemetryReadonly
15614                    .as_ref()
15615                    .to_string(),
15616            );
15617        }
15618
15619        #[allow(clippy::single_element_loop)]
15620        for &(find_this, param_name) in [("{+name}", "name")].iter() {
15621            url = params.uri_replacement(url, param_name, find_this, true);
15622        }
15623        {
15624            let to_remove = ["name"];
15625            params.remove_params(&to_remove);
15626        }
15627
15628        let url = params.parse_with_url(&url);
15629
15630        loop {
15631            let token = match self
15632                .hub
15633                .auth
15634                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
15635                .await
15636            {
15637                Ok(token) => token,
15638                Err(e) => match dlg.token(e) {
15639                    Ok(token) => token,
15640                    Err(e) => {
15641                        dlg.finished(false);
15642                        return Err(common::Error::MissingToken(e));
15643                    }
15644                },
15645            };
15646            let mut req_result = {
15647                let client = &self.hub.client;
15648                dlg.pre_request();
15649                let mut req_builder = hyper::Request::builder()
15650                    .method(hyper::Method::GET)
15651                    .uri(url.as_str())
15652                    .header(USER_AGENT, self.hub._user_agent.clone());
15653
15654                if let Some(token) = token.as_ref() {
15655                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
15656                }
15657
15658                let request = req_builder
15659                    .header(CONTENT_LENGTH, 0_u64)
15660                    .body(common::to_body::<String>(None));
15661
15662                client.request(request.unwrap()).await
15663            };
15664
15665            match req_result {
15666                Err(err) => {
15667                    if let common::Retry::After(d) = dlg.http_error(&err) {
15668                        sleep(d).await;
15669                        continue;
15670                    }
15671                    dlg.finished(false);
15672                    return Err(common::Error::HttpError(err));
15673                }
15674                Ok(res) => {
15675                    let (mut parts, body) = res.into_parts();
15676                    let mut body = common::Body::new(body);
15677                    if !parts.status.is_success() {
15678                        let bytes = common::to_bytes(body).await.unwrap_or_default();
15679                        let error = serde_json::from_str(&common::to_string(&bytes));
15680                        let response = common::to_response(parts, bytes.into());
15681
15682                        if let common::Retry::After(d) =
15683                            dlg.http_failure(&response, error.as_ref().ok())
15684                        {
15685                            sleep(d).await;
15686                            continue;
15687                        }
15688
15689                        dlg.finished(false);
15690
15691                        return Err(match error {
15692                            Ok(value) => common::Error::BadRequest(value),
15693                            _ => common::Error::Failure(response),
15694                        });
15695                    }
15696                    let response = {
15697                        let bytes = common::to_bytes(body).await.unwrap_or_default();
15698                        let encoded = common::to_string(&bytes);
15699                        match serde_json::from_str(&encoded) {
15700                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
15701                            Err(error) => {
15702                                dlg.response_json_decode_error(&encoded, &error);
15703                                return Err(common::Error::JsonDecodeError(
15704                                    encoded.to_string(),
15705                                    error,
15706                                ));
15707                            }
15708                        }
15709                    };
15710
15711                    dlg.finished(true);
15712                    return Ok(response);
15713                }
15714            }
15715        }
15716    }
15717
15718    /// Required. Name of the `TelemetryDevice` to return.
15719    ///
15720    /// Sets the *name* path property to the given value.
15721    ///
15722    /// Even though the property as already been set when instantiating this call,
15723    /// we provide this method for API completeness.
15724    pub fn name(mut self, new_value: &str) -> CustomerTelemetryDeviceGetCall<'a, C> {
15725        self._name = new_value.to_string();
15726        self
15727    }
15728    /// Required. Read mask to specify which fields to return. Supported read_mask paths are: - name - org_unit_id - device_id - serial_number - cpu_info - cpu_status_report - memory_info - memory_status_report - network_info - network_diagnostics_report - network_status_report - os_update_status - graphics_info - graphics_status_report - battery_info - battery_status_report - storage_info - storage_status_report - thunderbolt_info - audio_status_report - boot_performance_report - heartbeat_status_report - network_bandwidth_report - peripherals_report - kiosk_app_status_report - app_report - runtime_counters_report
15729    ///
15730    /// Sets the *read mask* query property to the given value.
15731    pub fn read_mask(
15732        mut self,
15733        new_value: common::FieldMask,
15734    ) -> CustomerTelemetryDeviceGetCall<'a, C> {
15735        self._read_mask = Some(new_value);
15736        self
15737    }
15738    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
15739    /// while executing the actual API request.
15740    ///
15741    /// ````text
15742    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
15743    /// ````
15744    ///
15745    /// Sets the *delegate* property to the given value.
15746    pub fn delegate(
15747        mut self,
15748        new_value: &'a mut dyn common::Delegate,
15749    ) -> CustomerTelemetryDeviceGetCall<'a, C> {
15750        self._delegate = Some(new_value);
15751        self
15752    }
15753
15754    /// Set any additional parameter of the query string used in the request.
15755    /// It should be used to set parameters which are not yet available through their own
15756    /// setters.
15757    ///
15758    /// Please note that this method must not be used to set any of the known parameters
15759    /// which have their own setter method. If done anyway, the request will fail.
15760    ///
15761    /// # Additional Parameters
15762    ///
15763    /// * *$.xgafv* (query-string) - V1 error format.
15764    /// * *access_token* (query-string) - OAuth access token.
15765    /// * *alt* (query-string) - Data format for response.
15766    /// * *callback* (query-string) - JSONP
15767    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
15768    /// * *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.
15769    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
15770    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
15771    /// * *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.
15772    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
15773    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
15774    pub fn param<T>(mut self, name: T, value: T) -> CustomerTelemetryDeviceGetCall<'a, C>
15775    where
15776        T: AsRef<str>,
15777    {
15778        self._additional_params
15779            .insert(name.as_ref().to_string(), value.as_ref().to_string());
15780        self
15781    }
15782
15783    /// Identifies the authorization scope for the method you are building.
15784    ///
15785    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
15786    /// [`Scope::ChromeManagementTelemetryReadonly`].
15787    ///
15788    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
15789    /// tokens for more than one scope.
15790    ///
15791    /// Usually there is more than one suitable scope to authorize an operation, some of which may
15792    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
15793    /// sufficient, a read-write scope will do as well.
15794    pub fn add_scope<St>(mut self, scope: St) -> CustomerTelemetryDeviceGetCall<'a, C>
15795    where
15796        St: AsRef<str>,
15797    {
15798        self._scopes.insert(String::from(scope.as_ref()));
15799        self
15800    }
15801    /// Identifies the authorization scope(s) for the method you are building.
15802    ///
15803    /// See [`Self::add_scope()`] for details.
15804    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerTelemetryDeviceGetCall<'a, C>
15805    where
15806        I: IntoIterator<Item = St>,
15807        St: AsRef<str>,
15808    {
15809        self._scopes
15810            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
15811        self
15812    }
15813
15814    /// Removes all scopes, and no default scope will be used either.
15815    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
15816    /// for details).
15817    pub fn clear_scopes(mut self) -> CustomerTelemetryDeviceGetCall<'a, C> {
15818        self._scopes.clear();
15819        self
15820    }
15821}
15822
15823/// List all telemetry devices.
15824///
15825/// A builder for the *telemetry.devices.list* method supported by a *customer* resource.
15826/// It is not used directly, but through a [`CustomerMethods`] instance.
15827///
15828/// # Example
15829///
15830/// Instantiate a resource method builder
15831///
15832/// ```test_harness,no_run
15833/// # extern crate hyper;
15834/// # extern crate hyper_rustls;
15835/// # extern crate google_chromemanagement1 as chromemanagement1;
15836/// # async fn dox() {
15837/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
15838///
15839/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
15840/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
15841/// #     .with_native_roots()
15842/// #     .unwrap()
15843/// #     .https_only()
15844/// #     .enable_http2()
15845/// #     .build();
15846///
15847/// # let executor = hyper_util::rt::TokioExecutor::new();
15848/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
15849/// #     secret,
15850/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
15851/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
15852/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
15853/// #     ),
15854/// # ).build().await.unwrap();
15855///
15856/// # let client = hyper_util::client::legacy::Client::builder(
15857/// #     hyper_util::rt::TokioExecutor::new()
15858/// # )
15859/// # .build(
15860/// #     hyper_rustls::HttpsConnectorBuilder::new()
15861/// #         .with_native_roots()
15862/// #         .unwrap()
15863/// #         .https_or_http()
15864/// #         .enable_http2()
15865/// #         .build()
15866/// # );
15867/// # let mut hub = ChromeManagement::new(client, auth);
15868/// // You can configure optional parameters by calling the respective setters at will, and
15869/// // execute the final call using `doit()`.
15870/// // Values shown here are possibly random and not representative !
15871/// let result = hub.customers().telemetry_devices_list("parent")
15872///              .read_mask(FieldMask::new::<&str>(&[]))
15873///              .page_token("et")
15874///              .page_size(-39)
15875///              .filter("aliquyam")
15876///              .doit().await;
15877/// # }
15878/// ```
15879pub struct CustomerTelemetryDeviceListCall<'a, C>
15880where
15881    C: 'a,
15882{
15883    hub: &'a ChromeManagement<C>,
15884    _parent: String,
15885    _read_mask: Option<common::FieldMask>,
15886    _page_token: Option<String>,
15887    _page_size: Option<i32>,
15888    _filter: Option<String>,
15889    _delegate: Option<&'a mut dyn common::Delegate>,
15890    _additional_params: HashMap<String, String>,
15891    _scopes: BTreeSet<String>,
15892}
15893
15894impl<'a, C> common::CallBuilder for CustomerTelemetryDeviceListCall<'a, C> {}
15895
15896impl<'a, C> CustomerTelemetryDeviceListCall<'a, C>
15897where
15898    C: common::Connector,
15899{
15900    /// Perform the operation you have build so far.
15901    pub async fn doit(
15902        mut self,
15903    ) -> common::Result<(
15904        common::Response,
15905        GoogleChromeManagementV1ListTelemetryDevicesResponse,
15906    )> {
15907        use std::borrow::Cow;
15908        use std::io::{Read, Seek};
15909
15910        use common::{url::Params, ToParts};
15911        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
15912
15913        let mut dd = common::DefaultDelegate;
15914        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
15915        dlg.begin(common::MethodInfo {
15916            id: "chromemanagement.customers.telemetry.devices.list",
15917            http_method: hyper::Method::GET,
15918        });
15919
15920        for &field in [
15921            "alt",
15922            "parent",
15923            "readMask",
15924            "pageToken",
15925            "pageSize",
15926            "filter",
15927        ]
15928        .iter()
15929        {
15930            if self._additional_params.contains_key(field) {
15931                dlg.finished(false);
15932                return Err(common::Error::FieldClash(field));
15933            }
15934        }
15935
15936        let mut params = Params::with_capacity(7 + self._additional_params.len());
15937        params.push("parent", self._parent);
15938        if let Some(value) = self._read_mask.as_ref() {
15939            params.push("readMask", value.to_string());
15940        }
15941        if let Some(value) = self._page_token.as_ref() {
15942            params.push("pageToken", value);
15943        }
15944        if let Some(value) = self._page_size.as_ref() {
15945            params.push("pageSize", value.to_string());
15946        }
15947        if let Some(value) = self._filter.as_ref() {
15948            params.push("filter", value);
15949        }
15950
15951        params.extend(self._additional_params.iter());
15952
15953        params.push("alt", "json");
15954        let mut url = self.hub._base_url.clone() + "v1/{+parent}/telemetry/devices";
15955        if self._scopes.is_empty() {
15956            self._scopes.insert(
15957                Scope::ChromeManagementTelemetryReadonly
15958                    .as_ref()
15959                    .to_string(),
15960            );
15961        }
15962
15963        #[allow(clippy::single_element_loop)]
15964        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
15965            url = params.uri_replacement(url, param_name, find_this, true);
15966        }
15967        {
15968            let to_remove = ["parent"];
15969            params.remove_params(&to_remove);
15970        }
15971
15972        let url = params.parse_with_url(&url);
15973
15974        loop {
15975            let token = match self
15976                .hub
15977                .auth
15978                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
15979                .await
15980            {
15981                Ok(token) => token,
15982                Err(e) => match dlg.token(e) {
15983                    Ok(token) => token,
15984                    Err(e) => {
15985                        dlg.finished(false);
15986                        return Err(common::Error::MissingToken(e));
15987                    }
15988                },
15989            };
15990            let mut req_result = {
15991                let client = &self.hub.client;
15992                dlg.pre_request();
15993                let mut req_builder = hyper::Request::builder()
15994                    .method(hyper::Method::GET)
15995                    .uri(url.as_str())
15996                    .header(USER_AGENT, self.hub._user_agent.clone());
15997
15998                if let Some(token) = token.as_ref() {
15999                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
16000                }
16001
16002                let request = req_builder
16003                    .header(CONTENT_LENGTH, 0_u64)
16004                    .body(common::to_body::<String>(None));
16005
16006                client.request(request.unwrap()).await
16007            };
16008
16009            match req_result {
16010                Err(err) => {
16011                    if let common::Retry::After(d) = dlg.http_error(&err) {
16012                        sleep(d).await;
16013                        continue;
16014                    }
16015                    dlg.finished(false);
16016                    return Err(common::Error::HttpError(err));
16017                }
16018                Ok(res) => {
16019                    let (mut parts, body) = res.into_parts();
16020                    let mut body = common::Body::new(body);
16021                    if !parts.status.is_success() {
16022                        let bytes = common::to_bytes(body).await.unwrap_or_default();
16023                        let error = serde_json::from_str(&common::to_string(&bytes));
16024                        let response = common::to_response(parts, bytes.into());
16025
16026                        if let common::Retry::After(d) =
16027                            dlg.http_failure(&response, error.as_ref().ok())
16028                        {
16029                            sleep(d).await;
16030                            continue;
16031                        }
16032
16033                        dlg.finished(false);
16034
16035                        return Err(match error {
16036                            Ok(value) => common::Error::BadRequest(value),
16037                            _ => common::Error::Failure(response),
16038                        });
16039                    }
16040                    let response = {
16041                        let bytes = common::to_bytes(body).await.unwrap_or_default();
16042                        let encoded = common::to_string(&bytes);
16043                        match serde_json::from_str(&encoded) {
16044                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
16045                            Err(error) => {
16046                                dlg.response_json_decode_error(&encoded, &error);
16047                                return Err(common::Error::JsonDecodeError(
16048                                    encoded.to_string(),
16049                                    error,
16050                                ));
16051                            }
16052                        }
16053                    };
16054
16055                    dlg.finished(true);
16056                    return Ok(response);
16057                }
16058            }
16059        }
16060    }
16061
16062    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
16063    ///
16064    /// Sets the *parent* path property to the given value.
16065    ///
16066    /// Even though the property as already been set when instantiating this call,
16067    /// we provide this method for API completeness.
16068    pub fn parent(mut self, new_value: &str) -> CustomerTelemetryDeviceListCall<'a, C> {
16069        self._parent = new_value.to_string();
16070        self
16071    }
16072    /// Required. Read mask to specify which fields to return. Supported read_mask paths are: - name - org_unit_id - device_id - serial_number - cpu_info - cpu_status_report - memory_info - memory_status_report - network_info - network_diagnostics_report - network_status_report - os_update_status - graphics_info - graphics_status_report - battery_info - battery_status_report - storage_info - storage_status_report - thunderbolt_info - audio_status_report - boot_performance_report - heartbeat_status_report - network_bandwidth_report - peripherals_report - kiosk_app_status_report - app_report - runtime_counters_report
16073    ///
16074    /// Sets the *read mask* query property to the given value.
16075    pub fn read_mask(
16076        mut self,
16077        new_value: common::FieldMask,
16078    ) -> CustomerTelemetryDeviceListCall<'a, C> {
16079        self._read_mask = Some(new_value);
16080        self
16081    }
16082    /// Token to specify next page in the list.
16083    ///
16084    /// Sets the *page token* query property to the given value.
16085    pub fn page_token(mut self, new_value: &str) -> CustomerTelemetryDeviceListCall<'a, C> {
16086        self._page_token = Some(new_value.to_string());
16087        self
16088    }
16089    /// Maximum number of results to return. Default value is 100. Maximum value is 1000.
16090    ///
16091    /// Sets the *page size* query property to the given value.
16092    pub fn page_size(mut self, new_value: i32) -> CustomerTelemetryDeviceListCall<'a, C> {
16093        self._page_size = Some(new_value);
16094        self
16095    }
16096    /// Optional. Only include resources that match the filter. Requests that don't specify a "reports_timestamp" value will default to returning only recent reports. Specify "reports_timestamp>=0" to get all report data. Supported filter fields: - org_unit_id - serial_number - device_id - reports_timestamp The "reports_timestamp" filter accepts either the Unix Epoch milliseconds format or the RFC3339 UTC "Zulu" format with nanosecond resolution and up to nine fractional digits. Both formats should be surrounded by simple double quotes. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z", "1679283943823".
16097    ///
16098    /// Sets the *filter* query property to the given value.
16099    pub fn filter(mut self, new_value: &str) -> CustomerTelemetryDeviceListCall<'a, C> {
16100        self._filter = Some(new_value.to_string());
16101        self
16102    }
16103    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
16104    /// while executing the actual API request.
16105    ///
16106    /// ````text
16107    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
16108    /// ````
16109    ///
16110    /// Sets the *delegate* property to the given value.
16111    pub fn delegate(
16112        mut self,
16113        new_value: &'a mut dyn common::Delegate,
16114    ) -> CustomerTelemetryDeviceListCall<'a, C> {
16115        self._delegate = Some(new_value);
16116        self
16117    }
16118
16119    /// Set any additional parameter of the query string used in the request.
16120    /// It should be used to set parameters which are not yet available through their own
16121    /// setters.
16122    ///
16123    /// Please note that this method must not be used to set any of the known parameters
16124    /// which have their own setter method. If done anyway, the request will fail.
16125    ///
16126    /// # Additional Parameters
16127    ///
16128    /// * *$.xgafv* (query-string) - V1 error format.
16129    /// * *access_token* (query-string) - OAuth access token.
16130    /// * *alt* (query-string) - Data format for response.
16131    /// * *callback* (query-string) - JSONP
16132    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
16133    /// * *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.
16134    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
16135    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
16136    /// * *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.
16137    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
16138    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
16139    pub fn param<T>(mut self, name: T, value: T) -> CustomerTelemetryDeviceListCall<'a, C>
16140    where
16141        T: AsRef<str>,
16142    {
16143        self._additional_params
16144            .insert(name.as_ref().to_string(), value.as_ref().to_string());
16145        self
16146    }
16147
16148    /// Identifies the authorization scope for the method you are building.
16149    ///
16150    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
16151    /// [`Scope::ChromeManagementTelemetryReadonly`].
16152    ///
16153    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
16154    /// tokens for more than one scope.
16155    ///
16156    /// Usually there is more than one suitable scope to authorize an operation, some of which may
16157    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
16158    /// sufficient, a read-write scope will do as well.
16159    pub fn add_scope<St>(mut self, scope: St) -> CustomerTelemetryDeviceListCall<'a, C>
16160    where
16161        St: AsRef<str>,
16162    {
16163        self._scopes.insert(String::from(scope.as_ref()));
16164        self
16165    }
16166    /// Identifies the authorization scope(s) for the method you are building.
16167    ///
16168    /// See [`Self::add_scope()`] for details.
16169    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerTelemetryDeviceListCall<'a, C>
16170    where
16171        I: IntoIterator<Item = St>,
16172        St: AsRef<str>,
16173    {
16174        self._scopes
16175            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
16176        self
16177    }
16178
16179    /// Removes all scopes, and no default scope will be used either.
16180    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
16181    /// for details).
16182    pub fn clear_scopes(mut self) -> CustomerTelemetryDeviceListCall<'a, C> {
16183        self._scopes.clear();
16184        self
16185    }
16186}
16187
16188/// List telemetry events.
16189///
16190/// A builder for the *telemetry.events.list* method supported by a *customer* resource.
16191/// It is not used directly, but through a [`CustomerMethods`] instance.
16192///
16193/// # Example
16194///
16195/// Instantiate a resource method builder
16196///
16197/// ```test_harness,no_run
16198/// # extern crate hyper;
16199/// # extern crate hyper_rustls;
16200/// # extern crate google_chromemanagement1 as chromemanagement1;
16201/// # async fn dox() {
16202/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
16203///
16204/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
16205/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
16206/// #     .with_native_roots()
16207/// #     .unwrap()
16208/// #     .https_only()
16209/// #     .enable_http2()
16210/// #     .build();
16211///
16212/// # let executor = hyper_util::rt::TokioExecutor::new();
16213/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
16214/// #     secret,
16215/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
16216/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
16217/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
16218/// #     ),
16219/// # ).build().await.unwrap();
16220///
16221/// # let client = hyper_util::client::legacy::Client::builder(
16222/// #     hyper_util::rt::TokioExecutor::new()
16223/// # )
16224/// # .build(
16225/// #     hyper_rustls::HttpsConnectorBuilder::new()
16226/// #         .with_native_roots()
16227/// #         .unwrap()
16228/// #         .https_or_http()
16229/// #         .enable_http2()
16230/// #         .build()
16231/// # );
16232/// # let mut hub = ChromeManagement::new(client, auth);
16233/// // You can configure optional parameters by calling the respective setters at will, and
16234/// // execute the final call using `doit()`.
16235/// // Values shown here are possibly random and not representative !
16236/// let result = hub.customers().telemetry_events_list("parent")
16237///              .read_mask(FieldMask::new::<&str>(&[]))
16238///              .page_token("et")
16239///              .page_size(-8)
16240///              .filter("Lorem")
16241///              .doit().await;
16242/// # }
16243/// ```
16244pub struct CustomerTelemetryEventListCall<'a, C>
16245where
16246    C: 'a,
16247{
16248    hub: &'a ChromeManagement<C>,
16249    _parent: String,
16250    _read_mask: Option<common::FieldMask>,
16251    _page_token: Option<String>,
16252    _page_size: Option<i32>,
16253    _filter: Option<String>,
16254    _delegate: Option<&'a mut dyn common::Delegate>,
16255    _additional_params: HashMap<String, String>,
16256    _scopes: BTreeSet<String>,
16257}
16258
16259impl<'a, C> common::CallBuilder for CustomerTelemetryEventListCall<'a, C> {}
16260
16261impl<'a, C> CustomerTelemetryEventListCall<'a, C>
16262where
16263    C: common::Connector,
16264{
16265    /// Perform the operation you have build so far.
16266    pub async fn doit(
16267        mut self,
16268    ) -> common::Result<(
16269        common::Response,
16270        GoogleChromeManagementV1ListTelemetryEventsResponse,
16271    )> {
16272        use std::borrow::Cow;
16273        use std::io::{Read, Seek};
16274
16275        use common::{url::Params, ToParts};
16276        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
16277
16278        let mut dd = common::DefaultDelegate;
16279        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
16280        dlg.begin(common::MethodInfo {
16281            id: "chromemanagement.customers.telemetry.events.list",
16282            http_method: hyper::Method::GET,
16283        });
16284
16285        for &field in [
16286            "alt",
16287            "parent",
16288            "readMask",
16289            "pageToken",
16290            "pageSize",
16291            "filter",
16292        ]
16293        .iter()
16294        {
16295            if self._additional_params.contains_key(field) {
16296                dlg.finished(false);
16297                return Err(common::Error::FieldClash(field));
16298            }
16299        }
16300
16301        let mut params = Params::with_capacity(7 + self._additional_params.len());
16302        params.push("parent", self._parent);
16303        if let Some(value) = self._read_mask.as_ref() {
16304            params.push("readMask", value.to_string());
16305        }
16306        if let Some(value) = self._page_token.as_ref() {
16307            params.push("pageToken", value);
16308        }
16309        if let Some(value) = self._page_size.as_ref() {
16310            params.push("pageSize", value.to_string());
16311        }
16312        if let Some(value) = self._filter.as_ref() {
16313            params.push("filter", value);
16314        }
16315
16316        params.extend(self._additional_params.iter());
16317
16318        params.push("alt", "json");
16319        let mut url = self.hub._base_url.clone() + "v1/{+parent}/telemetry/events";
16320        if self._scopes.is_empty() {
16321            self._scopes.insert(
16322                Scope::ChromeManagementTelemetryReadonly
16323                    .as_ref()
16324                    .to_string(),
16325            );
16326        }
16327
16328        #[allow(clippy::single_element_loop)]
16329        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
16330            url = params.uri_replacement(url, param_name, find_this, true);
16331        }
16332        {
16333            let to_remove = ["parent"];
16334            params.remove_params(&to_remove);
16335        }
16336
16337        let url = params.parse_with_url(&url);
16338
16339        loop {
16340            let token = match self
16341                .hub
16342                .auth
16343                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
16344                .await
16345            {
16346                Ok(token) => token,
16347                Err(e) => match dlg.token(e) {
16348                    Ok(token) => token,
16349                    Err(e) => {
16350                        dlg.finished(false);
16351                        return Err(common::Error::MissingToken(e));
16352                    }
16353                },
16354            };
16355            let mut req_result = {
16356                let client = &self.hub.client;
16357                dlg.pre_request();
16358                let mut req_builder = hyper::Request::builder()
16359                    .method(hyper::Method::GET)
16360                    .uri(url.as_str())
16361                    .header(USER_AGENT, self.hub._user_agent.clone());
16362
16363                if let Some(token) = token.as_ref() {
16364                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
16365                }
16366
16367                let request = req_builder
16368                    .header(CONTENT_LENGTH, 0_u64)
16369                    .body(common::to_body::<String>(None));
16370
16371                client.request(request.unwrap()).await
16372            };
16373
16374            match req_result {
16375                Err(err) => {
16376                    if let common::Retry::After(d) = dlg.http_error(&err) {
16377                        sleep(d).await;
16378                        continue;
16379                    }
16380                    dlg.finished(false);
16381                    return Err(common::Error::HttpError(err));
16382                }
16383                Ok(res) => {
16384                    let (mut parts, body) = res.into_parts();
16385                    let mut body = common::Body::new(body);
16386                    if !parts.status.is_success() {
16387                        let bytes = common::to_bytes(body).await.unwrap_or_default();
16388                        let error = serde_json::from_str(&common::to_string(&bytes));
16389                        let response = common::to_response(parts, bytes.into());
16390
16391                        if let common::Retry::After(d) =
16392                            dlg.http_failure(&response, error.as_ref().ok())
16393                        {
16394                            sleep(d).await;
16395                            continue;
16396                        }
16397
16398                        dlg.finished(false);
16399
16400                        return Err(match error {
16401                            Ok(value) => common::Error::BadRequest(value),
16402                            _ => common::Error::Failure(response),
16403                        });
16404                    }
16405                    let response = {
16406                        let bytes = common::to_bytes(body).await.unwrap_or_default();
16407                        let encoded = common::to_string(&bytes);
16408                        match serde_json::from_str(&encoded) {
16409                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
16410                            Err(error) => {
16411                                dlg.response_json_decode_error(&encoded, &error);
16412                                return Err(common::Error::JsonDecodeError(
16413                                    encoded.to_string(),
16414                                    error,
16415                                ));
16416                            }
16417                        }
16418                    };
16419
16420                    dlg.finished(true);
16421                    return Ok(response);
16422                }
16423            }
16424        }
16425    }
16426
16427    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
16428    ///
16429    /// Sets the *parent* path property to the given value.
16430    ///
16431    /// Even though the property as already been set when instantiating this call,
16432    /// we provide this method for API completeness.
16433    pub fn parent(mut self, new_value: &str) -> CustomerTelemetryEventListCall<'a, C> {
16434        self._parent = new_value.to_string();
16435        self
16436    }
16437    /// Required. Read mask to specify which fields to return. Although currently required, this field will become optional, while the filter parameter with an event type will be come required. Supported read_mask paths are: - device - user - audio_severe_underrun_event - usb_peripherals_event - https_latency_change_event - network_state_change_event - wifi_signal_strength_event - vpn_connection_state_change_event - app_install_event - app_uninstall_event - app_launch_event - os_crash_event - external_displays_event
16438    ///
16439    /// Sets the *read mask* query property to the given value.
16440    pub fn read_mask(
16441        mut self,
16442        new_value: common::FieldMask,
16443    ) -> CustomerTelemetryEventListCall<'a, C> {
16444        self._read_mask = Some(new_value);
16445        self
16446    }
16447    /// Optional. Token to specify next page in the list.
16448    ///
16449    /// Sets the *page token* query property to the given value.
16450    pub fn page_token(mut self, new_value: &str) -> CustomerTelemetryEventListCall<'a, C> {
16451        self._page_token = Some(new_value.to_string());
16452        self
16453    }
16454    /// Optional. Maximum number of results to return. Default value is 100. Maximum value is 1000.
16455    ///
16456    /// Sets the *page size* query property to the given value.
16457    pub fn page_size(mut self, new_value: i32) -> CustomerTelemetryEventListCall<'a, C> {
16458        self._page_size = Some(new_value);
16459        self
16460    }
16461    /// Optional. Only include resources that match the filter. Although this parameter is currently optional, this parameter will be required- please specify at least 1 event type. Supported filter fields: - device_id - user_id - device_org_unit_id - user_org_unit_id - timestamp - event_type The "timestamp" filter accepts either the Unix Epoch milliseconds format or the RFC3339 UTC "Zulu" format with nanosecond resolution and up to nine fractional digits. Both formats should be surrounded by simple double quotes. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z", "1679283943823".
16462    ///
16463    /// Sets the *filter* query property to the given value.
16464    pub fn filter(mut self, new_value: &str) -> CustomerTelemetryEventListCall<'a, C> {
16465        self._filter = Some(new_value.to_string());
16466        self
16467    }
16468    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
16469    /// while executing the actual API request.
16470    ///
16471    /// ````text
16472    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
16473    /// ````
16474    ///
16475    /// Sets the *delegate* property to the given value.
16476    pub fn delegate(
16477        mut self,
16478        new_value: &'a mut dyn common::Delegate,
16479    ) -> CustomerTelemetryEventListCall<'a, C> {
16480        self._delegate = Some(new_value);
16481        self
16482    }
16483
16484    /// Set any additional parameter of the query string used in the request.
16485    /// It should be used to set parameters which are not yet available through their own
16486    /// setters.
16487    ///
16488    /// Please note that this method must not be used to set any of the known parameters
16489    /// which have their own setter method. If done anyway, the request will fail.
16490    ///
16491    /// # Additional Parameters
16492    ///
16493    /// * *$.xgafv* (query-string) - V1 error format.
16494    /// * *access_token* (query-string) - OAuth access token.
16495    /// * *alt* (query-string) - Data format for response.
16496    /// * *callback* (query-string) - JSONP
16497    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
16498    /// * *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.
16499    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
16500    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
16501    /// * *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.
16502    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
16503    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
16504    pub fn param<T>(mut self, name: T, value: T) -> CustomerTelemetryEventListCall<'a, C>
16505    where
16506        T: AsRef<str>,
16507    {
16508        self._additional_params
16509            .insert(name.as_ref().to_string(), value.as_ref().to_string());
16510        self
16511    }
16512
16513    /// Identifies the authorization scope for the method you are building.
16514    ///
16515    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
16516    /// [`Scope::ChromeManagementTelemetryReadonly`].
16517    ///
16518    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
16519    /// tokens for more than one scope.
16520    ///
16521    /// Usually there is more than one suitable scope to authorize an operation, some of which may
16522    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
16523    /// sufficient, a read-write scope will do as well.
16524    pub fn add_scope<St>(mut self, scope: St) -> CustomerTelemetryEventListCall<'a, C>
16525    where
16526        St: AsRef<str>,
16527    {
16528        self._scopes.insert(String::from(scope.as_ref()));
16529        self
16530    }
16531    /// Identifies the authorization scope(s) for the method you are building.
16532    ///
16533    /// See [`Self::add_scope()`] for details.
16534    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerTelemetryEventListCall<'a, C>
16535    where
16536        I: IntoIterator<Item = St>,
16537        St: AsRef<str>,
16538    {
16539        self._scopes
16540            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
16541        self
16542    }
16543
16544    /// Removes all scopes, and no default scope will be used either.
16545    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
16546    /// for details).
16547    pub fn clear_scopes(mut self) -> CustomerTelemetryEventListCall<'a, C> {
16548        self._scopes.clear();
16549        self
16550    }
16551}
16552
16553/// Create a telemetry notification config.
16554///
16555/// A builder for the *telemetry.notificationConfigs.create* method supported by a *customer* resource.
16556/// It is not used directly, but through a [`CustomerMethods`] instance.
16557///
16558/// # Example
16559///
16560/// Instantiate a resource method builder
16561///
16562/// ```test_harness,no_run
16563/// # extern crate hyper;
16564/// # extern crate hyper_rustls;
16565/// # extern crate google_chromemanagement1 as chromemanagement1;
16566/// use chromemanagement1::api::GoogleChromeManagementV1TelemetryNotificationConfig;
16567/// # async fn dox() {
16568/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
16569///
16570/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
16571/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
16572/// #     .with_native_roots()
16573/// #     .unwrap()
16574/// #     .https_only()
16575/// #     .enable_http2()
16576/// #     .build();
16577///
16578/// # let executor = hyper_util::rt::TokioExecutor::new();
16579/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
16580/// #     secret,
16581/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
16582/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
16583/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
16584/// #     ),
16585/// # ).build().await.unwrap();
16586///
16587/// # let client = hyper_util::client::legacy::Client::builder(
16588/// #     hyper_util::rt::TokioExecutor::new()
16589/// # )
16590/// # .build(
16591/// #     hyper_rustls::HttpsConnectorBuilder::new()
16592/// #         .with_native_roots()
16593/// #         .unwrap()
16594/// #         .https_or_http()
16595/// #         .enable_http2()
16596/// #         .build()
16597/// # );
16598/// # let mut hub = ChromeManagement::new(client, auth);
16599/// // As the method needs a request, you would usually fill it with the desired information
16600/// // into the respective structure. Some of the parts shown here might not be applicable !
16601/// // Values shown here are possibly random and not representative !
16602/// let mut req = GoogleChromeManagementV1TelemetryNotificationConfig::default();
16603///
16604/// // You can configure optional parameters by calling the respective setters at will, and
16605/// // execute the final call using `doit()`.
16606/// // Values shown here are possibly random and not representative !
16607/// let result = hub.customers().telemetry_notification_configs_create(req, "parent")
16608///              .doit().await;
16609/// # }
16610/// ```
16611pub struct CustomerTelemetryNotificationConfigCreateCall<'a, C>
16612where
16613    C: 'a,
16614{
16615    hub: &'a ChromeManagement<C>,
16616    _request: GoogleChromeManagementV1TelemetryNotificationConfig,
16617    _parent: String,
16618    _delegate: Option<&'a mut dyn common::Delegate>,
16619    _additional_params: HashMap<String, String>,
16620    _scopes: BTreeSet<String>,
16621}
16622
16623impl<'a, C> common::CallBuilder for CustomerTelemetryNotificationConfigCreateCall<'a, C> {}
16624
16625impl<'a, C> CustomerTelemetryNotificationConfigCreateCall<'a, C>
16626where
16627    C: common::Connector,
16628{
16629    /// Perform the operation you have build so far.
16630    pub async fn doit(
16631        mut self,
16632    ) -> common::Result<(
16633        common::Response,
16634        GoogleChromeManagementV1TelemetryNotificationConfig,
16635    )> {
16636        use std::borrow::Cow;
16637        use std::io::{Read, Seek};
16638
16639        use common::{url::Params, ToParts};
16640        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
16641
16642        let mut dd = common::DefaultDelegate;
16643        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
16644        dlg.begin(common::MethodInfo {
16645            id: "chromemanagement.customers.telemetry.notificationConfigs.create",
16646            http_method: hyper::Method::POST,
16647        });
16648
16649        for &field in ["alt", "parent"].iter() {
16650            if self._additional_params.contains_key(field) {
16651                dlg.finished(false);
16652                return Err(common::Error::FieldClash(field));
16653            }
16654        }
16655
16656        let mut params = Params::with_capacity(4 + self._additional_params.len());
16657        params.push("parent", self._parent);
16658
16659        params.extend(self._additional_params.iter());
16660
16661        params.push("alt", "json");
16662        let mut url = self.hub._base_url.clone() + "v1/{+parent}/telemetry/notificationConfigs";
16663        if self._scopes.is_empty() {
16664            self._scopes.insert(
16665                Scope::ChromeManagementTelemetryReadonly
16666                    .as_ref()
16667                    .to_string(),
16668            );
16669        }
16670
16671        #[allow(clippy::single_element_loop)]
16672        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
16673            url = params.uri_replacement(url, param_name, find_this, true);
16674        }
16675        {
16676            let to_remove = ["parent"];
16677            params.remove_params(&to_remove);
16678        }
16679
16680        let url = params.parse_with_url(&url);
16681
16682        let mut json_mime_type = mime::APPLICATION_JSON;
16683        let mut request_value_reader = {
16684            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
16685            common::remove_json_null_values(&mut value);
16686            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
16687            serde_json::to_writer(&mut dst, &value).unwrap();
16688            dst
16689        };
16690        let request_size = request_value_reader
16691            .seek(std::io::SeekFrom::End(0))
16692            .unwrap();
16693        request_value_reader
16694            .seek(std::io::SeekFrom::Start(0))
16695            .unwrap();
16696
16697        loop {
16698            let token = match self
16699                .hub
16700                .auth
16701                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
16702                .await
16703            {
16704                Ok(token) => token,
16705                Err(e) => match dlg.token(e) {
16706                    Ok(token) => token,
16707                    Err(e) => {
16708                        dlg.finished(false);
16709                        return Err(common::Error::MissingToken(e));
16710                    }
16711                },
16712            };
16713            request_value_reader
16714                .seek(std::io::SeekFrom::Start(0))
16715                .unwrap();
16716            let mut req_result = {
16717                let client = &self.hub.client;
16718                dlg.pre_request();
16719                let mut req_builder = hyper::Request::builder()
16720                    .method(hyper::Method::POST)
16721                    .uri(url.as_str())
16722                    .header(USER_AGENT, self.hub._user_agent.clone());
16723
16724                if let Some(token) = token.as_ref() {
16725                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
16726                }
16727
16728                let request = req_builder
16729                    .header(CONTENT_TYPE, json_mime_type.to_string())
16730                    .header(CONTENT_LENGTH, request_size as u64)
16731                    .body(common::to_body(
16732                        request_value_reader.get_ref().clone().into(),
16733                    ));
16734
16735                client.request(request.unwrap()).await
16736            };
16737
16738            match req_result {
16739                Err(err) => {
16740                    if let common::Retry::After(d) = dlg.http_error(&err) {
16741                        sleep(d).await;
16742                        continue;
16743                    }
16744                    dlg.finished(false);
16745                    return Err(common::Error::HttpError(err));
16746                }
16747                Ok(res) => {
16748                    let (mut parts, body) = res.into_parts();
16749                    let mut body = common::Body::new(body);
16750                    if !parts.status.is_success() {
16751                        let bytes = common::to_bytes(body).await.unwrap_or_default();
16752                        let error = serde_json::from_str(&common::to_string(&bytes));
16753                        let response = common::to_response(parts, bytes.into());
16754
16755                        if let common::Retry::After(d) =
16756                            dlg.http_failure(&response, error.as_ref().ok())
16757                        {
16758                            sleep(d).await;
16759                            continue;
16760                        }
16761
16762                        dlg.finished(false);
16763
16764                        return Err(match error {
16765                            Ok(value) => common::Error::BadRequest(value),
16766                            _ => common::Error::Failure(response),
16767                        });
16768                    }
16769                    let response = {
16770                        let bytes = common::to_bytes(body).await.unwrap_or_default();
16771                        let encoded = common::to_string(&bytes);
16772                        match serde_json::from_str(&encoded) {
16773                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
16774                            Err(error) => {
16775                                dlg.response_json_decode_error(&encoded, &error);
16776                                return Err(common::Error::JsonDecodeError(
16777                                    encoded.to_string(),
16778                                    error,
16779                                ));
16780                            }
16781                        }
16782                    };
16783
16784                    dlg.finished(true);
16785                    return Ok(response);
16786                }
16787            }
16788        }
16789    }
16790
16791    ///
16792    /// Sets the *request* property to the given value.
16793    ///
16794    /// Even though the property as already been set when instantiating this call,
16795    /// we provide this method for API completeness.
16796    pub fn request(
16797        mut self,
16798        new_value: GoogleChromeManagementV1TelemetryNotificationConfig,
16799    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C> {
16800        self._request = new_value;
16801        self
16802    }
16803    /// Required. The parent resource where this notification config will be created. Format: `customers/{customer}`
16804    ///
16805    /// Sets the *parent* path property to the given value.
16806    ///
16807    /// Even though the property as already been set when instantiating this call,
16808    /// we provide this method for API completeness.
16809    pub fn parent(
16810        mut self,
16811        new_value: &str,
16812    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C> {
16813        self._parent = new_value.to_string();
16814        self
16815    }
16816    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
16817    /// while executing the actual API request.
16818    ///
16819    /// ````text
16820    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
16821    /// ````
16822    ///
16823    /// Sets the *delegate* property to the given value.
16824    pub fn delegate(
16825        mut self,
16826        new_value: &'a mut dyn common::Delegate,
16827    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C> {
16828        self._delegate = Some(new_value);
16829        self
16830    }
16831
16832    /// Set any additional parameter of the query string used in the request.
16833    /// It should be used to set parameters which are not yet available through their own
16834    /// setters.
16835    ///
16836    /// Please note that this method must not be used to set any of the known parameters
16837    /// which have their own setter method. If done anyway, the request will fail.
16838    ///
16839    /// # Additional Parameters
16840    ///
16841    /// * *$.xgafv* (query-string) - V1 error format.
16842    /// * *access_token* (query-string) - OAuth access token.
16843    /// * *alt* (query-string) - Data format for response.
16844    /// * *callback* (query-string) - JSONP
16845    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
16846    /// * *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.
16847    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
16848    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
16849    /// * *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.
16850    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
16851    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
16852    pub fn param<T>(
16853        mut self,
16854        name: T,
16855        value: T,
16856    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C>
16857    where
16858        T: AsRef<str>,
16859    {
16860        self._additional_params
16861            .insert(name.as_ref().to_string(), value.as_ref().to_string());
16862        self
16863    }
16864
16865    /// Identifies the authorization scope for the method you are building.
16866    ///
16867    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
16868    /// [`Scope::ChromeManagementTelemetryReadonly`].
16869    ///
16870    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
16871    /// tokens for more than one scope.
16872    ///
16873    /// Usually there is more than one suitable scope to authorize an operation, some of which may
16874    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
16875    /// sufficient, a read-write scope will do as well.
16876    pub fn add_scope<St>(
16877        mut self,
16878        scope: St,
16879    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C>
16880    where
16881        St: AsRef<str>,
16882    {
16883        self._scopes.insert(String::from(scope.as_ref()));
16884        self
16885    }
16886    /// Identifies the authorization scope(s) for the method you are building.
16887    ///
16888    /// See [`Self::add_scope()`] for details.
16889    pub fn add_scopes<I, St>(
16890        mut self,
16891        scopes: I,
16892    ) -> CustomerTelemetryNotificationConfigCreateCall<'a, C>
16893    where
16894        I: IntoIterator<Item = St>,
16895        St: AsRef<str>,
16896    {
16897        self._scopes
16898            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
16899        self
16900    }
16901
16902    /// Removes all scopes, and no default scope will be used either.
16903    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
16904    /// for details).
16905    pub fn clear_scopes(mut self) -> CustomerTelemetryNotificationConfigCreateCall<'a, C> {
16906        self._scopes.clear();
16907        self
16908    }
16909}
16910
16911/// Delete a telemetry notification config.
16912///
16913/// A builder for the *telemetry.notificationConfigs.delete* method supported by a *customer* resource.
16914/// It is not used directly, but through a [`CustomerMethods`] instance.
16915///
16916/// # Example
16917///
16918/// Instantiate a resource method builder
16919///
16920/// ```test_harness,no_run
16921/// # extern crate hyper;
16922/// # extern crate hyper_rustls;
16923/// # extern crate google_chromemanagement1 as chromemanagement1;
16924/// # async fn dox() {
16925/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
16926///
16927/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
16928/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
16929/// #     .with_native_roots()
16930/// #     .unwrap()
16931/// #     .https_only()
16932/// #     .enable_http2()
16933/// #     .build();
16934///
16935/// # let executor = hyper_util::rt::TokioExecutor::new();
16936/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
16937/// #     secret,
16938/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
16939/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
16940/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
16941/// #     ),
16942/// # ).build().await.unwrap();
16943///
16944/// # let client = hyper_util::client::legacy::Client::builder(
16945/// #     hyper_util::rt::TokioExecutor::new()
16946/// # )
16947/// # .build(
16948/// #     hyper_rustls::HttpsConnectorBuilder::new()
16949/// #         .with_native_roots()
16950/// #         .unwrap()
16951/// #         .https_or_http()
16952/// #         .enable_http2()
16953/// #         .build()
16954/// # );
16955/// # let mut hub = ChromeManagement::new(client, auth);
16956/// // You can configure optional parameters by calling the respective setters at will, and
16957/// // execute the final call using `doit()`.
16958/// // Values shown here are possibly random and not representative !
16959/// let result = hub.customers().telemetry_notification_configs_delete("name")
16960///              .doit().await;
16961/// # }
16962/// ```
16963pub struct CustomerTelemetryNotificationConfigDeleteCall<'a, C>
16964where
16965    C: 'a,
16966{
16967    hub: &'a ChromeManagement<C>,
16968    _name: String,
16969    _delegate: Option<&'a mut dyn common::Delegate>,
16970    _additional_params: HashMap<String, String>,
16971    _scopes: BTreeSet<String>,
16972}
16973
16974impl<'a, C> common::CallBuilder for CustomerTelemetryNotificationConfigDeleteCall<'a, C> {}
16975
16976impl<'a, C> CustomerTelemetryNotificationConfigDeleteCall<'a, C>
16977where
16978    C: common::Connector,
16979{
16980    /// Perform the operation you have build so far.
16981    pub async fn doit(mut self) -> common::Result<(common::Response, GoogleProtobufEmpty)> {
16982        use std::borrow::Cow;
16983        use std::io::{Read, Seek};
16984
16985        use common::{url::Params, ToParts};
16986        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
16987
16988        let mut dd = common::DefaultDelegate;
16989        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
16990        dlg.begin(common::MethodInfo {
16991            id: "chromemanagement.customers.telemetry.notificationConfigs.delete",
16992            http_method: hyper::Method::DELETE,
16993        });
16994
16995        for &field in ["alt", "name"].iter() {
16996            if self._additional_params.contains_key(field) {
16997                dlg.finished(false);
16998                return Err(common::Error::FieldClash(field));
16999            }
17000        }
17001
17002        let mut params = Params::with_capacity(3 + self._additional_params.len());
17003        params.push("name", self._name);
17004
17005        params.extend(self._additional_params.iter());
17006
17007        params.push("alt", "json");
17008        let mut url = self.hub._base_url.clone() + "v1/{+name}";
17009        if self._scopes.is_empty() {
17010            self._scopes.insert(
17011                Scope::ChromeManagementTelemetryReadonly
17012                    .as_ref()
17013                    .to_string(),
17014            );
17015        }
17016
17017        #[allow(clippy::single_element_loop)]
17018        for &(find_this, param_name) in [("{+name}", "name")].iter() {
17019            url = params.uri_replacement(url, param_name, find_this, true);
17020        }
17021        {
17022            let to_remove = ["name"];
17023            params.remove_params(&to_remove);
17024        }
17025
17026        let url = params.parse_with_url(&url);
17027
17028        loop {
17029            let token = match self
17030                .hub
17031                .auth
17032                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
17033                .await
17034            {
17035                Ok(token) => token,
17036                Err(e) => match dlg.token(e) {
17037                    Ok(token) => token,
17038                    Err(e) => {
17039                        dlg.finished(false);
17040                        return Err(common::Error::MissingToken(e));
17041                    }
17042                },
17043            };
17044            let mut req_result = {
17045                let client = &self.hub.client;
17046                dlg.pre_request();
17047                let mut req_builder = hyper::Request::builder()
17048                    .method(hyper::Method::DELETE)
17049                    .uri(url.as_str())
17050                    .header(USER_AGENT, self.hub._user_agent.clone());
17051
17052                if let Some(token) = token.as_ref() {
17053                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
17054                }
17055
17056                let request = req_builder
17057                    .header(CONTENT_LENGTH, 0_u64)
17058                    .body(common::to_body::<String>(None));
17059
17060                client.request(request.unwrap()).await
17061            };
17062
17063            match req_result {
17064                Err(err) => {
17065                    if let common::Retry::After(d) = dlg.http_error(&err) {
17066                        sleep(d).await;
17067                        continue;
17068                    }
17069                    dlg.finished(false);
17070                    return Err(common::Error::HttpError(err));
17071                }
17072                Ok(res) => {
17073                    let (mut parts, body) = res.into_parts();
17074                    let mut body = common::Body::new(body);
17075                    if !parts.status.is_success() {
17076                        let bytes = common::to_bytes(body).await.unwrap_or_default();
17077                        let error = serde_json::from_str(&common::to_string(&bytes));
17078                        let response = common::to_response(parts, bytes.into());
17079
17080                        if let common::Retry::After(d) =
17081                            dlg.http_failure(&response, error.as_ref().ok())
17082                        {
17083                            sleep(d).await;
17084                            continue;
17085                        }
17086
17087                        dlg.finished(false);
17088
17089                        return Err(match error {
17090                            Ok(value) => common::Error::BadRequest(value),
17091                            _ => common::Error::Failure(response),
17092                        });
17093                    }
17094                    let response = {
17095                        let bytes = common::to_bytes(body).await.unwrap_or_default();
17096                        let encoded = common::to_string(&bytes);
17097                        match serde_json::from_str(&encoded) {
17098                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
17099                            Err(error) => {
17100                                dlg.response_json_decode_error(&encoded, &error);
17101                                return Err(common::Error::JsonDecodeError(
17102                                    encoded.to_string(),
17103                                    error,
17104                                ));
17105                            }
17106                        }
17107                    };
17108
17109                    dlg.finished(true);
17110                    return Ok(response);
17111                }
17112            }
17113        }
17114    }
17115
17116    /// Required. The name of the notification config to delete. Format: `customers/{customer}/telemetry/notificationConfigs/{notification_config}`
17117    ///
17118    /// Sets the *name* path property to the given value.
17119    ///
17120    /// Even though the property as already been set when instantiating this call,
17121    /// we provide this method for API completeness.
17122    pub fn name(mut self, new_value: &str) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C> {
17123        self._name = new_value.to_string();
17124        self
17125    }
17126    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
17127    /// while executing the actual API request.
17128    ///
17129    /// ````text
17130    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
17131    /// ````
17132    ///
17133    /// Sets the *delegate* property to the given value.
17134    pub fn delegate(
17135        mut self,
17136        new_value: &'a mut dyn common::Delegate,
17137    ) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C> {
17138        self._delegate = Some(new_value);
17139        self
17140    }
17141
17142    /// Set any additional parameter of the query string used in the request.
17143    /// It should be used to set parameters which are not yet available through their own
17144    /// setters.
17145    ///
17146    /// Please note that this method must not be used to set any of the known parameters
17147    /// which have their own setter method. If done anyway, the request will fail.
17148    ///
17149    /// # Additional Parameters
17150    ///
17151    /// * *$.xgafv* (query-string) - V1 error format.
17152    /// * *access_token* (query-string) - OAuth access token.
17153    /// * *alt* (query-string) - Data format for response.
17154    /// * *callback* (query-string) - JSONP
17155    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
17156    /// * *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.
17157    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
17158    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
17159    /// * *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.
17160    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
17161    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
17162    pub fn param<T>(
17163        mut self,
17164        name: T,
17165        value: T,
17166    ) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C>
17167    where
17168        T: AsRef<str>,
17169    {
17170        self._additional_params
17171            .insert(name.as_ref().to_string(), value.as_ref().to_string());
17172        self
17173    }
17174
17175    /// Identifies the authorization scope for the method you are building.
17176    ///
17177    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
17178    /// [`Scope::ChromeManagementTelemetryReadonly`].
17179    ///
17180    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
17181    /// tokens for more than one scope.
17182    ///
17183    /// Usually there is more than one suitable scope to authorize an operation, some of which may
17184    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
17185    /// sufficient, a read-write scope will do as well.
17186    pub fn add_scope<St>(
17187        mut self,
17188        scope: St,
17189    ) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C>
17190    where
17191        St: AsRef<str>,
17192    {
17193        self._scopes.insert(String::from(scope.as_ref()));
17194        self
17195    }
17196    /// Identifies the authorization scope(s) for the method you are building.
17197    ///
17198    /// See [`Self::add_scope()`] for details.
17199    pub fn add_scopes<I, St>(
17200        mut self,
17201        scopes: I,
17202    ) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C>
17203    where
17204        I: IntoIterator<Item = St>,
17205        St: AsRef<str>,
17206    {
17207        self._scopes
17208            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
17209        self
17210    }
17211
17212    /// Removes all scopes, and no default scope will be used either.
17213    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
17214    /// for details).
17215    pub fn clear_scopes(mut self) -> CustomerTelemetryNotificationConfigDeleteCall<'a, C> {
17216        self._scopes.clear();
17217        self
17218    }
17219}
17220
17221/// List all telemetry notification configs.
17222///
17223/// A builder for the *telemetry.notificationConfigs.list* method supported by a *customer* resource.
17224/// It is not used directly, but through a [`CustomerMethods`] instance.
17225///
17226/// # Example
17227///
17228/// Instantiate a resource method builder
17229///
17230/// ```test_harness,no_run
17231/// # extern crate hyper;
17232/// # extern crate hyper_rustls;
17233/// # extern crate google_chromemanagement1 as chromemanagement1;
17234/// # async fn dox() {
17235/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
17236///
17237/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
17238/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
17239/// #     .with_native_roots()
17240/// #     .unwrap()
17241/// #     .https_only()
17242/// #     .enable_http2()
17243/// #     .build();
17244///
17245/// # let executor = hyper_util::rt::TokioExecutor::new();
17246/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
17247/// #     secret,
17248/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
17249/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
17250/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
17251/// #     ),
17252/// # ).build().await.unwrap();
17253///
17254/// # let client = hyper_util::client::legacy::Client::builder(
17255/// #     hyper_util::rt::TokioExecutor::new()
17256/// # )
17257/// # .build(
17258/// #     hyper_rustls::HttpsConnectorBuilder::new()
17259/// #         .with_native_roots()
17260/// #         .unwrap()
17261/// #         .https_or_http()
17262/// #         .enable_http2()
17263/// #         .build()
17264/// # );
17265/// # let mut hub = ChromeManagement::new(client, auth);
17266/// // You can configure optional parameters by calling the respective setters at will, and
17267/// // execute the final call using `doit()`.
17268/// // Values shown here are possibly random and not representative !
17269/// let result = hub.customers().telemetry_notification_configs_list("parent")
17270///              .page_token("dolores")
17271///              .page_size(-69)
17272///              .doit().await;
17273/// # }
17274/// ```
17275pub struct CustomerTelemetryNotificationConfigListCall<'a, C>
17276where
17277    C: 'a,
17278{
17279    hub: &'a ChromeManagement<C>,
17280    _parent: String,
17281    _page_token: Option<String>,
17282    _page_size: Option<i32>,
17283    _delegate: Option<&'a mut dyn common::Delegate>,
17284    _additional_params: HashMap<String, String>,
17285    _scopes: BTreeSet<String>,
17286}
17287
17288impl<'a, C> common::CallBuilder for CustomerTelemetryNotificationConfigListCall<'a, C> {}
17289
17290impl<'a, C> CustomerTelemetryNotificationConfigListCall<'a, C>
17291where
17292    C: common::Connector,
17293{
17294    /// Perform the operation you have build so far.
17295    pub async fn doit(
17296        mut self,
17297    ) -> common::Result<(
17298        common::Response,
17299        GoogleChromeManagementV1ListTelemetryNotificationConfigsResponse,
17300    )> {
17301        use std::borrow::Cow;
17302        use std::io::{Read, Seek};
17303
17304        use common::{url::Params, ToParts};
17305        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
17306
17307        let mut dd = common::DefaultDelegate;
17308        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
17309        dlg.begin(common::MethodInfo {
17310            id: "chromemanagement.customers.telemetry.notificationConfigs.list",
17311            http_method: hyper::Method::GET,
17312        });
17313
17314        for &field in ["alt", "parent", "pageToken", "pageSize"].iter() {
17315            if self._additional_params.contains_key(field) {
17316                dlg.finished(false);
17317                return Err(common::Error::FieldClash(field));
17318            }
17319        }
17320
17321        let mut params = Params::with_capacity(5 + self._additional_params.len());
17322        params.push("parent", self._parent);
17323        if let Some(value) = self._page_token.as_ref() {
17324            params.push("pageToken", value);
17325        }
17326        if let Some(value) = self._page_size.as_ref() {
17327            params.push("pageSize", value.to_string());
17328        }
17329
17330        params.extend(self._additional_params.iter());
17331
17332        params.push("alt", "json");
17333        let mut url = self.hub._base_url.clone() + "v1/{+parent}/telemetry/notificationConfigs";
17334        if self._scopes.is_empty() {
17335            self._scopes.insert(
17336                Scope::ChromeManagementTelemetryReadonly
17337                    .as_ref()
17338                    .to_string(),
17339            );
17340        }
17341
17342        #[allow(clippy::single_element_loop)]
17343        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
17344            url = params.uri_replacement(url, param_name, find_this, true);
17345        }
17346        {
17347            let to_remove = ["parent"];
17348            params.remove_params(&to_remove);
17349        }
17350
17351        let url = params.parse_with_url(&url);
17352
17353        loop {
17354            let token = match self
17355                .hub
17356                .auth
17357                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
17358                .await
17359            {
17360                Ok(token) => token,
17361                Err(e) => match dlg.token(e) {
17362                    Ok(token) => token,
17363                    Err(e) => {
17364                        dlg.finished(false);
17365                        return Err(common::Error::MissingToken(e));
17366                    }
17367                },
17368            };
17369            let mut req_result = {
17370                let client = &self.hub.client;
17371                dlg.pre_request();
17372                let mut req_builder = hyper::Request::builder()
17373                    .method(hyper::Method::GET)
17374                    .uri(url.as_str())
17375                    .header(USER_AGENT, self.hub._user_agent.clone());
17376
17377                if let Some(token) = token.as_ref() {
17378                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
17379                }
17380
17381                let request = req_builder
17382                    .header(CONTENT_LENGTH, 0_u64)
17383                    .body(common::to_body::<String>(None));
17384
17385                client.request(request.unwrap()).await
17386            };
17387
17388            match req_result {
17389                Err(err) => {
17390                    if let common::Retry::After(d) = dlg.http_error(&err) {
17391                        sleep(d).await;
17392                        continue;
17393                    }
17394                    dlg.finished(false);
17395                    return Err(common::Error::HttpError(err));
17396                }
17397                Ok(res) => {
17398                    let (mut parts, body) = res.into_parts();
17399                    let mut body = common::Body::new(body);
17400                    if !parts.status.is_success() {
17401                        let bytes = common::to_bytes(body).await.unwrap_or_default();
17402                        let error = serde_json::from_str(&common::to_string(&bytes));
17403                        let response = common::to_response(parts, bytes.into());
17404
17405                        if let common::Retry::After(d) =
17406                            dlg.http_failure(&response, error.as_ref().ok())
17407                        {
17408                            sleep(d).await;
17409                            continue;
17410                        }
17411
17412                        dlg.finished(false);
17413
17414                        return Err(match error {
17415                            Ok(value) => common::Error::BadRequest(value),
17416                            _ => common::Error::Failure(response),
17417                        });
17418                    }
17419                    let response = {
17420                        let bytes = common::to_bytes(body).await.unwrap_or_default();
17421                        let encoded = common::to_string(&bytes);
17422                        match serde_json::from_str(&encoded) {
17423                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
17424                            Err(error) => {
17425                                dlg.response_json_decode_error(&encoded, &error);
17426                                return Err(common::Error::JsonDecodeError(
17427                                    encoded.to_string(),
17428                                    error,
17429                                ));
17430                            }
17431                        }
17432                    };
17433
17434                    dlg.finished(true);
17435                    return Ok(response);
17436                }
17437            }
17438        }
17439    }
17440
17441    /// Required. The parent which owns the notification configs.
17442    ///
17443    /// Sets the *parent* path property to the given value.
17444    ///
17445    /// Even though the property as already been set when instantiating this call,
17446    /// we provide this method for API completeness.
17447    pub fn parent(mut self, new_value: &str) -> CustomerTelemetryNotificationConfigListCall<'a, C> {
17448        self._parent = new_value.to_string();
17449        self
17450    }
17451    /// A page token, received from a previous `ListTelemetryNotificationConfigs` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListTelemetryNotificationConfigs` must match the call that provided the page token.
17452    ///
17453    /// Sets the *page token* query property to the given value.
17454    pub fn page_token(
17455        mut self,
17456        new_value: &str,
17457    ) -> CustomerTelemetryNotificationConfigListCall<'a, C> {
17458        self._page_token = Some(new_value.to_string());
17459        self
17460    }
17461    /// The maximum number of notification configs to return. The service may return fewer than this value. If unspecified, at most 100 notification configs will be returned. The maximum value is 100; values above 100 will be coerced to 100.
17462    ///
17463    /// Sets the *page size* query property to the given value.
17464    pub fn page_size(
17465        mut self,
17466        new_value: i32,
17467    ) -> CustomerTelemetryNotificationConfigListCall<'a, C> {
17468        self._page_size = Some(new_value);
17469        self
17470    }
17471    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
17472    /// while executing the actual API request.
17473    ///
17474    /// ````text
17475    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
17476    /// ````
17477    ///
17478    /// Sets the *delegate* property to the given value.
17479    pub fn delegate(
17480        mut self,
17481        new_value: &'a mut dyn common::Delegate,
17482    ) -> CustomerTelemetryNotificationConfigListCall<'a, C> {
17483        self._delegate = Some(new_value);
17484        self
17485    }
17486
17487    /// Set any additional parameter of the query string used in the request.
17488    /// It should be used to set parameters which are not yet available through their own
17489    /// setters.
17490    ///
17491    /// Please note that this method must not be used to set any of the known parameters
17492    /// which have their own setter method. If done anyway, the request will fail.
17493    ///
17494    /// # Additional Parameters
17495    ///
17496    /// * *$.xgafv* (query-string) - V1 error format.
17497    /// * *access_token* (query-string) - OAuth access token.
17498    /// * *alt* (query-string) - Data format for response.
17499    /// * *callback* (query-string) - JSONP
17500    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
17501    /// * *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.
17502    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
17503    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
17504    /// * *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.
17505    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
17506    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
17507    pub fn param<T>(
17508        mut self,
17509        name: T,
17510        value: T,
17511    ) -> CustomerTelemetryNotificationConfigListCall<'a, C>
17512    where
17513        T: AsRef<str>,
17514    {
17515        self._additional_params
17516            .insert(name.as_ref().to_string(), value.as_ref().to_string());
17517        self
17518    }
17519
17520    /// Identifies the authorization scope for the method you are building.
17521    ///
17522    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
17523    /// [`Scope::ChromeManagementTelemetryReadonly`].
17524    ///
17525    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
17526    /// tokens for more than one scope.
17527    ///
17528    /// Usually there is more than one suitable scope to authorize an operation, some of which may
17529    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
17530    /// sufficient, a read-write scope will do as well.
17531    pub fn add_scope<St>(mut self, scope: St) -> CustomerTelemetryNotificationConfigListCall<'a, C>
17532    where
17533        St: AsRef<str>,
17534    {
17535        self._scopes.insert(String::from(scope.as_ref()));
17536        self
17537    }
17538    /// Identifies the authorization scope(s) for the method you are building.
17539    ///
17540    /// See [`Self::add_scope()`] for details.
17541    pub fn add_scopes<I, St>(
17542        mut self,
17543        scopes: I,
17544    ) -> CustomerTelemetryNotificationConfigListCall<'a, C>
17545    where
17546        I: IntoIterator<Item = St>,
17547        St: AsRef<str>,
17548    {
17549        self._scopes
17550            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
17551        self
17552    }
17553
17554    /// Removes all scopes, and no default scope will be used either.
17555    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
17556    /// for details).
17557    pub fn clear_scopes(mut self) -> CustomerTelemetryNotificationConfigListCall<'a, C> {
17558        self._scopes.clear();
17559        self
17560    }
17561}
17562
17563/// Get telemetry user.
17564///
17565/// A builder for the *telemetry.users.get* method supported by a *customer* resource.
17566/// It is not used directly, but through a [`CustomerMethods`] instance.
17567///
17568/// # Example
17569///
17570/// Instantiate a resource method builder
17571///
17572/// ```test_harness,no_run
17573/// # extern crate hyper;
17574/// # extern crate hyper_rustls;
17575/// # extern crate google_chromemanagement1 as chromemanagement1;
17576/// # async fn dox() {
17577/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
17578///
17579/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
17580/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
17581/// #     .with_native_roots()
17582/// #     .unwrap()
17583/// #     .https_only()
17584/// #     .enable_http2()
17585/// #     .build();
17586///
17587/// # let executor = hyper_util::rt::TokioExecutor::new();
17588/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
17589/// #     secret,
17590/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
17591/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
17592/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
17593/// #     ),
17594/// # ).build().await.unwrap();
17595///
17596/// # let client = hyper_util::client::legacy::Client::builder(
17597/// #     hyper_util::rt::TokioExecutor::new()
17598/// # )
17599/// # .build(
17600/// #     hyper_rustls::HttpsConnectorBuilder::new()
17601/// #         .with_native_roots()
17602/// #         .unwrap()
17603/// #         .https_or_http()
17604/// #         .enable_http2()
17605/// #         .build()
17606/// # );
17607/// # let mut hub = ChromeManagement::new(client, auth);
17608/// // You can configure optional parameters by calling the respective setters at will, and
17609/// // execute the final call using `doit()`.
17610/// // Values shown here are possibly random and not representative !
17611/// let result = hub.customers().telemetry_users_get("name")
17612///              .read_mask(FieldMask::new::<&str>(&[]))
17613///              .doit().await;
17614/// # }
17615/// ```
17616pub struct CustomerTelemetryUserGetCall<'a, C>
17617where
17618    C: 'a,
17619{
17620    hub: &'a ChromeManagement<C>,
17621    _name: String,
17622    _read_mask: Option<common::FieldMask>,
17623    _delegate: Option<&'a mut dyn common::Delegate>,
17624    _additional_params: HashMap<String, String>,
17625    _scopes: BTreeSet<String>,
17626}
17627
17628impl<'a, C> common::CallBuilder for CustomerTelemetryUserGetCall<'a, C> {}
17629
17630impl<'a, C> CustomerTelemetryUserGetCall<'a, C>
17631where
17632    C: common::Connector,
17633{
17634    /// Perform the operation you have build so far.
17635    pub async fn doit(
17636        mut self,
17637    ) -> common::Result<(common::Response, GoogleChromeManagementV1TelemetryUser)> {
17638        use std::borrow::Cow;
17639        use std::io::{Read, Seek};
17640
17641        use common::{url::Params, ToParts};
17642        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
17643
17644        let mut dd = common::DefaultDelegate;
17645        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
17646        dlg.begin(common::MethodInfo {
17647            id: "chromemanagement.customers.telemetry.users.get",
17648            http_method: hyper::Method::GET,
17649        });
17650
17651        for &field in ["alt", "name", "readMask"].iter() {
17652            if self._additional_params.contains_key(field) {
17653                dlg.finished(false);
17654                return Err(common::Error::FieldClash(field));
17655            }
17656        }
17657
17658        let mut params = Params::with_capacity(4 + self._additional_params.len());
17659        params.push("name", self._name);
17660        if let Some(value) = self._read_mask.as_ref() {
17661            params.push("readMask", value.to_string());
17662        }
17663
17664        params.extend(self._additional_params.iter());
17665
17666        params.push("alt", "json");
17667        let mut url = self.hub._base_url.clone() + "v1/{+name}";
17668        if self._scopes.is_empty() {
17669            self._scopes.insert(
17670                Scope::ChromeManagementTelemetryReadonly
17671                    .as_ref()
17672                    .to_string(),
17673            );
17674        }
17675
17676        #[allow(clippy::single_element_loop)]
17677        for &(find_this, param_name) in [("{+name}", "name")].iter() {
17678            url = params.uri_replacement(url, param_name, find_this, true);
17679        }
17680        {
17681            let to_remove = ["name"];
17682            params.remove_params(&to_remove);
17683        }
17684
17685        let url = params.parse_with_url(&url);
17686
17687        loop {
17688            let token = match self
17689                .hub
17690                .auth
17691                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
17692                .await
17693            {
17694                Ok(token) => token,
17695                Err(e) => match dlg.token(e) {
17696                    Ok(token) => token,
17697                    Err(e) => {
17698                        dlg.finished(false);
17699                        return Err(common::Error::MissingToken(e));
17700                    }
17701                },
17702            };
17703            let mut req_result = {
17704                let client = &self.hub.client;
17705                dlg.pre_request();
17706                let mut req_builder = hyper::Request::builder()
17707                    .method(hyper::Method::GET)
17708                    .uri(url.as_str())
17709                    .header(USER_AGENT, self.hub._user_agent.clone());
17710
17711                if let Some(token) = token.as_ref() {
17712                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
17713                }
17714
17715                let request = req_builder
17716                    .header(CONTENT_LENGTH, 0_u64)
17717                    .body(common::to_body::<String>(None));
17718
17719                client.request(request.unwrap()).await
17720            };
17721
17722            match req_result {
17723                Err(err) => {
17724                    if let common::Retry::After(d) = dlg.http_error(&err) {
17725                        sleep(d).await;
17726                        continue;
17727                    }
17728                    dlg.finished(false);
17729                    return Err(common::Error::HttpError(err));
17730                }
17731                Ok(res) => {
17732                    let (mut parts, body) = res.into_parts();
17733                    let mut body = common::Body::new(body);
17734                    if !parts.status.is_success() {
17735                        let bytes = common::to_bytes(body).await.unwrap_or_default();
17736                        let error = serde_json::from_str(&common::to_string(&bytes));
17737                        let response = common::to_response(parts, bytes.into());
17738
17739                        if let common::Retry::After(d) =
17740                            dlg.http_failure(&response, error.as_ref().ok())
17741                        {
17742                            sleep(d).await;
17743                            continue;
17744                        }
17745
17746                        dlg.finished(false);
17747
17748                        return Err(match error {
17749                            Ok(value) => common::Error::BadRequest(value),
17750                            _ => common::Error::Failure(response),
17751                        });
17752                    }
17753                    let response = {
17754                        let bytes = common::to_bytes(body).await.unwrap_or_default();
17755                        let encoded = common::to_string(&bytes);
17756                        match serde_json::from_str(&encoded) {
17757                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
17758                            Err(error) => {
17759                                dlg.response_json_decode_error(&encoded, &error);
17760                                return Err(common::Error::JsonDecodeError(
17761                                    encoded.to_string(),
17762                                    error,
17763                                ));
17764                            }
17765                        }
17766                    };
17767
17768                    dlg.finished(true);
17769                    return Ok(response);
17770                }
17771            }
17772        }
17773    }
17774
17775    /// Required. Name of the `TelemetryUser` to return.
17776    ///
17777    /// Sets the *name* path property to the given value.
17778    ///
17779    /// Even though the property as already been set when instantiating this call,
17780    /// we provide this method for API completeness.
17781    pub fn name(mut self, new_value: &str) -> CustomerTelemetryUserGetCall<'a, C> {
17782        self._name = new_value.to_string();
17783        self
17784    }
17785    /// Read mask to specify which fields to return. Supported read_mask paths are: - name - org_unit_id - user_id - user_email - user_device.device_id - user_device.audio_status_report - user_device.device_activity_report - user_device.network_bandwidth_report - user_device.peripherals_report - user_device.app_report
17786    ///
17787    /// Sets the *read mask* query property to the given value.
17788    pub fn read_mask(
17789        mut self,
17790        new_value: common::FieldMask,
17791    ) -> CustomerTelemetryUserGetCall<'a, C> {
17792        self._read_mask = Some(new_value);
17793        self
17794    }
17795    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
17796    /// while executing the actual API request.
17797    ///
17798    /// ````text
17799    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
17800    /// ````
17801    ///
17802    /// Sets the *delegate* property to the given value.
17803    pub fn delegate(
17804        mut self,
17805        new_value: &'a mut dyn common::Delegate,
17806    ) -> CustomerTelemetryUserGetCall<'a, C> {
17807        self._delegate = Some(new_value);
17808        self
17809    }
17810
17811    /// Set any additional parameter of the query string used in the request.
17812    /// It should be used to set parameters which are not yet available through their own
17813    /// setters.
17814    ///
17815    /// Please note that this method must not be used to set any of the known parameters
17816    /// which have their own setter method. If done anyway, the request will fail.
17817    ///
17818    /// # Additional Parameters
17819    ///
17820    /// * *$.xgafv* (query-string) - V1 error format.
17821    /// * *access_token* (query-string) - OAuth access token.
17822    /// * *alt* (query-string) - Data format for response.
17823    /// * *callback* (query-string) - JSONP
17824    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
17825    /// * *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.
17826    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
17827    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
17828    /// * *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.
17829    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
17830    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
17831    pub fn param<T>(mut self, name: T, value: T) -> CustomerTelemetryUserGetCall<'a, C>
17832    where
17833        T: AsRef<str>,
17834    {
17835        self._additional_params
17836            .insert(name.as_ref().to_string(), value.as_ref().to_string());
17837        self
17838    }
17839
17840    /// Identifies the authorization scope for the method you are building.
17841    ///
17842    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
17843    /// [`Scope::ChromeManagementTelemetryReadonly`].
17844    ///
17845    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
17846    /// tokens for more than one scope.
17847    ///
17848    /// Usually there is more than one suitable scope to authorize an operation, some of which may
17849    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
17850    /// sufficient, a read-write scope will do as well.
17851    pub fn add_scope<St>(mut self, scope: St) -> CustomerTelemetryUserGetCall<'a, C>
17852    where
17853        St: AsRef<str>,
17854    {
17855        self._scopes.insert(String::from(scope.as_ref()));
17856        self
17857    }
17858    /// Identifies the authorization scope(s) for the method you are building.
17859    ///
17860    /// See [`Self::add_scope()`] for details.
17861    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerTelemetryUserGetCall<'a, C>
17862    where
17863        I: IntoIterator<Item = St>,
17864        St: AsRef<str>,
17865    {
17866        self._scopes
17867            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
17868        self
17869    }
17870
17871    /// Removes all scopes, and no default scope will be used either.
17872    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
17873    /// for details).
17874    pub fn clear_scopes(mut self) -> CustomerTelemetryUserGetCall<'a, C> {
17875        self._scopes.clear();
17876        self
17877    }
17878}
17879
17880/// List all telemetry users.
17881///
17882/// A builder for the *telemetry.users.list* method supported by a *customer* resource.
17883/// It is not used directly, but through a [`CustomerMethods`] instance.
17884///
17885/// # Example
17886///
17887/// Instantiate a resource method builder
17888///
17889/// ```test_harness,no_run
17890/// # extern crate hyper;
17891/// # extern crate hyper_rustls;
17892/// # extern crate google_chromemanagement1 as chromemanagement1;
17893/// # async fn dox() {
17894/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
17895///
17896/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
17897/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
17898/// #     .with_native_roots()
17899/// #     .unwrap()
17900/// #     .https_only()
17901/// #     .enable_http2()
17902/// #     .build();
17903///
17904/// # let executor = hyper_util::rt::TokioExecutor::new();
17905/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
17906/// #     secret,
17907/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
17908/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
17909/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
17910/// #     ),
17911/// # ).build().await.unwrap();
17912///
17913/// # let client = hyper_util::client::legacy::Client::builder(
17914/// #     hyper_util::rt::TokioExecutor::new()
17915/// # )
17916/// # .build(
17917/// #     hyper_rustls::HttpsConnectorBuilder::new()
17918/// #         .with_native_roots()
17919/// #         .unwrap()
17920/// #         .https_or_http()
17921/// #         .enable_http2()
17922/// #         .build()
17923/// # );
17924/// # let mut hub = ChromeManagement::new(client, auth);
17925/// // You can configure optional parameters by calling the respective setters at will, and
17926/// // execute the final call using `doit()`.
17927/// // Values shown here are possibly random and not representative !
17928/// let result = hub.customers().telemetry_users_list("parent")
17929///              .read_mask(FieldMask::new::<&str>(&[]))
17930///              .page_token("no")
17931///              .page_size(-85)
17932///              .filter("elitr")
17933///              .doit().await;
17934/// # }
17935/// ```
17936pub struct CustomerTelemetryUserListCall<'a, C>
17937where
17938    C: 'a,
17939{
17940    hub: &'a ChromeManagement<C>,
17941    _parent: String,
17942    _read_mask: Option<common::FieldMask>,
17943    _page_token: Option<String>,
17944    _page_size: Option<i32>,
17945    _filter: Option<String>,
17946    _delegate: Option<&'a mut dyn common::Delegate>,
17947    _additional_params: HashMap<String, String>,
17948    _scopes: BTreeSet<String>,
17949}
17950
17951impl<'a, C> common::CallBuilder for CustomerTelemetryUserListCall<'a, C> {}
17952
17953impl<'a, C> CustomerTelemetryUserListCall<'a, C>
17954where
17955    C: common::Connector,
17956{
17957    /// Perform the operation you have build so far.
17958    pub async fn doit(
17959        mut self,
17960    ) -> common::Result<(
17961        common::Response,
17962        GoogleChromeManagementV1ListTelemetryUsersResponse,
17963    )> {
17964        use std::borrow::Cow;
17965        use std::io::{Read, Seek};
17966
17967        use common::{url::Params, ToParts};
17968        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
17969
17970        let mut dd = common::DefaultDelegate;
17971        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
17972        dlg.begin(common::MethodInfo {
17973            id: "chromemanagement.customers.telemetry.users.list",
17974            http_method: hyper::Method::GET,
17975        });
17976
17977        for &field in [
17978            "alt",
17979            "parent",
17980            "readMask",
17981            "pageToken",
17982            "pageSize",
17983            "filter",
17984        ]
17985        .iter()
17986        {
17987            if self._additional_params.contains_key(field) {
17988                dlg.finished(false);
17989                return Err(common::Error::FieldClash(field));
17990            }
17991        }
17992
17993        let mut params = Params::with_capacity(7 + self._additional_params.len());
17994        params.push("parent", self._parent);
17995        if let Some(value) = self._read_mask.as_ref() {
17996            params.push("readMask", value.to_string());
17997        }
17998        if let Some(value) = self._page_token.as_ref() {
17999            params.push("pageToken", value);
18000        }
18001        if let Some(value) = self._page_size.as_ref() {
18002            params.push("pageSize", value.to_string());
18003        }
18004        if let Some(value) = self._filter.as_ref() {
18005            params.push("filter", value);
18006        }
18007
18008        params.extend(self._additional_params.iter());
18009
18010        params.push("alt", "json");
18011        let mut url = self.hub._base_url.clone() + "v1/{+parent}/telemetry/users";
18012        if self._scopes.is_empty() {
18013            self._scopes.insert(
18014                Scope::ChromeManagementTelemetryReadonly
18015                    .as_ref()
18016                    .to_string(),
18017            );
18018        }
18019
18020        #[allow(clippy::single_element_loop)]
18021        for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
18022            url = params.uri_replacement(url, param_name, find_this, true);
18023        }
18024        {
18025            let to_remove = ["parent"];
18026            params.remove_params(&to_remove);
18027        }
18028
18029        let url = params.parse_with_url(&url);
18030
18031        loop {
18032            let token = match self
18033                .hub
18034                .auth
18035                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
18036                .await
18037            {
18038                Ok(token) => token,
18039                Err(e) => match dlg.token(e) {
18040                    Ok(token) => token,
18041                    Err(e) => {
18042                        dlg.finished(false);
18043                        return Err(common::Error::MissingToken(e));
18044                    }
18045                },
18046            };
18047            let mut req_result = {
18048                let client = &self.hub.client;
18049                dlg.pre_request();
18050                let mut req_builder = hyper::Request::builder()
18051                    .method(hyper::Method::GET)
18052                    .uri(url.as_str())
18053                    .header(USER_AGENT, self.hub._user_agent.clone());
18054
18055                if let Some(token) = token.as_ref() {
18056                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
18057                }
18058
18059                let request = req_builder
18060                    .header(CONTENT_LENGTH, 0_u64)
18061                    .body(common::to_body::<String>(None));
18062
18063                client.request(request.unwrap()).await
18064            };
18065
18066            match req_result {
18067                Err(err) => {
18068                    if let common::Retry::After(d) = dlg.http_error(&err) {
18069                        sleep(d).await;
18070                        continue;
18071                    }
18072                    dlg.finished(false);
18073                    return Err(common::Error::HttpError(err));
18074                }
18075                Ok(res) => {
18076                    let (mut parts, body) = res.into_parts();
18077                    let mut body = common::Body::new(body);
18078                    if !parts.status.is_success() {
18079                        let bytes = common::to_bytes(body).await.unwrap_or_default();
18080                        let error = serde_json::from_str(&common::to_string(&bytes));
18081                        let response = common::to_response(parts, bytes.into());
18082
18083                        if let common::Retry::After(d) =
18084                            dlg.http_failure(&response, error.as_ref().ok())
18085                        {
18086                            sleep(d).await;
18087                            continue;
18088                        }
18089
18090                        dlg.finished(false);
18091
18092                        return Err(match error {
18093                            Ok(value) => common::Error::BadRequest(value),
18094                            _ => common::Error::Failure(response),
18095                        });
18096                    }
18097                    let response = {
18098                        let bytes = common::to_bytes(body).await.unwrap_or_default();
18099                        let encoded = common::to_string(&bytes);
18100                        match serde_json::from_str(&encoded) {
18101                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
18102                            Err(error) => {
18103                                dlg.response_json_decode_error(&encoded, &error);
18104                                return Err(common::Error::JsonDecodeError(
18105                                    encoded.to_string(),
18106                                    error,
18107                                ));
18108                            }
18109                        }
18110                    };
18111
18112                    dlg.finished(true);
18113                    return Ok(response);
18114                }
18115            }
18116        }
18117    }
18118
18119    /// Required. Customer id or "my_customer" to use the customer associated to the account making the request.
18120    ///
18121    /// Sets the *parent* path property to the given value.
18122    ///
18123    /// Even though the property as already been set when instantiating this call,
18124    /// we provide this method for API completeness.
18125    pub fn parent(mut self, new_value: &str) -> CustomerTelemetryUserListCall<'a, C> {
18126        self._parent = new_value.to_string();
18127        self
18128    }
18129    /// Read mask to specify which fields to return. Supported read_mask paths are: - name - org_unit_id - user_id - user_email - user_device.device_id - user_device.audio_status_report - user_device.device_activity_report - user_device.network_bandwidth_report - user_device.peripherals_report - user_device.app_report
18130    ///
18131    /// Sets the *read mask* query property to the given value.
18132    pub fn read_mask(
18133        mut self,
18134        new_value: common::FieldMask,
18135    ) -> CustomerTelemetryUserListCall<'a, C> {
18136        self._read_mask = Some(new_value);
18137        self
18138    }
18139    /// Token to specify next page in the list.
18140    ///
18141    /// Sets the *page token* query property to the given value.
18142    pub fn page_token(mut self, new_value: &str) -> CustomerTelemetryUserListCall<'a, C> {
18143        self._page_token = Some(new_value.to_string());
18144        self
18145    }
18146    /// Maximum number of results to return. Default value is 100. Maximum value is 1000.
18147    ///
18148    /// Sets the *page size* query property to the given value.
18149    pub fn page_size(mut self, new_value: i32) -> CustomerTelemetryUserListCall<'a, C> {
18150        self._page_size = Some(new_value);
18151        self
18152    }
18153    /// Only include resources that match the filter. Supported filter fields: - user_id - user_org_unit_id
18154    ///
18155    /// Sets the *filter* query property to the given value.
18156    pub fn filter(mut self, new_value: &str) -> CustomerTelemetryUserListCall<'a, C> {
18157        self._filter = Some(new_value.to_string());
18158        self
18159    }
18160    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
18161    /// while executing the actual API request.
18162    ///
18163    /// ````text
18164    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
18165    /// ````
18166    ///
18167    /// Sets the *delegate* property to the given value.
18168    pub fn delegate(
18169        mut self,
18170        new_value: &'a mut dyn common::Delegate,
18171    ) -> CustomerTelemetryUserListCall<'a, C> {
18172        self._delegate = Some(new_value);
18173        self
18174    }
18175
18176    /// Set any additional parameter of the query string used in the request.
18177    /// It should be used to set parameters which are not yet available through their own
18178    /// setters.
18179    ///
18180    /// Please note that this method must not be used to set any of the known parameters
18181    /// which have their own setter method. If done anyway, the request will fail.
18182    ///
18183    /// # Additional Parameters
18184    ///
18185    /// * *$.xgafv* (query-string) - V1 error format.
18186    /// * *access_token* (query-string) - OAuth access token.
18187    /// * *alt* (query-string) - Data format for response.
18188    /// * *callback* (query-string) - JSONP
18189    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
18190    /// * *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.
18191    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
18192    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
18193    /// * *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.
18194    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
18195    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
18196    pub fn param<T>(mut self, name: T, value: T) -> CustomerTelemetryUserListCall<'a, C>
18197    where
18198        T: AsRef<str>,
18199    {
18200        self._additional_params
18201            .insert(name.as_ref().to_string(), value.as_ref().to_string());
18202        self
18203    }
18204
18205    /// Identifies the authorization scope for the method you are building.
18206    ///
18207    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
18208    /// [`Scope::ChromeManagementTelemetryReadonly`].
18209    ///
18210    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
18211    /// tokens for more than one scope.
18212    ///
18213    /// Usually there is more than one suitable scope to authorize an operation, some of which may
18214    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
18215    /// sufficient, a read-write scope will do as well.
18216    pub fn add_scope<St>(mut self, scope: St) -> CustomerTelemetryUserListCall<'a, C>
18217    where
18218        St: AsRef<str>,
18219    {
18220        self._scopes.insert(String::from(scope.as_ref()));
18221        self
18222    }
18223    /// Identifies the authorization scope(s) for the method you are building.
18224    ///
18225    /// See [`Self::add_scope()`] for details.
18226    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerTelemetryUserListCall<'a, C>
18227    where
18228        I: IntoIterator<Item = St>,
18229        St: AsRef<str>,
18230    {
18231        self._scopes
18232            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
18233        self
18234    }
18235
18236    /// Removes all scopes, and no default scope will be used either.
18237    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
18238    /// for details).
18239    pub fn clear_scopes(mut self) -> CustomerTelemetryUserListCall<'a, C> {
18240        self._scopes.clear();
18241        self
18242    }
18243}
18244
18245/// Moves a third party chrome profile user to a destination OU. All profiles associated to that user will be moved to the destination OU.
18246///
18247/// A builder for the *thirdPartyProfileUsers.move* method supported by a *customer* resource.
18248/// It is not used directly, but through a [`CustomerMethods`] instance.
18249///
18250/// # Example
18251///
18252/// Instantiate a resource method builder
18253///
18254/// ```test_harness,no_run
18255/// # extern crate hyper;
18256/// # extern crate hyper_rustls;
18257/// # extern crate google_chromemanagement1 as chromemanagement1;
18258/// use chromemanagement1::api::GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest;
18259/// # async fn dox() {
18260/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
18261///
18262/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
18263/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
18264/// #     .with_native_roots()
18265/// #     .unwrap()
18266/// #     .https_only()
18267/// #     .enable_http2()
18268/// #     .build();
18269///
18270/// # let executor = hyper_util::rt::TokioExecutor::new();
18271/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
18272/// #     secret,
18273/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
18274/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
18275/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
18276/// #     ),
18277/// # ).build().await.unwrap();
18278///
18279/// # let client = hyper_util::client::legacy::Client::builder(
18280/// #     hyper_util::rt::TokioExecutor::new()
18281/// # )
18282/// # .build(
18283/// #     hyper_rustls::HttpsConnectorBuilder::new()
18284/// #         .with_native_roots()
18285/// #         .unwrap()
18286/// #         .https_or_http()
18287/// #         .enable_http2()
18288/// #         .build()
18289/// # );
18290/// # let mut hub = ChromeManagement::new(client, auth);
18291/// // As the method needs a request, you would usually fill it with the desired information
18292/// // into the respective structure. Some of the parts shown here might not be applicable !
18293/// // Values shown here are possibly random and not representative !
18294/// let mut req = GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest::default();
18295///
18296/// // You can configure optional parameters by calling the respective setters at will, and
18297/// // execute the final call using `doit()`.
18298/// // Values shown here are possibly random and not representative !
18299/// let result = hub.customers().third_party_profile_users_move(req, "name")
18300///              .doit().await;
18301/// # }
18302/// ```
18303pub struct CustomerThirdPartyProfileUserMoveCall<'a, C>
18304where
18305    C: 'a,
18306{
18307    hub: &'a ChromeManagement<C>,
18308    _request: GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest,
18309    _name: String,
18310    _delegate: Option<&'a mut dyn common::Delegate>,
18311    _additional_params: HashMap<String, String>,
18312    _scopes: BTreeSet<String>,
18313}
18314
18315impl<'a, C> common::CallBuilder for CustomerThirdPartyProfileUserMoveCall<'a, C> {}
18316
18317impl<'a, C> CustomerThirdPartyProfileUserMoveCall<'a, C>
18318where
18319    C: common::Connector,
18320{
18321    /// Perform the operation you have build so far.
18322    pub async fn doit(
18323        mut self,
18324    ) -> common::Result<(
18325        common::Response,
18326        GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserResponse,
18327    )> {
18328        use std::borrow::Cow;
18329        use std::io::{Read, Seek};
18330
18331        use common::{url::Params, ToParts};
18332        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
18333
18334        let mut dd = common::DefaultDelegate;
18335        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
18336        dlg.begin(common::MethodInfo {
18337            id: "chromemanagement.customers.thirdPartyProfileUsers.move",
18338            http_method: hyper::Method::POST,
18339        });
18340
18341        for &field in ["alt", "name"].iter() {
18342            if self._additional_params.contains_key(field) {
18343                dlg.finished(false);
18344                return Err(common::Error::FieldClash(field));
18345            }
18346        }
18347
18348        let mut params = Params::with_capacity(4 + self._additional_params.len());
18349        params.push("name", self._name);
18350
18351        params.extend(self._additional_params.iter());
18352
18353        params.push("alt", "json");
18354        let mut url = self.hub._base_url.clone() + "v1/{+name}:move";
18355        if self._scopes.is_empty() {
18356            self._scopes
18357                .insert(Scope::ChromeManagementProfile.as_ref().to_string());
18358        }
18359
18360        #[allow(clippy::single_element_loop)]
18361        for &(find_this, param_name) in [("{+name}", "name")].iter() {
18362            url = params.uri_replacement(url, param_name, find_this, true);
18363        }
18364        {
18365            let to_remove = ["name"];
18366            params.remove_params(&to_remove);
18367        }
18368
18369        let url = params.parse_with_url(&url);
18370
18371        let mut json_mime_type = mime::APPLICATION_JSON;
18372        let mut request_value_reader = {
18373            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
18374            common::remove_json_null_values(&mut value);
18375            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
18376            serde_json::to_writer(&mut dst, &value).unwrap();
18377            dst
18378        };
18379        let request_size = request_value_reader
18380            .seek(std::io::SeekFrom::End(0))
18381            .unwrap();
18382        request_value_reader
18383            .seek(std::io::SeekFrom::Start(0))
18384            .unwrap();
18385
18386        loop {
18387            let token = match self
18388                .hub
18389                .auth
18390                .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
18391                .await
18392            {
18393                Ok(token) => token,
18394                Err(e) => match dlg.token(e) {
18395                    Ok(token) => token,
18396                    Err(e) => {
18397                        dlg.finished(false);
18398                        return Err(common::Error::MissingToken(e));
18399                    }
18400                },
18401            };
18402            request_value_reader
18403                .seek(std::io::SeekFrom::Start(0))
18404                .unwrap();
18405            let mut req_result = {
18406                let client = &self.hub.client;
18407                dlg.pre_request();
18408                let mut req_builder = hyper::Request::builder()
18409                    .method(hyper::Method::POST)
18410                    .uri(url.as_str())
18411                    .header(USER_AGENT, self.hub._user_agent.clone());
18412
18413                if let Some(token) = token.as_ref() {
18414                    req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
18415                }
18416
18417                let request = req_builder
18418                    .header(CONTENT_TYPE, json_mime_type.to_string())
18419                    .header(CONTENT_LENGTH, request_size as u64)
18420                    .body(common::to_body(
18421                        request_value_reader.get_ref().clone().into(),
18422                    ));
18423
18424                client.request(request.unwrap()).await
18425            };
18426
18427            match req_result {
18428                Err(err) => {
18429                    if let common::Retry::After(d) = dlg.http_error(&err) {
18430                        sleep(d).await;
18431                        continue;
18432                    }
18433                    dlg.finished(false);
18434                    return Err(common::Error::HttpError(err));
18435                }
18436                Ok(res) => {
18437                    let (mut parts, body) = res.into_parts();
18438                    let mut body = common::Body::new(body);
18439                    if !parts.status.is_success() {
18440                        let bytes = common::to_bytes(body).await.unwrap_or_default();
18441                        let error = serde_json::from_str(&common::to_string(&bytes));
18442                        let response = common::to_response(parts, bytes.into());
18443
18444                        if let common::Retry::After(d) =
18445                            dlg.http_failure(&response, error.as_ref().ok())
18446                        {
18447                            sleep(d).await;
18448                            continue;
18449                        }
18450
18451                        dlg.finished(false);
18452
18453                        return Err(match error {
18454                            Ok(value) => common::Error::BadRequest(value),
18455                            _ => common::Error::Failure(response),
18456                        });
18457                    }
18458                    let response = {
18459                        let bytes = common::to_bytes(body).await.unwrap_or_default();
18460                        let encoded = common::to_string(&bytes);
18461                        match serde_json::from_str(&encoded) {
18462                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
18463                            Err(error) => {
18464                                dlg.response_json_decode_error(&encoded, &error);
18465                                return Err(common::Error::JsonDecodeError(
18466                                    encoded.to_string(),
18467                                    error,
18468                                ));
18469                            }
18470                        }
18471                    };
18472
18473                    dlg.finished(true);
18474                    return Ok(response);
18475                }
18476            }
18477        }
18478    }
18479
18480    ///
18481    /// Sets the *request* property to the given value.
18482    ///
18483    /// Even though the property as already been set when instantiating this call,
18484    /// we provide this method for API completeness.
18485    pub fn request(
18486        mut self,
18487        new_value: GoogleChromeManagementVersionsV1MoveThirdPartyProfileUserRequest,
18488    ) -> CustomerThirdPartyProfileUserMoveCall<'a, C> {
18489        self._request = new_value;
18490        self
18491    }
18492    /// Required. Format: customers/{customer_id}/thirdPartyProfileUsers/{third_party_profile_user_id}
18493    ///
18494    /// Sets the *name* path property to the given value.
18495    ///
18496    /// Even though the property as already been set when instantiating this call,
18497    /// we provide this method for API completeness.
18498    pub fn name(mut self, new_value: &str) -> CustomerThirdPartyProfileUserMoveCall<'a, C> {
18499        self._name = new_value.to_string();
18500        self
18501    }
18502    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
18503    /// while executing the actual API request.
18504    ///
18505    /// ````text
18506    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
18507    /// ````
18508    ///
18509    /// Sets the *delegate* property to the given value.
18510    pub fn delegate(
18511        mut self,
18512        new_value: &'a mut dyn common::Delegate,
18513    ) -> CustomerThirdPartyProfileUserMoveCall<'a, C> {
18514        self._delegate = Some(new_value);
18515        self
18516    }
18517
18518    /// Set any additional parameter of the query string used in the request.
18519    /// It should be used to set parameters which are not yet available through their own
18520    /// setters.
18521    ///
18522    /// Please note that this method must not be used to set any of the known parameters
18523    /// which have their own setter method. If done anyway, the request will fail.
18524    ///
18525    /// # Additional Parameters
18526    ///
18527    /// * *$.xgafv* (query-string) - V1 error format.
18528    /// * *access_token* (query-string) - OAuth access token.
18529    /// * *alt* (query-string) - Data format for response.
18530    /// * *callback* (query-string) - JSONP
18531    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
18532    /// * *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.
18533    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
18534    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
18535    /// * *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.
18536    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
18537    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
18538    pub fn param<T>(mut self, name: T, value: T) -> CustomerThirdPartyProfileUserMoveCall<'a, C>
18539    where
18540        T: AsRef<str>,
18541    {
18542        self._additional_params
18543            .insert(name.as_ref().to_string(), value.as_ref().to_string());
18544        self
18545    }
18546
18547    /// Identifies the authorization scope for the method you are building.
18548    ///
18549    /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
18550    /// [`Scope::ChromeManagementProfile`].
18551    ///
18552    /// The `scope` will be added to a set of scopes. This is important as one can maintain access
18553    /// tokens for more than one scope.
18554    ///
18555    /// Usually there is more than one suitable scope to authorize an operation, some of which may
18556    /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
18557    /// sufficient, a read-write scope will do as well.
18558    pub fn add_scope<St>(mut self, scope: St) -> CustomerThirdPartyProfileUserMoveCall<'a, C>
18559    where
18560        St: AsRef<str>,
18561    {
18562        self._scopes.insert(String::from(scope.as_ref()));
18563        self
18564    }
18565    /// Identifies the authorization scope(s) for the method you are building.
18566    ///
18567    /// See [`Self::add_scope()`] for details.
18568    pub fn add_scopes<I, St>(mut self, scopes: I) -> CustomerThirdPartyProfileUserMoveCall<'a, C>
18569    where
18570        I: IntoIterator<Item = St>,
18571        St: AsRef<str>,
18572    {
18573        self._scopes
18574            .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
18575        self
18576    }
18577
18578    /// Removes all scopes, and no default scope will be used either.
18579    /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
18580    /// for details).
18581    pub fn clear_scopes(mut self) -> CustomerThirdPartyProfileUserMoveCall<'a, C> {
18582        self._scopes.clear();
18583        self
18584    }
18585}
18586
18587/// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
18588///
18589/// A builder for the *cancel* method supported by a *operation* resource.
18590/// It is not used directly, but through a [`OperationMethods`] instance.
18591///
18592/// # Example
18593///
18594/// Instantiate a resource method builder
18595///
18596/// ```test_harness,no_run
18597/// # extern crate hyper;
18598/// # extern crate hyper_rustls;
18599/// # extern crate google_chromemanagement1 as chromemanagement1;
18600/// use chromemanagement1::api::GoogleLongrunningCancelOperationRequest;
18601/// # async fn dox() {
18602/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
18603///
18604/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
18605/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
18606/// #     .with_native_roots()
18607/// #     .unwrap()
18608/// #     .https_only()
18609/// #     .enable_http2()
18610/// #     .build();
18611///
18612/// # let executor = hyper_util::rt::TokioExecutor::new();
18613/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
18614/// #     secret,
18615/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
18616/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
18617/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
18618/// #     ),
18619/// # ).build().await.unwrap();
18620///
18621/// # let client = hyper_util::client::legacy::Client::builder(
18622/// #     hyper_util::rt::TokioExecutor::new()
18623/// # )
18624/// # .build(
18625/// #     hyper_rustls::HttpsConnectorBuilder::new()
18626/// #         .with_native_roots()
18627/// #         .unwrap()
18628/// #         .https_or_http()
18629/// #         .enable_http2()
18630/// #         .build()
18631/// # );
18632/// # let mut hub = ChromeManagement::new(client, auth);
18633/// // As the method needs a request, you would usually fill it with the desired information
18634/// // into the respective structure. Some of the parts shown here might not be applicable !
18635/// // Values shown here are possibly random and not representative !
18636/// let mut req = GoogleLongrunningCancelOperationRequest::default();
18637///
18638/// // You can configure optional parameters by calling the respective setters at will, and
18639/// // execute the final call using `doit()`.
18640/// // Values shown here are possibly random and not representative !
18641/// let result = hub.operations().cancel(req, "name")
18642///              .doit().await;
18643/// # }
18644/// ```
18645pub struct OperationCancelCall<'a, C>
18646where
18647    C: 'a,
18648{
18649    hub: &'a ChromeManagement<C>,
18650    _request: GoogleLongrunningCancelOperationRequest,
18651    _name: String,
18652    _delegate: Option<&'a mut dyn common::Delegate>,
18653    _additional_params: HashMap<String, String>,
18654}
18655
18656impl<'a, C> common::CallBuilder for OperationCancelCall<'a, C> {}
18657
18658impl<'a, C> OperationCancelCall<'a, C>
18659where
18660    C: common::Connector,
18661{
18662    /// Perform the operation you have build so far.
18663    pub async fn doit(mut self) -> common::Result<(common::Response, GoogleProtobufEmpty)> {
18664        use std::borrow::Cow;
18665        use std::io::{Read, Seek};
18666
18667        use common::{url::Params, ToParts};
18668        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
18669
18670        let mut dd = common::DefaultDelegate;
18671        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
18672        dlg.begin(common::MethodInfo {
18673            id: "chromemanagement.operations.cancel",
18674            http_method: hyper::Method::POST,
18675        });
18676
18677        for &field in ["alt", "name"].iter() {
18678            if self._additional_params.contains_key(field) {
18679                dlg.finished(false);
18680                return Err(common::Error::FieldClash(field));
18681            }
18682        }
18683
18684        let mut params = Params::with_capacity(4 + self._additional_params.len());
18685        params.push("name", self._name);
18686
18687        params.extend(self._additional_params.iter());
18688
18689        params.push("alt", "json");
18690        let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel";
18691
18692        match dlg.api_key() {
18693            Some(value) => params.push("key", value),
18694            None => {
18695                dlg.finished(false);
18696                return Err(common::Error::MissingAPIKey);
18697            }
18698        }
18699
18700        #[allow(clippy::single_element_loop)]
18701        for &(find_this, param_name) in [("{+name}", "name")].iter() {
18702            url = params.uri_replacement(url, param_name, find_this, true);
18703        }
18704        {
18705            let to_remove = ["name"];
18706            params.remove_params(&to_remove);
18707        }
18708
18709        let url = params.parse_with_url(&url);
18710
18711        let mut json_mime_type = mime::APPLICATION_JSON;
18712        let mut request_value_reader = {
18713            let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
18714            common::remove_json_null_values(&mut value);
18715            let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
18716            serde_json::to_writer(&mut dst, &value).unwrap();
18717            dst
18718        };
18719        let request_size = request_value_reader
18720            .seek(std::io::SeekFrom::End(0))
18721            .unwrap();
18722        request_value_reader
18723            .seek(std::io::SeekFrom::Start(0))
18724            .unwrap();
18725
18726        loop {
18727            request_value_reader
18728                .seek(std::io::SeekFrom::Start(0))
18729                .unwrap();
18730            let mut req_result = {
18731                let client = &self.hub.client;
18732                dlg.pre_request();
18733                let mut req_builder = hyper::Request::builder()
18734                    .method(hyper::Method::POST)
18735                    .uri(url.as_str())
18736                    .header(USER_AGENT, self.hub._user_agent.clone());
18737
18738                let request = req_builder
18739                    .header(CONTENT_TYPE, json_mime_type.to_string())
18740                    .header(CONTENT_LENGTH, request_size as u64)
18741                    .body(common::to_body(
18742                        request_value_reader.get_ref().clone().into(),
18743                    ));
18744
18745                client.request(request.unwrap()).await
18746            };
18747
18748            match req_result {
18749                Err(err) => {
18750                    if let common::Retry::After(d) = dlg.http_error(&err) {
18751                        sleep(d).await;
18752                        continue;
18753                    }
18754                    dlg.finished(false);
18755                    return Err(common::Error::HttpError(err));
18756                }
18757                Ok(res) => {
18758                    let (mut parts, body) = res.into_parts();
18759                    let mut body = common::Body::new(body);
18760                    if !parts.status.is_success() {
18761                        let bytes = common::to_bytes(body).await.unwrap_or_default();
18762                        let error = serde_json::from_str(&common::to_string(&bytes));
18763                        let response = common::to_response(parts, bytes.into());
18764
18765                        if let common::Retry::After(d) =
18766                            dlg.http_failure(&response, error.as_ref().ok())
18767                        {
18768                            sleep(d).await;
18769                            continue;
18770                        }
18771
18772                        dlg.finished(false);
18773
18774                        return Err(match error {
18775                            Ok(value) => common::Error::BadRequest(value),
18776                            _ => common::Error::Failure(response),
18777                        });
18778                    }
18779                    let response = {
18780                        let bytes = common::to_bytes(body).await.unwrap_or_default();
18781                        let encoded = common::to_string(&bytes);
18782                        match serde_json::from_str(&encoded) {
18783                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
18784                            Err(error) => {
18785                                dlg.response_json_decode_error(&encoded, &error);
18786                                return Err(common::Error::JsonDecodeError(
18787                                    encoded.to_string(),
18788                                    error,
18789                                ));
18790                            }
18791                        }
18792                    };
18793
18794                    dlg.finished(true);
18795                    return Ok(response);
18796                }
18797            }
18798        }
18799    }
18800
18801    ///
18802    /// Sets the *request* property to the given value.
18803    ///
18804    /// Even though the property as already been set when instantiating this call,
18805    /// we provide this method for API completeness.
18806    pub fn request(
18807        mut self,
18808        new_value: GoogleLongrunningCancelOperationRequest,
18809    ) -> OperationCancelCall<'a, C> {
18810        self._request = new_value;
18811        self
18812    }
18813    /// The name of the operation resource to be cancelled.
18814    ///
18815    /// Sets the *name* path property to the given value.
18816    ///
18817    /// Even though the property as already been set when instantiating this call,
18818    /// we provide this method for API completeness.
18819    pub fn name(mut self, new_value: &str) -> OperationCancelCall<'a, C> {
18820        self._name = new_value.to_string();
18821        self
18822    }
18823    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
18824    /// while executing the actual API request.
18825    ///
18826    /// ````text
18827    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
18828    /// ````
18829    ///
18830    /// Sets the *delegate* property to the given value.
18831    pub fn delegate(
18832        mut self,
18833        new_value: &'a mut dyn common::Delegate,
18834    ) -> OperationCancelCall<'a, C> {
18835        self._delegate = Some(new_value);
18836        self
18837    }
18838
18839    /// Set any additional parameter of the query string used in the request.
18840    /// It should be used to set parameters which are not yet available through their own
18841    /// setters.
18842    ///
18843    /// Please note that this method must not be used to set any of the known parameters
18844    /// which have their own setter method. If done anyway, the request will fail.
18845    ///
18846    /// # Additional Parameters
18847    ///
18848    /// * *$.xgafv* (query-string) - V1 error format.
18849    /// * *access_token* (query-string) - OAuth access token.
18850    /// * *alt* (query-string) - Data format for response.
18851    /// * *callback* (query-string) - JSONP
18852    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
18853    /// * *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.
18854    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
18855    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
18856    /// * *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.
18857    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
18858    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
18859    pub fn param<T>(mut self, name: T, value: T) -> OperationCancelCall<'a, C>
18860    where
18861        T: AsRef<str>,
18862    {
18863        self._additional_params
18864            .insert(name.as_ref().to_string(), value.as_ref().to_string());
18865        self
18866    }
18867}
18868
18869/// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
18870///
18871/// A builder for the *delete* method supported by a *operation* resource.
18872/// It is not used directly, but through a [`OperationMethods`] instance.
18873///
18874/// # Example
18875///
18876/// Instantiate a resource method builder
18877///
18878/// ```test_harness,no_run
18879/// # extern crate hyper;
18880/// # extern crate hyper_rustls;
18881/// # extern crate google_chromemanagement1 as chromemanagement1;
18882/// # async fn dox() {
18883/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
18884///
18885/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
18886/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
18887/// #     .with_native_roots()
18888/// #     .unwrap()
18889/// #     .https_only()
18890/// #     .enable_http2()
18891/// #     .build();
18892///
18893/// # let executor = hyper_util::rt::TokioExecutor::new();
18894/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
18895/// #     secret,
18896/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
18897/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
18898/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
18899/// #     ),
18900/// # ).build().await.unwrap();
18901///
18902/// # let client = hyper_util::client::legacy::Client::builder(
18903/// #     hyper_util::rt::TokioExecutor::new()
18904/// # )
18905/// # .build(
18906/// #     hyper_rustls::HttpsConnectorBuilder::new()
18907/// #         .with_native_roots()
18908/// #         .unwrap()
18909/// #         .https_or_http()
18910/// #         .enable_http2()
18911/// #         .build()
18912/// # );
18913/// # let mut hub = ChromeManagement::new(client, auth);
18914/// // You can configure optional parameters by calling the respective setters at will, and
18915/// // execute the final call using `doit()`.
18916/// // Values shown here are possibly random and not representative !
18917/// let result = hub.operations().delete("name")
18918///              .doit().await;
18919/// # }
18920/// ```
18921pub struct OperationDeleteCall<'a, C>
18922where
18923    C: 'a,
18924{
18925    hub: &'a ChromeManagement<C>,
18926    _name: String,
18927    _delegate: Option<&'a mut dyn common::Delegate>,
18928    _additional_params: HashMap<String, String>,
18929}
18930
18931impl<'a, C> common::CallBuilder for OperationDeleteCall<'a, C> {}
18932
18933impl<'a, C> OperationDeleteCall<'a, C>
18934where
18935    C: common::Connector,
18936{
18937    /// Perform the operation you have build so far.
18938    pub async fn doit(mut self) -> common::Result<(common::Response, GoogleProtobufEmpty)> {
18939        use std::borrow::Cow;
18940        use std::io::{Read, Seek};
18941
18942        use common::{url::Params, ToParts};
18943        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
18944
18945        let mut dd = common::DefaultDelegate;
18946        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
18947        dlg.begin(common::MethodInfo {
18948            id: "chromemanagement.operations.delete",
18949            http_method: hyper::Method::DELETE,
18950        });
18951
18952        for &field in ["alt", "name"].iter() {
18953            if self._additional_params.contains_key(field) {
18954                dlg.finished(false);
18955                return Err(common::Error::FieldClash(field));
18956            }
18957        }
18958
18959        let mut params = Params::with_capacity(3 + self._additional_params.len());
18960        params.push("name", self._name);
18961
18962        params.extend(self._additional_params.iter());
18963
18964        params.push("alt", "json");
18965        let mut url = self.hub._base_url.clone() + "v1/{+name}";
18966
18967        match dlg.api_key() {
18968            Some(value) => params.push("key", value),
18969            None => {
18970                dlg.finished(false);
18971                return Err(common::Error::MissingAPIKey);
18972            }
18973        }
18974
18975        #[allow(clippy::single_element_loop)]
18976        for &(find_this, param_name) in [("{+name}", "name")].iter() {
18977            url = params.uri_replacement(url, param_name, find_this, true);
18978        }
18979        {
18980            let to_remove = ["name"];
18981            params.remove_params(&to_remove);
18982        }
18983
18984        let url = params.parse_with_url(&url);
18985
18986        loop {
18987            let mut req_result = {
18988                let client = &self.hub.client;
18989                dlg.pre_request();
18990                let mut req_builder = hyper::Request::builder()
18991                    .method(hyper::Method::DELETE)
18992                    .uri(url.as_str())
18993                    .header(USER_AGENT, self.hub._user_agent.clone());
18994
18995                let request = req_builder
18996                    .header(CONTENT_LENGTH, 0_u64)
18997                    .body(common::to_body::<String>(None));
18998
18999                client.request(request.unwrap()).await
19000            };
19001
19002            match req_result {
19003                Err(err) => {
19004                    if let common::Retry::After(d) = dlg.http_error(&err) {
19005                        sleep(d).await;
19006                        continue;
19007                    }
19008                    dlg.finished(false);
19009                    return Err(common::Error::HttpError(err));
19010                }
19011                Ok(res) => {
19012                    let (mut parts, body) = res.into_parts();
19013                    let mut body = common::Body::new(body);
19014                    if !parts.status.is_success() {
19015                        let bytes = common::to_bytes(body).await.unwrap_or_default();
19016                        let error = serde_json::from_str(&common::to_string(&bytes));
19017                        let response = common::to_response(parts, bytes.into());
19018
19019                        if let common::Retry::After(d) =
19020                            dlg.http_failure(&response, error.as_ref().ok())
19021                        {
19022                            sleep(d).await;
19023                            continue;
19024                        }
19025
19026                        dlg.finished(false);
19027
19028                        return Err(match error {
19029                            Ok(value) => common::Error::BadRequest(value),
19030                            _ => common::Error::Failure(response),
19031                        });
19032                    }
19033                    let response = {
19034                        let bytes = common::to_bytes(body).await.unwrap_or_default();
19035                        let encoded = common::to_string(&bytes);
19036                        match serde_json::from_str(&encoded) {
19037                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
19038                            Err(error) => {
19039                                dlg.response_json_decode_error(&encoded, &error);
19040                                return Err(common::Error::JsonDecodeError(
19041                                    encoded.to_string(),
19042                                    error,
19043                                ));
19044                            }
19045                        }
19046                    };
19047
19048                    dlg.finished(true);
19049                    return Ok(response);
19050                }
19051            }
19052        }
19053    }
19054
19055    /// The name of the operation resource to be deleted.
19056    ///
19057    /// Sets the *name* path property to the given value.
19058    ///
19059    /// Even though the property as already been set when instantiating this call,
19060    /// we provide this method for API completeness.
19061    pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C> {
19062        self._name = new_value.to_string();
19063        self
19064    }
19065    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
19066    /// while executing the actual API request.
19067    ///
19068    /// ````text
19069    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
19070    /// ````
19071    ///
19072    /// Sets the *delegate* property to the given value.
19073    pub fn delegate(
19074        mut self,
19075        new_value: &'a mut dyn common::Delegate,
19076    ) -> OperationDeleteCall<'a, C> {
19077        self._delegate = Some(new_value);
19078        self
19079    }
19080
19081    /// Set any additional parameter of the query string used in the request.
19082    /// It should be used to set parameters which are not yet available through their own
19083    /// setters.
19084    ///
19085    /// Please note that this method must not be used to set any of the known parameters
19086    /// which have their own setter method. If done anyway, the request will fail.
19087    ///
19088    /// # Additional Parameters
19089    ///
19090    /// * *$.xgafv* (query-string) - V1 error format.
19091    /// * *access_token* (query-string) - OAuth access token.
19092    /// * *alt* (query-string) - Data format for response.
19093    /// * *callback* (query-string) - JSONP
19094    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
19095    /// * *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.
19096    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
19097    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
19098    /// * *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.
19099    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
19100    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
19101    pub fn param<T>(mut self, name: T, value: T) -> OperationDeleteCall<'a, C>
19102    where
19103        T: AsRef<str>,
19104    {
19105        self._additional_params
19106            .insert(name.as_ref().to_string(), value.as_ref().to_string());
19107        self
19108    }
19109}
19110
19111/// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
19112///
19113/// A builder for the *list* method supported by a *operation* resource.
19114/// It is not used directly, but through a [`OperationMethods`] instance.
19115///
19116/// # Example
19117///
19118/// Instantiate a resource method builder
19119///
19120/// ```test_harness,no_run
19121/// # extern crate hyper;
19122/// # extern crate hyper_rustls;
19123/// # extern crate google_chromemanagement1 as chromemanagement1;
19124/// # async fn dox() {
19125/// # use chromemanagement1::{ChromeManagement, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
19126///
19127/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
19128/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
19129/// #     .with_native_roots()
19130/// #     .unwrap()
19131/// #     .https_only()
19132/// #     .enable_http2()
19133/// #     .build();
19134///
19135/// # let executor = hyper_util::rt::TokioExecutor::new();
19136/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
19137/// #     secret,
19138/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
19139/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
19140/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
19141/// #     ),
19142/// # ).build().await.unwrap();
19143///
19144/// # let client = hyper_util::client::legacy::Client::builder(
19145/// #     hyper_util::rt::TokioExecutor::new()
19146/// # )
19147/// # .build(
19148/// #     hyper_rustls::HttpsConnectorBuilder::new()
19149/// #         .with_native_roots()
19150/// #         .unwrap()
19151/// #         .https_or_http()
19152/// #         .enable_http2()
19153/// #         .build()
19154/// # );
19155/// # let mut hub = ChromeManagement::new(client, auth);
19156/// // You can configure optional parameters by calling the respective setters at will, and
19157/// // execute the final call using `doit()`.
19158/// // Values shown here are possibly random and not representative !
19159/// let result = hub.operations().list("name")
19160///              .return_partial_success(true)
19161///              .page_token("aliquyam")
19162///              .page_size(-69)
19163///              .filter("sadipscing")
19164///              .doit().await;
19165/// # }
19166/// ```
19167pub struct OperationListCall<'a, C>
19168where
19169    C: 'a,
19170{
19171    hub: &'a ChromeManagement<C>,
19172    _name: String,
19173    _return_partial_success: Option<bool>,
19174    _page_token: Option<String>,
19175    _page_size: Option<i32>,
19176    _filter: Option<String>,
19177    _delegate: Option<&'a mut dyn common::Delegate>,
19178    _additional_params: HashMap<String, String>,
19179}
19180
19181impl<'a, C> common::CallBuilder for OperationListCall<'a, C> {}
19182
19183impl<'a, C> OperationListCall<'a, C>
19184where
19185    C: common::Connector,
19186{
19187    /// Perform the operation you have build so far.
19188    pub async fn doit(
19189        mut self,
19190    ) -> common::Result<(common::Response, GoogleLongrunningListOperationsResponse)> {
19191        use std::borrow::Cow;
19192        use std::io::{Read, Seek};
19193
19194        use common::{url::Params, ToParts};
19195        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
19196
19197        let mut dd = common::DefaultDelegate;
19198        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
19199        dlg.begin(common::MethodInfo {
19200            id: "chromemanagement.operations.list",
19201            http_method: hyper::Method::GET,
19202        });
19203
19204        for &field in [
19205            "alt",
19206            "name",
19207            "returnPartialSuccess",
19208            "pageToken",
19209            "pageSize",
19210            "filter",
19211        ]
19212        .iter()
19213        {
19214            if self._additional_params.contains_key(field) {
19215                dlg.finished(false);
19216                return Err(common::Error::FieldClash(field));
19217            }
19218        }
19219
19220        let mut params = Params::with_capacity(7 + self._additional_params.len());
19221        params.push("name", self._name);
19222        if let Some(value) = self._return_partial_success.as_ref() {
19223            params.push("returnPartialSuccess", value.to_string());
19224        }
19225        if let Some(value) = self._page_token.as_ref() {
19226            params.push("pageToken", value);
19227        }
19228        if let Some(value) = self._page_size.as_ref() {
19229            params.push("pageSize", value.to_string());
19230        }
19231        if let Some(value) = self._filter.as_ref() {
19232            params.push("filter", value);
19233        }
19234
19235        params.extend(self._additional_params.iter());
19236
19237        params.push("alt", "json");
19238        let mut url = self.hub._base_url.clone() + "v1/{+name}";
19239
19240        match dlg.api_key() {
19241            Some(value) => params.push("key", value),
19242            None => {
19243                dlg.finished(false);
19244                return Err(common::Error::MissingAPIKey);
19245            }
19246        }
19247
19248        #[allow(clippy::single_element_loop)]
19249        for &(find_this, param_name) in [("{+name}", "name")].iter() {
19250            url = params.uri_replacement(url, param_name, find_this, true);
19251        }
19252        {
19253            let to_remove = ["name"];
19254            params.remove_params(&to_remove);
19255        }
19256
19257        let url = params.parse_with_url(&url);
19258
19259        loop {
19260            let mut req_result = {
19261                let client = &self.hub.client;
19262                dlg.pre_request();
19263                let mut req_builder = hyper::Request::builder()
19264                    .method(hyper::Method::GET)
19265                    .uri(url.as_str())
19266                    .header(USER_AGENT, self.hub._user_agent.clone());
19267
19268                let request = req_builder
19269                    .header(CONTENT_LENGTH, 0_u64)
19270                    .body(common::to_body::<String>(None));
19271
19272                client.request(request.unwrap()).await
19273            };
19274
19275            match req_result {
19276                Err(err) => {
19277                    if let common::Retry::After(d) = dlg.http_error(&err) {
19278                        sleep(d).await;
19279                        continue;
19280                    }
19281                    dlg.finished(false);
19282                    return Err(common::Error::HttpError(err));
19283                }
19284                Ok(res) => {
19285                    let (mut parts, body) = res.into_parts();
19286                    let mut body = common::Body::new(body);
19287                    if !parts.status.is_success() {
19288                        let bytes = common::to_bytes(body).await.unwrap_or_default();
19289                        let error = serde_json::from_str(&common::to_string(&bytes));
19290                        let response = common::to_response(parts, bytes.into());
19291
19292                        if let common::Retry::After(d) =
19293                            dlg.http_failure(&response, error.as_ref().ok())
19294                        {
19295                            sleep(d).await;
19296                            continue;
19297                        }
19298
19299                        dlg.finished(false);
19300
19301                        return Err(match error {
19302                            Ok(value) => common::Error::BadRequest(value),
19303                            _ => common::Error::Failure(response),
19304                        });
19305                    }
19306                    let response = {
19307                        let bytes = common::to_bytes(body).await.unwrap_or_default();
19308                        let encoded = common::to_string(&bytes);
19309                        match serde_json::from_str(&encoded) {
19310                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
19311                            Err(error) => {
19312                                dlg.response_json_decode_error(&encoded, &error);
19313                                return Err(common::Error::JsonDecodeError(
19314                                    encoded.to_string(),
19315                                    error,
19316                                ));
19317                            }
19318                        }
19319                    };
19320
19321                    dlg.finished(true);
19322                    return Ok(response);
19323                }
19324            }
19325        }
19326    }
19327
19328    /// The name of the operation's parent resource.
19329    ///
19330    /// Sets the *name* path property to the given value.
19331    ///
19332    /// Even though the property as already been set when instantiating this call,
19333    /// we provide this method for API completeness.
19334    pub fn name(mut self, new_value: &str) -> OperationListCall<'a, C> {
19335        self._name = new_value.to_string();
19336        self
19337    }
19338    /// When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
19339    ///
19340    /// Sets the *return partial success* query property to the given value.
19341    pub fn return_partial_success(mut self, new_value: bool) -> OperationListCall<'a, C> {
19342        self._return_partial_success = Some(new_value);
19343        self
19344    }
19345    /// The standard list page token.
19346    ///
19347    /// Sets the *page token* query property to the given value.
19348    pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C> {
19349        self._page_token = Some(new_value.to_string());
19350        self
19351    }
19352    /// The standard list page size.
19353    ///
19354    /// Sets the *page size* query property to the given value.
19355    pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C> {
19356        self._page_size = Some(new_value);
19357        self
19358    }
19359    /// The standard list filter.
19360    ///
19361    /// Sets the *filter* query property to the given value.
19362    pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C> {
19363        self._filter = Some(new_value.to_string());
19364        self
19365    }
19366    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
19367    /// while executing the actual API request.
19368    ///
19369    /// ````text
19370    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
19371    /// ````
19372    ///
19373    /// Sets the *delegate* property to the given value.
19374    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> OperationListCall<'a, C> {
19375        self._delegate = Some(new_value);
19376        self
19377    }
19378
19379    /// Set any additional parameter of the query string used in the request.
19380    /// It should be used to set parameters which are not yet available through their own
19381    /// setters.
19382    ///
19383    /// Please note that this method must not be used to set any of the known parameters
19384    /// which have their own setter method. If done anyway, the request will fail.
19385    ///
19386    /// # Additional Parameters
19387    ///
19388    /// * *$.xgafv* (query-string) - V1 error format.
19389    /// * *access_token* (query-string) - OAuth access token.
19390    /// * *alt* (query-string) - Data format for response.
19391    /// * *callback* (query-string) - JSONP
19392    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
19393    /// * *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.
19394    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
19395    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
19396    /// * *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.
19397    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
19398    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
19399    pub fn param<T>(mut self, name: T, value: T) -> OperationListCall<'a, C>
19400    where
19401        T: AsRef<str>,
19402    {
19403        self._additional_params
19404            .insert(name.as_ref().to_string(), value.as_ref().to_string());
19405        self
19406    }
19407}