mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-02 07:02:07 +01:00
Bump version to 1.0.9; update JSON schemas; add new APIs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,106 @@ struct Engine<'n> {
|
||||
|
||||
|
||||
impl<'n> Engine<'n> {
|
||||
fn _projects_agent(&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()[..] {
|
||||
"avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]);
|
||||
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::GoogleCloudDialogflowV2beta1Agent = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.projects().agent(request, opt.value_of("parent").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 {
|
||||
"update-mask" => {
|
||||
call = call.update_mask(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(["update-mask"].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 _projects_agent_entity_types_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
@@ -1259,11 +1359,14 @@ impl<'n> Engine<'n> {
|
||||
"query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })),
|
||||
"query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })),
|
||||
@@ -1271,7 +1374,7 @@ impl<'n> Engine<'n> {
|
||||
"query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -3752,11 +3855,14 @@ impl<'n> Engine<'n> {
|
||||
"query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
||||
"query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })),
|
||||
"query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })),
|
||||
@@ -3764,7 +3870,7 @@ impl<'n> Engine<'n> {
|
||||
"query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
||||
"query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]);
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
@@ -4247,6 +4353,58 @@ impl<'n> Engine<'n> {
|
||||
}
|
||||
}
|
||||
|
||||
fn _projects_delete_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.projects().delete_agent(opt.value_of("parent").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 _projects_get_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
let mut call = self.hub.projects().get_agent(opt.value_of("parent").unwrap_or(""));
|
||||
@@ -5134,6 +5292,9 @@ impl<'n> Engine<'n> {
|
||||
match self.opt.subcommand() {
|
||||
("projects", Some(opt)) => {
|
||||
match opt.subcommand() {
|
||||
("agent", Some(opt)) => {
|
||||
call_result = self._projects_agent(opt, dry_run, &mut err);
|
||||
},
|
||||
("agent-entity-types-batch-delete", Some(opt)) => {
|
||||
call_result = self._projects_agent_entity_types_batch_delete(opt, dry_run, &mut err);
|
||||
},
|
||||
@@ -5305,6 +5466,9 @@ impl<'n> Engine<'n> {
|
||||
("agent-train", Some(opt)) => {
|
||||
call_result = self._projects_agent_train(opt, dry_run, &mut err);
|
||||
},
|
||||
("delete-agent", Some(opt)) => {
|
||||
call_result = self._projects_delete_agent(opt, dry_run, &mut err);
|
||||
},
|
||||
("get-agent", Some(opt)) => {
|
||||
call_result = self._projects_get_agent(opt, dry_run, &mut err);
|
||||
},
|
||||
@@ -5435,7 +5599,36 @@ impl<'n> Engine<'n> {
|
||||
fn main() {
|
||||
let mut exit_status = 0i32;
|
||||
let arg_data = [
|
||||
("projects", "methods: 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-environments-users-sessions-contexts-create', 'agent-environments-users-sessions-contexts-delete', 'agent-environments-users-sessions-contexts-get', 'agent-environments-users-sessions-contexts-list', 'agent-environments-users-sessions-contexts-patch', 'agent-environments-users-sessions-delete-contexts', 'agent-environments-users-sessions-detect-intent', 'agent-environments-users-sessions-entity-types-create', 'agent-environments-users-sessions-entity-types-delete', 'agent-environments-users-sessions-entity-types-get', 'agent-environments-users-sessions-entity-types-list', 'agent-environments-users-sessions-entity-types-patch', 'agent-export', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-knowledge-bases-create', 'agent-knowledge-bases-delete', 'agent-knowledge-bases-documents-create', 'agent-knowledge-bases-documents-delete', 'agent-knowledge-bases-documents-get', 'agent-knowledge-bases-documents-list', 'agent-knowledge-bases-documents-patch', 'agent-knowledge-bases-documents-reload', 'agent-knowledge-bases-get', 'agent-knowledge-bases-list', 'agent-knowledge-bases-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'get-agent', 'knowledge-bases-create', 'knowledge-bases-delete', 'knowledge-bases-documents-create', 'knowledge-bases-documents-delete', 'knowledge-bases-documents-get', 'knowledge-bases-documents-list', 'knowledge-bases-documents-patch', 'knowledge-bases-documents-reload', 'knowledge-bases-get', 'knowledge-bases-list', 'knowledge-bases-patch' and 'operations-get'", vec![
|
||||
("projects", "methods: 'agent', 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-environments-users-sessions-contexts-create', 'agent-environments-users-sessions-contexts-delete', 'agent-environments-users-sessions-contexts-get', 'agent-environments-users-sessions-contexts-list', 'agent-environments-users-sessions-contexts-patch', 'agent-environments-users-sessions-delete-contexts', 'agent-environments-users-sessions-detect-intent', 'agent-environments-users-sessions-entity-types-create', 'agent-environments-users-sessions-entity-types-delete', 'agent-environments-users-sessions-entity-types-get', 'agent-environments-users-sessions-entity-types-list', 'agent-environments-users-sessions-entity-types-patch', 'agent-export', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-knowledge-bases-create', 'agent-knowledge-bases-delete', 'agent-knowledge-bases-documents-create', 'agent-knowledge-bases-documents-delete', 'agent-knowledge-bases-documents-get', 'agent-knowledge-bases-documents-list', 'agent-knowledge-bases-documents-patch', 'agent-knowledge-bases-documents-reload', 'agent-knowledge-bases-get', 'agent-knowledge-bases-list', 'agent-knowledge-bases-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'delete-agent', 'get-agent', 'knowledge-bases-create', 'knowledge-bases-delete', 'knowledge-bases-documents-create', 'knowledge-bases-documents-delete', 'knowledge-bases-documents-get', 'knowledge-bases-documents-list', 'knowledge-bases-documents-patch', 'knowledge-bases-documents-reload', 'knowledge-bases-get', 'knowledge-bases-list', 'knowledge-bases-patch' and 'operations-get'", vec![
|
||||
("agent",
|
||||
Some(r##"Creates/updates the specified agent."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
None,
|
||||
Some(r##"Required. The project of this agent.
|
||||
Format: `projects/<Project 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"##),
|
||||
Some(false),
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-entity-types-batch-delete",
|
||||
Some(r##"Deletes entity types in the specified agent.
|
||||
|
||||
@@ -5915,8 +6108,8 @@ fn main() {
|
||||
`projects/<Project ID>/agent/environments/<Environment ID>/users/<User
|
||||
ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
|
||||
default 'draft' environment. If `User ID` is not specified, we are using
|
||||
"-". It’s up to the API caller to choose an appropriate `Session ID` and
|
||||
`User Id`. They can be a random numbers or some type of user and session
|
||||
"-". It's up to the API caller to choose an appropriate `Session ID` and
|
||||
`User Id`. They can be a random number or some type of user and session
|
||||
identifiers (preferably hashed). The length of the `Session ID` and
|
||||
`User ID` must not exceed 36 characters."##),
|
||||
Some(true),
|
||||
@@ -6356,7 +6549,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-create",
|
||||
Some(r##"Creates a knowledge base."##),
|
||||
Some(r##"Creates a knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-create",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
@@ -6385,7 +6581,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-delete",
|
||||
Some(r##"Deletes the specified knowledge base."##),
|
||||
Some(r##"Deletes the specified knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-delete",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -6410,6 +6609,9 @@ fn main() {
|
||||
("agent-knowledge-bases-documents-create",
|
||||
Some(r##"Creates a new document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: Document,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-create",
|
||||
@@ -6442,6 +6644,9 @@ fn main() {
|
||||
("agent-knowledge-bases-documents-delete",
|
||||
Some(r##"Deletes the specified document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: google.protobuf.Empty,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-delete",
|
||||
@@ -6467,7 +6672,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-documents-get",
|
||||
Some(r##"Retrieves the specified document."##),
|
||||
Some(r##"Retrieves the specified document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-get",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -6491,7 +6699,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-documents-list",
|
||||
Some(r##"Returns the list of all documents of the knowledge base."##),
|
||||
Some(r##"Returns the list of all documents of the knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-list",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
@@ -6515,6 +6726,10 @@ fn main() {
|
||||
]),
|
||||
("agent-knowledge-bases-documents-patch",
|
||||
Some(r##"Updates the specified document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: Document,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-patch",
|
||||
@@ -6551,6 +6766,10 @@ fn main() {
|
||||
content. The previously loaded content of the document will be deleted.
|
||||
Note: Even when the content of the document has not changed, there still
|
||||
may be side effects because of internal implementation changes.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: Document,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-reload",
|
||||
@@ -6582,7 +6801,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-get",
|
||||
Some(r##"Retrieves the specified knowledge base."##),
|
||||
Some(r##"Retrieves the specified knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-get",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -6605,7 +6827,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-list",
|
||||
Some(r##"Returns the list of all knowledge bases of the specified agent."##),
|
||||
Some(r##"Returns the list of all knowledge bases of the specified agent.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-list",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
@@ -6628,7 +6853,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("agent-knowledge-bases-patch",
|
||||
Some(r##"Updates the specified knowledge base."##),
|
||||
Some(r##"Updates the specified knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-patch",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -6914,8 +7142,8 @@ fn main() {
|
||||
`projects/<Project ID>/agent/environments/<Environment ID>/users/<User
|
||||
ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
|
||||
default 'draft' environment. If `User ID` is not specified, we are using
|
||||
"-". It’s up to the API caller to choose an appropriate `Session ID` and
|
||||
`User Id`. They can be a random numbers or some type of user and session
|
||||
"-". It's up to the API caller to choose an appropriate `Session ID` and
|
||||
`User Id`. They can be a random number or some type of user and session
|
||||
identifiers (preferably hashed). The length of the `Session ID` and
|
||||
`User ID` must not exceed 36 characters."##),
|
||||
Some(true),
|
||||
@@ -7119,6 +7347,29 @@ 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)),
|
||||
]),
|
||||
("delete-agent",
|
||||
Some(r##"Deletes the specified agent."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_delete-agent",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
None,
|
||||
Some(r##"Required. The project that the agent to delete is associated with.
|
||||
Format: `projects/<Project 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"##),
|
||||
@@ -7149,7 +7400,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-create",
|
||||
Some(r##"Creates a knowledge base."##),
|
||||
Some(r##"Creates a knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-create",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
@@ -7178,7 +7432,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-delete",
|
||||
Some(r##"Deletes the specified knowledge base."##),
|
||||
Some(r##"Deletes the specified knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-delete",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -7203,6 +7460,9 @@ fn main() {
|
||||
("knowledge-bases-documents-create",
|
||||
Some(r##"Creates a new document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: Document,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-create",
|
||||
@@ -7235,6 +7495,9 @@ fn main() {
|
||||
("knowledge-bases-documents-delete",
|
||||
Some(r##"Deletes the specified document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: google.protobuf.Empty,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-delete",
|
||||
@@ -7260,7 +7523,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-documents-get",
|
||||
Some(r##"Retrieves the specified document."##),
|
||||
Some(r##"Retrieves the specified document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-get",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -7284,7 +7550,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-documents-list",
|
||||
Some(r##"Returns the list of all documents of the knowledge base."##),
|
||||
Some(r##"Returns the list of all documents of the knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-list",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
@@ -7308,6 +7577,10 @@ fn main() {
|
||||
]),
|
||||
("knowledge-bases-documents-patch",
|
||||
Some(r##"Updates the specified document.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: Document,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-patch",
|
||||
@@ -7344,6 +7617,10 @@ fn main() {
|
||||
content. The previously loaded content of the document will be deleted.
|
||||
Note: Even when the content of the document has not changed, there still
|
||||
may be side effects because of internal implementation changes.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
|
||||
only use `projects.knowledgeBases.documents`.
|
||||
|
||||
Operation <response: Document,
|
||||
metadata: KnowledgeOperationMetadata>"##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-reload",
|
||||
@@ -7375,7 +7652,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-get",
|
||||
Some(r##"Retrieves the specified knowledge base."##),
|
||||
Some(r##"Retrieves the specified knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-get",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -7398,7 +7678,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-list",
|
||||
Some(r##"Returns the list of all knowledge bases of the specified agent."##),
|
||||
Some(r##"Returns the list of all knowledge bases of the specified agent.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-list",
|
||||
vec![
|
||||
(Some(r##"parent"##),
|
||||
@@ -7421,7 +7704,10 @@ fn main() {
|
||||
Some(false)),
|
||||
]),
|
||||
("knowledge-bases-patch",
|
||||
Some(r##"Updates the specified knowledge base."##),
|
||||
Some(r##"Updates the specified knowledge base.
|
||||
|
||||
Note: The `projects.agent.knowledgeBases` resource is deprecated;
|
||||
only use `projects.knowledgeBases`."##),
|
||||
"Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-patch",
|
||||
vec![
|
||||
(Some(r##"name"##),
|
||||
@@ -7480,7 +7766,7 @@ fn main() {
|
||||
|
||||
let mut app = App::new("dialogflow2-beta1")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("1.0.8+20190402")
|
||||
.version("1.0.9+20190629")
|
||||
.about("Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
|
||||
Reference in New Issue
Block a user