mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2025-12-26 17:02:24 +01:00
Upgrade to latest API versions + code regen
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
|
||||
name = "google-fusiontables2-cli"
|
||||
version = "1.0.6+20170413"
|
||||
version = "1.0.6+20171117"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
|
||||
description = "A complete library to interact with fusiontables (protocol v2)"
|
||||
repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2-cli"
|
||||
@@ -37,4 +37,4 @@ clap = "^2.0"
|
||||
|
||||
[dependencies.google-fusiontables2]
|
||||
path = "../fusiontables2"
|
||||
version = "1.0.6+20170413"
|
||||
version = "1.0.6+20171117"
|
||||
|
||||
@@ -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 *fusiontables* API at revision *20170413*. The CLI is at version *1.0.6*.
|
||||
This documentation was generated from the *fusiontables* API at revision *20171117*. The CLI is at version *1.0.6*.
|
||||
|
||||
```bash
|
||||
fusiontables2 [options]
|
||||
@@ -55,6 +55,7 @@ fusiontables2 [options]
|
||||
insert (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
list [-p <v>]... [-o <out>]
|
||||
patch <table-id> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
refetch-sheet <table-id> [-p <v>]... [-o <out>]
|
||||
replace-rows <table-id> (-u (simple|resumable) -f <file> [-m <mime>]) [-p <v>]... [-o <out>]
|
||||
update <table-id> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
task
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
site_name: fusiontables v1.0.6+20170413
|
||||
site_name: fusiontables v1.0.6+20171117
|
||||
site_url: http://byron.github.io/google-apis-rs/google-fusiontables2-cli
|
||||
site_description: A complete library to interact with fusiontables (protocol v2)
|
||||
|
||||
@@ -31,6 +31,7 @@ pages:
|
||||
- ['table_insert.md', 'Table', 'Insert']
|
||||
- ['table_list.md', 'Table', 'List']
|
||||
- ['table_patch.md', 'Table', 'Patch']
|
||||
- ['table_refetch-sheet.md', 'Table', 'Refetch Sheet']
|
||||
- ['table_replace-rows.md', 'Table', 'Replace Rows']
|
||||
- ['table_update.md', 'Table', 'Update']
|
||||
- ['task_delete.md', 'Task', 'Delete']
|
||||
|
||||
@@ -1692,6 +1692,58 @@ impl<'n> Engine<'n> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _table_refetch_sheet(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.table().refetch_sheet(opt.value_of("table-id").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 _table_replace_rows(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.table().replace_rows(opt.value_of("table-id").unwrap_or(""));
|
||||
@@ -2548,6 +2600,9 @@ impl<'n> Engine<'n> {
|
||||
("patch", Some(opt)) => {
|
||||
call_result = self._table_patch(opt, dry_run, &mut err);
|
||||
},
|
||||
("refetch-sheet", Some(opt)) => {
|
||||
call_result = self._table_refetch_sheet(opt, dry_run, &mut err);
|
||||
},
|
||||
("replace-rows", Some(opt)) => {
|
||||
call_result = self._table_replace_rows(opt, dry_run, &mut err);
|
||||
},
|
||||
@@ -3095,7 +3150,7 @@ fn main() {
|
||||
]),
|
||||
]),
|
||||
|
||||
("table", "methods: 'copy', 'delete', 'get', 'import-rows', 'import-table', 'insert', 'list', 'patch', 'replace-rows' and 'update'", vec![
|
||||
("table", "methods: 'copy', 'delete', 'get', 'import-rows', 'import-table', 'insert', 'list', 'patch', 'refetch-sheet', 'replace-rows' and 'update'", vec![
|
||||
("copy",
|
||||
Some(r##"Copies a table."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_fusiontables2_cli/table_copy",
|
||||
@@ -3272,6 +3327,28 @@ 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)),
|
||||
]),
|
||||
("refetch-sheet",
|
||||
Some(r##"Replaces rows of the table with the rows of the spreadsheet that is first imported from. Current rows remain visible until all replacement rows are ready."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_fusiontables2_cli/table_refetch-sheet",
|
||||
vec![
|
||||
(Some(r##"table-id"##),
|
||||
None,
|
||||
Some(r##"Table whose rows will be replaced from the spreadsheet."##),
|
||||
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"##),
|
||||
@@ -3586,7 +3663,7 @@ fn main() {
|
||||
|
||||
let mut app = App::new("fusiontables2")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("1.0.6+20170413")
|
||||
.version("1.0.6+20171117")
|
||||
.about("API for working with Fusion Tables data.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fusiontables2_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
|
||||
Reference in New Issue
Block a user