aws_sdk_securityhub/operation/get_insights/_get_insights_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 GetInsightsInput {
6 /// <p>The ARNs of the insights to describe. If you don't provide any insight ARNs, then <code>GetInsights</code> returns all of your custom insights. It does not return any managed insights.</p>
7 pub insight_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 /// <p>The token that is required for pagination. On your first call to the <code>GetInsights</code> operation, set the value of this parameter to <code>NULL</code>.</p>
9 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
10 pub next_token: ::std::option::Option<::std::string::String>,
11 /// <p>The maximum number of items to return in the response.</p>
12 pub max_results: ::std::option::Option<i32>,
13}
14impl GetInsightsInput {
15 /// <p>The ARNs of the insights to describe. If you don't provide any insight ARNs, then <code>GetInsights</code> returns all of your custom insights. It does not return any managed insights.</p>
16 ///
17 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.insight_arns.is_none()`.
18 pub fn insight_arns(&self) -> &[::std::string::String] {
19 self.insight_arns.as_deref().unwrap_or_default()
20 }
21 /// <p>The token that is required for pagination. On your first call to the <code>GetInsights</code> operation, set the value of this parameter to <code>NULL</code>.</p>
22 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
23 pub fn next_token(&self) -> ::std::option::Option<&str> {
24 self.next_token.as_deref()
25 }
26 /// <p>The maximum number of items to return in the response.</p>
27 pub fn max_results(&self) -> ::std::option::Option<i32> {
28 self.max_results
29 }
30}
31impl GetInsightsInput {
32 /// Creates a new builder-style object to manufacture [`GetInsightsInput`](crate::operation::get_insights::GetInsightsInput).
33 pub fn builder() -> crate::operation::get_insights::builders::GetInsightsInputBuilder {
34 crate::operation::get_insights::builders::GetInsightsInputBuilder::default()
35 }
36}
37
38/// A builder for [`GetInsightsInput`](crate::operation::get_insights::GetInsightsInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct GetInsightsInputBuilder {
42 pub(crate) insight_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43 pub(crate) next_token: ::std::option::Option<::std::string::String>,
44 pub(crate) max_results: ::std::option::Option<i32>,
45}
46impl GetInsightsInputBuilder {
47 /// Appends an item to `insight_arns`.
48 ///
49 /// To override the contents of this collection use [`set_insight_arns`](Self::set_insight_arns).
50 ///
51 /// <p>The ARNs of the insights to describe. If you don't provide any insight ARNs, then <code>GetInsights</code> returns all of your custom insights. It does not return any managed insights.</p>
52 pub fn insight_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 let mut v = self.insight_arns.unwrap_or_default();
54 v.push(input.into());
55 self.insight_arns = ::std::option::Option::Some(v);
56 self
57 }
58 /// <p>The ARNs of the insights to describe. If you don't provide any insight ARNs, then <code>GetInsights</code> returns all of your custom insights. It does not return any managed insights.</p>
59 pub fn set_insight_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
60 self.insight_arns = input;
61 self
62 }
63 /// <p>The ARNs of the insights to describe. If you don't provide any insight ARNs, then <code>GetInsights</code> returns all of your custom insights. It does not return any managed insights.</p>
64 pub fn get_insight_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
65 &self.insight_arns
66 }
67 /// <p>The token that is required for pagination. On your first call to the <code>GetInsights</code> operation, set the value of this parameter to <code>NULL</code>.</p>
68 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
69 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.next_token = ::std::option::Option::Some(input.into());
71 self
72 }
73 /// <p>The token that is required for pagination. On your first call to the <code>GetInsights</code> operation, set the value of this parameter to <code>NULL</code>.</p>
74 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
75 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.next_token = input;
77 self
78 }
79 /// <p>The token that is required for pagination. On your first call to the <code>GetInsights</code> operation, set the value of this parameter to <code>NULL</code>.</p>
80 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
81 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
82 &self.next_token
83 }
84 /// <p>The maximum number of items to return in the response.</p>
85 pub fn max_results(mut self, input: i32) -> Self {
86 self.max_results = ::std::option::Option::Some(input);
87 self
88 }
89 /// <p>The maximum number of items to return in the response.</p>
90 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
91 self.max_results = input;
92 self
93 }
94 /// <p>The maximum number of items to return in the response.</p>
95 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
96 &self.max_results
97 }
98 /// Consumes the builder and constructs a [`GetInsightsInput`](crate::operation::get_insights::GetInsightsInput).
99 pub fn build(self) -> ::std::result::Result<crate::operation::get_insights::GetInsightsInput, ::aws_smithy_types::error::operation::BuildError> {
100 ::std::result::Result::Ok(crate::operation::get_insights::GetInsightsInput {
101 insight_arns: self.insight_arns,
102 next_token: self.next_token,
103 max_results: self.max_results,
104 })
105 }
106}