aws_sdk_s3vectors/operation/get_index/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_index::_get_index_output::GetIndexOutputBuilder;
3
4pub use crate::operation::get_index::_get_index_input::GetIndexInputBuilder;
5
6impl crate::operation::get_index::builders::GetIndexInputBuilder {
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::get_index::GetIndexOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_index::GetIndexError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_index();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetIndex`.
24///
25/// <note>
26/// <p>Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change.</p>
27/// </note>
28/// <p>Returns vector index attributes. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN).</p>
29/// <dl>
30/// <dt>
31/// Permissions
32/// </dt>
33/// <dd>
34/// <p>You must have the <code>s3vectors:GetIndex</code> permission to use this operation.</p>
35/// </dd>
36/// </dl>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct GetIndexFluentBuilder {
39    handle: ::std::sync::Arc<crate::client::Handle>,
40    inner: crate::operation::get_index::builders::GetIndexInputBuilder,
41    config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl crate::client::customize::internal::CustomizableSend<crate::operation::get_index::GetIndexOutput, crate::operation::get_index::GetIndexError>
44    for GetIndexFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<crate::operation::get_index::GetIndexOutput, crate::operation::get_index::GetIndexError>,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl GetIndexFluentBuilder {
56    /// Creates a new `GetIndexFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the GetIndex as a reference.
65    pub fn as_input(&self) -> &crate::operation::get_index::builders::GetIndexInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::get_index::GetIndexOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::get_index::GetIndexError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::get_index::GetIndex::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::get_index::GetIndex::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_index::GetIndexOutput, crate::operation::get_index::GetIndexError, Self>
101    {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The name of the vector bucket that contains the vector index.</p>
114    pub fn vector_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.vector_bucket_name(input.into());
116        self
117    }
118    /// <p>The name of the vector bucket that contains the vector index.</p>
119    pub fn set_vector_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_vector_bucket_name(input);
121        self
122    }
123    /// <p>The name of the vector bucket that contains the vector index.</p>
124    pub fn get_vector_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_vector_bucket_name()
126    }
127    /// <p>The name of the vector index.</p>
128    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.index_name(input.into());
130        self
131    }
132    /// <p>The name of the vector index.</p>
133    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_index_name(input);
135        self
136    }
137    /// <p>The name of the vector index.</p>
138    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_index_name()
140    }
141    /// <p>The ARN of the vector index.</p>
142    pub fn index_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.index_arn(input.into());
144        self
145    }
146    /// <p>The ARN of the vector index.</p>
147    pub fn set_index_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_index_arn(input);
149        self
150    }
151    /// <p>The ARN of the vector index.</p>
152    pub fn get_index_arn(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_index_arn()
154    }
155}