Skip to main content

aws_sdk_lexmodelsv2/types/
_overall_test_results.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about the overall test results.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct OverallTestResults {
7    /// <p>A list of the overall test results.</p>
8    pub items: ::std::vec::Vec<crate::types::OverallTestResultItem>,
9}
10impl OverallTestResults {
11    /// <p>A list of the overall test results.</p>
12    pub fn items(&self) -> &[crate::types::OverallTestResultItem] {
13        use std::ops::Deref;
14        self.items.deref()
15    }
16}
17impl OverallTestResults {
18    /// Creates a new builder-style object to manufacture [`OverallTestResults`](crate::types::OverallTestResults).
19    pub fn builder() -> crate::types::builders::OverallTestResultsBuilder {
20        crate::types::builders::OverallTestResultsBuilder::default()
21    }
22}
23
24/// A builder for [`OverallTestResults`](crate::types::OverallTestResults).
25#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
26#[non_exhaustive]
27pub struct OverallTestResultsBuilder {
28    pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::OverallTestResultItem>>,
29}
30impl OverallTestResultsBuilder {
31    /// Appends an item to `items`.
32    ///
33    /// To override the contents of this collection use [`set_items`](Self::set_items).
34    ///
35    /// <p>A list of the overall test results.</p>
36    pub fn items(mut self, input: crate::types::OverallTestResultItem) -> Self {
37        let mut v = self.items.unwrap_or_default();
38        v.push(input);
39        self.items = ::std::option::Option::Some(v);
40        self
41    }
42    /// <p>A list of the overall test results.</p>
43    pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OverallTestResultItem>>) -> Self {
44        self.items = input;
45        self
46    }
47    /// <p>A list of the overall test results.</p>
48    pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OverallTestResultItem>> {
49        &self.items
50    }
51    /// Consumes the builder and constructs a [`OverallTestResults`](crate::types::OverallTestResults).
52    /// This method will fail if any of the following fields are not set:
53    /// - [`items`](crate::types::builders::OverallTestResultsBuilder::items)
54    pub fn build(self) -> ::std::result::Result<crate::types::OverallTestResults, ::aws_smithy_types::error::operation::BuildError> {
55        ::std::result::Result::Ok(crate::types::OverallTestResults {
56            items: self.items.ok_or_else(|| {
57                ::aws_smithy_types::error::operation::BuildError::missing_field(
58                    "items",
59                    "items was not specified but it is required when building OverallTestResults",
60                )
61            })?,
62        })
63    }
64}