aws_sdk_elasticsearch/operation/update_package/
_update_package_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for request parameters to <code> <code>UpdatePackage</code> </code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdatePackageInput {
7    /// <p>Unique identifier for the package.</p>
8    pub package_id: ::std::option::Option<::std::string::String>,
9    /// <p>The S3 location for importing the package specified as <code>S3BucketName</code> and <code>S3Key</code></p>
10    pub package_source: ::std::option::Option<crate::types::PackageSource>,
11    /// <p>New description of the package.</p>
12    pub package_description: ::std::option::Option<::std::string::String>,
13    /// <p>An info message for the new version which will be shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
14    pub commit_message: ::std::option::Option<::std::string::String>,
15}
16impl UpdatePackageInput {
17    /// <p>Unique identifier for the package.</p>
18    pub fn package_id(&self) -> ::std::option::Option<&str> {
19        self.package_id.as_deref()
20    }
21    /// <p>The S3 location for importing the package specified as <code>S3BucketName</code> and <code>S3Key</code></p>
22    pub fn package_source(&self) -> ::std::option::Option<&crate::types::PackageSource> {
23        self.package_source.as_ref()
24    }
25    /// <p>New description of the package.</p>
26    pub fn package_description(&self) -> ::std::option::Option<&str> {
27        self.package_description.as_deref()
28    }
29    /// <p>An info message for the new version which will be shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
30    pub fn commit_message(&self) -> ::std::option::Option<&str> {
31        self.commit_message.as_deref()
32    }
33}
34impl UpdatePackageInput {
35    /// Creates a new builder-style object to manufacture [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
36    pub fn builder() -> crate::operation::update_package::builders::UpdatePackageInputBuilder {
37        crate::operation::update_package::builders::UpdatePackageInputBuilder::default()
38    }
39}
40
41/// A builder for [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UpdatePackageInputBuilder {
45    pub(crate) package_id: ::std::option::Option<::std::string::String>,
46    pub(crate) package_source: ::std::option::Option<crate::types::PackageSource>,
47    pub(crate) package_description: ::std::option::Option<::std::string::String>,
48    pub(crate) commit_message: ::std::option::Option<::std::string::String>,
49}
50impl UpdatePackageInputBuilder {
51    /// <p>Unique identifier for the package.</p>
52    /// This field is required.
53    pub fn package_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.package_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>Unique identifier for the package.</p>
58    pub fn set_package_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.package_id = input;
60        self
61    }
62    /// <p>Unique identifier for the package.</p>
63    pub fn get_package_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.package_id
65    }
66    /// <p>The S3 location for importing the package specified as <code>S3BucketName</code> and <code>S3Key</code></p>
67    /// This field is required.
68    pub fn package_source(mut self, input: crate::types::PackageSource) -> Self {
69        self.package_source = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>The S3 location for importing the package specified as <code>S3BucketName</code> and <code>S3Key</code></p>
73    pub fn set_package_source(mut self, input: ::std::option::Option<crate::types::PackageSource>) -> Self {
74        self.package_source = input;
75        self
76    }
77    /// <p>The S3 location for importing the package specified as <code>S3BucketName</code> and <code>S3Key</code></p>
78    pub fn get_package_source(&self) -> &::std::option::Option<crate::types::PackageSource> {
79        &self.package_source
80    }
81    /// <p>New description of the package.</p>
82    pub fn package_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.package_description = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>New description of the package.</p>
87    pub fn set_package_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.package_description = input;
89        self
90    }
91    /// <p>New description of the package.</p>
92    pub fn get_package_description(&self) -> &::std::option::Option<::std::string::String> {
93        &self.package_description
94    }
95    /// <p>An info message for the new version which will be shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
96    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.commit_message = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>An info message for the new version which will be shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
101    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.commit_message = input;
103        self
104    }
105    /// <p>An info message for the new version which will be shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
106    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
107        &self.commit_message
108    }
109    /// Consumes the builder and constructs a [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::update_package::UpdatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::update_package::UpdatePackageInput {
114            package_id: self.package_id,
115            package_source: self.package_source,
116            package_description: self.package_description,
117            commit_message: self.commit_message,
118        })
119    }
120}