aws_sdk_neptunegraph/operation/execute_query/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::execute_query::_execute_query_output::ExecuteQueryOutputBuilder;
3
4pub use crate::operation::execute_query::_execute_query_input::ExecuteQueryInputBuilder;
5
6impl crate::operation::execute_query::builders::ExecuteQueryInputBuilder {
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::execute_query::ExecuteQueryOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::execute_query::ExecuteQueryError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.execute_query();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExecuteQuery`.
24///
25/// <p>Execute an openCypher query.</p>
26/// <p>When invoking this operation in a Neptune Analytics cluster, the IAM user or role making the request must have a policy attached that allows one of the following IAM actions in that cluster, depending on the query:</p>
27/// <ul>
28/// <li>
29/// <p>neptune-graph:ReadDataViaQuery</p></li>
30/// <li>
31/// <p>neptune-graph:WriteDataViaQuery</p></li>
32/// <li>
33/// <p>neptune-graph:DeleteDataViaQuery</p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct ExecuteQueryFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::execute_query::builders::ExecuteQueryInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::execute_query::ExecuteQueryOutput,
44        crate::operation::execute_query::ExecuteQueryError,
45    > for ExecuteQueryFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::execute_query::ExecuteQueryOutput,
53            crate::operation::execute_query::ExecuteQueryError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl ExecuteQueryFluentBuilder {
60    /// Creates a new `ExecuteQueryFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the ExecuteQuery as a reference.
69    pub fn as_input(&self) -> &crate::operation::execute_query::builders::ExecuteQueryInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::execute_query::ExecuteQueryOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::execute_query::ExecuteQueryError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::execute_query::ExecuteQuery::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::execute_query::ExecuteQuery::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::execute_query::ExecuteQueryOutput,
106        crate::operation::execute_query::ExecuteQueryError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The unique identifier of the Neptune Analytics graph.</p>
121    pub fn graph_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.graph_identifier(input.into());
123        self
124    }
125    /// <p>The unique identifier of the Neptune Analytics graph.</p>
126    pub fn set_graph_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_graph_identifier(input);
128        self
129    }
130    /// <p>The unique identifier of the Neptune Analytics graph.</p>
131    pub fn get_graph_identifier(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_graph_identifier()
133    }
134    /// <p>The query string to be executed.</p>
135    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.query_string(input.into());
137        self
138    }
139    /// <p>The query string to be executed.</p>
140    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_query_string(input);
142        self
143    }
144    /// <p>The query string to be executed.</p>
145    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_query_string()
147    }
148    /// <p>The query language the query is written in. Currently only openCypher is supported.</p>
149    pub fn language(mut self, input: crate::types::QueryLanguage) -> Self {
150        self.inner = self.inner.language(input);
151        self
152    }
153    /// <p>The query language the query is written in. Currently only openCypher is supported.</p>
154    pub fn set_language(mut self, input: ::std::option::Option<crate::types::QueryLanguage>) -> Self {
155        self.inner = self.inner.set_language(input);
156        self
157    }
158    /// <p>The query language the query is written in. Currently only openCypher is supported.</p>
159    pub fn get_language(&self) -> &::std::option::Option<crate::types::QueryLanguage> {
160        self.inner.get_language()
161    }
162    ///
163    /// Adds a key-value pair to `parameters`.
164    ///
165    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
166    ///
167    /// <p>The data parameters the query can use in JSON format. For example: {"name": "john", "age": 20}. (optional)</p>
168    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
169        self.inner = self.inner.parameters(k.into(), v);
170        self
171    }
172    /// <p>The data parameters the query can use in JSON format. For example: {"name": "john", "age": 20}. (optional)</p>
173    pub fn set_parameters(
174        mut self,
175        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
176    ) -> Self {
177        self.inner = self.inner.set_parameters(input);
178        self
179    }
180    /// <p>The data parameters the query can use in JSON format. For example: {"name": "john", "age": 20}. (optional)</p>
181    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>> {
182        self.inner.get_parameters()
183    }
184    /// <p>Query plan cache is a feature that saves the query plan and reuses it on successive executions of the same query. This reduces query latency, and works for both <code>READ</code> and <code>UPDATE</code> queries. The plan cache is an LRU cache with a 5 minute TTL and a capacity of 1000.</p>
185    pub fn plan_cache(mut self, input: crate::types::PlanCacheType) -> Self {
186        self.inner = self.inner.plan_cache(input);
187        self
188    }
189    /// <p>Query plan cache is a feature that saves the query plan and reuses it on successive executions of the same query. This reduces query latency, and works for both <code>READ</code> and <code>UPDATE</code> queries. The plan cache is an LRU cache with a 5 minute TTL and a capacity of 1000.</p>
190    pub fn set_plan_cache(mut self, input: ::std::option::Option<crate::types::PlanCacheType>) -> Self {
191        self.inner = self.inner.set_plan_cache(input);
192        self
193    }
194    /// <p>Query plan cache is a feature that saves the query plan and reuses it on successive executions of the same query. This reduces query latency, and works for both <code>READ</code> and <code>UPDATE</code> queries. The plan cache is an LRU cache with a 5 minute TTL and a capacity of 1000.</p>
195    pub fn get_plan_cache(&self) -> &::std::option::Option<crate::types::PlanCacheType> {
196        self.inner.get_plan_cache()
197    }
198    /// <p>The explain mode parameter returns a query explain instead of the actual query results. A query explain can be used to gather insights about the query execution such as planning decisions, time spent on each operator, solutions flowing etc.</p>
199    pub fn explain_mode(mut self, input: crate::types::ExplainMode) -> Self {
200        self.inner = self.inner.explain_mode(input);
201        self
202    }
203    /// <p>The explain mode parameter returns a query explain instead of the actual query results. A query explain can be used to gather insights about the query execution such as planning decisions, time spent on each operator, solutions flowing etc.</p>
204    pub fn set_explain_mode(mut self, input: ::std::option::Option<crate::types::ExplainMode>) -> Self {
205        self.inner = self.inner.set_explain_mode(input);
206        self
207    }
208    /// <p>The explain mode parameter returns a query explain instead of the actual query results. A query explain can be used to gather insights about the query execution such as planning decisions, time spent on each operator, solutions flowing etc.</p>
209    pub fn get_explain_mode(&self) -> &::std::option::Option<crate::types::ExplainMode> {
210        self.inner.get_explain_mode()
211    }
212    /// <p>Specifies the query timeout duration, in milliseconds. (optional)</p>
213    pub fn query_timeout_milliseconds(mut self, input: i32) -> Self {
214        self.inner = self.inner.query_timeout_milliseconds(input);
215        self
216    }
217    /// <p>Specifies the query timeout duration, in milliseconds. (optional)</p>
218    pub fn set_query_timeout_milliseconds(mut self, input: ::std::option::Option<i32>) -> Self {
219        self.inner = self.inner.set_query_timeout_milliseconds(input);
220        self
221    }
222    /// <p>Specifies the query timeout duration, in milliseconds. (optional)</p>
223    pub fn get_query_timeout_milliseconds(&self) -> &::std::option::Option<i32> {
224        self.inner.get_query_timeout_milliseconds()
225    }
226}