aws_sdk_b2bi/operation/generate_mapping/
_generate_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 GenerateMappingOutput {
6    /// <p>Returns a mapping template based on your inputs.</p>
7    pub mapping_template: ::std::string::String,
8    /// <p>Returns a percentage that estimates the accuracy of the generated mapping.</p>
9    pub mapping_accuracy: ::std::option::Option<f32>,
10    _request_id: Option<String>,
11}
12impl GenerateMappingOutput {
13    /// <p>Returns a mapping template based on your inputs.</p>
14    pub fn mapping_template(&self) -> &str {
15        use std::ops::Deref;
16        self.mapping_template.deref()
17    }
18    /// <p>Returns a percentage that estimates the accuracy of the generated mapping.</p>
19    pub fn mapping_accuracy(&self) -> ::std::option::Option<f32> {
20        self.mapping_accuracy
21    }
22}
23impl ::aws_types::request_id::RequestId for GenerateMappingOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl GenerateMappingOutput {
29    /// Creates a new builder-style object to manufacture [`GenerateMappingOutput`](crate::operation::generate_mapping::GenerateMappingOutput).
30    pub fn builder() -> crate::operation::generate_mapping::builders::GenerateMappingOutputBuilder {
31        crate::operation::generate_mapping::builders::GenerateMappingOutputBuilder::default()
32    }
33}
34
35/// A builder for [`GenerateMappingOutput`](crate::operation::generate_mapping::GenerateMappingOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct GenerateMappingOutputBuilder {
39    pub(crate) mapping_template: ::std::option::Option<::std::string::String>,
40    pub(crate) mapping_accuracy: ::std::option::Option<f32>,
41    _request_id: Option<String>,
42}
43impl GenerateMappingOutputBuilder {
44    /// <p>Returns a mapping template based on your inputs.</p>
45    /// This field is required.
46    pub fn mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.mapping_template = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>Returns a mapping template based on your inputs.</p>
51    pub fn set_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.mapping_template = input;
53        self
54    }
55    /// <p>Returns a mapping template based on your inputs.</p>
56    pub fn get_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
57        &self.mapping_template
58    }
59    /// <p>Returns a percentage that estimates the accuracy of the generated mapping.</p>
60    pub fn mapping_accuracy(mut self, input: f32) -> Self {
61        self.mapping_accuracy = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>Returns a percentage that estimates the accuracy of the generated mapping.</p>
65    pub fn set_mapping_accuracy(mut self, input: ::std::option::Option<f32>) -> Self {
66        self.mapping_accuracy = input;
67        self
68    }
69    /// <p>Returns a percentage that estimates the accuracy of the generated mapping.</p>
70    pub fn get_mapping_accuracy(&self) -> &::std::option::Option<f32> {
71        &self.mapping_accuracy
72    }
73    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
74        self._request_id = Some(request_id.into());
75        self
76    }
77
78    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
79        self._request_id = request_id;
80        self
81    }
82    /// Consumes the builder and constructs a [`GenerateMappingOutput`](crate::operation::generate_mapping::GenerateMappingOutput).
83    /// This method will fail if any of the following fields are not set:
84    /// - [`mapping_template`](crate::operation::generate_mapping::builders::GenerateMappingOutputBuilder::mapping_template)
85    pub fn build(
86        self,
87    ) -> ::std::result::Result<crate::operation::generate_mapping::GenerateMappingOutput, ::aws_smithy_types::error::operation::BuildError> {
88        ::std::result::Result::Ok(crate::operation::generate_mapping::GenerateMappingOutput {
89            mapping_template: self.mapping_template.ok_or_else(|| {
90                ::aws_smithy_types::error::operation::BuildError::missing_field(
91                    "mapping_template",
92                    "mapping_template was not specified but it is required when building GenerateMappingOutput",
93                )
94            })?,
95            mapping_accuracy: self.mapping_accuracy,
96            _request_id: self._request_id,
97        })
98    }
99}