aws_sdk_appsync/operation/update_resolver/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_resolver::_update_resolver_output::UpdateResolverOutputBuilder;
3
4pub use crate::operation::update_resolver::_update_resolver_input::UpdateResolverInputBuilder;
5
6impl crate::operation::update_resolver::builders::UpdateResolverInputBuilder {
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::update_resolver::UpdateResolverOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_resolver::UpdateResolverError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_resolver();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateResolver`.
24///
25/// <p>Updates a <code>Resolver</code> object.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateResolverFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_resolver::builders::UpdateResolverInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_resolver::UpdateResolverOutput,
35        crate::operation::update_resolver::UpdateResolverError,
36    > for UpdateResolverFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_resolver::UpdateResolverOutput,
44            crate::operation::update_resolver::UpdateResolverError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateResolverFluentBuilder {
51    /// Creates a new `UpdateResolverFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateResolver as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_resolver::builders::UpdateResolverInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_resolver::UpdateResolverOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_resolver::UpdateResolverError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_resolver::UpdateResolver::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_resolver::UpdateResolver::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_resolver::UpdateResolverOutput,
97        crate::operation::update_resolver::UpdateResolverError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The API ID.</p>
112    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.api_id(input.into());
114        self
115    }
116    /// <p>The API ID.</p>
117    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_api_id(input);
119        self
120    }
121    /// <p>The API ID.</p>
122    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_api_id()
124    }
125    /// <p>The new type name.</p>
126    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.type_name(input.into());
128        self
129    }
130    /// <p>The new type name.</p>
131    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_type_name(input);
133        self
134    }
135    /// <p>The new type name.</p>
136    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_type_name()
138    }
139    /// <p>The new field name.</p>
140    pub fn field_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.field_name(input.into());
142        self
143    }
144    /// <p>The new field name.</p>
145    pub fn set_field_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_field_name(input);
147        self
148    }
149    /// <p>The new field name.</p>
150    pub fn get_field_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_field_name()
152    }
153    /// <p>The new data source name.</p>
154    pub fn data_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.data_source_name(input.into());
156        self
157    }
158    /// <p>The new data source name.</p>
159    pub fn set_data_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_data_source_name(input);
161        self
162    }
163    /// <p>The new data source name.</p>
164    pub fn get_data_source_name(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_data_source_name()
166    }
167    /// <p>The new request mapping template.</p>
168    /// <p>A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).</p>
169    /// <p>VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.</p>
170    pub fn request_mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.request_mapping_template(input.into());
172        self
173    }
174    /// <p>The new request mapping template.</p>
175    /// <p>A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).</p>
176    /// <p>VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.</p>
177    pub fn set_request_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_request_mapping_template(input);
179        self
180    }
181    /// <p>The new request mapping template.</p>
182    /// <p>A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).</p>
183    /// <p>VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.</p>
184    pub fn get_request_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
185        self.inner.get_request_mapping_template()
186    }
187    /// <p>The new response mapping template.</p>
188    pub fn response_mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.inner = self.inner.response_mapping_template(input.into());
190        self
191    }
192    /// <p>The new response mapping template.</p>
193    pub fn set_response_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.inner = self.inner.set_response_mapping_template(input);
195        self
196    }
197    /// <p>The new response mapping template.</p>
198    pub fn get_response_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
199        self.inner.get_response_mapping_template()
200    }
201    /// <p>The resolver type.</p>
202    /// <ul>
203    /// <li>
204    /// <p><b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p></li>
205    /// <li>
206    /// <p><b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p></li>
207    /// </ul>
208    pub fn kind(mut self, input: crate::types::ResolverKind) -> Self {
209        self.inner = self.inner.kind(input);
210        self
211    }
212    /// <p>The resolver type.</p>
213    /// <ul>
214    /// <li>
215    /// <p><b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p></li>
216    /// <li>
217    /// <p><b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p></li>
218    /// </ul>
219    pub fn set_kind(mut self, input: ::std::option::Option<crate::types::ResolverKind>) -> Self {
220        self.inner = self.inner.set_kind(input);
221        self
222    }
223    /// <p>The resolver type.</p>
224    /// <ul>
225    /// <li>
226    /// <p><b>UNIT</b>: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.</p></li>
227    /// <li>
228    /// <p><b>PIPELINE</b>: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of <code>Function</code> objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.</p></li>
229    /// </ul>
230    pub fn get_kind(&self) -> &::std::option::Option<crate::types::ResolverKind> {
231        self.inner.get_kind()
232    }
233    /// <p>The <code>PipelineConfig</code>.</p>
234    pub fn pipeline_config(mut self, input: crate::types::PipelineConfig) -> Self {
235        self.inner = self.inner.pipeline_config(input);
236        self
237    }
238    /// <p>The <code>PipelineConfig</code>.</p>
239    pub fn set_pipeline_config(mut self, input: ::std::option::Option<crate::types::PipelineConfig>) -> Self {
240        self.inner = self.inner.set_pipeline_config(input);
241        self
242    }
243    /// <p>The <code>PipelineConfig</code>.</p>
244    pub fn get_pipeline_config(&self) -> &::std::option::Option<crate::types::PipelineConfig> {
245        self.inner.get_pipeline_config()
246    }
247    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
248    pub fn sync_config(mut self, input: crate::types::SyncConfig) -> Self {
249        self.inner = self.inner.sync_config(input);
250        self
251    }
252    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
253    pub fn set_sync_config(mut self, input: ::std::option::Option<crate::types::SyncConfig>) -> Self {
254        self.inner = self.inner.set_sync_config(input);
255        self
256    }
257    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
258    pub fn get_sync_config(&self) -> &::std::option::Option<crate::types::SyncConfig> {
259        self.inner.get_sync_config()
260    }
261    /// <p>The caching configuration for the resolver.</p>
262    pub fn caching_config(mut self, input: crate::types::CachingConfig) -> Self {
263        self.inner = self.inner.caching_config(input);
264        self
265    }
266    /// <p>The caching configuration for the resolver.</p>
267    pub fn set_caching_config(mut self, input: ::std::option::Option<crate::types::CachingConfig>) -> Self {
268        self.inner = self.inner.set_caching_config(input);
269        self
270    }
271    /// <p>The caching configuration for the resolver.</p>
272    pub fn get_caching_config(&self) -> &::std::option::Option<crate::types::CachingConfig> {
273        self.inner.get_caching_config()
274    }
275    /// <p>The maximum batching size for a resolver.</p>
276    pub fn max_batch_size(mut self, input: i32) -> Self {
277        self.inner = self.inner.max_batch_size(input);
278        self
279    }
280    /// <p>The maximum batching size for a resolver.</p>
281    pub fn set_max_batch_size(mut self, input: ::std::option::Option<i32>) -> Self {
282        self.inner = self.inner.set_max_batch_size(input);
283        self
284    }
285    /// <p>The maximum batching size for a resolver.</p>
286    pub fn get_max_batch_size(&self) -> &::std::option::Option<i32> {
287        self.inner.get_max_batch_size()
288    }
289    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
290    pub fn runtime(mut self, input: crate::types::AppSyncRuntime) -> Self {
291        self.inner = self.inner.runtime(input);
292        self
293    }
294    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
295    pub fn set_runtime(mut self, input: ::std::option::Option<crate::types::AppSyncRuntime>) -> Self {
296        self.inner = self.inner.set_runtime(input);
297        self
298    }
299    /// <p>Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.</p>
300    pub fn get_runtime(&self) -> &::std::option::Option<crate::types::AppSyncRuntime> {
301        self.inner.get_runtime()
302    }
303    /// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
304    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305        self.inner = self.inner.code(input.into());
306        self
307    }
308    /// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
309    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310        self.inner = self.inner.set_code(input);
311        self
312    }
313    /// <p>The <code>resolver</code> code that contains the request and response functions. When code is used, the <code>runtime</code> is required. The <code>runtime</code> value must be <code>APPSYNC_JS</code>.</p>
314    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
315        self.inner.get_code()
316    }
317    /// <p>Enables or disables enhanced resolver metrics for specified resolvers. Note that <code>metricsConfig</code> won't be used unless the <code>resolverLevelMetricsBehavior</code> value is set to <code>PER_RESOLVER_METRICS</code>. If the <code>resolverLevelMetricsBehavior</code> is set to <code>FULL_REQUEST_RESOLVER_METRICS</code> instead, <code>metricsConfig</code> will be ignored. However, you can still set its value.</p>
318    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
319    pub fn metrics_config(mut self, input: crate::types::ResolverLevelMetricsConfig) -> Self {
320        self.inner = self.inner.metrics_config(input);
321        self
322    }
323    /// <p>Enables or disables enhanced resolver metrics for specified resolvers. Note that <code>metricsConfig</code> won't be used unless the <code>resolverLevelMetricsBehavior</code> value is set to <code>PER_RESOLVER_METRICS</code>. If the <code>resolverLevelMetricsBehavior</code> is set to <code>FULL_REQUEST_RESOLVER_METRICS</code> instead, <code>metricsConfig</code> will be ignored. However, you can still set its value.</p>
324    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
325    pub fn set_metrics_config(mut self, input: ::std::option::Option<crate::types::ResolverLevelMetricsConfig>) -> Self {
326        self.inner = self.inner.set_metrics_config(input);
327        self
328    }
329    /// <p>Enables or disables enhanced resolver metrics for specified resolvers. Note that <code>metricsConfig</code> won't be used unless the <code>resolverLevelMetricsBehavior</code> value is set to <code>PER_RESOLVER_METRICS</code>. If the <code>resolverLevelMetricsBehavior</code> is set to <code>FULL_REQUEST_RESOLVER_METRICS</code> instead, <code>metricsConfig</code> will be ignored. However, you can still set its value.</p>
330    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
331    pub fn get_metrics_config(&self) -> &::std::option::Option<crate::types::ResolverLevelMetricsConfig> {
332        self.inner.get_metrics_config()
333    }
334}