aws_sdk_securityhub/operation/batch_get_standards_control_associations/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_get_standards_control_associations::_batch_get_standards_control_associations_output::BatchGetStandardsControlAssociationsOutputBuilder;
3
4pub use crate::operation::batch_get_standards_control_associations::_batch_get_standards_control_associations_input::BatchGetStandardsControlAssociationsInputBuilder;
5
6impl crate::operation::batch_get_standards_control_associations::builders::BatchGetStandardsControlAssociationsInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.batch_get_standards_control_associations();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `BatchGetStandardsControlAssociations`.
24///
25/// <p>For a batch of security controls and standards, identifies whether each control is currently enabled or disabled in a standard.</p>
26/// <p>Calls to this operation return a <code>RESOURCE_NOT_FOUND_EXCEPTION</code> error when the standard subscription for the association has a <code>NOT_READY_FOR_UPDATES</code> value for <code>StandardsControlsUpdatable</code>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct BatchGetStandardsControlAssociationsFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::batch_get_standards_control_associations::builders::BatchGetStandardsControlAssociationsInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsOutput,
36        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsError,
37    > for BatchGetStandardsControlAssociationsFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsOutput,
45            crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl BatchGetStandardsControlAssociationsFluentBuilder {
52    /// Creates a new `BatchGetStandardsControlAssociationsFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the BatchGetStandardsControlAssociations as a reference.
61    pub fn as_input(
62        &self,
63    ) -> &crate::operation::batch_get_standards_control_associations::builders::BatchGetStandardsControlAssociationsInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins =
88            crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociations::operation_runtime_plugins(
89                self.handle.runtime_plugins.clone(),
90                &self.handle.conf,
91                self.config_override,
92            );
93        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociations::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsOutput,
101        crate::operation::batch_get_standards_control_associations::BatchGetStandardsControlAssociationsError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    ///
116    /// Appends an item to `StandardsControlAssociationIds`.
117    ///
118    /// To override the contents of this collection use [`set_standards_control_association_ids`](Self::set_standards_control_association_ids).
119    ///
120    /// <p>An array with one or more objects that includes a security control (identified with <code>SecurityControlId</code>, <code>SecurityControlArn</code>, or a mix of both parameters) and the Amazon Resource Name (ARN) of a standard. This field is used to query the enablement status of a control in a specified standard. The security control ID or ARN is the same across standards.</p>
121    pub fn standards_control_association_ids(mut self, input: crate::types::StandardsControlAssociationId) -> Self {
122        self.inner = self.inner.standards_control_association_ids(input);
123        self
124    }
125    /// <p>An array with one or more objects that includes a security control (identified with <code>SecurityControlId</code>, <code>SecurityControlArn</code>, or a mix of both parameters) and the Amazon Resource Name (ARN) of a standard. This field is used to query the enablement status of a control in a specified standard. The security control ID or ARN is the same across standards.</p>
126    pub fn set_standards_control_association_ids(
127        mut self,
128        input: ::std::option::Option<::std::vec::Vec<crate::types::StandardsControlAssociationId>>,
129    ) -> Self {
130        self.inner = self.inner.set_standards_control_association_ids(input);
131        self
132    }
133    /// <p>An array with one or more objects that includes a security control (identified with <code>SecurityControlId</code>, <code>SecurityControlArn</code>, or a mix of both parameters) and the Amazon Resource Name (ARN) of a standard. This field is used to query the enablement status of a control in a specified standard. The security control ID or ARN is the same across standards.</p>
134    pub fn get_standards_control_association_ids(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StandardsControlAssociationId>> {
135        self.inner.get_standards_control_association_ids()
136    }
137}