aws_sdk_opensearch/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 the <code>UpdatePackage</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdatePackageInput {
7    /// <p>The unique identifier for the package.</p>
8    pub package_id: ::std::option::Option<::std::string::String>,
9    /// <p>Amazon S3 bucket and key for the package.</p>
10    pub package_source: ::std::option::Option<crate::types::PackageSource>,
11    /// <p>A new description of the package.</p>
12    pub package_description: ::std::option::Option<::std::string::String>,
13    /// <p>Commit message for the updated file, which is shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
14    pub commit_message: ::std::option::Option<::std::string::String>,
15    /// <p>The updated configuration details for a package.</p>
16    pub package_configuration: ::std::option::Option<crate::types::PackageConfiguration>,
17    /// <p>Encryption options for a package.</p>
18    pub package_encryption_options: ::std::option::Option<crate::types::PackageEncryptionOptions>,
19}
20impl UpdatePackageInput {
21    /// <p>The unique identifier for the package.</p>
22    pub fn package_id(&self) -> ::std::option::Option<&str> {
23        self.package_id.as_deref()
24    }
25    /// <p>Amazon S3 bucket and key for the package.</p>
26    pub fn package_source(&self) -> ::std::option::Option<&crate::types::PackageSource> {
27        self.package_source.as_ref()
28    }
29    /// <p>A new description of the package.</p>
30    pub fn package_description(&self) -> ::std::option::Option<&str> {
31        self.package_description.as_deref()
32    }
33    /// <p>Commit message for the updated file, which is shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
34    pub fn commit_message(&self) -> ::std::option::Option<&str> {
35        self.commit_message.as_deref()
36    }
37    /// <p>The updated configuration details for a package.</p>
38    pub fn package_configuration(&self) -> ::std::option::Option<&crate::types::PackageConfiguration> {
39        self.package_configuration.as_ref()
40    }
41    /// <p>Encryption options for a package.</p>
42    pub fn package_encryption_options(&self) -> ::std::option::Option<&crate::types::PackageEncryptionOptions> {
43        self.package_encryption_options.as_ref()
44    }
45}
46impl UpdatePackageInput {
47    /// Creates a new builder-style object to manufacture [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
48    pub fn builder() -> crate::operation::update_package::builders::UpdatePackageInputBuilder {
49        crate::operation::update_package::builders::UpdatePackageInputBuilder::default()
50    }
51}
52
53/// A builder for [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct UpdatePackageInputBuilder {
57    pub(crate) package_id: ::std::option::Option<::std::string::String>,
58    pub(crate) package_source: ::std::option::Option<crate::types::PackageSource>,
59    pub(crate) package_description: ::std::option::Option<::std::string::String>,
60    pub(crate) commit_message: ::std::option::Option<::std::string::String>,
61    pub(crate) package_configuration: ::std::option::Option<crate::types::PackageConfiguration>,
62    pub(crate) package_encryption_options: ::std::option::Option<crate::types::PackageEncryptionOptions>,
63}
64impl UpdatePackageInputBuilder {
65    /// <p>The unique identifier for the package.</p>
66    /// This field is required.
67    pub fn package_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.package_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The unique identifier for the package.</p>
72    pub fn set_package_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.package_id = input;
74        self
75    }
76    /// <p>The unique identifier for the package.</p>
77    pub fn get_package_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.package_id
79    }
80    /// <p>Amazon S3 bucket and key for the package.</p>
81    /// This field is required.
82    pub fn package_source(mut self, input: crate::types::PackageSource) -> Self {
83        self.package_source = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>Amazon S3 bucket and key for the package.</p>
87    pub fn set_package_source(mut self, input: ::std::option::Option<crate::types::PackageSource>) -> Self {
88        self.package_source = input;
89        self
90    }
91    /// <p>Amazon S3 bucket and key for the package.</p>
92    pub fn get_package_source(&self) -> &::std::option::Option<crate::types::PackageSource> {
93        &self.package_source
94    }
95    /// <p>A new description of the package.</p>
96    pub fn package_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.package_description = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>A new description of the package.</p>
101    pub fn set_package_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.package_description = input;
103        self
104    }
105    /// <p>A new description of the package.</p>
106    pub fn get_package_description(&self) -> &::std::option::Option<::std::string::String> {
107        &self.package_description
108    }
109    /// <p>Commit message for the updated file, which is shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
110    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.commit_message = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>Commit message for the updated file, which is shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
115    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.commit_message = input;
117        self
118    }
119    /// <p>Commit message for the updated file, which is shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>
120    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
121        &self.commit_message
122    }
123    /// <p>The updated configuration details for a package.</p>
124    pub fn package_configuration(mut self, input: crate::types::PackageConfiguration) -> Self {
125        self.package_configuration = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>The updated configuration details for a package.</p>
129    pub fn set_package_configuration(mut self, input: ::std::option::Option<crate::types::PackageConfiguration>) -> Self {
130        self.package_configuration = input;
131        self
132    }
133    /// <p>The updated configuration details for a package.</p>
134    pub fn get_package_configuration(&self) -> &::std::option::Option<crate::types::PackageConfiguration> {
135        &self.package_configuration
136    }
137    /// <p>Encryption options for a package.</p>
138    pub fn package_encryption_options(mut self, input: crate::types::PackageEncryptionOptions) -> Self {
139        self.package_encryption_options = ::std::option::Option::Some(input);
140        self
141    }
142    /// <p>Encryption options for a package.</p>
143    pub fn set_package_encryption_options(mut self, input: ::std::option::Option<crate::types::PackageEncryptionOptions>) -> Self {
144        self.package_encryption_options = input;
145        self
146    }
147    /// <p>Encryption options for a package.</p>
148    pub fn get_package_encryption_options(&self) -> &::std::option::Option<crate::types::PackageEncryptionOptions> {
149        &self.package_encryption_options
150    }
151    /// Consumes the builder and constructs a [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
152    pub fn build(
153        self,
154    ) -> ::std::result::Result<crate::operation::update_package::UpdatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
155        ::std::result::Result::Ok(crate::operation::update_package::UpdatePackageInput {
156            package_id: self.package_id,
157            package_source: self.package_source,
158            package_description: self.package_description,
159            commit_message: self.commit_message,
160            package_configuration: self.package_configuration,
161            package_encryption_options: self.package_encryption_options,
162        })
163    }
164}