Skip to main content

aws_sdk_devopsguru/types/
_list_insights_any_status_filter.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Used to filter for insights that have any status.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListInsightsAnyStatusFilter {
7    /// <p>Use to filter for either <code>REACTIVE</code> or <code>PROACTIVE</code> insights.</p>
8    pub r#type: crate::types::InsightType,
9    /// <p>A time range used to specify when the behavior of the filtered insights started.</p>
10    pub start_time_range: ::std::option::Option<crate::types::StartTimeRange>,
11}
12impl ListInsightsAnyStatusFilter {
13    /// <p>Use to filter for either <code>REACTIVE</code> or <code>PROACTIVE</code> insights.</p>
14    pub fn r#type(&self) -> &crate::types::InsightType {
15        &self.r#type
16    }
17    /// <p>A time range used to specify when the behavior of the filtered insights started.</p>
18    pub fn start_time_range(&self) -> ::std::option::Option<&crate::types::StartTimeRange> {
19        self.start_time_range.as_ref()
20    }
21}
22impl ListInsightsAnyStatusFilter {
23    /// Creates a new builder-style object to manufacture [`ListInsightsAnyStatusFilter`](crate::types::ListInsightsAnyStatusFilter).
24    pub fn builder() -> crate::types::builders::ListInsightsAnyStatusFilterBuilder {
25        crate::types::builders::ListInsightsAnyStatusFilterBuilder::default()
26    }
27}
28
29/// A builder for [`ListInsightsAnyStatusFilter`](crate::types::ListInsightsAnyStatusFilter).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ListInsightsAnyStatusFilterBuilder {
33    pub(crate) r#type: ::std::option::Option<crate::types::InsightType>,
34    pub(crate) start_time_range: ::std::option::Option<crate::types::StartTimeRange>,
35}
36impl ListInsightsAnyStatusFilterBuilder {
37    /// <p>Use to filter for either <code>REACTIVE</code> or <code>PROACTIVE</code> insights.</p>
38    /// This field is required.
39    pub fn r#type(mut self, input: crate::types::InsightType) -> Self {
40        self.r#type = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>Use to filter for either <code>REACTIVE</code> or <code>PROACTIVE</code> insights.</p>
44    pub fn set_type(mut self, input: ::std::option::Option<crate::types::InsightType>) -> Self {
45        self.r#type = input;
46        self
47    }
48    /// <p>Use to filter for either <code>REACTIVE</code> or <code>PROACTIVE</code> insights.</p>
49    pub fn get_type(&self) -> &::std::option::Option<crate::types::InsightType> {
50        &self.r#type
51    }
52    /// <p>A time range used to specify when the behavior of the filtered insights started.</p>
53    /// This field is required.
54    pub fn start_time_range(mut self, input: crate::types::StartTimeRange) -> Self {
55        self.start_time_range = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>A time range used to specify when the behavior of the filtered insights started.</p>
59    pub fn set_start_time_range(mut self, input: ::std::option::Option<crate::types::StartTimeRange>) -> Self {
60        self.start_time_range = input;
61        self
62    }
63    /// <p>A time range used to specify when the behavior of the filtered insights started.</p>
64    pub fn get_start_time_range(&self) -> &::std::option::Option<crate::types::StartTimeRange> {
65        &self.start_time_range
66    }
67    /// Consumes the builder and constructs a [`ListInsightsAnyStatusFilter`](crate::types::ListInsightsAnyStatusFilter).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`r#type`](crate::types::builders::ListInsightsAnyStatusFilterBuilder::type)
70    pub fn build(self) -> ::std::result::Result<crate::types::ListInsightsAnyStatusFilter, ::aws_smithy_types::error::operation::BuildError> {
71        ::std::result::Result::Ok(crate::types::ListInsightsAnyStatusFilter {
72            r#type: self.r#type.ok_or_else(|| {
73                ::aws_smithy_types::error::operation::BuildError::missing_field(
74                    "r#type",
75                    "r#type was not specified but it is required when building ListInsightsAnyStatusFilter",
76                )
77            })?,
78            start_time_range: self.start_time_range,
79        })
80    }
81}