|
|
|
|
@@ -187,6 +187,7 @@ where
|
|
|
|
|
|
|
|
|
|
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
|
|
|
|
match &temp_cursor.to_string()[..] {
|
|
|
|
|
"data-boost-isolation-read-only.compute-billing-owner" => Some(("dataBoostIsolationReadOnly.computeBillingOwner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"multi-cluster-routing-use-any.cluster-ids" => Some(("multiClusterRoutingUseAny.clusterIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
|
|
|
|
@@ -196,7 +197,7 @@ where
|
|
|
|
|
"single-cluster-routing.cluster-id" => Some(("singleClusterRouting.clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"standard-isolation.priority" => Some(("standardIsolation.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-transactional-writes", "cluster-id", "cluster-ids", "description", "etag", "multi-cluster-routing-use-any", "name", "priority", "single-cluster-routing", "standard-isolation"]);
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-transactional-writes", "cluster-id", "cluster-ids", "compute-billing-owner", "data-boost-isolation-read-only", "description", "etag", "multi-cluster-routing-use-any", "name", "priority", "single-cluster-routing", "standard-isolation"]);
|
|
|
|
|
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
|
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
@@ -453,6 +454,7 @@ where
|
|
|
|
|
|
|
|
|
|
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
|
|
|
|
match &temp_cursor.to_string()[..] {
|
|
|
|
|
"data-boost-isolation-read-only.compute-billing-owner" => Some(("dataBoostIsolationReadOnly.computeBillingOwner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"multi-cluster-routing-use-any.cluster-ids" => Some(("multiClusterRoutingUseAny.clusterIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
|
|
|
|
@@ -462,7 +464,7 @@ where
|
|
|
|
|
"single-cluster-routing.cluster-id" => Some(("singleClusterRouting.clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"standard-isolation.priority" => Some(("standardIsolation.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-transactional-writes", "cluster-id", "cluster-ids", "description", "etag", "multi-cluster-routing-use-any", "name", "priority", "single-cluster-routing", "standard-isolation"]);
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-transactional-writes", "cluster-id", "cluster-ids", "compute-billing-owner", "data-boost-isolation-read-only", "description", "etag", "multi-cluster-routing-use-any", "name", "priority", "single-cluster-routing", "standard-isolation"]);
|
|
|
|
|
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
|
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
@@ -2277,6 +2279,624 @@ where
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async fn _projects_instances_tables_authorized_views_create(&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()[..] {
|
|
|
|
|
"deletion-protection" => Some(("deletionProtection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
|
|
|
|
"etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"subset-view.row-prefixes" => Some(("subsetView.rowPrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["deletion-protection", "etag", "name", "row-prefixes", "subset-view"]);
|
|
|
|
|
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::AuthorizedView = json::value::from_value(object).unwrap();
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_create(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 {
|
|
|
|
|
"authorized-view-id" => {
|
|
|
|
|
call = call.authorized_view_id(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(["authorized-view-id"].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_instances_tables_authorized_views_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
|
|
|
|
-> Result<(), DoitError> {
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_delete(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 {
|
|
|
|
|
"etag" => {
|
|
|
|
|
call = call.etag(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(["etag"].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_instances_tables_authorized_views_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
|
|
|
|
-> Result<(), DoitError> {
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_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 {
|
|
|
|
|
"view" => {
|
|
|
|
|
call = call.view(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(["view"].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_instances_tables_authorized_views_get_iam_policy(&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()[..] {
|
|
|
|
|
"options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-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::GetIamPolicyRequest = json::value::from_value(object).unwrap();
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_get_iam_policy(request, opt.value_of("resource").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_instances_tables_authorized_views_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
|
|
|
|
-> Result<(), DoitError> {
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_list(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 {
|
|
|
|
|
"view" => {
|
|
|
|
|
call = call.view(value.unwrap_or(""));
|
|
|
|
|
},
|
|
|
|
|
"page-token" => {
|
|
|
|
|
call = call.page_token(value.unwrap_or(""));
|
|
|
|
|
},
|
|
|
|
|
"page-size" => {
|
|
|
|
|
call = call.page_size( value.map(|v| arg_from_str(v, err, "page-size", "int32")).unwrap_or(-0));
|
|
|
|
|
},
|
|
|
|
|
_ => {
|
|
|
|
|
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(["page-size", "page-token", "view"].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_instances_tables_authorized_views_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()[..] {
|
|
|
|
|
"deletion-protection" => Some(("deletionProtection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
|
|
|
|
"etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"subset-view.row-prefixes" => Some(("subsetView.rowPrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["deletion-protection", "etag", "name", "row-prefixes", "subset-view"]);
|
|
|
|
|
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::AuthorizedView = json::value::from_value(object).unwrap();
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_patch(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 {
|
|
|
|
|
"update-mask" => {
|
|
|
|
|
call = call.update_mask( value.map(|v| arg_from_str(v, err, "update-mask", "google-fieldmask")).unwrap_or(FieldMask::default()));
|
|
|
|
|
},
|
|
|
|
|
"ignore-warnings" => {
|
|
|
|
|
call = call.ignore_warnings( value.map(|v| arg_from_str(v, err, "ignore-warnings", "boolean")).unwrap_or(false));
|
|
|
|
|
},
|
|
|
|
|
_ => {
|
|
|
|
|
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(["ignore-warnings", "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().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_instances_tables_authorized_views_set_iam_policy(&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()[..] {
|
|
|
|
|
"policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
|
|
|
|
"update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "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::SetIamPolicyRequest = json::value::from_value(object).unwrap();
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_set_iam_policy(request, opt.value_of("resource").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_instances_tables_authorized_views_test_iam_permissions(&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()[..] {
|
|
|
|
|
"permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]);
|
|
|
|
|
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::TestIamPermissionsRequest = json::value::from_value(object).unwrap();
|
|
|
|
|
let mut call = self.hub.projects().instances_tables_authorized_views_test_iam_permissions(request, opt.value_of("resource").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_instances_tables_check_consistency(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
|
|
|
|
|
-> Result<(), DoitError> {
|
|
|
|
|
|
|
|
|
|
@@ -2385,6 +3005,8 @@ where
|
|
|
|
|
|
|
|
|
|
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
|
|
|
|
match &temp_cursor.to_string()[..] {
|
|
|
|
|
"table.automated-backup-policy.frequency" => Some(("table.automatedBackupPolicy.frequency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"table.automated-backup-policy.retention-period" => Some(("table.automatedBackupPolicy.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"table.change-stream-config.retention-period" => Some(("table.changeStreamConfig.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"table.deletion-protection" => Some(("table.deletionProtection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
|
|
|
|
"table.granularity" => Some(("table.granularity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
@@ -2401,7 +3023,7 @@ where
|
|
|
|
|
"table.stats.row-count" => Some(("table.stats.rowCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
|
|
|
|
"table-id" => Some(("tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["average-cells-per-column", "average-columns-per-row", "backup", "backup-info", "change-stream-config", "deletion-protection", "end-time", "granularity", "logical-data-bytes", "name", "restore-info", "retention-period", "row-count", "source-backup", "source-table", "source-type", "start-time", "stats", "table", "table-id"]);
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["automated-backup-policy", "average-cells-per-column", "average-columns-per-row", "backup", "backup-info", "change-stream-config", "deletion-protection", "end-time", "frequency", "granularity", "logical-data-bytes", "name", "restore-info", "retention-period", "row-count", "source-backup", "source-table", "source-type", "start-time", "stats", "table", "table-id"]);
|
|
|
|
|
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
|
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
@@ -2994,6 +3616,8 @@ where
|
|
|
|
|
|
|
|
|
|
let type_info: Option<(&'static str, JsonTypeInfo)> =
|
|
|
|
|
match &temp_cursor.to_string()[..] {
|
|
|
|
|
"automated-backup-policy.frequency" => Some(("automatedBackupPolicy.frequency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"automated-backup-policy.retention-period" => Some(("automatedBackupPolicy.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"change-stream-config.retention-period" => Some(("changeStreamConfig.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"deletion-protection" => Some(("deletionProtection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })),
|
|
|
|
|
"granularity" => Some(("granularity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
@@ -3009,7 +3633,7 @@ where
|
|
|
|
|
"stats.logical-data-bytes" => Some(("stats.logicalDataBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
|
|
|
|
"stats.row-count" => Some(("stats.rowCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
|
|
|
|
_ => {
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["average-cells-per-column", "average-columns-per-row", "backup", "backup-info", "change-stream-config", "deletion-protection", "end-time", "granularity", "logical-data-bytes", "name", "restore-info", "retention-period", "row-count", "source-backup", "source-table", "source-type", "start-time", "stats"]);
|
|
|
|
|
let suggestion = FieldCursor::did_you_mean(key, &vec!["automated-backup-policy", "average-cells-per-column", "average-columns-per-row", "backup", "backup-info", "change-stream-config", "deletion-protection", "end-time", "frequency", "granularity", "logical-data-bytes", "name", "restore-info", "retention-period", "row-count", "source-backup", "source-table", "source-type", "start-time", "stats"]);
|
|
|
|
|
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
|
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
@@ -3758,6 +4382,30 @@ where
|
|
|
|
|
("instances-set-iam-policy", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_set_iam_policy(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-create", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_create(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-delete", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_delete(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-get", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_get(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-get-iam-policy", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_get_iam_policy(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-list", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_list(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-patch", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_patch(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-set-iam-policy", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_set_iam_policy(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-authorized-views-test-iam-permissions", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_authorized_views_test_iam_permissions(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
("instances-tables-check-consistency", Some(opt)) => {
|
|
|
|
|
call_result = self._projects_instances_tables_check_consistency(opt, dry_run, &mut err).await;
|
|
|
|
|
},
|
|
|
|
|
@@ -3935,7 +4583,7 @@ async fn main() {
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
("projects", "methods: 'instances-app-profiles-create', 'instances-app-profiles-delete', 'instances-app-profiles-get', 'instances-app-profiles-list', 'instances-app-profiles-patch', 'instances-clusters-backups-copy', 'instances-clusters-backups-create', 'instances-clusters-backups-delete', 'instances-clusters-backups-get', 'instances-clusters-backups-get-iam-policy', 'instances-clusters-backups-list', 'instances-clusters-backups-patch', 'instances-clusters-backups-set-iam-policy', 'instances-clusters-backups-test-iam-permissions', 'instances-clusters-create', 'instances-clusters-delete', 'instances-clusters-get', 'instances-clusters-hot-tablets-list', 'instances-clusters-list', 'instances-clusters-partial-update-cluster', 'instances-clusters-update', 'instances-create', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-partial-update-instance', 'instances-set-iam-policy', 'instances-tables-check-consistency', 'instances-tables-create', 'instances-tables-delete', 'instances-tables-drop-row-range', 'instances-tables-generate-consistency-token', 'instances-tables-get', 'instances-tables-get-iam-policy', 'instances-tables-list', 'instances-tables-modify-column-families', 'instances-tables-patch', 'instances-tables-restore', 'instances-tables-set-iam-policy', 'instances-tables-test-iam-permissions', 'instances-tables-undelete', 'instances-test-iam-permissions', 'instances-update' and 'locations-list'", vec![
|
|
|
|
|
("projects", "methods: 'instances-app-profiles-create', 'instances-app-profiles-delete', 'instances-app-profiles-get', 'instances-app-profiles-list', 'instances-app-profiles-patch', 'instances-clusters-backups-copy', 'instances-clusters-backups-create', 'instances-clusters-backups-delete', 'instances-clusters-backups-get', 'instances-clusters-backups-get-iam-policy', 'instances-clusters-backups-list', 'instances-clusters-backups-patch', 'instances-clusters-backups-set-iam-policy', 'instances-clusters-backups-test-iam-permissions', 'instances-clusters-create', 'instances-clusters-delete', 'instances-clusters-get', 'instances-clusters-hot-tablets-list', 'instances-clusters-list', 'instances-clusters-partial-update-cluster', 'instances-clusters-update', 'instances-create', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-partial-update-instance', 'instances-set-iam-policy', 'instances-tables-authorized-views-create', 'instances-tables-authorized-views-delete', 'instances-tables-authorized-views-get', 'instances-tables-authorized-views-get-iam-policy', 'instances-tables-authorized-views-list', 'instances-tables-authorized-views-patch', 'instances-tables-authorized-views-set-iam-policy', 'instances-tables-authorized-views-test-iam-permissions', 'instances-tables-check-consistency', 'instances-tables-create', 'instances-tables-delete', 'instances-tables-drop-row-range', 'instances-tables-generate-consistency-token', 'instances-tables-get', 'instances-tables-get-iam-policy', 'instances-tables-list', 'instances-tables-modify-column-families', 'instances-tables-patch', 'instances-tables-restore', 'instances-tables-set-iam-policy', 'instances-tables-test-iam-permissions', 'instances-tables-undelete', 'instances-test-iam-permissions', 'instances-update' and 'locations-list'", vec![
|
|
|
|
|
("instances-app-profiles-create",
|
|
|
|
|
Some(r##"Creates an app profile within an instance."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-app-profiles-create",
|
|
|
|
|
@@ -4636,6 +5284,212 @@ 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)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-create",
|
|
|
|
|
Some(r##"Creates a new AuthorizedView in a table."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-create",
|
|
|
|
|
vec![
|
|
|
|
|
(Some(r##"parent"##),
|
|
|
|
|
None,
|
|
|
|
|
Some(r##"Required. This is the name of the table the AuthorizedView belongs to. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`."##),
|
|
|
|
|
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)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-delete",
|
|
|
|
|
Some(r##"Permanently deletes a specified AuthorizedView."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-delete",
|
|
|
|
|
vec![
|
|
|
|
|
(Some(r##"name"##),
|
|
|
|
|
None,
|
|
|
|
|
Some(r##"Required. The unique name of the AuthorizedView to be deleted. Values are of the form `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`."##),
|
|
|
|
|
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"##),
|
|
|
|
|
Some(false),
|
|
|
|
|
Some(false)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-get",
|
|
|
|
|
Some(r##"Gets information from a specified AuthorizedView."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-get",
|
|
|
|
|
vec![
|
|
|
|
|
(Some(r##"name"##),
|
|
|
|
|
None,
|
|
|
|
|
Some(r##"Required. The unique name of the requested AuthorizedView. Values are of the form `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`."##),
|
|
|
|
|
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"##),
|
|
|
|
|
Some(false),
|
|
|
|
|
Some(false)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-get-iam-policy",
|
|
|
|
|
Some(r##"Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-get-iam-policy",
|
|
|
|
|
vec for the appropriate value for this field."##),
|
|
|
|
|
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)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-list",
|
|
|
|
|
Some(r##"Lists all AuthorizedViews from a specific table."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-list",
|
|
|
|
|
vec![
|
|
|
|
|
(Some(r##"parent"##),
|
|
|
|
|
None,
|
|
|
|
|
Some(r##"Required. The unique name of the table for which AuthorizedViews should be listed. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`."##),
|
|
|
|
|
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"##),
|
|
|
|
|
Some(false),
|
|
|
|
|
Some(false)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-patch",
|
|
|
|
|
Some(r##"Updates an AuthorizedView in a table."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-patch",
|
|
|
|
|
vec![
|
|
|
|
|
(Some(r##"name"##),
|
|
|
|
|
None,
|
|
|
|
|
Some(r##"Identifier. The name of this AuthorizedView. Values are of the form `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`"##),
|
|
|
|
|
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)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-set-iam-policy",
|
|
|
|
|
Some(r##"Sets the access control policy on a Table or Backup resource. Replaces any existing policy."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-set-iam-policy",
|
|
|
|
|
vec for the appropriate value for this field."##),
|
|
|
|
|
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)),
|
|
|
|
|
]),
|
|
|
|
|
("instances-tables-authorized-views-test-iam-permissions",
|
|
|
|
|
Some(r##"Returns permissions that the caller has on the specified Table or Backup resource."##),
|
|
|
|
|
"Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-authorized-views-test-iam-permissions",
|
|
|
|
|
vec for the appropriate value for this field."##),
|
|
|
|
|
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"##),
|
|
|
|
|
@@ -5100,7 +5954,7 @@ async fn main() {
|
|
|
|
|
|
|
|
|
|
let mut app = App::new("bigtableadmin2")
|
|
|
|
|
.author("Sebastian Thiel <byronimo@gmail.com>")
|
|
|
|
|
.version("5.0.4+20240221")
|
|
|
|
|
.version("5.0.5+20240331")
|
|
|
|
|
.about("Administer your Cloud Bigtable tables and instances.")
|
|
|
|
|
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli")
|
|
|
|
|
.arg(Arg::with_name("url")
|
|
|
|
|
@@ -5164,6 +6018,7 @@ async fn main() {
|
|
|
|
|
|
|
|
|
|
let debug = matches.is_present("adebug");
|
|
|
|
|
let connector = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots()
|
|
|
|
|
.unwrap()
|
|
|
|
|
.https_or_http()
|
|
|
|
|
.enable_http1()
|
|
|
|
|
.build();
|
|
|
|
|
|