aws_sdk_elasticsearch/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 <code> <code>CreatePackage</code> </code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePackageInput {
7    /// <p>Unique identifier for the package.</p>
8    pub package_name: ::std::option::Option<::std::string::String>,
9    /// <p>Type of package. Currently supports only TXT-DICTIONARY.</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 customer S3 location <code>PackageSource</code> for importing the package.</p>
14    pub package_source: ::std::option::Option<crate::types::PackageSource>,
15}
16impl CreatePackageInput {
17    /// <p>Unique identifier for the package.</p>
18    pub fn package_name(&self) -> ::std::option::Option<&str> {
19        self.package_name.as_deref()
20    }
21    /// <p>Type of package. Currently supports only TXT-DICTIONARY.</p>
22    pub fn package_type(&self) -> ::std::option::Option<&crate::types::PackageType> {
23        self.package_type.as_ref()
24    }
25    /// <p>Description of the package.</p>
26    pub fn package_description(&self) -> ::std::option::Option<&str> {
27        self.package_description.as_deref()
28    }
29    /// <p>The customer S3 location <code>PackageSource</code> for importing the package.</p>
30    pub fn package_source(&self) -> ::std::option::Option<&crate::types::PackageSource> {
31        self.package_source.as_ref()
32    }
33}
34impl CreatePackageInput {
35    /// Creates a new builder-style object to manufacture [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
36    pub fn builder() -> crate::operation::create_package::builders::CreatePackageInputBuilder {
37        crate::operation::create_package::builders::CreatePackageInputBuilder::default()
38    }
39}
40
41/// A builder for [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CreatePackageInputBuilder {
45    pub(crate) package_name: ::std::option::Option<::std::string::String>,
46    pub(crate) package_type: ::std::option::Option<crate::types::PackageType>,
47    pub(crate) package_description: ::std::option::Option<::std::string::String>,
48    pub(crate) package_source: ::std::option::Option<crate::types::PackageSource>,
49}
50impl CreatePackageInputBuilder {
51    /// <p>Unique identifier for the package.</p>
52    /// This field is required.
53    pub fn package_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.package_name = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>Unique identifier for the package.</p>
58    pub fn set_package_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.package_name = input;
60        self
61    }
62    /// <p>Unique identifier for the package.</p>
63    pub fn get_package_name(&self) -> &::std::option::Option<::std::string::String> {
64        &self.package_name
65    }
66    /// <p>Type of package. Currently supports only TXT-DICTIONARY.</p>
67    /// This field is required.
68    pub fn package_type(mut self, input: crate::types::PackageType) -> Self {
69        self.package_type = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>Type of package. Currently supports only TXT-DICTIONARY.</p>
73    pub fn set_package_type(mut self, input: ::std::option::Option<crate::types::PackageType>) -> Self {
74        self.package_type = input;
75        self
76    }
77    /// <p>Type of package. Currently supports only TXT-DICTIONARY.</p>
78    pub fn get_package_type(&self) -> &::std::option::Option<crate::types::PackageType> {
79        &self.package_type
80    }
81    /// <p>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>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>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>The customer S3 location <code>PackageSource</code> for importing the package.</p>
96    /// This field is required.
97    pub fn package_source(mut self, input: crate::types::PackageSource) -> Self {
98        self.package_source = ::std::option::Option::Some(input);
99        self
100    }
101    /// <p>The customer S3 location <code>PackageSource</code> for importing the package.</p>
102    pub fn set_package_source(mut self, input: ::std::option::Option<crate::types::PackageSource>) -> Self {
103        self.package_source = input;
104        self
105    }
106    /// <p>The customer S3 location <code>PackageSource</code> for importing the package.</p>
107    pub fn get_package_source(&self) -> &::std::option::Option<crate::types::PackageSource> {
108        &self.package_source
109    }
110    /// Consumes the builder and constructs a [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
111    pub fn build(
112        self,
113    ) -> ::std::result::Result<crate::operation::create_package::CreatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
114        ::std::result::Result::Ok(crate::operation::create_package::CreatePackageInput {
115            package_name: self.package_name,
116            package_type: self.package_type,
117            package_description: self.package_description,
118            package_source: self.package_source,
119        })
120    }
121}