aws-sdk-backupsearch 1.49.0

AWS SDK for AWS Backup Search
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_search_job::_start_search_job_input::StartSearchJobInputBuilder;

pub use crate::operation::start_search_job::_start_search_job_output::StartSearchJobOutputBuilder;

impl crate::operation::start_search_job::builders::StartSearchJobInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::start_search_job::StartSearchJobOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_search_job::StartSearchJobError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_search_job();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartSearchJob`.
///
/// <p>This operation creates a search job which returns recovery points filtered by SearchScope and items filtered by ItemFilters.</p>
/// <p>You can optionally include ClientToken, EncryptionKeyArn, Name, and/or Tags.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartSearchJobFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_search_job::builders::StartSearchJobInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_search_job::StartSearchJobOutput,
        crate::operation::start_search_job::StartSearchJobError,
    > for StartSearchJobFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_search_job::StartSearchJobOutput,
            crate::operation::start_search_job::StartSearchJobError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartSearchJobFluentBuilder {
    /// Creates a new `StartSearchJobFluentBuilder`.
    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 StartSearchJob as a reference.
    pub fn as_input(&self) -> &crate::operation::start_search_job::builders::StartSearchJobInputBuilder {
        &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::start_search_job::StartSearchJobOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_search_job::StartSearchJobError,
            ::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::start_search_job::StartSearchJob::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_search_job::StartSearchJob::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::start_search_job::StartSearchJobOutput,
        crate::operation::start_search_job::StartSearchJobError,
        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
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>List of tags returned by the operation.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v);
        self
    }
    /// <p>List of tags returned by the operation.</p>
    pub fn set_tags(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
    ) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>List of tags returned by the operation.</p>
    pub fn get_tags(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
        self.inner.get_tags()
    }
    /// <p>Include alphanumeric characters to create a name for this search job.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>Include alphanumeric characters to create a name for this search job.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>Include alphanumeric characters to create a name for this search job.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The encryption key for the specified search job.</p>
    pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.encryption_key_arn(input.into());
        self
    }
    /// <p>The encryption key for the specified search job.</p>
    pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_encryption_key_arn(input);
        self
    }
    /// <p>The encryption key for the specified search job.</p>
    pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_encryption_key_arn()
    }
    /// <p>Include this parameter to allow multiple identical calls for idempotency.</p>
    /// <p>A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.</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>Include this parameter to allow multiple identical calls for idempotency.</p>
    /// <p>A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.</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>Include this parameter to allow multiple identical calls for idempotency.</p>
    /// <p>A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.</p>
    pub fn search_scope(mut self, input: crate::types::SearchScope) -> Self {
        self.inner = self.inner.search_scope(input);
        self
    }
    /// <p>This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.</p>
    pub fn set_search_scope(mut self, input: ::std::option::Option<crate::types::SearchScope>) -> Self {
        self.inner = self.inner.set_search_scope(input);
        self
    }
    /// <p>This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.</p>
    pub fn get_search_scope(&self) -> &::std::option::Option<crate::types::SearchScope> {
        self.inner.get_search_scope()
    }
    /// <p>Item Filters represent all input item properties specified when the search was created.</p>
    /// <p>Contains either EBSItemFilters or S3ItemFilters</p>
    pub fn item_filters(mut self, input: crate::types::ItemFilters) -> Self {
        self.inner = self.inner.item_filters(input);
        self
    }
    /// <p>Item Filters represent all input item properties specified when the search was created.</p>
    /// <p>Contains either EBSItemFilters or S3ItemFilters</p>
    pub fn set_item_filters(mut self, input: ::std::option::Option<crate::types::ItemFilters>) -> Self {
        self.inner = self.inner.set_item_filters(input);
        self
    }
    /// <p>Item Filters represent all input item properties specified when the search was created.</p>
    /// <p>Contains either EBSItemFilters or S3ItemFilters</p>
    pub fn get_item_filters(&self) -> &::std::option::Option<crate::types::ItemFilters> {
        self.inner.get_item_filters()
    }
}