aws_sdk_ssm/operation/get_document/
_get_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 GetDocumentInput {
6    /// <p>The name of the SSM document.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.</p>
9    pub version_name: ::std::option::Option<::std::string::String>,
10    /// <p>The document version for which you want information.</p>
11    pub document_version: ::std::option::Option<::std::string::String>,
12    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
13    pub document_format: ::std::option::Option<crate::types::DocumentFormat>,
14}
15impl GetDocumentInput {
16    /// <p>The name of the SSM document.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.</p>
21    pub fn version_name(&self) -> ::std::option::Option<&str> {
22        self.version_name.as_deref()
23    }
24    /// <p>The document version for which you want information.</p>
25    pub fn document_version(&self) -> ::std::option::Option<&str> {
26        self.document_version.as_deref()
27    }
28    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
29    pub fn document_format(&self) -> ::std::option::Option<&crate::types::DocumentFormat> {
30        self.document_format.as_ref()
31    }
32}
33impl GetDocumentInput {
34    /// Creates a new builder-style object to manufacture [`GetDocumentInput`](crate::operation::get_document::GetDocumentInput).
35    pub fn builder() -> crate::operation::get_document::builders::GetDocumentInputBuilder {
36        crate::operation::get_document::builders::GetDocumentInputBuilder::default()
37    }
38}
39
40/// A builder for [`GetDocumentInput`](crate::operation::get_document::GetDocumentInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetDocumentInputBuilder {
44    pub(crate) name: ::std::option::Option<::std::string::String>,
45    pub(crate) version_name: ::std::option::Option<::std::string::String>,
46    pub(crate) document_version: ::std::option::Option<::std::string::String>,
47    pub(crate) document_format: ::std::option::Option<crate::types::DocumentFormat>,
48}
49impl GetDocumentInputBuilder {
50    /// <p>The name of the SSM 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 SSM 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 SSM document.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.</p>
66    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.version_name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.</p>
71    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.version_name = input;
73        self
74    }
75    /// <p>An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.</p>
76    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.version_name
78    }
79    /// <p>The document version for which you want information.</p>
80    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.document_version = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The document version for which you want information.</p>
85    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.document_version = input;
87        self
88    }
89    /// <p>The document version for which you want information.</p>
90    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
91        &self.document_version
92    }
93    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
94    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
95        self.document_format = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
99    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
100        self.document_format = input;
101        self
102    }
103    /// <p>Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.</p>
104    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
105        &self.document_format
106    }
107    /// Consumes the builder and constructs a [`GetDocumentInput`](crate::operation::get_document::GetDocumentInput).
108    pub fn build(self) -> ::std::result::Result<crate::operation::get_document::GetDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
109        ::std::result::Result::Ok(crate::operation::get_document::GetDocumentInput {
110            name: self.name,
111            version_name: self.version_name,
112            document_version: self.document_version,
113            document_format: self.document_format,
114        })
115    }
116}