Skip to main content

aws_sdk_entityresolution/operation/update_schema_mapping/
_update_schema_mapping_output.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 UpdateSchemaMappingOutput {
6    /// <p>The name of the schema.</p>
7    pub schema_name: ::std::string::String,
8    /// <p>The ARN (Amazon Resource Name) that Entity Resolution generated for the <code>SchemaMapping</code>.</p>
9    pub schema_arn: ::std::string::String,
10    /// <p>A description of the schema.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>A list of <code>MappedInputFields</code>. Each <code>MappedInputField</code> corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.</p>
13    pub mapped_input_fields: ::std::vec::Vec<crate::types::SchemaInputAttribute>,
14    _request_id: Option<String>,
15}
16impl UpdateSchemaMappingOutput {
17    /// <p>The name of the schema.</p>
18    pub fn schema_name(&self) -> &str {
19        use std::ops::Deref;
20        self.schema_name.deref()
21    }
22    /// <p>The ARN (Amazon Resource Name) that Entity Resolution generated for the <code>SchemaMapping</code>.</p>
23    pub fn schema_arn(&self) -> &str {
24        use std::ops::Deref;
25        self.schema_arn.deref()
26    }
27    /// <p>A description of the schema.</p>
28    pub fn description(&self) -> ::std::option::Option<&str> {
29        self.description.as_deref()
30    }
31    /// <p>A list of <code>MappedInputFields</code>. Each <code>MappedInputField</code> corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.</p>
32    pub fn mapped_input_fields(&self) -> &[crate::types::SchemaInputAttribute] {
33        use std::ops::Deref;
34        self.mapped_input_fields.deref()
35    }
36}
37impl ::aws_types::request_id::RequestId for UpdateSchemaMappingOutput {
38    fn request_id(&self) -> Option<&str> {
39        self._request_id.as_deref()
40    }
41}
42impl UpdateSchemaMappingOutput {
43    /// Creates a new builder-style object to manufacture [`UpdateSchemaMappingOutput`](crate::operation::update_schema_mapping::UpdateSchemaMappingOutput).
44    pub fn builder() -> crate::operation::update_schema_mapping::builders::UpdateSchemaMappingOutputBuilder {
45        crate::operation::update_schema_mapping::builders::UpdateSchemaMappingOutputBuilder::default()
46    }
47}
48
49/// A builder for [`UpdateSchemaMappingOutput`](crate::operation::update_schema_mapping::UpdateSchemaMappingOutput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct UpdateSchemaMappingOutputBuilder {
53    pub(crate) schema_name: ::std::option::Option<::std::string::String>,
54    pub(crate) schema_arn: ::std::option::Option<::std::string::String>,
55    pub(crate) description: ::std::option::Option<::std::string::String>,
56    pub(crate) mapped_input_fields: ::std::option::Option<::std::vec::Vec<crate::types::SchemaInputAttribute>>,
57    _request_id: Option<String>,
58}
59impl UpdateSchemaMappingOutputBuilder {
60    /// <p>The name of the schema.</p>
61    /// This field is required.
62    pub fn schema_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.schema_name = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The name of the schema.</p>
67    pub fn set_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.schema_name = input;
69        self
70    }
71    /// <p>The name of the schema.</p>
72    pub fn get_schema_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.schema_name
74    }
75    /// <p>The ARN (Amazon Resource Name) that Entity Resolution generated for the <code>SchemaMapping</code>.</p>
76    /// This field is required.
77    pub fn schema_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.schema_arn = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The ARN (Amazon Resource Name) that Entity Resolution generated for the <code>SchemaMapping</code>.</p>
82    pub fn set_schema_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.schema_arn = input;
84        self
85    }
86    /// <p>The ARN (Amazon Resource Name) that Entity Resolution generated for the <code>SchemaMapping</code>.</p>
87    pub fn get_schema_arn(&self) -> &::std::option::Option<::std::string::String> {
88        &self.schema_arn
89    }
90    /// <p>A description of the schema.</p>
91    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.description = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>A description of the schema.</p>
96    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.description = input;
98        self
99    }
100    /// <p>A description of the schema.</p>
101    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
102        &self.description
103    }
104    /// Appends an item to `mapped_input_fields`.
105    ///
106    /// To override the contents of this collection use [`set_mapped_input_fields`](Self::set_mapped_input_fields).
107    ///
108    /// <p>A list of <code>MappedInputFields</code>. Each <code>MappedInputField</code> corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.</p>
109    pub fn mapped_input_fields(mut self, input: crate::types::SchemaInputAttribute) -> Self {
110        let mut v = self.mapped_input_fields.unwrap_or_default();
111        v.push(input);
112        self.mapped_input_fields = ::std::option::Option::Some(v);
113        self
114    }
115    /// <p>A list of <code>MappedInputFields</code>. Each <code>MappedInputField</code> corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.</p>
116    pub fn set_mapped_input_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SchemaInputAttribute>>) -> Self {
117        self.mapped_input_fields = input;
118        self
119    }
120    /// <p>A list of <code>MappedInputFields</code>. Each <code>MappedInputField</code> corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.</p>
121    pub fn get_mapped_input_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SchemaInputAttribute>> {
122        &self.mapped_input_fields
123    }
124    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
125        self._request_id = Some(request_id.into());
126        self
127    }
128
129    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
130        self._request_id = request_id;
131        self
132    }
133    /// Consumes the builder and constructs a [`UpdateSchemaMappingOutput`](crate::operation::update_schema_mapping::UpdateSchemaMappingOutput).
134    /// This method will fail if any of the following fields are not set:
135    /// - [`schema_name`](crate::operation::update_schema_mapping::builders::UpdateSchemaMappingOutputBuilder::schema_name)
136    /// - [`schema_arn`](crate::operation::update_schema_mapping::builders::UpdateSchemaMappingOutputBuilder::schema_arn)
137    /// - [`mapped_input_fields`](crate::operation::update_schema_mapping::builders::UpdateSchemaMappingOutputBuilder::mapped_input_fields)
138    pub fn build(
139        self,
140    ) -> ::std::result::Result<crate::operation::update_schema_mapping::UpdateSchemaMappingOutput, ::aws_smithy_types::error::operation::BuildError>
141    {
142        ::std::result::Result::Ok(crate::operation::update_schema_mapping::UpdateSchemaMappingOutput {
143            schema_name: self.schema_name.ok_or_else(|| {
144                ::aws_smithy_types::error::operation::BuildError::missing_field(
145                    "schema_name",
146                    "schema_name was not specified but it is required when building UpdateSchemaMappingOutput",
147                )
148            })?,
149            schema_arn: self.schema_arn.ok_or_else(|| {
150                ::aws_smithy_types::error::operation::BuildError::missing_field(
151                    "schema_arn",
152                    "schema_arn was not specified but it is required when building UpdateSchemaMappingOutput",
153                )
154            })?,
155            description: self.description,
156            mapped_input_fields: self.mapped_input_fields.ok_or_else(|| {
157                ::aws_smithy_types::error::operation::BuildError::missing_field(
158                    "mapped_input_fields",
159                    "mapped_input_fields was not specified but it is required when building UpdateSchemaMappingOutput",
160                )
161            })?,
162            _request_id: self._request_id,
163        })
164    }
165}