mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-02 17:42:16 +01:00
regen all APIs
This commit is contained in:
@@ -230,11 +230,12 @@ where
|
||||
"node-count" => Some(("nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"parameters.id" => Some(("parameters.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"parameters.params" => Some(("parameters.params", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })),
|
||||
"reserved-ip-range-id" => Some(("reservedIpRangeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"zones" => Some(("zones", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["authorized-network", "cpu-count", "create-time", "description", "discovery-endpoint", "display-name", "end-time", "id", "labels", "maintenance-policy", "maintenance-schedule", "memcache-full-version", "memcache-version", "memory-size-mb", "name", "node-config", "node-count", "parameters", "params", "schedule-deadline-time", "start-time", "state", "update-time", "zones"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["authorized-network", "cpu-count", "create-time", "description", "discovery-endpoint", "display-name", "end-time", "id", "labels", "maintenance-policy", "maintenance-schedule", "memcache-full-version", "memcache-version", "memory-size-mb", "name", "node-config", "node-count", "parameters", "params", "reserved-ip-range-id", "schedule-deadline-time", "start-time", "state", "update-time", "zones"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -509,11 +510,12 @@ where
|
||||
"node-count" => Some(("nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"parameters.id" => Some(("parameters.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"parameters.params" => Some(("parameters.params", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })),
|
||||
"reserved-ip-range-id" => Some(("reservedIpRangeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"zones" => Some(("zones", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["authorized-network", "cpu-count", "create-time", "description", "discovery-endpoint", "display-name", "end-time", "id", "labels", "maintenance-policy", "maintenance-schedule", "memcache-full-version", "memcache-version", "memory-size-mb", "name", "node-config", "node-count", "parameters", "params", "schedule-deadline-time", "start-time", "state", "update-time", "zones"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["authorized-network", "cpu-count", "create-time", "description", "discovery-endpoint", "display-name", "end-time", "id", "labels", "maintenance-policy", "maintenance-schedule", "memcache-full-version", "memcache-version", "memory-size-mb", "name", "node-config", "node-count", "parameters", "params", "reserved-ip-range-id", "schedule-deadline-time", "start-time", "state", "update-time", "zones"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -750,6 +752,91 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
async fn _projects_locations_instances_upgrade(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
let mut field_cursor = FieldCursor::default();
|
||||
let mut object = json::value::Value::Object(Default::default());
|
||||
|
||||
for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
|
||||
let last_errc = err.issues.len();
|
||||
let (key, value) = parse_kv_arg(&*kvarg, err, false);
|
||||
let mut temp_cursor = field_cursor.clone();
|
||||
if let Err(field_err) = temp_cursor.set(&*key) {
|
||||
err.issues.push(field_err);
|
||||
}
|
||||
if value.is_none() {
|
||||
field_cursor = temp_cursor.clone();
|
||||
if err.issues.len() > last_errc {
|
||||
err.issues.remove(last_errc);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"memcache-version" => Some(("memcacheVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["memcache-version"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
};
|
||||
if let Some((field_cursor_str, type_info)) = type_info {
|
||||
FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor);
|
||||
}
|
||||
}
|
||||
let mut request: api::GoogleCloudMemcacheV1UpgradeInstanceRequest = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.projects().locations_instances_upgrade(request, opt.value_of("name").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 {
|
||||
_ => {
|
||||
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 } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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 _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or(""));
|
||||
@@ -1096,6 +1183,9 @@ where
|
||||
("locations-instances-update-parameters", Some(opt)) => {
|
||||
call_result = self._projects_locations_instances_update_parameters(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("locations-instances-upgrade", Some(opt)) => {
|
||||
call_result = self._projects_locations_instances_upgrade(opt, dry_run, &mut err).await;
|
||||
},
|
||||
("locations-list", Some(opt)) => {
|
||||
call_result = self._projects_locations_list(opt, dry_run, &mut err).await;
|
||||
},
|
||||
@@ -1190,7 +1280,7 @@ where
|
||||
async fn main() {
|
||||
let mut exit_status = 0i32;
|
||||
let arg_data = [
|
||||
("projects", "methods: 'locations-get', 'locations-instances-apply-parameters', 'locations-instances-create', 'locations-instances-delete', 'locations-instances-get', 'locations-instances-list', 'locations-instances-patch', 'locations-instances-reschedule-maintenance', 'locations-instances-update-parameters', 'locations-list', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get' and 'locations-operations-list'", vec![
|
||||
("projects", "methods: 'locations-get', 'locations-instances-apply-parameters', 'locations-instances-create', 'locations-instances-delete', 'locations-instances-get', 'locations-instances-list', 'locations-instances-patch', 'locations-instances-reschedule-maintenance', 'locations-instances-update-parameters', 'locations-instances-upgrade', 'locations-list', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get' and 'locations-operations-list'", vec![
|
||||
("locations-get",
|
||||
Some(r##"Gets information about a location."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_memcache1_cli/projects_locations-get",
|
||||
@@ -1413,6 +1503,34 @@ 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)),
|
||||
]),
|
||||
("locations-instances-upgrade",
|
||||
Some(r##"Upgrades the Memcache instance to a newer memcached engine version specified in the request."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_memcache1_cli/projects_locations-instances-upgrade",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
None,
|
||||
Some(r##"Required. Memcache instance resource name using the form: `projects/{project}/locations/{location}/instances/{instance}` where `location_id` refers to a GCP region."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"kv"##),
|
||||
Some(r##"r"##),
|
||||
Some(r##"Set various fields of the request structure, matching the key=value form"##),
|
||||
Some(true),
|
||||
Some(true)),
|
||||
|
||||
(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"##),
|
||||
@@ -1514,7 +1632,7 @@ async fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("locations-operations-list",
|
||||
Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id."##),
|
||||
Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_memcache1_cli/projects_locations-operations-list",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -1541,7 +1659,7 @@ async fn main() {
|
||||
|
||||
let mut app = App::new("memcache1")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("5.0.3+20230103")
|
||||
.version("5.0.3+20240222")
|
||||
.about("Google Cloud Memorystore for Memcached API is used for creating and managing Memcached instances in GCP.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_memcache1_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
|
||||
Reference in New Issue
Block a user