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 GetPatchBaselineInput {
    /// <p>The ID of the patch baseline to retrieve.</p><note>
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
    /// </note>
    pub baseline_id: ::std::option::Option<::std::string::String>,
}
impl GetPatchBaselineInput {
    /// <p>The ID of the patch baseline to retrieve.</p><note>
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
    /// </note>
    pub fn baseline_id(&self) -> ::std::option::Option<&str> {
        self.baseline_id.as_deref()
    }
}
static GETPATCHBASELINEINPUT_MEMBER_BASELINE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetPatchBaselineInput$BaselineId",
        "com.amazonaws.ssm.synthetic",
        "GetPatchBaselineInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "BaselineId",
    0,
);
static GETPATCHBASELINEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetPatchBaselineInput",
        "com.amazonaws.ssm.synthetic",
        "GetPatchBaselineInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&GETPATCHBASELINEINPUT_MEMBER_BASELINE_ID],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("GetPatchBaselineRequest");
impl GetPatchBaselineInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETPATCHBASELINEINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetPatchBaselineInput {
    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.baseline_id {
            ser.write_string(&GETPATCHBASELINEINPUT_MEMBER_BASELINE_ID, val)?;
        }
        Ok(())
    }
}
impl crate::operation::get_patch_baseline::builders::GetPatchBaselineInputBuilder {
    #[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(&GETPATCHBASELINEINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.baseline_id = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl GetPatchBaselineInput {
    /// 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.baseline_id = builder.baseline_id.or(Some(String::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl GetPatchBaselineInput {
    /// Creates a new builder-style object to manufacture [`GetPatchBaselineInput`](crate::operation::get_patch_baseline::GetPatchBaselineInput).
    pub fn builder() -> crate::operation::get_patch_baseline::builders::GetPatchBaselineInputBuilder {
        crate::operation::get_patch_baseline::builders::GetPatchBaselineInputBuilder::default()
    }
}

/// A builder for [`GetPatchBaselineInput`](crate::operation::get_patch_baseline::GetPatchBaselineInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetPatchBaselineInputBuilder {
    pub(crate) baseline_id: ::std::option::Option<::std::string::String>,
}
impl GetPatchBaselineInputBuilder {
    /// <p>The ID of the patch baseline to retrieve.</p><note>
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
    /// </note>
    /// This field is required.
    pub fn baseline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.baseline_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the patch baseline to retrieve.</p><note>
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
    /// </note>
    pub fn set_baseline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.baseline_id = input;
        self
    }
    /// <p>The ID of the patch baseline to retrieve.</p><note>
    /// <p>To retrieve information about an Amazon Web Services managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline <code>AWS-AmazonLinuxDefaultPatchBaseline</code>, specify <code>arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7</code> instead of <code>pb-0e392de35e7c563b7</code>.</p>
    /// </note>
    pub fn get_baseline_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.baseline_id
    }
    /// Consumes the builder and constructs a [`GetPatchBaselineInput`](crate::operation::get_patch_baseline::GetPatchBaselineInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_patch_baseline::GetPatchBaselineInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_patch_baseline::GetPatchBaselineInput {
            baseline_id: self.baseline_id,
        })
    }
}