mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-15 22:18:10 +01:00
Regen all APIs from new JSON
This commit is contained in:
committed by
Sebastian Thiel
parent
86a884c48b
commit
2ad9f3781d
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
|
||||
name = "google-tagmanager1-cli"
|
||||
version = "1.0.8+20171108"
|
||||
version = "1.0.8+20190220"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail.com>"]
|
||||
description = "A complete library to interact with Tag Manager (protocol v1)"
|
||||
repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1-cli"
|
||||
@@ -39,4 +39,4 @@ clap = "^2.0"
|
||||
|
||||
[dependencies.google-tagmanager1]
|
||||
path = "../tagmanager1"
|
||||
version = "1.0.8+20171108"
|
||||
version = "1.0.8+20190220"
|
||||
|
||||
@@ -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 *Tag Manager* API at revision *20171108*. The CLI is at version *1.0.8*.
|
||||
This documentation was generated from the *Tag Manager* API at revision *20190220*. The CLI is at version *1.0.8*.
|
||||
|
||||
```bash
|
||||
tagmanager1 [options]
|
||||
@@ -36,7 +36,6 @@ tagmanager1 [options]
|
||||
containers-environments-delete <account-id> <container-id> <environment-id> [-p <v>]...
|
||||
containers-environments-get <account-id> <container-id> <environment-id> [-p <v>]... [-o <out>]
|
||||
containers-environments-list <account-id> <container-id> [-p <v>]... [-o <out>]
|
||||
containers-environments-patch <account-id> <container-id> <environment-id> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
containers-environments-update <account-id> <container-id> <environment-id> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
containers-folders-create <account-id> <container-id> (-r <kv>)... [-p <v>]... [-o <out>]
|
||||
containers-folders-delete <account-id> <container-id> <folder-id> [-p <v>]...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
site_name: Tag Manager v1.0.8+20171108
|
||||
site_name: Tag Manager v1.0.8+20190220
|
||||
site_url: http://byron.github.io/google-apis-rs/google-tagmanager1-cli
|
||||
site_description: A complete library to interact with Tag Manager (protocol v1)
|
||||
|
||||
@@ -15,7 +15,6 @@ pages:
|
||||
- ['accounts_containers-environments-delete.md', 'Accounts', 'Containers Environments Delete']
|
||||
- ['accounts_containers-environments-get.md', 'Accounts', 'Containers Environments Get']
|
||||
- ['accounts_containers-environments-list.md', 'Accounts', 'Containers Environments List']
|
||||
- ['accounts_containers-environments-patch.md', 'Accounts', 'Containers Environments Patch']
|
||||
- ['accounts_containers-environments-update.md', 'Accounts', 'Containers Environments Update']
|
||||
- ['accounts_containers-folders-create.md', 'Accounts', 'Containers Folders Create']
|
||||
- ['accounts_containers-folders-delete.md', 'Accounts', 'Containers Folders Delete']
|
||||
|
||||
@@ -429,106 +429,6 @@ impl<'n> Engine<'n> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _accounts_containers_environments_patch(&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()[..] {
|
||||
"authorization-code" => Some(("authorizationCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"authorization-timestamp-ms" => Some(("authorizationTimestampMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"container-version-id" => Some(("containerVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp-ms", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "type", "url"]);
|
||||
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::Environment = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.accounts().containers_environments_patch(request, opt.value_of("account-id").unwrap_or(""), opt.value_of("container-id").unwrap_or(""), opt.value_of("environment-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 {
|
||||
"fingerprint" => {
|
||||
call = call.fingerprint(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(["fingerprint"].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 _accounts_containers_environments_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
@@ -3594,9 +3494,6 @@ impl<'n> Engine<'n> {
|
||||
("containers-environments-list", Some(opt)) => {
|
||||
call_result = self._accounts_containers_environments_list(opt, dry_run, &mut err);
|
||||
},
|
||||
("containers-environments-patch", Some(opt)) => {
|
||||
call_result = self._accounts_containers_environments_patch(opt, dry_run, &mut err);
|
||||
},
|
||||
("containers-environments-update", Some(opt)) => {
|
||||
call_result = self._accounts_containers_environments_update(opt, dry_run, &mut err);
|
||||
},
|
||||
@@ -3814,7 +3711,7 @@ impl<'n> Engine<'n> {
|
||||
fn main() {
|
||||
let mut exit_status = 0i32;
|
||||
let arg_data = [
|
||||
("accounts", "methods: 'containers-create', 'containers-delete', 'containers-environments-create', 'containers-environments-delete', 'containers-environments-get', 'containers-environments-list', 'containers-environments-patch', 'containers-environments-update', 'containers-folders-create', 'containers-folders-delete', 'containers-folders-entities-list', 'containers-folders-get', 'containers-folders-list', 'containers-folders-update', 'containers-get', 'containers-list', 'containers-move-folders-update', 'containers-reauthorize-environments-update', 'containers-tags-create', 'containers-tags-delete', 'containers-tags-get', 'containers-tags-list', 'containers-tags-update', 'containers-triggers-create', 'containers-triggers-delete', 'containers-triggers-get', 'containers-triggers-list', 'containers-triggers-update', 'containers-update', 'containers-variables-create', 'containers-variables-delete', 'containers-variables-get', 'containers-variables-list', 'containers-variables-update', 'containers-versions-create', 'containers-versions-delete', 'containers-versions-get', 'containers-versions-list', 'containers-versions-publish', 'containers-versions-restore', 'containers-versions-undelete', 'containers-versions-update', 'get', 'list', 'permissions-create', 'permissions-delete', 'permissions-get', 'permissions-list', 'permissions-update' and 'update'", vec![
|
||||
("accounts", "methods: 'containers-create', 'containers-delete', 'containers-environments-create', 'containers-environments-delete', 'containers-environments-get', 'containers-environments-list', 'containers-environments-update', 'containers-folders-create', 'containers-folders-delete', 'containers-folders-entities-list', 'containers-folders-get', 'containers-folders-list', 'containers-folders-update', 'containers-get', 'containers-list', 'containers-move-folders-update', 'containers-reauthorize-environments-update', 'containers-tags-create', 'containers-tags-delete', 'containers-tags-get', 'containers-tags-list', 'containers-tags-update', 'containers-triggers-create', 'containers-triggers-delete', 'containers-triggers-get', 'containers-triggers-list', 'containers-triggers-update', 'containers-update', 'containers-variables-create', 'containers-variables-delete', 'containers-variables-get', 'containers-variables-list', 'containers-variables-update', 'containers-versions-create', 'containers-versions-delete', 'containers-versions-get', 'containers-versions-list', 'containers-versions-publish', 'containers-versions-restore', 'containers-versions-undelete', 'containers-versions-update', 'get', 'list', 'permissions-create', 'permissions-delete', 'permissions-get', 'permissions-list', 'permissions-update' and 'update'", vec![
|
||||
("containers-create",
|
||||
Some(r##"Creates a Container."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_tagmanager1_cli/accounts_containers-create",
|
||||
@@ -3983,46 +3880,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)),
|
||||
]),
|
||||
("containers-environments-patch",
|
||||
Some(r##"Updates a GTM Environment. This method supports patch semantics."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_tagmanager1_cli/accounts_containers-environments-patch",
|
||||
vec![
|
||||
(Some(r##"account-id"##),
|
||||
None,
|
||||
Some(r##"The GTM Account ID."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"container-id"##),
|
||||
None,
|
||||
Some(r##"The GTM Container ID."##),
|
||||
Some(true),
|
||||
Some(false)),
|
||||
|
||||
(Some(r##"environment-id"##),
|
||||
None,
|
||||
Some(r##"The GTM Environment ID."##),
|
||||
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"##),
|
||||
@@ -5389,7 +5246,7 @@ fn main() {
|
||||
|
||||
let mut app = App::new("tagmanager1")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("1.0.8+20171108")
|
||||
.version("1.0.8+20190220")
|
||||
.about("Accesses Tag Manager accounts and containers.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager1_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
|
||||
Reference in New Issue
Block a user