aws-sdk-abusesignal 1.1.0

AWS SDK for AWS Abuse Signal API
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_abuse_report::_create_abuse_report_input::CreateAbuseReportInputBuilder;

pub use crate::operation::create_abuse_report::_create_abuse_report_output::CreateAbuseReportOutputBuilder;

impl crate::operation::create_abuse_report::builders::CreateAbuseReportInputBuilder {
    /// 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_abuse_report::CreateAbuseReportOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_abuse_report::CreateAbuseReportError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_abuse_report();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateAbuseReport`.
///
/// <p>Submits a structured report. Amazon Web Services validates it and returns a report ID. A successful response confirms that Amazon Web Services received your report. It doesn't mean that Amazon Web Services has reached an outcome. Use <code>GetAbuseReportStatus</code> with the report ID to check the report's status and outcome.</p>
/// <p>This operation is idempotent within a time window. If you provide a <code>clientToken</code>, duplicate requests within 24 hours return the existing report ID. If you omit it, the service generates a token scoped to 5 minutes.</p><important>
/// <p><b>Cross-Region data residency:</b> By submitting a report, you instruct Amazon Web Services to store it in all supported Regions (<code>us-east-1</code>, <code>us-west-2</code>, and <code>eu-west-2</code>), including across the United States and Europe. If data must remain in a single Region, do not include it in the report.</p>
/// </important>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAbuseReportFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_abuse_report::builders::CreateAbuseReportInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_abuse_report::CreateAbuseReportOutput,
        crate::operation::create_abuse_report::CreateAbuseReportError,
    > for CreateAbuseReportFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_abuse_report::CreateAbuseReportOutput,
            crate::operation::create_abuse_report::CreateAbuseReportError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateAbuseReportFluentBuilder {
    /// Creates a new `CreateAbuseReportFluentBuilder`.
    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 CreateAbuseReport as a reference.
    pub fn as_input(&self) -> &crate::operation::create_abuse_report::builders::CreateAbuseReportInputBuilder {
        &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_abuse_report::CreateAbuseReportOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_abuse_report::CreateAbuseReportError,
            ::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_abuse_report::CreateAbuseReport::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_abuse_report::CreateAbuseReport::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_abuse_report::CreateAbuseReportOutput,
        crate::operation::create_abuse_report::CreateAbuseReportError,
        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
    }
    /// <p>The abuse report data in XARF format. Provide the report under the <code>xarf</code> key.</p>
    pub fn report(mut self, input: crate::types::ReportData) -> Self {
        self.inner = self.inner.report(input);
        self
    }
    /// <p>The abuse report data in XARF format. Provide the report under the <code>xarf</code> key.</p>
    pub fn set_report(mut self, input: ::std::option::Option<crate::types::ReportData>) -> Self {
        self.inner = self.inner.set_report(input);
        self
    }
    /// <p>The abuse report data in XARF format. Provide the report under the <code>xarf</code> key.</p>
    pub fn get_report(&self) -> &::std::option::Option<crate::types::ReportData> {
        self.inner.get_report()
    }
    /// <p>An optional correlation ID for tracking the report in the reporter's system. The service echoes this value back in responses, and you can use it to filter reports with <code>ListAbuseReportStatuses</code>.</p>
    pub fn correlation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.correlation_id(input.into());
        self
    }
    /// <p>An optional correlation ID for tracking the report in the reporter's system. The service echoes this value back in responses, and you can use it to filter reports with <code>ListAbuseReportStatuses</code>.</p>
    pub fn set_correlation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_correlation_id(input);
        self
    }
    /// <p>An optional correlation ID for tracking the report in the reporter's system. The service echoes this value back in responses, and you can use it to filter reports with <code>ListAbuseReportStatuses</code>.</p>
    pub fn get_correlation_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_correlation_id()
    }
    /// <p>An optional, client-provided idempotency token that ensures the operation completes no more than once. If the token matches a previous request within 24 hours, the service returns the existing report ID instead of creating a new report. When you omit this token, the service automatically generates one that is scoped to a 5-minute window.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>An optional, client-provided idempotency token that ensures the operation completes no more than once. If the token matches a previous request within 24 hours, the service returns the existing report ID instead of creating a new report. When you omit this token, the service automatically generates one that is scoped to a 5-minute window.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>An optional, client-provided idempotency token that ensures the operation completes no more than once. If the token matches a previous request within 24 hours, the service returns the existing report ID instead of creating a new report. When you omit this token, the service automatically generates one that is scoped to a 5-minute window.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}