aws-sdk-ssm 1.131.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 GetParameterInput {
    /// <p>The name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.</p>
    /// <p>To query by parameter label, use <code>"Name": "name:label"</code>. To query by parameter version, use <code>"Name": "name:version"</code>.</p>
    /// <p>For more information about shared parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>Return decrypted values for secure string parameters. This flag is ignored for <code>String</code> and <code>StringList</code> parameter types.</p>
    pub with_decryption: ::std::option::Option<bool>,
}
impl GetParameterInput {
    /// <p>The name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.</p>
    /// <p>To query by parameter label, use <code>"Name": "name:label"</code>. To query by parameter version, use <code>"Name": "name:version"</code>.</p>
    /// <p>For more information about shared parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Return decrypted values for secure string parameters. This flag is ignored for <code>String</code> and <code>StringList</code> parameter types.</p>
    pub fn with_decryption(&self) -> ::std::option::Option<bool> {
        self.with_decryption
    }
}
static GETPARAMETERINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetParameterInput$Name",
        "com.amazonaws.ssm.synthetic",
        "GetParameterInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Name",
    0,
);
static GETPARAMETERINPUT_MEMBER_WITH_DECRYPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetParameterInput$WithDecryption",
        "com.amazonaws.ssm.synthetic",
        "GetParameterInput",
    ),
    ::aws_smithy_schema::ShapeType::Boolean,
    "WithDecryption",
    1,
);
static GETPARAMETERINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetParameterInput",
        "com.amazonaws.ssm.synthetic",
        "GetParameterInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&GETPARAMETERINPUT_MEMBER_NAME, &GETPARAMETERINPUT_MEMBER_WITH_DECRYPTION],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("GetParameterRequest");
impl GetParameterInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETPARAMETERINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetParameterInput {
    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
        Self::SCHEMA
    }

    #[allow(unused_variables, clippy::diverging_sub_expression)]
    fn serialize_members(
        &self,
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        if let Some(ref val) = self.name {
            ser.write_string(&GETPARAMETERINPUT_MEMBER_NAME, val)?;
        }
        if let Some(ref val) = self.with_decryption {
            ser.write_boolean(&GETPARAMETERINPUT_MEMBER_WITH_DECRYPTION, *val)?;
        }
        Ok(())
    }
}
impl crate::operation::get_parameter::builders::GetParameterInputBuilder {
    #[allow(
        unused_variables,
        unreachable_code,
        clippy::single_match,
        clippy::match_single_binding,
        clippy::diverging_sub_expression
    )]
    pub(crate) fn deserialize_members(
        &mut self,
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        deserializer.read_struct(&GETPARAMETERINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.name = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.with_decryption = Some(deser.read_boolean(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl GetParameterInput {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    pub fn deserialize(
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
        let mut builder = Self::builder();
        builder.deserialize_members(deserializer)?;
        builder.name = builder.name.or(Some(String::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl GetParameterInput {
    /// Creates a new builder-style object to manufacture [`GetParameterInput`](crate::operation::get_parameter::GetParameterInput).
    pub fn builder() -> crate::operation::get_parameter::builders::GetParameterInputBuilder {
        crate::operation::get_parameter::builders::GetParameterInputBuilder::default()
    }
}

/// A builder for [`GetParameterInput`](crate::operation::get_parameter::GetParameterInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetParameterInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) with_decryption: ::std::option::Option<bool>,
}
impl GetParameterInputBuilder {
    /// <p>The name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.</p>
    /// <p>To query by parameter label, use <code>"Name": "name:label"</code>. To query by parameter version, use <code>"Name": "name:version"</code>.</p>
    /// <p>For more information about shared parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
    /// 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 name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.</p>
    /// <p>To query by parameter label, use <code>"Name": "name:label"</code>. To query by parameter version, use <code>"Name": "name:version"</code>.</p>
    /// <p>For more information about shared parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the parameter that you want to query. For parameters shared with you from another account, you must use the full ARN.</p>
    /// <p>To query by parameter label, use <code>"Name": "name:label"</code>. To query by parameter version, use <code>"Name": "name:version"</code>.</p>
    /// <p>For more information about shared parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>Return decrypted values for secure string parameters. This flag is ignored for <code>String</code> and <code>StringList</code> parameter types.</p>
    pub fn with_decryption(mut self, input: bool) -> Self {
        self.with_decryption = ::std::option::Option::Some(input);
        self
    }
    /// <p>Return decrypted values for secure string parameters. This flag is ignored for <code>String</code> and <code>StringList</code> parameter types.</p>
    pub fn set_with_decryption(mut self, input: ::std::option::Option<bool>) -> Self {
        self.with_decryption = input;
        self
    }
    /// <p>Return decrypted values for secure string parameters. This flag is ignored for <code>String</code> and <code>StringList</code> parameter types.</p>
    pub fn get_with_decryption(&self) -> &::std::option::Option<bool> {
        &self.with_decryption
    }
    /// Consumes the builder and constructs a [`GetParameterInput`](crate::operation::get_parameter::GetParameterInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_parameter::GetParameterInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_parameter::GetParameterInput {
            name: self.name,
            with_decryption: self.with_decryption,
        })
    }
}