Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,22 +352,38 @@ impl ClusterCommand {

// Set Request.labels data
if let Some(arg) = &self.labels {
ep_builder.labels(arg.iter().cloned());
let mut data: Vec<(String, create::Labels)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels(data.into_iter());
}

// Set Request.labels_added data
if let Some(arg) = &self.labels_added {
ep_builder.labels_added(arg.iter().cloned());
let mut data: Vec<(String, create::LabelsAdded)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels_added(data.into_iter());
}

// Set Request.labels_overridden data
if let Some(arg) = &self.labels_overridden {
ep_builder.labels_overridden(arg.iter().cloned());
let mut data: Vec<(String, create::LabelsOverridden)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels_overridden(data.into_iter());
}

// Set Request.labels_skipped data
if let Some(arg) = &self.labels_skipped {
ep_builder.labels_skipped(arg.iter().cloned());
let mut data: Vec<(String, create::LabelsSkipped)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels_skipped(data.into_iter());
}

// Set Request.links data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,38 @@ impl NodegroupCommand {

// Set Request.labels data
if let Some(arg) = &self.labels {
ep_builder.labels(arg.iter().cloned());
let mut data: Vec<(String, create::Labels)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels(data.into_iter());
}

// Set Request.labels_added data
if let Some(arg) = &self.labels_added {
ep_builder.labels_added(arg.iter().cloned());
let mut data: Vec<(String, create::LabelsAdded)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels_added(data.into_iter());
}

// Set Request.labels_overridden data
if let Some(arg) = &self.labels_overridden {
ep_builder.labels_overridden(arg.iter().cloned());
let mut data: Vec<(String, create::LabelsOverridden)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels_overridden(data.into_iter());
}

// Set Request.labels_skipped data
if let Some(arg) = &self.labels_skipped {
ep_builder.labels_skipped(arg.iter().cloned());
let mut data: Vec<(String, create::LabelsSkipped)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels_skipped(data.into_iter());
}

// Set Request.links data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,11 @@ impl ClustertemplateCommand {

// Set Request.labels data
if let Some(arg) = &self.labels {
ep_builder.labels(arg.iter().cloned());
let mut data: Vec<(String, create::Labels)> = Vec::new();
for (k, v) in arg.iter() {
data.push((k.clone(), serde_json::from_str(v)?));
}
ep_builder.labels(data.into_iter());
}

// Set Request.links data
Expand Down
3 changes: 2 additions & 1 deletion openstack_cli/src/dns/v2/zone/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ pub struct ZoneCommand {
#[arg(help_heading = "Body parameters", long)]
description: Option<String>,

/// e-mail for the zone. Used in SOA records for the zone
/// e-mail for the zone. Used in SOA records for the zone. Mandatory for
/// PRIMARY zones, forbidden for SECONDARY zones.
#[arg(help_heading = "Body parameters", long)]
email: Option<String>,

Expand Down
3 changes: 2 additions & 1 deletion openstack_cli/src/dns/v2/zone/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ pub struct ZoneCommand {
#[arg(help_heading = "Body parameters", long)]
description: Option<String>,

/// e-mail for the zone. Used in SOA records for the zone
/// e-mail for the zone. Used in SOA records for the zone. Forbidden for
/// SECONDARY zones.
#[arg(help_heading = "Body parameters", long)]
email: Option<String>,

Expand Down
6 changes: 3 additions & 3 deletions openstack_cli/src/identity/v3/endpoint/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ struct Endpoint {
#[arg(help_heading = "Body parameters", long, action = clap::ArgAction::SetTrue, conflicts_with = "description")]
no_description: bool,

/// Indicates whether the endpoint appears in the service catalog -false.
/// The endpoint does not appear in the service catalog. -true. The
/// endpoint appears in the service catalog.
/// Indicates whether the endpoint appears in the service catalog: -
/// `false`. The endpoint does not appear in the service catalog. - `true`.
/// The endpoint appears in the service catalog.
#[arg(action=clap::ArgAction::Set, help_heading = "Body parameters", long)]
enabled: Option<bool>,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use openstack_types::identity::v3::os_federation::identity_provider::protocol::r

/// Create protocol for an IDP.
///
/// PUT /OS-Federation/identity_providers/{idp_id}/protocols/{protocol_id}
/// PUT /OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}
#[derive(Args)]
pub struct ProtocolCommand {
/// Request Query parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ struct Protocol {

#[arg(help_heading = "Body parameters", long)]
remote_id_attribute: Option<String>,

/// Set explicit NULL for the remote_id_attribute
#[arg(help_heading = "Body parameters", long, action = clap::ArgAction::SetTrue, conflicts_with = "remote_id_attribute")]
no_remote_id_attribute: bool,
}

impl ProtocolCommand {
Expand Down Expand Up @@ -119,9 +115,7 @@ impl ProtocolCommand {
protocol_builder.mapping_id(&args.mapping_id);

if let Some(val) = &args.remote_id_attribute {
protocol_builder.remote_id_attribute(Some(val.into()));
} else if args.no_remote_id_attribute {
protocol_builder.remote_id_attribute(None);
protocol_builder.remote_id_attribute(val);
}

ep_builder.protocol(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ pub enum HealthStatus {
Unknown,
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum Labels<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum LabelsAdded<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum LabelsOverridden<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum LabelsSkipped<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

/// A link representation.
#[derive(Builder, Debug, Deserialize, Clone, Serialize)]
#[builder(setter(strip_option))]
Expand Down Expand Up @@ -191,16 +223,16 @@ pub struct Request<'a> {
/// way to pass additional parameters that are specific to a cluster
/// driver.
#[builder(default, private, setter(into, name = "_labels"))]
pub(crate) labels: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels: Option<BTreeMap<Cow<'a, str>, Labels<'a>>>,

#[builder(default, private, setter(into, name = "_labels_added"))]
pub(crate) labels_added: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels_added: Option<BTreeMap<Cow<'a, str>, LabelsAdded<'a>>>,

#[builder(default, private, setter(into, name = "_labels_overridden"))]
pub(crate) labels_overridden: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels_overridden: Option<BTreeMap<Cow<'a, str>, LabelsOverridden<'a>>>,

#[builder(default, private, setter(into, name = "_labels_skipped"))]
pub(crate) labels_skipped: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels_skipped: Option<BTreeMap<Cow<'a, str>, LabelsSkipped<'a>>>,

#[builder(default, setter(into))]
pub(crate) links: Option<Vec<Links<'a>>>,
Expand Down Expand Up @@ -310,7 +342,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<Labels<'a>>,
{
self.labels
.get_or_insert(None)
Expand All @@ -323,7 +355,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<LabelsAdded<'a>>,
{
self.labels_added
.get_or_insert(None)
Expand All @@ -336,7 +368,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<LabelsOverridden<'a>>,
{
self.labels_overridden
.get_or_insert(None)
Expand All @@ -349,7 +381,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<LabelsSkipped<'a>>,
{
self.labels_skipped
.get_or_insert(None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,38 @@ use serde::Serialize;
use std::borrow::Cow;
use std::collections::BTreeMap;

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum Labels<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum LabelsAdded<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum LabelsOverridden<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum LabelsSkipped<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

/// A link representation.
#[derive(Builder, Debug, Deserialize, Clone, Serialize)]
#[builder(setter(strip_option))]
Expand Down Expand Up @@ -124,16 +156,16 @@ pub struct Request<'a> {
pub(crate) is_default: Option<Cow<'a, str>>,

#[builder(default, private, setter(into, name = "_labels"))]
pub(crate) labels: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels: Option<BTreeMap<Cow<'a, str>, Labels<'a>>>,

#[builder(default, private, setter(into, name = "_labels_added"))]
pub(crate) labels_added: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels_added: Option<BTreeMap<Cow<'a, str>, LabelsAdded<'a>>>,

#[builder(default, private, setter(into, name = "_labels_overridden"))]
pub(crate) labels_overridden: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels_overridden: Option<BTreeMap<Cow<'a, str>, LabelsOverridden<'a>>>,

#[builder(default, private, setter(into, name = "_labels_skipped"))]
pub(crate) labels_skipped: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels_skipped: Option<BTreeMap<Cow<'a, str>, LabelsSkipped<'a>>>,

#[builder(default, setter(into))]
pub(crate) links: Option<Vec<Links<'a>>>,
Expand Down Expand Up @@ -195,7 +227,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<Labels<'a>>,
{
self.labels
.get_or_insert(None)
Expand All @@ -208,7 +240,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<LabelsAdded<'a>>,
{
self.labels_added
.get_or_insert(None)
Expand All @@ -221,7 +253,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<LabelsOverridden<'a>>,
{
self.labels_overridden
.get_or_insert(None)
Expand All @@ -234,7 +266,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<LabelsSkipped<'a>>,
{
self.labels_skipped
.get_or_insert(None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ pub enum Coe {
Kubernetes,
}

#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(untagged)]
pub enum Labels<'a> {
F1(bool),
F2(i32),
F3(Cow<'a, str>),
}

/// A link representation.
#[derive(Builder, Debug, Deserialize, Clone, Serialize)]
#[builder(setter(strip_option))]
Expand Down Expand Up @@ -185,7 +193,7 @@ pub struct Request<'a> {
/// way to pass additional parameters that are specific to a cluster
/// driver.
#[builder(default, private, setter(into, name = "_labels"))]
pub(crate) labels: Option<BTreeMap<Cow<'a, str>, Cow<'a, str>>>,
pub(crate) labels: Option<BTreeMap<Cow<'a, str>, Labels<'a>>>,

#[builder(default, setter(into))]
pub(crate) links: Option<Vec<Links<'a>>>,
Expand Down Expand Up @@ -290,7 +298,7 @@ impl<'a> RequestBuilder<'a> {
where
I: Iterator<Item = (K, V)>,
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
V: Into<Labels<'a>>,
{
self.labels
.get_or_insert(None)
Expand Down
3 changes: 2 additions & 1 deletion openstack_sdk/src/api/dns/v2/zone/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ pub struct Request<'a> {
#[builder(default, setter(into))]
pub(crate) description: Option<Cow<'a, str>>,

/// e-mail for the zone. Used in SOA records for the zone
/// e-mail for the zone. Used in SOA records for the zone. Mandatory for
/// PRIMARY zones, forbidden for SECONDARY zones.
#[builder(default, setter(into))]
pub(crate) email: Option<Cow<'a, str>>,

Expand Down
Loading
Loading