aws_sdk_securityhub/operation/create_insight/_create_insight_input.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 CreateInsightInput {
6 /// <p>The name of the custom insight to create.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>One or more attributes used to filter the findings included in the insight. The insight only includes findings that match the criteria defined in the filters.</p>
9 pub filters: ::std::option::Option<crate::types::AwsSecurityFindingFilters>,
10 /// <p>The attribute used to group the findings for the insight. The grouping attribute identifies the type of item that the insight applies to. For example, if an insight is grouped by resource identifier, then the insight produces a list of resource identifiers.</p>
11 pub group_by_attribute: ::std::option::Option<::std::string::String>,
12}
13impl CreateInsightInput {
14 /// <p>The name of the custom insight to create.</p>
15 pub fn name(&self) -> ::std::option::Option<&str> {
16 self.name.as_deref()
17 }
18 /// <p>One or more attributes used to filter the findings included in the insight. The insight only includes findings that match the criteria defined in the filters.</p>
19 pub fn filters(&self) -> ::std::option::Option<&crate::types::AwsSecurityFindingFilters> {
20 self.filters.as_ref()
21 }
22 /// <p>The attribute used to group the findings for the insight. The grouping attribute identifies the type of item that the insight applies to. For example, if an insight is grouped by resource identifier, then the insight produces a list of resource identifiers.</p>
23 pub fn group_by_attribute(&self) -> ::std::option::Option<&str> {
24 self.group_by_attribute.as_deref()
25 }
26}
27impl CreateInsightInput {
28 /// Creates a new builder-style object to manufacture [`CreateInsightInput`](crate::operation::create_insight::CreateInsightInput).
29 pub fn builder() -> crate::operation::create_insight::builders::CreateInsightInputBuilder {
30 crate::operation::create_insight::builders::CreateInsightInputBuilder::default()
31 }
32}
33
34/// A builder for [`CreateInsightInput`](crate::operation::create_insight::CreateInsightInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateInsightInputBuilder {
38 pub(crate) name: ::std::option::Option<::std::string::String>,
39 pub(crate) filters: ::std::option::Option<crate::types::AwsSecurityFindingFilters>,
40 pub(crate) group_by_attribute: ::std::option::Option<::std::string::String>,
41}
42impl CreateInsightInputBuilder {
43 /// <p>The name of the custom insight to create.</p>
44 /// This field is required.
45 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.name = ::std::option::Option::Some(input.into());
47 self
48 }
49 /// <p>The name of the custom insight to create.</p>
50 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.name = input;
52 self
53 }
54 /// <p>The name of the custom insight to create.</p>
55 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56 &self.name
57 }
58 /// <p>One or more attributes used to filter the findings included in the insight. The insight only includes findings that match the criteria defined in the filters.</p>
59 /// This field is required.
60 pub fn filters(mut self, input: crate::types::AwsSecurityFindingFilters) -> Self {
61 self.filters = ::std::option::Option::Some(input);
62 self
63 }
64 /// <p>One or more attributes used to filter the findings included in the insight. The insight only includes findings that match the criteria defined in the filters.</p>
65 pub fn set_filters(mut self, input: ::std::option::Option<crate::types::AwsSecurityFindingFilters>) -> Self {
66 self.filters = input;
67 self
68 }
69 /// <p>One or more attributes used to filter the findings included in the insight. The insight only includes findings that match the criteria defined in the filters.</p>
70 pub fn get_filters(&self) -> &::std::option::Option<crate::types::AwsSecurityFindingFilters> {
71 &self.filters
72 }
73 /// <p>The attribute used to group the findings for the insight. The grouping attribute identifies the type of item that the insight applies to. For example, if an insight is grouped by resource identifier, then the insight produces a list of resource identifiers.</p>
74 /// This field is required.
75 pub fn group_by_attribute(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.group_by_attribute = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The attribute used to group the findings for the insight. The grouping attribute identifies the type of item that the insight applies to. For example, if an insight is grouped by resource identifier, then the insight produces a list of resource identifiers.</p>
80 pub fn set_group_by_attribute(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.group_by_attribute = input;
82 self
83 }
84 /// <p>The attribute used to group the findings for the insight. The grouping attribute identifies the type of item that the insight applies to. For example, if an insight is grouped by resource identifier, then the insight produces a list of resource identifiers.</p>
85 pub fn get_group_by_attribute(&self) -> &::std::option::Option<::std::string::String> {
86 &self.group_by_attribute
87 }
88 /// Consumes the builder and constructs a [`CreateInsightInput`](crate::operation::create_insight::CreateInsightInput).
89 pub fn build(
90 self,
91 ) -> ::std::result::Result<crate::operation::create_insight::CreateInsightInput, ::aws_smithy_types::error::operation::BuildError> {
92 ::std::result::Result::Ok(crate::operation::create_insight::CreateInsightInput {
93 name: self.name,
94 filters: self.filters,
95 group_by_attribute: self.group_by_attribute,
96 })
97 }
98}