aws_sdk_opensearch/operation/create_package/
_create_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>CreatePackage</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePackageInput {
7    /// <p>Unique name for the package.</p>
8    pub package_name: ::std::option::Option<::std::string::String>,
9    /// <p>The type of package.</p>
10    pub package_type: ::std::option::Option<crate::types::PackageType>,
11    /// <p>Description of the package.</p>
12    pub package_description: ::std::option::Option<::std::string::String>,
13    /// <p>The Amazon S3 location from which to import the package.</p>
14    pub package_source: ::std::option::Option<crate::types::PackageSource>,
15    /// <p>The configuration parameters for the package being created.</p>
16    pub package_configuration: ::std::option::Option<crate::types::PackageConfiguration>,
17    /// <p>The version of the Amazon OpenSearch Service engine for which is compatible with the package. This can only be specified for package type <code>ZIP-PLUGIN</code></p>
18    pub engine_version: ::std::option::Option<::std::string::String>,
19    /// <p>The vending options for the package being created. They determine if the package can be vended to other users.</p>
20    pub package_vending_options: ::std::option::Option<crate::types::PackageVendingOptions>,
21    /// <p>The encryption parameters for the package being created.</p>
22    pub package_encryption_options: ::std::option::Option<crate::types::PackageEncryptionOptions>,
23}
24impl CreatePackageInput {
25    /// <p>Unique name for the package.</p>
26    pub fn package_name(&self) -> ::std::option::Option<&str> {
27        self.package_name.as_deref()
28    }
29    /// <p>The type of package.</p>
30    pub fn package_type(&self) -> ::std::option::Option<&crate::types::PackageType> {
31        self.package_type.as_ref()
32    }
33    /// <p>Description of the package.</p>
34    pub fn package_description(&self) -> ::std::option::Option<&str> {
35        self.package_description.as_deref()
36    }
37    /// <p>The Amazon S3 location from which to import the package.</p>
38    pub fn package_source(&self) -> ::std::option::Option<&crate::types::PackageSource> {
39        self.package_source.as_ref()
40    }
41    /// <p>The configuration parameters for the package being created.</p>
42    pub fn package_configuration(&self) -> ::std::option::Option<&crate::types::PackageConfiguration> {
43        self.package_configuration.as_ref()
44    }
45    /// <p>The version of the Amazon OpenSearch Service engine for which is compatible with the package. This can only be specified for package type <code>ZIP-PLUGIN</code></p>
46    pub fn engine_version(&self) -> ::std::option::Option<&str> {
47        self.engine_version.as_deref()
48    }
49    /// <p>The vending options for the package being created. They determine if the package can be vended to other users.</p>
50    pub fn package_vending_options(&self) -> ::std::option::Option<&crate::types::PackageVendingOptions> {
51        self.package_vending_options.as_ref()
52    }
53    /// <p>The encryption parameters for the package being created.</p>
54    pub fn package_encryption_options(&self) -> ::std::option::Option<&crate::types::PackageEncryptionOptions> {
55        self.package_encryption_options.as_ref()
56    }
57}
58impl CreatePackageInput {
59    /// Creates a new builder-style object to manufacture [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
60    pub fn builder() -> crate::operation::create_package::builders::CreatePackageInputBuilder {
61        crate::operation::create_package::builders::CreatePackageInputBuilder::default()
62    }
63}
64
65/// A builder for [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct CreatePackageInputBuilder {
69    pub(crate) package_name: ::std::option::Option<::std::string::String>,
70    pub(crate) package_type: ::std::option::Option<crate::types::PackageType>,
71    pub(crate) package_description: ::std::option::Option<::std::string::String>,
72    pub(crate) package_source: ::std::option::Option<crate::types::PackageSource>,
73    pub(crate) package_configuration: ::std::option::Option<crate::types::PackageConfiguration>,
74    pub(crate) engine_version: ::std::option::Option<::std::string::String>,
75    pub(crate) package_vending_options: ::std::option::Option<crate::types::PackageVendingOptions>,
76    pub(crate) package_encryption_options: ::std::option::Option<crate::types::PackageEncryptionOptions>,
77}
78impl CreatePackageInputBuilder {
79    /// <p>Unique name for the package.</p>
80    /// This field is required.
81    pub fn package_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.package_name = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>Unique name for the package.</p>
86    pub fn set_package_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.package_name = input;
88        self
89    }
90    /// <p>Unique name for the package.</p>
91    pub fn get_package_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.package_name
93    }
94    /// <p>The type of package.</p>
95    /// This field is required.
96    pub fn package_type(mut self, input: crate::types::PackageType) -> Self {
97        self.package_type = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>The type of package.</p>
101    pub fn set_package_type(mut self, input: ::std::option::Option<crate::types::PackageType>) -> Self {
102        self.package_type = input;
103        self
104    }
105    /// <p>The type of package.</p>
106    pub fn get_package_type(&self) -> &::std::option::Option<crate::types::PackageType> {
107        &self.package_type
108    }
109    /// <p>Description of the package.</p>
110    pub fn package_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.package_description = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>Description of the package.</p>
115    pub fn set_package_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.package_description = input;
117        self
118    }
119    /// <p>Description of the package.</p>
120    pub fn get_package_description(&self) -> &::std::option::Option<::std::string::String> {
121        &self.package_description
122    }
123    /// <p>The Amazon S3 location from which to import the package.</p>
124    /// This field is required.
125    pub fn package_source(mut self, input: crate::types::PackageSource) -> Self {
126        self.package_source = ::std::option::Option::Some(input);
127        self
128    }
129    /// <p>The Amazon S3 location from which to import the package.</p>
130    pub fn set_package_source(mut self, input: ::std::option::Option<crate::types::PackageSource>) -> Self {
131        self.package_source = input;
132        self
133    }
134    /// <p>The Amazon S3 location from which to import the package.</p>
135    pub fn get_package_source(&self) -> &::std::option::Option<crate::types::PackageSource> {
136        &self.package_source
137    }
138    /// <p>The configuration parameters for the package being created.</p>
139    pub fn package_configuration(mut self, input: crate::types::PackageConfiguration) -> Self {
140        self.package_configuration = ::std::option::Option::Some(input);
141        self
142    }
143    /// <p>The configuration parameters for the package being created.</p>
144    pub fn set_package_configuration(mut self, input: ::std::option::Option<crate::types::PackageConfiguration>) -> Self {
145        self.package_configuration = input;
146        self
147    }
148    /// <p>The configuration parameters for the package being created.</p>
149    pub fn get_package_configuration(&self) -> &::std::option::Option<crate::types::PackageConfiguration> {
150        &self.package_configuration
151    }
152    /// <p>The version of the Amazon OpenSearch Service engine for which is compatible with the package. This can only be specified for package type <code>ZIP-PLUGIN</code></p>
153    pub fn engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.engine_version = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>The version of the Amazon OpenSearch Service engine for which is compatible with the package. This can only be specified for package type <code>ZIP-PLUGIN</code></p>
158    pub fn set_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.engine_version = input;
160        self
161    }
162    /// <p>The version of the Amazon OpenSearch Service engine for which is compatible with the package. This can only be specified for package type <code>ZIP-PLUGIN</code></p>
163    pub fn get_engine_version(&self) -> &::std::option::Option<::std::string::String> {
164        &self.engine_version
165    }
166    /// <p>The vending options for the package being created. They determine if the package can be vended to other users.</p>
167    pub fn package_vending_options(mut self, input: crate::types::PackageVendingOptions) -> Self {
168        self.package_vending_options = ::std::option::Option::Some(input);
169        self
170    }
171    /// <p>The vending options for the package being created. They determine if the package can be vended to other users.</p>
172    pub fn set_package_vending_options(mut self, input: ::std::option::Option<crate::types::PackageVendingOptions>) -> Self {
173        self.package_vending_options = input;
174        self
175    }
176    /// <p>The vending options for the package being created. They determine if the package can be vended to other users.</p>
177    pub fn get_package_vending_options(&self) -> &::std::option::Option<crate::types::PackageVendingOptions> {
178        &self.package_vending_options
179    }
180    /// <p>The encryption parameters for the package being created.</p>
181    pub fn package_encryption_options(mut self, input: crate::types::PackageEncryptionOptions) -> Self {
182        self.package_encryption_options = ::std::option::Option::Some(input);
183        self
184    }
185    /// <p>The encryption parameters for the package being created.</p>
186    pub fn set_package_encryption_options(mut self, input: ::std::option::Option<crate::types::PackageEncryptionOptions>) -> Self {
187        self.package_encryption_options = input;
188        self
189    }
190    /// <p>The encryption parameters for the package being created.</p>
191    pub fn get_package_encryption_options(&self) -> &::std::option::Option<crate::types::PackageEncryptionOptions> {
192        &self.package_encryption_options
193    }
194    /// Consumes the builder and constructs a [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
195    pub fn build(
196        self,
197    ) -> ::std::result::Result<crate::operation::create_package::CreatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
198        ::std::result::Result::Ok(crate::operation::create_package::CreatePackageInput {
199            package_name: self.package_name,
200            package_type: self.package_type,
201            package_description: self.package_description,
202            package_source: self.package_source,
203            package_configuration: self.package_configuration,
204            engine_version: self.engine_version,
205            package_vending_options: self.package_vending_options,
206            package_encryption_options: self.package_encryption_options,
207        })
208    }
209}