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 UpdateDocumentMetadataInput {
    /// <p>The name of the change template for which a version's metadata is to be updated.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The version of a change template in which to update approval metadata.</p>
    pub document_version: ::std::option::Option<::std::string::String>,
    /// <p>The change template review details to update.</p>
    pub document_reviews: ::std::option::Option<crate::types::DocumentReviews>,
}
impl UpdateDocumentMetadataInput {
    /// <p>The name of the change template for which a version's metadata is to be updated.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The version of a change template in which to update approval metadata.</p>
    pub fn document_version(&self) -> ::std::option::Option<&str> {
        self.document_version.as_deref()
    }
    /// <p>The change template review details to update.</p>
    pub fn document_reviews(&self) -> ::std::option::Option<&crate::types::DocumentReviews> {
        self.document_reviews.as_ref()
    }
}
static UPDATEDOCUMENTMETADATAINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#UpdateDocumentMetadataInput$Name",
        "com.amazonaws.ssm.synthetic",
        "UpdateDocumentMetadataInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Name",
    0,
);
static UPDATEDOCUMENTMETADATAINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#UpdateDocumentMetadataInput$DocumentVersion",
        "com.amazonaws.ssm.synthetic",
        "UpdateDocumentMetadataInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DocumentVersion",
    1,
);
static UPDATEDOCUMENTMETADATAINPUT_MEMBER_DOCUMENT_REVIEWS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#UpdateDocumentMetadataInput$DocumentReviews",
        "com.amazonaws.ssm.synthetic",
        "UpdateDocumentMetadataInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    "DocumentReviews",
    2,
);
static UPDATEDOCUMENTMETADATAINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#UpdateDocumentMetadataInput",
        "com.amazonaws.ssm.synthetic",
        "UpdateDocumentMetadataInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &UPDATEDOCUMENTMETADATAINPUT_MEMBER_NAME,
        &UPDATEDOCUMENTMETADATAINPUT_MEMBER_DOCUMENT_VERSION,
        &UPDATEDOCUMENTMETADATAINPUT_MEMBER_DOCUMENT_REVIEWS,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("UpdateDocumentMetadataRequest");
impl UpdateDocumentMetadataInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &UPDATEDOCUMENTMETADATAINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateDocumentMetadataInput {
    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(&UPDATEDOCUMENTMETADATAINPUT_MEMBER_NAME, val)?;
        }
        if let Some(ref val) = self.document_version {
            ser.write_string(&UPDATEDOCUMENTMETADATAINPUT_MEMBER_DOCUMENT_VERSION, val)?;
        }
        if let Some(ref val) = self.document_reviews {
            ser.write_struct(&UPDATEDOCUMENTMETADATAINPUT_MEMBER_DOCUMENT_REVIEWS, val)?;
        }
        Ok(())
    }
}
impl crate::operation::update_document_metadata::builders::UpdateDocumentMetadataInputBuilder {
    #[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(&UPDATEDOCUMENTMETADATAINPUT_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.document_version = Some(deser.read_string(member)?);
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.document_reviews = Some(crate::types::DocumentReviews::deserialize(deser)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl UpdateDocumentMetadataInput {
    /// 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 UpdateDocumentMetadataInput {
    /// Creates a new builder-style object to manufacture [`UpdateDocumentMetadataInput`](crate::operation::update_document_metadata::UpdateDocumentMetadataInput).
    pub fn builder() -> crate::operation::update_document_metadata::builders::UpdateDocumentMetadataInputBuilder {
        crate::operation::update_document_metadata::builders::UpdateDocumentMetadataInputBuilder::default()
    }
}

/// A builder for [`UpdateDocumentMetadataInput`](crate::operation::update_document_metadata::UpdateDocumentMetadataInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateDocumentMetadataInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
    pub(crate) document_reviews: ::std::option::Option<crate::types::DocumentReviews>,
}
impl UpdateDocumentMetadataInputBuilder {
    /// <p>The name of the change template for which a version's metadata is to be updated.</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 of the change template for which a version's metadata is to be updated.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the change template for which a version's metadata is to be updated.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The version of a change template in which to update approval metadata.</p>
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of a change template in which to update approval metadata.</p>
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document_version = input;
        self
    }
    /// <p>The version of a change template in which to update approval metadata.</p>
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_version
    }
    /// <p>The change template review details to update.</p>
    /// This field is required.
    pub fn document_reviews(mut self, input: crate::types::DocumentReviews) -> Self {
        self.document_reviews = ::std::option::Option::Some(input);
        self
    }
    /// <p>The change template review details to update.</p>
    pub fn set_document_reviews(mut self, input: ::std::option::Option<crate::types::DocumentReviews>) -> Self {
        self.document_reviews = input;
        self
    }
    /// <p>The change template review details to update.</p>
    pub fn get_document_reviews(&self) -> &::std::option::Option<crate::types::DocumentReviews> {
        &self.document_reviews
    }
    /// Consumes the builder and constructs a [`UpdateDocumentMetadataInput`](crate::operation::update_document_metadata::UpdateDocumentMetadataInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_document_metadata::UpdateDocumentMetadataInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_document_metadata::UpdateDocumentMetadataInput {
            name: self.name,
            document_version: self.document_version,
            document_reviews: self.document_reviews,
        })
    }
}