aws_sdk_evidently/operation/test_segment_pattern/
_test_segment_pattern_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 TestSegmentPatternOutput {
6    /// <p>Returns <code>true</code> if the pattern matches the payload.</p>
7    pub r#match: bool,
8    _request_id: Option<String>,
9}
10impl TestSegmentPatternOutput {
11    /// <p>Returns <code>true</code> if the pattern matches the payload.</p>
12    pub fn r#match(&self) -> bool {
13        self.r#match
14    }
15}
16impl ::aws_types::request_id::RequestId for TestSegmentPatternOutput {
17    fn request_id(&self) -> Option<&str> {
18        self._request_id.as_deref()
19    }
20}
21impl TestSegmentPatternOutput {
22    /// Creates a new builder-style object to manufacture [`TestSegmentPatternOutput`](crate::operation::test_segment_pattern::TestSegmentPatternOutput).
23    pub fn builder() -> crate::operation::test_segment_pattern::builders::TestSegmentPatternOutputBuilder {
24        crate::operation::test_segment_pattern::builders::TestSegmentPatternOutputBuilder::default()
25    }
26}
27
28/// A builder for [`TestSegmentPatternOutput`](crate::operation::test_segment_pattern::TestSegmentPatternOutput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct TestSegmentPatternOutputBuilder {
32    pub(crate) r#match: ::std::option::Option<bool>,
33    _request_id: Option<String>,
34}
35impl TestSegmentPatternOutputBuilder {
36    /// <p>Returns <code>true</code> if the pattern matches the payload.</p>
37    /// This field is required.
38    pub fn r#match(mut self, input: bool) -> Self {
39        self.r#match = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>Returns <code>true</code> if the pattern matches the payload.</p>
43    pub fn set_match(mut self, input: ::std::option::Option<bool>) -> Self {
44        self.r#match = input;
45        self
46    }
47    /// <p>Returns <code>true</code> if the pattern matches the payload.</p>
48    pub fn get_match(&self) -> &::std::option::Option<bool> {
49        &self.r#match
50    }
51    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
52        self._request_id = Some(request_id.into());
53        self
54    }
55
56    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
57        self._request_id = request_id;
58        self
59    }
60    /// Consumes the builder and constructs a [`TestSegmentPatternOutput`](crate::operation::test_segment_pattern::TestSegmentPatternOutput).
61    /// This method will fail if any of the following fields are not set:
62    /// - [`r#match`](crate::operation::test_segment_pattern::builders::TestSegmentPatternOutputBuilder::match)
63    pub fn build(
64        self,
65    ) -> ::std::result::Result<crate::operation::test_segment_pattern::TestSegmentPatternOutput, ::aws_smithy_types::error::operation::BuildError>
66    {
67        ::std::result::Result::Ok(crate::operation::test_segment_pattern::TestSegmentPatternOutput {
68            r#match: self.r#match.ok_or_else(|| {
69                ::aws_smithy_types::error::operation::BuildError::missing_field(
70                    "r#match",
71                    "r#match was not specified but it is required when building TestSegmentPatternOutput",
72                )
73            })?,
74            _request_id: self._request_id,
75        })
76    }
77}