aws-sdk-ssm 1.112.0

AWS SDK for Amazon Simple Systems Manager (SSM)
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct LabelParameterVersionInput {
    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
    /// </note>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
    pub parameter_version: ::std::option::Option<i64>,
    /// <p>One or more labels to attach to the specified parameter version.</p>
    pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl LabelParameterVersionInput {
    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
    /// </note>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
    pub fn parameter_version(&self) -> ::std::option::Option<i64> {
        self.parameter_version
    }
    /// <p>One or more labels to attach to the specified parameter version.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.labels.is_none()`.
    pub fn labels(&self) -> &[::std::string::String] {
        self.labels.as_deref().unwrap_or_default()
    }
}
impl LabelParameterVersionInput {
    /// Creates a new builder-style object to manufacture [`LabelParameterVersionInput`](crate::operation::label_parameter_version::LabelParameterVersionInput).
    pub fn builder() -> crate::operation::label_parameter_version::builders::LabelParameterVersionInputBuilder {
        crate::operation::label_parameter_version::builders::LabelParameterVersionInputBuilder::default()
    }
}

/// A builder for [`LabelParameterVersionInput`](crate::operation::label_parameter_version::LabelParameterVersionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LabelParameterVersionInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) parameter_version: ::std::option::Option<i64>,
    pub(crate) labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl LabelParameterVersionInputBuilder {
    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
    /// </note>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
    /// </note>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
    /// </note>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
    pub fn parameter_version(mut self, input: i64) -> Self {
        self.parameter_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
    pub fn set_parameter_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.parameter_version = input;
        self
    }
    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
    pub fn get_parameter_version(&self) -> &::std::option::Option<i64> {
        &self.parameter_version
    }
    /// Appends an item to `labels`.
    ///
    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
    ///
    /// <p>One or more labels to attach to the specified parameter version.</p>
    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.labels.unwrap_or_default();
        v.push(input.into());
        self.labels = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or more labels to attach to the specified parameter version.</p>
    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.labels = input;
        self
    }
    /// <p>One or more labels to attach to the specified parameter version.</p>
    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.labels
    }
    /// Consumes the builder and constructs a [`LabelParameterVersionInput`](crate::operation::label_parameter_version::LabelParameterVersionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::label_parameter_version::LabelParameterVersionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::label_parameter_version::LabelParameterVersionInput {
            name: self.name,
            parameter_version: self.parameter_version,
            labels: self.labels,
        })
    }
}