aws_sdk_inspector2/operation/disable/
_disable_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 DisableInput {
6    /// <p>An array of account IDs you want to disable 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 disable.</p>
9    pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>,
10}
11impl DisableInput {
12    /// <p>An array of account IDs you want to disable Amazon Inspector scans for.</p>
13    ///
14    /// 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()`.
15    pub fn account_ids(&self) -> &[::std::string::String] {
16        self.account_ids.as_deref().unwrap_or_default()
17    }
18    /// <p>The resource scan types you want to disable.</p>
19    ///
20    /// 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()`.
21    pub fn resource_types(&self) -> &[crate::types::ResourceScanType] {
22        self.resource_types.as_deref().unwrap_or_default()
23    }
24}
25impl DisableInput {
26    /// Creates a new builder-style object to manufacture [`DisableInput`](crate::operation::disable::DisableInput).
27    pub fn builder() -> crate::operation::disable::builders::DisableInputBuilder {
28        crate::operation::disable::builders::DisableInputBuilder::default()
29    }
30}
31
32/// A builder for [`DisableInput`](crate::operation::disable::DisableInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct DisableInputBuilder {
36    pub(crate) account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
37    pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>,
38}
39impl DisableInputBuilder {
40    /// Appends an item to `account_ids`.
41    ///
42    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
43    ///
44    /// <p>An array of account IDs you want to disable Amazon Inspector scans for.</p>
45    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        let mut v = self.account_ids.unwrap_or_default();
47        v.push(input.into());
48        self.account_ids = ::std::option::Option::Some(v);
49        self
50    }
51    /// <p>An array of account IDs you want to disable Amazon Inspector scans for.</p>
52    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
53        self.account_ids = input;
54        self
55    }
56    /// <p>An array of account IDs you want to disable Amazon Inspector scans for.</p>
57    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
58        &self.account_ids
59    }
60    /// Appends an item to `resource_types`.
61    ///
62    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
63    ///
64    /// <p>The resource scan types you want to disable.</p>
65    pub fn resource_types(mut self, input: crate::types::ResourceScanType) -> Self {
66        let mut v = self.resource_types.unwrap_or_default();
67        v.push(input);
68        self.resource_types = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>The resource scan types you want to disable.</p>
72    pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>>) -> Self {
73        self.resource_types = input;
74        self
75    }
76    /// <p>The resource scan types you want to disable.</p>
77    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceScanType>> {
78        &self.resource_types
79    }
80    /// Consumes the builder and constructs a [`DisableInput`](crate::operation::disable::DisableInput).
81    pub fn build(self) -> ::std::result::Result<crate::operation::disable::DisableInput, ::aws_smithy_types::error::operation::BuildError> {
82        ::std::result::Result::Ok(crate::operation::disable::DisableInput {
83            account_ids: self.account_ids,
84            resource_types: self.resource_types,
85        })
86    }
87}