aws-sdk-agentregistry 1.0.0

AWS SDK for Agent Registry
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::search_discoverable_registry_records::_search_discoverable_registry_records_input::SearchDiscoverableRegistryRecordsInputBuilder;

pub use crate::operation::search_discoverable_registry_records::_search_discoverable_registry_records_output::SearchDiscoverableRegistryRecordsOutputBuilder;

impl crate::operation::search_discoverable_registry_records::builders::SearchDiscoverableRegistryRecordsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.search_discoverable_registry_records();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `SearchDiscoverableRegistryRecords`.
///
/// <p>Searches the discoverable registry records in a registry using a natural language query. Returns metadata for the matching records ordered by relevance.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SearchDiscoverableRegistryRecordsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::search_discoverable_registry_records::builders::SearchDiscoverableRegistryRecordsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsOutput,
        crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsError,
    > for SearchDiscoverableRegistryRecordsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsOutput,
            crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl SearchDiscoverableRegistryRecordsFluentBuilder {
    /// Creates a new `SearchDiscoverableRegistryRecordsFluentBuilder`.
    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 SearchDiscoverableRegistryRecords as a reference.
    pub fn as_input(&self) -> &crate::operation::search_discoverable_registry_records::builders::SearchDiscoverableRegistryRecordsInputBuilder {
        &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::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsError,
            ::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::search_discoverable_registry_records::SearchDiscoverableRegistryRecords::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecords::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::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsOutput,
        crate::operation::search_discoverable_registry_records::SearchDiscoverableRegistryRecordsError,
        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 natural language query to search for matching registry records.</p>
    pub fn search_query(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.search_query(input.into());
        self
    }
    /// <p>The natural language query to search for matching registry records.</p>
    pub fn set_search_query(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_search_query(input);
        self
    }
    /// <p>The natural language query to search for matching registry records.</p>
    pub fn get_search_query(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_search_query()
    }
    ///
    /// Appends an item to `registryIds`.
    ///
    /// To override the contents of this collection use [`set_registry_ids`](Self::set_registry_ids).
    ///
    /// <p>The registry identifiers to search within. Currently, you must specify exactly one registry identifier. You can provide either the full Amazon Web Services Resource Name (ARN) or the registry ID.</p>
    pub fn registry_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.registry_ids(input.into());
        self
    }
    /// <p>The registry identifiers to search within. Currently, you must specify exactly one registry identifier. You can provide either the full Amazon Web Services Resource Name (ARN) or the registry ID.</p>
    pub fn set_registry_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_registry_ids(input);
        self
    }
    /// <p>The registry identifiers to search within. Currently, you must specify exactly one registry identifier. You can provide either the full Amazon Web Services Resource Name (ARN) or the registry ID.</p>
    pub fn get_registry_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_registry_ids()
    }
    /// <p>The maximum number of results to return. Valid values are 1 through 20. The default value is 10.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.inner = self.inner.max_results(input);
        self
    }
    /// <p>The maximum number of results to return. Valid values are 1 through 20. The default value is 10.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_results(input);
        self
    }
    /// <p>The maximum number of results to return. Valid values are 1 through 20. The default value is 10.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_results()
    }
    /// <p>An optional structured JSON metadata filter that narrows the search results. Supports the field-level operators <code>$eq</code>, <code>$ne</code>, and <code>$in</code>, and the logical operators <code>$and</code> and <code>$or</code> on filterable fields.</p>
    pub fn filters(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.inner = self.inner.filters(input);
        self
    }
    /// <p>An optional structured JSON metadata filter that narrows the search results. Supports the field-level operators <code>$eq</code>, <code>$ne</code>, and <code>$in</code>, and the logical operators <code>$and</code> and <code>$or</code> on filterable fields.</p>
    pub fn set_filters(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.inner = self.inner.set_filters(input);
        self
    }
    /// <p>An optional structured JSON metadata filter that narrows the search results. Supports the field-level operators <code>$eq</code>, <code>$ne</code>, and <code>$in</code>, and the logical operators <code>$and</code> and <code>$or</code> on filterable fields.</p>
    pub fn get_filters(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        self.inner.get_filters()
    }
}