aws_sdk_inspector2/operation/enable/
_enable_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 EnableInput {
6    /// <p>A list of account IDs you want to enable Amazon Inspector scans for.</p>
7    pub account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The resource scan types you want to enable.</p>
9    pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>,
10    /// <p>The idempotency token for the request.</p>
11    pub client_token: ::std::option::Option<::std::string::String>,
12}
13impl EnableInput {
14    /// <p>A list of account IDs you want to enable Amazon Inspector scans for.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.account_ids.is_none()`.
17    pub fn account_ids(&self) -> &[::std::string::String] {
18        self.account_ids.as_deref().unwrap_or_default()
19    }
20    /// <p>The resource scan types you want to enable.</p>
21    ///
22    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
23    pub fn resource_types(&self) -> &[crate::types::ResourceScanType] {
24        self.resource_types.as_deref().unwrap_or_default()
25    }
26    /// <p>The idempotency token for the request.</p>
27    pub fn client_token(&self) -> ::std::option::Option<&str> {
28        self.client_token.as_deref()
29    }
30}
31impl EnableInput {
32    /// Creates a new builder-style object to manufacture [`EnableInput`](crate::operation::enable::EnableInput).
33    pub fn builder() -> crate::operation::enable::builders::EnableInputBuilder {
34        crate::operation::enable::builders::EnableInputBuilder::default()
35    }
36}
37
38/// A builder for [`EnableInput`](crate::operation::enable::EnableInput).
39#[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    /// Appends an item to `account_ids`.
48    ///
49    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
50    ///
51    /// <p>A list of account IDs you want to enable Amazon Inspector scans for.</p>
52    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    /// <p>A list of account IDs you want to enable Amazon Inspector scans for.</p>
59    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    /// <p>A list of account IDs you want to enable Amazon Inspector scans for.</p>
64    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
65        &self.account_ids
66    }
67    /// Appends an item to `resource_types`.
68    ///
69    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
70    ///
71    /// <p>The resource scan types you want to enable.</p>
72    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    /// <p>The resource scan types you want to enable.</p>
79    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    /// <p>The resource scan types you want to enable.</p>
84    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>> {
85        &self.resource_types
86    }
87    /// <p>The idempotency token for the request.</p>
88    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    /// <p>The idempotency token for the request.</p>
93    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.client_token = input;
95        self
96    }
97    /// <p>The idempotency token for the request.</p>
98    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
99        &self.client_token
100    }
101    /// Consumes the builder and constructs a [`EnableInput`](crate::operation::enable::EnableInput).
102    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}