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 DeleteDocumentInput {
    /// <p>The name of the document.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub document_version: ::std::option::Option<::std::string::String>,
    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub version_name: ::std::option::Option<::std::string::String>,
    /// <p>Some SSM document types require that you specify a <code>Force</code> flag before you can delete the document. For example, you must specify a <code>Force</code> flag to delete a document of type <code>ApplicationConfigurationSchema</code>. You can restrict access to the <code>Force</code> flag in an Identity and Access Management (IAM) policy.</p>
    pub force: ::std::option::Option<bool>,
}
impl DeleteDocumentInput {
    /// <p>The name of the document.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub fn document_version(&self) -> ::std::option::Option<&str> {
        self.document_version.as_deref()
    }
    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub fn version_name(&self) -> ::std::option::Option<&str> {
        self.version_name.as_deref()
    }
    /// <p>Some SSM document types require that you specify a <code>Force</code> flag before you can delete the document. For example, you must specify a <code>Force</code> flag to delete a document of type <code>ApplicationConfigurationSchema</code>. You can restrict access to the <code>Force</code> flag in an Identity and Access Management (IAM) policy.</p>
    pub fn force(&self) -> ::std::option::Option<bool> {
        self.force
    }
}
static DELETEDOCUMENTINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteDocumentInput$Name",
        "com.amazonaws.ssm.synthetic",
        "DeleteDocumentInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Name",
    0,
);
static DELETEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteDocumentInput$DocumentVersion",
        "com.amazonaws.ssm.synthetic",
        "DeleteDocumentInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DocumentVersion",
    1,
);
static DELETEDOCUMENTINPUT_MEMBER_VERSION_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteDocumentInput$VersionName",
        "com.amazonaws.ssm.synthetic",
        "DeleteDocumentInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "VersionName",
    2,
);
static DELETEDOCUMENTINPUT_MEMBER_FORCE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteDocumentInput$Force",
        "com.amazonaws.ssm.synthetic",
        "DeleteDocumentInput",
    ),
    ::aws_smithy_schema::ShapeType::Boolean,
    "Force",
    3,
);
static DELETEDOCUMENTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteDocumentInput",
        "com.amazonaws.ssm.synthetic",
        "DeleteDocumentInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &DELETEDOCUMENTINPUT_MEMBER_NAME,
        &DELETEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION,
        &DELETEDOCUMENTINPUT_MEMBER_VERSION_NAME,
        &DELETEDOCUMENTINPUT_MEMBER_FORCE,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DeleteDocumentRequest");
impl DeleteDocumentInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DELETEDOCUMENTINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DeleteDocumentInput {
    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(&DELETEDOCUMENTINPUT_MEMBER_NAME, val)?;
        }
        if let Some(ref val) = self.document_version {
            ser.write_string(&DELETEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION, val)?;
        }
        if let Some(ref val) = self.version_name {
            ser.write_string(&DELETEDOCUMENTINPUT_MEMBER_VERSION_NAME, val)?;
        }
        if let Some(ref val) = self.force {
            ser.write_boolean(&DELETEDOCUMENTINPUT_MEMBER_FORCE, *val)?;
        }
        Ok(())
    }
}
impl crate::operation::delete_document::builders::DeleteDocumentInputBuilder {
    #[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(&DELETEDOCUMENTINPUT_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.version_name = Some(deser.read_string(member)?);
                    }
                }
                Some(3) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.force = Some(deser.read_boolean(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

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

/// A builder for [`DeleteDocumentInput`](crate::operation::delete_document::DeleteDocumentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeleteDocumentInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
    pub(crate) force: ::std::option::Option<bool>,
}
impl DeleteDocumentInputBuilder {
    /// <p>The name of the document.</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 document.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the document.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</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 the document that you want to delete. If not provided, all versions of the document are deleted.</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 the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_version
    }
    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.version_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version_name = input;
        self
    }
    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.version_name
    }
    /// <p>Some SSM document types require that you specify a <code>Force</code> flag before you can delete the document. For example, you must specify a <code>Force</code> flag to delete a document of type <code>ApplicationConfigurationSchema</code>. You can restrict access to the <code>Force</code> flag in an Identity and Access Management (IAM) policy.</p>
    pub fn force(mut self, input: bool) -> Self {
        self.force = ::std::option::Option::Some(input);
        self
    }
    /// <p>Some SSM document types require that you specify a <code>Force</code> flag before you can delete the document. For example, you must specify a <code>Force</code> flag to delete a document of type <code>ApplicationConfigurationSchema</code>. You can restrict access to the <code>Force</code> flag in an Identity and Access Management (IAM) policy.</p>
    pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
        self.force = input;
        self
    }
    /// <p>Some SSM document types require that you specify a <code>Force</code> flag before you can delete the document. For example, you must specify a <code>Force</code> flag to delete a document of type <code>ApplicationConfigurationSchema</code>. You can restrict access to the <code>Force</code> flag in an Identity and Access Management (IAM) policy.</p>
    pub fn get_force(&self) -> &::std::option::Option<bool> {
        &self.force
    }
    /// Consumes the builder and constructs a [`DeleteDocumentInput`](crate::operation::delete_document::DeleteDocumentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::delete_document::DeleteDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::delete_document::DeleteDocumentInput {
            name: self.name,
            document_version: self.document_version,
            version_name: self.version_name,
            force: self.force,
        })
    }
}