aws_sdk_opensearch/operation/create_application/
_create_application_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 CreateApplicationInput {
6    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <p>The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The data sources to link to the OpenSearch application.</p>
11    pub data_sources: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>,
12    /// <p>Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.</p>
13    pub iam_identity_center_options: ::std::option::Option<crate::types::IamIdentityCenterOptionsInput>,
14    /// <p>Configuration settings for the OpenSearch application, including administrative options.</p>
15    pub app_configs: ::std::option::Option<::std::vec::Vec<crate::types::AppConfig>>,
16    /// <p>A list of tags attached to a domain.</p>
17    pub tag_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateApplicationInput {
20    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
21    pub fn client_token(&self) -> ::std::option::Option<&str> {
22        self.client_token.as_deref()
23    }
24    /// <p>The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.</p>
25    pub fn name(&self) -> ::std::option::Option<&str> {
26        self.name.as_deref()
27    }
28    /// <p>The data sources to link to the OpenSearch application.</p>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.data_sources.is_none()`.
31    pub fn data_sources(&self) -> &[crate::types::DataSource] {
32        self.data_sources.as_deref().unwrap_or_default()
33    }
34    /// <p>Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.</p>
35    pub fn iam_identity_center_options(&self) -> ::std::option::Option<&crate::types::IamIdentityCenterOptionsInput> {
36        self.iam_identity_center_options.as_ref()
37    }
38    /// <p>Configuration settings for the OpenSearch application, including administrative options.</p>
39    ///
40    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.app_configs.is_none()`.
41    pub fn app_configs(&self) -> &[crate::types::AppConfig] {
42        self.app_configs.as_deref().unwrap_or_default()
43    }
44    /// <p>A list of tags attached to a domain.</p>
45    ///
46    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_list.is_none()`.
47    pub fn tag_list(&self) -> &[crate::types::Tag] {
48        self.tag_list.as_deref().unwrap_or_default()
49    }
50}
51impl CreateApplicationInput {
52    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
53    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
54        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
55    }
56}
57
58/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct CreateApplicationInputBuilder {
62    pub(crate) client_token: ::std::option::Option<::std::string::String>,
63    pub(crate) name: ::std::option::Option<::std::string::String>,
64    pub(crate) data_sources: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>,
65    pub(crate) iam_identity_center_options: ::std::option::Option<crate::types::IamIdentityCenterOptionsInput>,
66    pub(crate) app_configs: ::std::option::Option<::std::vec::Vec<crate::types::AppConfig>>,
67    pub(crate) tag_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
68}
69impl CreateApplicationInputBuilder {
70    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
71    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.client_token = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
76    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.client_token = input;
78        self
79    }
80    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
81    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
82        &self.client_token
83    }
84    /// <p>The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.</p>
85    /// This field is required.
86    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.name = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.</p>
91    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.name = input;
93        self
94    }
95    /// <p>The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.</p>
96    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
97        &self.name
98    }
99    /// Appends an item to `data_sources`.
100    ///
101    /// To override the contents of this collection use [`set_data_sources`](Self::set_data_sources).
102    ///
103    /// <p>The data sources to link to the OpenSearch application.</p>
104    pub fn data_sources(mut self, input: crate::types::DataSource) -> Self {
105        let mut v = self.data_sources.unwrap_or_default();
106        v.push(input);
107        self.data_sources = ::std::option::Option::Some(v);
108        self
109    }
110    /// <p>The data sources to link to the OpenSearch application.</p>
111    pub fn set_data_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>) -> Self {
112        self.data_sources = input;
113        self
114    }
115    /// <p>The data sources to link to the OpenSearch application.</p>
116    pub fn get_data_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataSource>> {
117        &self.data_sources
118    }
119    /// <p>Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.</p>
120    pub fn iam_identity_center_options(mut self, input: crate::types::IamIdentityCenterOptionsInput) -> Self {
121        self.iam_identity_center_options = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.</p>
125    pub fn set_iam_identity_center_options(mut self, input: ::std::option::Option<crate::types::IamIdentityCenterOptionsInput>) -> Self {
126        self.iam_identity_center_options = input;
127        self
128    }
129    /// <p>Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.</p>
130    pub fn get_iam_identity_center_options(&self) -> &::std::option::Option<crate::types::IamIdentityCenterOptionsInput> {
131        &self.iam_identity_center_options
132    }
133    /// Appends an item to `app_configs`.
134    ///
135    /// To override the contents of this collection use [`set_app_configs`](Self::set_app_configs).
136    ///
137    /// <p>Configuration settings for the OpenSearch application, including administrative options.</p>
138    pub fn app_configs(mut self, input: crate::types::AppConfig) -> Self {
139        let mut v = self.app_configs.unwrap_or_default();
140        v.push(input);
141        self.app_configs = ::std::option::Option::Some(v);
142        self
143    }
144    /// <p>Configuration settings for the OpenSearch application, including administrative options.</p>
145    pub fn set_app_configs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AppConfig>>) -> Self {
146        self.app_configs = input;
147        self
148    }
149    /// <p>Configuration settings for the OpenSearch application, including administrative options.</p>
150    pub fn get_app_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AppConfig>> {
151        &self.app_configs
152    }
153    /// Appends an item to `tag_list`.
154    ///
155    /// To override the contents of this collection use [`set_tag_list`](Self::set_tag_list).
156    ///
157    /// <p>A list of tags attached to a domain.</p>
158    pub fn tag_list(mut self, input: crate::types::Tag) -> Self {
159        let mut v = self.tag_list.unwrap_or_default();
160        v.push(input);
161        self.tag_list = ::std::option::Option::Some(v);
162        self
163    }
164    /// <p>A list of tags attached to a domain.</p>
165    pub fn set_tag_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
166        self.tag_list = input;
167        self
168    }
169    /// <p>A list of tags attached to a domain.</p>
170    pub fn get_tag_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
171        &self.tag_list
172    }
173    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
174    pub fn build(
175        self,
176    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
177        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
178            client_token: self.client_token,
179            name: self.name,
180            data_sources: self.data_sources,
181            iam_identity_center_options: self.iam_identity_center_options,
182            app_configs: self.app_configs,
183            tag_list: self.tag_list,
184        })
185    }
186}