aws_sdk_inspector2/operation/enable/
_enable_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct EnableInput {
6 pub account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>,
10 pub client_token: ::std::option::Option<::std::string::String>,
12}
13impl EnableInput {
14 pub fn account_ids(&self) -> &[::std::string::String] {
18 self.account_ids.as_deref().unwrap_or_default()
19 }
20 pub fn resource_types(&self) -> &[crate::types::ResourceScanType] {
24 self.resource_types.as_deref().unwrap_or_default()
25 }
26 pub fn client_token(&self) -> ::std::option::Option<&str> {
28 self.client_token.as_deref()
29 }
30}
31impl EnableInput {
32 pub fn builder() -> crate::operation::enable::builders::EnableInputBuilder {
34 crate::operation::enable::builders::EnableInputBuilder::default()
35 }
36}
37
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct EnableInputBuilder {
42 pub(crate) account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43 pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>,
44 pub(crate) client_token: ::std::option::Option<::std::string::String>,
45}
46impl EnableInputBuilder {
47 pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 let mut v = self.account_ids.unwrap_or_default();
54 v.push(input.into());
55 self.account_ids = ::std::option::Option::Some(v);
56 self
57 }
58 pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
60 self.account_ids = input;
61 self
62 }
63 pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
65 &self.account_ids
66 }
67 pub fn resource_types(mut self, input: crate::types::ResourceScanType) -> Self {
73 let mut v = self.resource_types.unwrap_or_default();
74 v.push(input);
75 self.resource_types = ::std::option::Option::Some(v);
76 self
77 }
78 pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>) -> Self {
80 self.resource_types = input;
81 self
82 }
83 pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>> {
85 &self.resource_types
86 }
87 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.client_token = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.client_token = input;
95 self
96 }
97 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
99 &self.client_token
100 }
101 pub fn build(self) -> ::std::result::Result<crate::operation::enable::EnableInput, ::aws_smithy_types::error::operation::BuildError> {
103 ::std::result::Result::Ok(crate::operation::enable::EnableInput {
104 account_ids: self.account_ids,
105 resource_types: self.resource_types,
106 client_token: self.client_token,
107 })
108 }
109}