aws-sdk-securityir 1.47.0

AWS SDK for Security Incident Response
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_membership::_create_membership_output::CreateMembershipOutputBuilder;

pub use crate::operation::create_membership::_create_membership_input::CreateMembershipInputBuilder;

impl crate::operation::create_membership::builders::CreateMembershipInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_membership::CreateMembershipOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_membership::CreateMembershipError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_membership();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateMembership`.
///
/// <p>Creates a new membership.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateMembershipFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_membership::builders::CreateMembershipInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_membership::CreateMembershipOutput,
        crate::operation::create_membership::CreateMembershipError,
    > for CreateMembershipFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_membership::CreateMembershipOutput,
            crate::operation::create_membership::CreateMembershipError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateMembershipFluentBuilder {
    /// Creates a new `CreateMembershipFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateMembership as a reference.
    pub fn as_input(&self) -> &crate::operation::create_membership::builders::CreateMembershipInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_membership::CreateMembershipOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_membership::CreateMembershipError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_membership::CreateMembership::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_membership::CreateMembership::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_membership::CreateMembershipOutput,
        crate::operation::create_membership::CreateMembershipError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <note>
    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
    /// </note>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <note>
    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
    /// </note>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <note>
    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
    /// </note>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
    pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.membership_name(input.into());
        self
    }
    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
    pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_membership_name(input);
        self
    }
    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
    pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_membership_name()
    }
    ///
    /// Appends an item to `incidentResponseTeam`.
    ///
    /// To override the contents of this collection use [`set_incident_response_team`](Self::set_incident_response_team).
    ///
    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
    pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
        self.inner = self.inner.incident_response_team(input);
        self
    }
    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
    pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
        self.inner = self.inner.set_incident_response_team(input);
        self
    }
    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
    pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
        self.inner.get_incident_response_team()
    }
    ///
    /// Appends an item to `optInFeatures`.
    ///
    /// To override the contents of this collection use [`set_opt_in_features`](Self::set_opt_in_features).
    ///
    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
    pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
        self.inner = self.inner.opt_in_features(input);
        self
    }
    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
    pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
        self.inner = self.inner.set_opt_in_features(input);
        self
    }
    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
    pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
        self.inner.get_opt_in_features()
    }
    ///
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Optional element for customer configured tags.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>Optional element for customer configured tags.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>Optional element for customer configured tags.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
    /// <p>This parameter is optional. If not specified, the default value is false.</p>
    /// <ul>
    /// <li>
    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
    /// <li>
    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
    /// </ul>
    pub fn cover_entire_organization(mut self, input: bool) -> Self {
        self.inner = self.inner.cover_entire_organization(input);
        self
    }
    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
    /// <p>This parameter is optional. If not specified, the default value is false.</p>
    /// <ul>
    /// <li>
    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
    /// <li>
    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
    /// </ul>
    pub fn set_cover_entire_organization(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_cover_entire_organization(input);
        self
    }
    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
    /// <p>This parameter is optional. If not specified, the default value is false.</p>
    /// <ul>
    /// <li>
    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
    /// <li>
    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
    /// </ul>
    pub fn get_cover_entire_organization(&self) -> &::std::option::Option<bool> {
        self.inner.get_cover_entire_organization()
    }
}