Skip to main content

aws_sdk_opensearch/operation/add_data_source/
_add_data_source_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for the parameters to the <code>AddDataSource</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AddDataSourceInput {
7    /// <p>The name of the domain to add the data source to.</p>
8    pub domain_name: ::std::option::Option<::std::string::String>,
9    /// <p>A name for the data source.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The type of data source.</p>
12    pub data_source_type: ::std::option::Option<crate::types::DataSourceType>,
13    /// <p>A description of the data source.</p>
14    pub description: ::std::option::Option<::std::string::String>,
15}
16impl AddDataSourceInput {
17    /// <p>The name of the domain to add the data source to.</p>
18    pub fn domain_name(&self) -> ::std::option::Option<&str> {
19        self.domain_name.as_deref()
20    }
21    /// <p>A name for the data source.</p>
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// <p>The type of data source.</p>
26    pub fn data_source_type(&self) -> ::std::option::Option<&crate::types::DataSourceType> {
27        self.data_source_type.as_ref()
28    }
29    /// <p>A description of the data source.</p>
30    pub fn description(&self) -> ::std::option::Option<&str> {
31        self.description.as_deref()
32    }
33}
34impl AddDataSourceInput {
35    /// Creates a new builder-style object to manufacture [`AddDataSourceInput`](crate::operation::add_data_source::AddDataSourceInput).
36    pub fn builder() -> crate::operation::add_data_source::builders::AddDataSourceInputBuilder {
37        crate::operation::add_data_source::builders::AddDataSourceInputBuilder::default()
38    }
39}
40
41/// A builder for [`AddDataSourceInput`](crate::operation::add_data_source::AddDataSourceInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct AddDataSourceInputBuilder {
45    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
46    pub(crate) name: ::std::option::Option<::std::string::String>,
47    pub(crate) data_source_type: ::std::option::Option<crate::types::DataSourceType>,
48    pub(crate) description: ::std::option::Option<::std::string::String>,
49}
50impl AddDataSourceInputBuilder {
51    /// <p>The name of the domain to add the data source to.</p>
52    /// This field is required.
53    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.domain_name = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The name of the domain to add the data source to.</p>
58    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.domain_name = input;
60        self
61    }
62    /// <p>The name of the domain to add the data source to.</p>
63    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
64        &self.domain_name
65    }
66    /// <p>A name for the data source.</p>
67    /// This field is required.
68    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>A name for the data source.</p>
73    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.name = input;
75        self
76    }
77    /// <p>A name for the data source.</p>
78    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.name
80    }
81    /// <p>The type of data source.</p>
82    /// This field is required.
83    pub fn data_source_type(mut self, input: crate::types::DataSourceType) -> Self {
84        self.data_source_type = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The type of data source.</p>
88    pub fn set_data_source_type(mut self, input: ::std::option::Option<crate::types::DataSourceType>) -> Self {
89        self.data_source_type = input;
90        self
91    }
92    /// <p>The type of data source.</p>
93    pub fn get_data_source_type(&self) -> &::std::option::Option<crate::types::DataSourceType> {
94        &self.data_source_type
95    }
96    /// <p>A description of the data source.</p>
97    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.description = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>A description of the data source.</p>
102    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.description = input;
104        self
105    }
106    /// <p>A description of the data source.</p>
107    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
108        &self.description
109    }
110    /// Consumes the builder and constructs a [`AddDataSourceInput`](crate::operation::add_data_source::AddDataSourceInput).
111    pub fn build(
112        self,
113    ) -> ::std::result::Result<crate::operation::add_data_source::AddDataSourceInput, ::aws_smithy_types::error::operation::BuildError> {
114        ::std::result::Result::Ok(crate::operation::add_data_source::AddDataSourceInput {
115            domain_name: self.domain_name,
116            name: self.name,
117            data_source_type: self.data_source_type,
118            description: self.description,
119        })
120    }
121}