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.

/// <p>An Amazon Web Services Systems Manager parameter in Parameter Store.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Parameter {
    /// <p>The name of the parameter.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub r#type: ::std::option::Option<crate::types::ParameterType>,
    /// <p>The parameter value.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub value: ::std::option::Option<::std::string::String>,
    /// <p>The parameter version.</p>
    pub version: i64,
    /// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
    /// <p>parameter_name:version</p>
    /// <p>parameter_name:label</p>
    pub selector: ::std::option::Option<::std::string::String>,
    /// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
    pub source_result: ::std::option::Option<::std::string::String>,
    /// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Resource Name (ARN) of the parameter.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
    pub data_type: ::std::option::Option<::std::string::String>,
}
impl Parameter {
    /// <p>The name of the parameter.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ParameterType> {
        self.r#type.as_ref()
    }
    /// <p>The parameter value.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn value(&self) -> ::std::option::Option<&str> {
        self.value.as_deref()
    }
    /// <p>The parameter version.</p>
    pub fn version(&self) -> i64 {
        self.version
    }
    /// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
    /// <p>parameter_name:version</p>
    /// <p>parameter_name:label</p>
    pub fn selector(&self) -> ::std::option::Option<&str> {
        self.selector.as_deref()
    }
    /// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
    pub fn source_result(&self) -> ::std::option::Option<&str> {
        self.source_result.as_deref()
    }
    /// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_date.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the parameter.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
    pub fn data_type(&self) -> ::std::option::Option<&str> {
        self.data_type.as_deref()
    }
}
impl ::std::fmt::Debug for Parameter {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Parameter");
        formatter.field("name", &self.name);
        formatter.field("r#type", &self.r#type);
        formatter.field("value", &"*** Sensitive Data Redacted ***");
        formatter.field("version", &self.version);
        formatter.field("selector", &self.selector);
        formatter.field("source_result", &self.source_result);
        formatter.field("last_modified_date", &self.last_modified_date);
        formatter.field("arn", &self.arn);
        formatter.field("data_type", &self.data_type);
        formatter.finish()
    }
}
impl Parameter {
    /// Creates a new builder-style object to manufacture [`Parameter`](crate::types::Parameter).
    pub fn builder() -> crate::types::builders::ParameterBuilder {
        crate::types::builders::ParameterBuilder::default()
    }
}

/// A builder for [`Parameter`](crate::types::Parameter).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ParameterBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::ParameterType>,
    pub(crate) value: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<i64>,
    pub(crate) selector: ::std::option::Option<::std::string::String>,
    pub(crate) source_result: ::std::option::Option<::std::string::String>,
    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) data_type: ::std::option::Option<::std::string::String>,
}
impl ParameterBuilder {
    /// <p>The name of the parameter.</p>
    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 name of the parameter.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the parameter.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn r#type(mut self, input: crate::types::ParameterType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ParameterType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ParameterType> {
        &self.r#type
    }
    /// <p>The parameter value.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The parameter value.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value = input;
        self
    }
    /// <p>The parameter value.</p><note>
    /// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
    /// </note>
    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.value
    }
    /// <p>The parameter version.</p>
    pub fn version(mut self, input: i64) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The parameter version.</p>
    pub fn set_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.version = input;
        self
    }
    /// <p>The parameter version.</p>
    pub fn get_version(&self) -> &::std::option::Option<i64> {
        &self.version
    }
    /// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
    /// <p>parameter_name:version</p>
    /// <p>parameter_name:label</p>
    pub fn selector(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.selector = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
    /// <p>parameter_name:version</p>
    /// <p>parameter_name:label</p>
    pub fn set_selector(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.selector = input;
        self
    }
    /// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
    /// <p>parameter_name:version</p>
    /// <p>parameter_name:label</p>
    pub fn get_selector(&self) -> &::std::option::Option<::std::string::String> {
        &self.selector
    }
    /// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
    pub fn source_result(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_result = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
    pub fn set_source_result(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_result = input;
        self
    }
    /// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
    pub fn get_source_result(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_result
    }
    /// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_date = input;
        self
    }
    /// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_date
    }
    /// <p>The Amazon Resource Name (ARN) of the parameter.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the parameter.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the parameter.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
    pub fn data_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.data_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
    pub fn set_data_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.data_type = input;
        self
    }
    /// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
    pub fn get_data_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_type
    }
    /// Consumes the builder and constructs a [`Parameter`](crate::types::Parameter).
    pub fn build(self) -> crate::types::Parameter {
        crate::types::Parameter {
            name: self.name,
            r#type: self.r#type,
            value: self.value,
            version: self.version.unwrap_or_default(),
            selector: self.selector,
            source_result: self.source_result,
            last_modified_date: self.last_modified_date,
            arn: self.arn,
            data_type: self.data_type,
        }
    }
}
impl ::std::fmt::Debug for ParameterBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ParameterBuilder");
        formatter.field("name", &self.name);
        formatter.field("r#type", &self.r#type);
        formatter.field("value", &"*** Sensitive Data Redacted ***");
        formatter.field("version", &self.version);
        formatter.field("selector", &self.selector);
        formatter.field("source_result", &self.source_result);
        formatter.field("last_modified_date", &self.last_modified_date);
        formatter.field("arn", &self.arn);
        formatter.field("data_type", &self.data_type);
        formatter.finish()
    }
}