mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
make regen-apis
This commit is contained in:
@@ -219,6 +219,136 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
async fn _customers_apps_fetch_devices_requesting_extension(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.customers().apps_fetch_devices_requesting_extension(opt.value_of("customer").unwrap_or(""));
|
||||
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
let (key, value) = parse_kv_arg(&*parg, err, false);
|
||||
match key {
|
||||
"page-token" => {
|
||||
call = call.page_token(value.unwrap_or(""));
|
||||
},
|
||||
"page-size" => {
|
||||
call = call.page_size( value.map(|v| arg_from_str(v, err, "page-size", "int32")).unwrap_or(-0));
|
||||
},
|
||||
"org-unit-id" => {
|
||||
call = call.org_unit_id(value.unwrap_or(""));
|
||||
},
|
||||
"extension-id" => {
|
||||
call = call.extension_id(value.unwrap_or(""));
|
||||
},
|
||||
_ => {
|
||||
let mut found = false;
|
||||
for param in &self.gp {
|
||||
if key == *param {
|
||||
found = true;
|
||||
call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["extension-id", "org-unit-id", "page-size", "page-token"].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let protocol = CallType::Standard;
|
||||
if dry_run {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
call = call.add_scope(scope);
|
||||
}
|
||||
let mut ostream = match writer_from_opts(opt.value_of("out")) {
|
||||
Ok(mut f) => f,
|
||||
Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)),
|
||||
};
|
||||
match match protocol {
|
||||
CallType::Standard => call.doit().await,
|
||||
_ => unreachable!()
|
||||
} {
|
||||
Err(api_err) => Err(DoitError::ApiError(api_err)),
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema).expect("serde to work");
|
||||
remove_json_null_values(&mut value);
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
ostream.flush().unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn _customers_apps_fetch_users_requesting_extension(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.customers().apps_fetch_users_requesting_extension(opt.value_of("customer").unwrap_or(""));
|
||||
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
let (key, value) = parse_kv_arg(&*parg, err, false);
|
||||
match key {
|
||||
"page-token" => {
|
||||
call = call.page_token(value.unwrap_or(""));
|
||||
},
|
||||
"page-size" => {
|
||||
call = call.page_size( value.map(|v| arg_from_str(v, err, "page-size", "int32")).unwrap_or(-0));
|
||||
},
|
||||
"org-unit-id" => {
|
||||
call = call.org_unit_id(value.unwrap_or(""));
|
||||
},
|
||||
"extension-id" => {
|
||||
call = call.extension_id(value.unwrap_or(""));
|
||||
},
|
||||
_ => {
|
||||
let mut found = false;
|
||||
for param in &self.gp {
|
||||
if key == *param {
|
||||
found = true;
|
||||
call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["extension-id", "org-unit-id", "page-size", "page-token"].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let protocol = CallType::Standard;
|
||||
if dry_run {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
call = call.add_scope(scope);
|
||||
}
|
||||
let mut ostream = match writer_from_opts(opt.value_of("out")) {
|
||||
Ok(mut f) => f,
|
||||
Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)),
|
||||
};
|
||||
match match protocol {
|
||||
CallType::Standard => call.doit().await,
|
||||
_ => unreachable!()
|
||||
} {
|
||||
Err(api_err) => Err(DoitError::ApiError(api_err)),
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema).expect("serde to work");
|
||||
remove_json_null_values(&mut value);
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
ostream.flush().unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn _customers_apps_web_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.customers().apps_web_get(opt.value_of("name").unwrap_or(""));
|
||||
@@ -327,6 +457,68 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
async fn _customers_reports_count_chrome_crash_events(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.customers().reports_count_chrome_crash_events(opt.value_of("customer").unwrap_or(""));
|
||||
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
let (key, value) = parse_kv_arg(&*parg, err, false);
|
||||
match key {
|
||||
"org-unit-id" => {
|
||||
call = call.org_unit_id(value.unwrap_or(""));
|
||||
},
|
||||
"order-by" => {
|
||||
call = call.order_by(value.unwrap_or(""));
|
||||
},
|
||||
"filter" => {
|
||||
call = call.filter(value.unwrap_or(""));
|
||||
},
|
||||
_ => {
|
||||
let mut found = false;
|
||||
for param in &self.gp {
|
||||
if key == *param {
|
||||
found = true;
|
||||
call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["filter", "order-by", "org-unit-id"].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let protocol = CallType::Standard;
|
||||
if dry_run {
|
||||
Ok(())
|
||||
} else {
|
||||
assert!(err.issues.len() == 0);
|
||||
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
call = call.add_scope(scope);
|
||||
}
|
||||
let mut ostream = match writer_from_opts(opt.value_of("out")) {
|
||||
Ok(mut f) => f,
|
||||
Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)),
|
||||
};
|
||||
match match protocol {
|
||||
CallType::Standard => call.doit().await,
|
||||
_ => unreachable!()
|
||||
} {
|
||||
Err(api_err) => Err(DoitError::ApiError(api_err)),
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema).expect("serde to work");
|
||||
remove_json_null_values(&mut value);
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
ostream.flush().unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn _customers_reports_count_chrome_devices_reaching_auto_expiration_date(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.customers().reports_count_chrome_devices_reaching_auto_expiration_date(opt.value_of("customer").unwrap_or(""));
|
||||
@@ -1444,12 +1636,21 @@ where
|
||||
("apps-count-chrome-app-requests", Some(opt)) => {
|
||||
call_result = self._customers_apps_count_chrome_app_requests(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("apps-fetch-devices-requesting-extension", Some(opt)) => {
|
||||
call_result = self._customers_apps_fetch_devices_requesting_extension(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("apps-fetch-users-requesting-extension", Some(opt)) => {
|
||||
call_result = self._customers_apps_fetch_users_requesting_extension(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("apps-web-get", Some(opt)) => {
|
||||
call_result = self._customers_apps_web_get(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("reports-count-chrome-browsers-needing-attention", Some(opt)) => {
|
||||
call_result = self._customers_reports_count_chrome_browsers_needing_attention(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("reports-count-chrome-crash-events", Some(opt)) => {
|
||||
call_result = self._customers_reports_count_chrome_crash_events(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("reports-count-chrome-devices-reaching-auto-expiration-date", Some(opt)) => {
|
||||
call_result = self._customers_reports_count_chrome_devices_reaching_auto_expiration_date(opt, dry_run, &mut err).await;
|
||||
},
|
||||
@@ -1580,7 +1781,7 @@ where
|
||||
async fn main() {
|
||||
let mut exit_status = 0i32;
|
||||
let arg_data = [
|
||||
("customers", "methods: 'apps-android-get', 'apps-chrome-get', 'apps-count-chrome-app-requests', 'apps-web-get', 'reports-count-chrome-browsers-needing-attention', '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-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' and 'telemetry-users-list'", vec![
|
||||
("customers", "methods: 'apps-android-get', 'apps-chrome-get', 'apps-count-chrome-app-requests', 'apps-fetch-devices-requesting-extension', 'apps-fetch-users-requesting-extension', 'apps-web-get', '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-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' and 'telemetry-users-list'", vec![
|
||||
("apps-android-get",
|
||||
Some(r##"Get a specific app for a customer by its resource name."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_chromemanagement1_cli/customers_apps-android-get",
|
||||
@@ -1641,6 +1842,50 @@ async fn main() {
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("apps-fetch-devices-requesting-extension",
|
||||
Some(r##"Get a list of devices that have requested to install an extension."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_chromemanagement1_cli/customers_apps-fetch-devices-requesting-extension",
|
||||
vec![
|
||||
(Some(r##"customer"##),
|
||||
None,
|
||||
Some(r##"Required. The customer ID or "my_customer" prefixed with "customers/"."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"v"##),
|
||||
Some(r##"p"##),
|
||||
Some(r##"Set various optional parameters, matching the key=value form"##),
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("apps-fetch-users-requesting-extension",
|
||||
Some(r##"Get a list of users that have requested to install an extension."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_chromemanagement1_cli/customers_apps-fetch-users-requesting-extension",
|
||||
vec![
|
||||
(Some(r##"customer"##),
|
||||
None,
|
||||
Some(r##"Required. The customer ID or "my_customer" prefixed with "customers/"."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"v"##),
|
||||
Some(r##"p"##),
|
||||
Some(r##"Set various optional parameters, matching the key=value form"##),
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
@@ -1685,6 +1930,28 @@ async fn main() {
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("reports-count-chrome-crash-events",
|
||||
Some(r##"Get a count of Chrome crash events."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_chromemanagement1_cli/customers_reports-count-chrome-crash-events",
|
||||
vec![
|
||||
(Some(r##"customer"##),
|
||||
None,
|
||||
Some(r##"Customer ID."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"v"##),
|
||||
Some(r##"p"##),
|
||||
Some(r##"Set various optional parameters, matching the key=value form"##),
|
||||
Some(false),
|
||||
Some(true)),
|
||||
|
||||
(Some(r##"out"##),
|
||||
Some(r##"o"##),
|
||||
Some(r##"Specify the file into which to write the program's output"##),
|
||||
@@ -2077,7 +2344,7 @@ async fn main() {
|
||||
|
||||
let mut app = App::new("chromemanagement1")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("5.0.4+20240303")
|
||||
.version("5.0.5+20240418")
|
||||
.about("The Chrome Management API is a suite of services that allows Chrome administrators to view, manage and gain insights on their Chrome OS and Chrome Browser devices.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_chromemanagement1_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
@@ -2141,6 +2408,7 @@ async fn main() {
|
||||
|
||||
let debug = matches.is_present("adebug");
|
||||
let connector = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots()
|
||||
.unwrap()
|
||||
.https_or_http()
|
||||
.enable_http1()
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user