aws_sdk_ssm/operation/delete_document/
_delete_document_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteDocumentInput {
6    /// <p>The name of the document.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
9    pub document_version: ::std::option::Option<::std::string::String>,
10    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
11    pub version_name: ::std::option::Option<::std::string::String>,
12    /// <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>
13    pub force: ::std::option::Option<bool>,
14}
15impl DeleteDocumentInput {
16    /// <p>The name of the document.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
21    pub fn document_version(&self) -> ::std::option::Option<&str> {
22        self.document_version.as_deref()
23    }
24    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
25    pub fn version_name(&self) -> ::std::option::Option<&str> {
26        self.version_name.as_deref()
27    }
28    /// <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>
29    pub fn force(&self) -> ::std::option::Option<bool> {
30        self.force
31    }
32}
33impl DeleteDocumentInput {
34    /// Creates a new builder-style object to manufacture [`DeleteDocumentInput`](crate::operation::delete_document::DeleteDocumentInput).
35    pub fn builder() -> crate::operation::delete_document::builders::DeleteDocumentInputBuilder {
36        crate::operation::delete_document::builders::DeleteDocumentInputBuilder::default()
37    }
38}
39
40/// A builder for [`DeleteDocumentInput`](crate::operation::delete_document::DeleteDocumentInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct DeleteDocumentInputBuilder {
44    pub(crate) name: ::std::option::Option<::std::string::String>,
45    pub(crate) document_version: ::std::option::Option<::std::string::String>,
46    pub(crate) version_name: ::std::option::Option<::std::string::String>,
47    pub(crate) force: ::std::option::Option<bool>,
48}
49impl DeleteDocumentInputBuilder {
50    /// <p>The name of the document.</p>
51    /// This field is required.
52    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the document.</p>
57    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.name = input;
59        self
60    }
61    /// <p>The name of the document.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
66    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.document_version = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
71    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.document_version = input;
73        self
74    }
75    /// <p>The version of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
76    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
77        &self.document_version
78    }
79    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
80    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.version_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
85    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.version_name = input;
87        self
88    }
89    /// <p>The version name of the document that you want to delete. If not provided, all versions of the document are deleted.</p>
90    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.version_name
92    }
93    /// <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>
94    pub fn force(mut self, input: bool) -> Self {
95        self.force = ::std::option::Option::Some(input);
96        self
97    }
98    /// <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>
99    pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
100        self.force = input;
101        self
102    }
103    /// <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>
104    pub fn get_force(&self) -> &::std::option::Option<bool> {
105        &self.force
106    }
107    /// Consumes the builder and constructs a [`DeleteDocumentInput`](crate::operation::delete_document::DeleteDocumentInput).
108    pub fn build(
109        self,
110    ) -> ::std::result::Result<crate::operation::delete_document::DeleteDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::delete_document::DeleteDocumentInput {
112            name: self.name,
113            document_version: self.document_version,
114            version_name: self.version_name,
115            force: self.force,
116        })
117    }
118}