aws_sdk_opensearch/operation/update_application/
_update_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 UpdateApplicationInput {
6    /// <p>The unique identifier for the OpenSearch application to be updated.</p>
7    pub id: ::std::option::Option<::std::string::String>,
8    /// <p>The data sources to associate with the OpenSearch application.</p>
9    pub data_sources: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>,
10    /// <p>The configuration settings to modify for the OpenSearch application.</p>
11    pub app_configs: ::std::option::Option<::std::vec::Vec<crate::types::AppConfig>>,
12}
13impl UpdateApplicationInput {
14    /// <p>The unique identifier for the OpenSearch application to be updated.</p>
15    pub fn id(&self) -> ::std::option::Option<&str> {
16        self.id.as_deref()
17    }
18    /// <p>The data sources to associate with the OpenSearch application.</p>
19    ///
20    /// 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()`.
21    pub fn data_sources(&self) -> &[crate::types::DataSource] {
22        self.data_sources.as_deref().unwrap_or_default()
23    }
24    /// <p>The configuration settings to modify for the OpenSearch application.</p>
25    ///
26    /// 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()`.
27    pub fn app_configs(&self) -> &[crate::types::AppConfig] {
28        self.app_configs.as_deref().unwrap_or_default()
29    }
30}
31impl UpdateApplicationInput {
32    /// Creates a new builder-style object to manufacture [`UpdateApplicationInput`](crate::operation::update_application::UpdateApplicationInput).
33    pub fn builder() -> crate::operation::update_application::builders::UpdateApplicationInputBuilder {
34        crate::operation::update_application::builders::UpdateApplicationInputBuilder::default()
35    }
36}
37
38/// A builder for [`UpdateApplicationInput`](crate::operation::update_application::UpdateApplicationInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct UpdateApplicationInputBuilder {
42    pub(crate) id: ::std::option::Option<::std::string::String>,
43    pub(crate) data_sources: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>,
44    pub(crate) app_configs: ::std::option::Option<::std::vec::Vec<crate::types::AppConfig>>,
45}
46impl UpdateApplicationInputBuilder {
47    /// <p>The unique identifier for the OpenSearch application to be updated.</p>
48    /// This field is required.
49    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.id = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The unique identifier for the OpenSearch application to be updated.</p>
54    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.id = input;
56        self
57    }
58    /// <p>The unique identifier for the OpenSearch application to be updated.</p>
59    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
60        &self.id
61    }
62    /// Appends an item to `data_sources`.
63    ///
64    /// To override the contents of this collection use [`set_data_sources`](Self::set_data_sources).
65    ///
66    /// <p>The data sources to associate with the OpenSearch application.</p>
67    pub fn data_sources(mut self, input: crate::types::DataSource) -> Self {
68        let mut v = self.data_sources.unwrap_or_default();
69        v.push(input);
70        self.data_sources = ::std::option::Option::Some(v);
71        self
72    }
73    /// <p>The data sources to associate with the OpenSearch application.</p>
74    pub fn set_data_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>) -> Self {
75        self.data_sources = input;
76        self
77    }
78    /// <p>The data sources to associate with the OpenSearch application.</p>
79    pub fn get_data_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataSource>> {
80        &self.data_sources
81    }
82    /// Appends an item to `app_configs`.
83    ///
84    /// To override the contents of this collection use [`set_app_configs`](Self::set_app_configs).
85    ///
86    /// <p>The configuration settings to modify for the OpenSearch application.</p>
87    pub fn app_configs(mut self, input: crate::types::AppConfig) -> Self {
88        let mut v = self.app_configs.unwrap_or_default();
89        v.push(input);
90        self.app_configs = ::std::option::Option::Some(v);
91        self
92    }
93    /// <p>The configuration settings to modify for the OpenSearch application.</p>
94    pub fn set_app_configs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AppConfig>>) -> Self {
95        self.app_configs = input;
96        self
97    }
98    /// <p>The configuration settings to modify for the OpenSearch application.</p>
99    pub fn get_app_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AppConfig>> {
100        &self.app_configs
101    }
102    /// Consumes the builder and constructs a [`UpdateApplicationInput`](crate::operation::update_application::UpdateApplicationInput).
103    pub fn build(
104        self,
105    ) -> ::std::result::Result<crate::operation::update_application::UpdateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
106        ::std::result::Result::Ok(crate::operation::update_application::UpdateApplicationInput {
107            id: self.id,
108            data_sources: self.data_sources,
109            app_configs: self.app_configs,
110        })
111    }
112}