1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about the result.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ResultData {
    /// <p>The identifier of the result data.</p>
    pub result_id: ::std::string::String,
    /// <p>The document.</p>
    pub document: ::std::option::Option<crate::types::Document>,
    /// <p>The relevance score of the results.</p>
    pub relevance_score: f64,
}
impl ResultData {
    /// <p>The identifier of the result data.</p>
    pub fn result_id(&self) -> &str {
        use std::ops::Deref;
        self.result_id.deref()
    }
    /// <p>The document.</p>
    pub fn document(&self) -> ::std::option::Option<&crate::types::Document> {
        self.document.as_ref()
    }
    /// <p>The relevance score of the results.</p>
    pub fn relevance_score(&self) -> f64 {
        self.relevance_score
    }
}
impl ResultData {
    /// Creates a new builder-style object to manufacture [`ResultData`](crate::types::ResultData).
    pub fn builder() -> crate::types::builders::ResultDataBuilder {
        crate::types::builders::ResultDataBuilder::default()
    }
}

/// A builder for [`ResultData`](crate::types::ResultData).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ResultDataBuilder {
    pub(crate) result_id: ::std::option::Option<::std::string::String>,
    pub(crate) document: ::std::option::Option<crate::types::Document>,
    pub(crate) relevance_score: ::std::option::Option<f64>,
}
impl ResultDataBuilder {
    /// <p>The identifier of the result data.</p>
    /// This field is required.
    pub fn result_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.result_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the result data.</p>
    pub fn set_result_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.result_id = input;
        self
    }
    /// <p>The identifier of the result data.</p>
    pub fn get_result_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.result_id
    }
    /// <p>The document.</p>
    /// This field is required.
    pub fn document(mut self, input: crate::types::Document) -> Self {
        self.document = ::std::option::Option::Some(input);
        self
    }
    /// <p>The document.</p>
    pub fn set_document(mut self, input: ::std::option::Option<crate::types::Document>) -> Self {
        self.document = input;
        self
    }
    /// <p>The document.</p>
    pub fn get_document(&self) -> &::std::option::Option<crate::types::Document> {
        &self.document
    }
    /// <p>The relevance score of the results.</p>
    pub fn relevance_score(mut self, input: f64) -> Self {
        self.relevance_score = ::std::option::Option::Some(input);
        self
    }
    /// <p>The relevance score of the results.</p>
    pub fn set_relevance_score(mut self, input: ::std::option::Option<f64>) -> Self {
        self.relevance_score = input;
        self
    }
    /// <p>The relevance score of the results.</p>
    pub fn get_relevance_score(&self) -> &::std::option::Option<f64> {
        &self.relevance_score
    }
    /// Consumes the builder and constructs a [`ResultData`](crate::types::ResultData).
    /// This method will fail if any of the following fields are not set:
    /// - [`result_id`](crate::types::builders::ResultDataBuilder::result_id)
    pub fn build(self) -> ::std::result::Result<crate::types::ResultData, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ResultData {
            result_id: self.result_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "result_id",
                    "result_id was not specified but it is required when building ResultData",
                )
            })?,
            document: self.document,
            relevance_score: self.relevance_score.unwrap_or_default(),
        })
    }
}