Bump version to 1.0.9; update JSON schemas; add new APIs

This commit is contained in:
Sebastian Thiel
2019-07-05 11:32:35 +08:00
parent 99e97ceece
commit e42ebc0c2b
2442 changed files with 190984 additions and 71186 deletions

View File

@@ -4,7 +4,7 @@
[package]
name = "google-speech1-cli"
version = "1.0.8+20190321"
version = "1.0.9+20190627"
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
description = "A complete library to interact with Speech (protocol v1)"
repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/speech1-cli"
@@ -39,4 +39,4 @@ clap = "^2.0"
[dependencies.google-speech1]
path = "../speech1"
version = "1.0.8+20190321"
version = "1.0.9+20190627"

View File

@@ -6,7 +6,7 @@ DO NOT EDIT !
The MIT License (MIT)
=====================
Copyright © `2015-2016` `Sebastian Thiel`
Copyright © `2015-2019` `Sebastian Thiel`
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma
# Usage
This documentation was generated from the *Speech* API at revision *20190321*. The CLI is at version *1.0.8*.
This documentation was generated from the *Speech* API at revision *20190627*. The CLI is at version *1.0.9*.
```bash
speech1 [options]
@@ -35,7 +35,6 @@ speech1 [options]
projects
locations-operations-get <name> [-p <v>]... [-o <out>]
locations-operations-list <name> [-p <v>]... [-o <out>]
operations-manual-recognition-tasks-get <name> [-p <v>]... [-o <out>]
speech
longrunningrecognize (-r <kv>)... [-p <v>]... [-o <out>]
recognize (-r <kv>)... [-p <v>]... [-o <out>]

View File

@@ -1,4 +1,4 @@
site_name: Speech v1.0.8+20190321
site_name: Speech v1.0.9+20190627
site_url: http://byron.github.io/google-apis-rs/google-speech1-cli
site_description: A complete library to interact with Speech (protocol v1)
@@ -13,11 +13,10 @@ pages:
- ['operations_list.md', 'Operations', 'List']
- ['projects_locations-operations-get.md', 'Projects', 'Locations Operations Get']
- ['projects_locations-operations-list.md', 'Projects', 'Locations Operations List']
- ['projects_operations-manual-recognition-tasks-get.md', 'Projects', 'Operations Manual Recognition Tasks Get']
- ['speech_longrunningrecognize.md', 'Speech', 'Longrunningrecognize']
- ['speech_recognize.md', 'Speech', 'Recognize']
theme: readthedocs
copyright: Copyright &copy; 2015-2016, `Sebastian Thiel`
copyright: Copyright &copy; 2015-2019, `Sebastian Thiel`

View File

@@ -67,6 +67,17 @@ pub fn remove_json_null_values(value: &mut Value) {
map.remove(key);
}
}
json::value::Value::Array(ref mut arr) => {
let mut i = 0;
while i < arr.len() {
if arr[i].is_null() {
arr.remove(i);
} else {
remove_json_null_values(&mut arr[i]);
i += 1;
}
}
}
_ => {}
}
}

View File

@@ -277,58 +277,6 @@ impl<'n> Engine<'n> {
}
}
fn _projects_operations_manual_recognition_tasks_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.projects().operations_manual_recognition_tasks_get(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(),
_ => 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(())
}
}
}
}
fn _speech_longrunningrecognize(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
@@ -568,9 +516,6 @@ impl<'n> Engine<'n> {
("locations-operations-list", Some(opt)) => {
call_result = self._projects_locations_operations_list(opt, dry_run, &mut err);
},
("operations-manual-recognition-tasks-get", Some(opt)) => {
call_result = self._projects_operations_manual_recognition_tasks_get(opt, dry_run, &mut err);
},
_ => {
err.issues.push(CLIError::MissingMethodError("projects".to_string()));
writeln!(io::stderr(), "{}\n", opt.usage()).ok();
@@ -728,7 +673,7 @@ fn main() {
]),
]),
("projects", "methods: 'locations-operations-get', 'locations-operations-list' and 'operations-manual-recognition-tasks-get'", vec![
("projects", "methods: 'locations-operations-get' and 'locations-operations-list'", vec![
("locations-operations-get",
Some(r##"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
@@ -778,30 +723,6 @@ 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)),
]),
("operations-manual-recognition-tasks-get",
Some(r##"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."##),
"Details at http://byron.github.io/google-apis-rs/google_speech1_cli/projects_operations-manual-recognition-tasks-get",
vec![
(Some(r##"name"##),
None,
Some(r##"The name of the operation resource."##),
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"##),
@@ -867,7 +788,7 @@ fn main() {
let mut app = App::new("speech1")
.author("Sebastian Thiel <byronimo@gmail.com>")
.version("1.0.8+20190321")
.version("1.0.9+20190627")
.about("Converts audio to text by applying powerful neural network models.")
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_speech1_cli")
.arg(Arg::with_name("url")