aws_sdk_appsync/operation/create_graphql_api/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_graphql_api::_create_graphql_api_output::CreateGraphqlApiOutputBuilder;
3
4pub use crate::operation::create_graphql_api::_create_graphql_api_input::CreateGraphqlApiInputBuilder;
5
6impl crate::operation::create_graphql_api::builders::CreateGraphqlApiInputBuilder {
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::create_graphql_api::CreateGraphqlApiOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_graphql_api::CreateGraphqlApiError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_graphql_api();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateGraphqlApi`.
24///
25/// <p>Creates a <code>GraphqlApi</code> object.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateGraphqlApiFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_graphql_api::builders::CreateGraphqlApiInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_graphql_api::CreateGraphqlApiOutput,
35        crate::operation::create_graphql_api::CreateGraphqlApiError,
36    > for CreateGraphqlApiFluentBuilder
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::create_graphql_api::CreateGraphqlApiOutput,
44            crate::operation::create_graphql_api::CreateGraphqlApiError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateGraphqlApiFluentBuilder {
51    /// Creates a new `CreateGraphqlApiFluentBuilder`.
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 CreateGraphqlApi as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_graphql_api::builders::CreateGraphqlApiInputBuilder {
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::create_graphql_api::CreateGraphqlApiOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_graphql_api::CreateGraphqlApiError,
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::create_graphql_api::CreateGraphqlApi::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_graphql_api::CreateGraphqlApi::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::create_graphql_api::CreateGraphqlApiOutput,
97        crate::operation::create_graphql_api::CreateGraphqlApiError,
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>A user-supplied name for the <code>GraphqlApi</code>.</p>
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.name(input.into());
114        self
115    }
116    /// <p>A user-supplied name for the <code>GraphqlApi</code>.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_name(input);
119        self
120    }
121    /// <p>A user-supplied name for the <code>GraphqlApi</code>.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The Amazon CloudWatch Logs configuration.</p>
126    pub fn log_config(mut self, input: crate::types::LogConfig) -> Self {
127        self.inner = self.inner.log_config(input);
128        self
129    }
130    /// <p>The Amazon CloudWatch Logs configuration.</p>
131    pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::LogConfig>) -> Self {
132        self.inner = self.inner.set_log_config(input);
133        self
134    }
135    /// <p>The Amazon CloudWatch Logs configuration.</p>
136    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::LogConfig> {
137        self.inner.get_log_config()
138    }
139    /// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
140    pub fn authentication_type(mut self, input: crate::types::AuthenticationType) -> Self {
141        self.inner = self.inner.authentication_type(input);
142        self
143    }
144    /// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
145    pub fn set_authentication_type(mut self, input: ::std::option::Option<crate::types::AuthenticationType>) -> Self {
146        self.inner = self.inner.set_authentication_type(input);
147        self
148    }
149    /// <p>The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>
150    pub fn get_authentication_type(&self) -> &::std::option::Option<crate::types::AuthenticationType> {
151        self.inner.get_authentication_type()
152    }
153    /// <p>The Amazon Cognito user pool configuration.</p>
154    pub fn user_pool_config(mut self, input: crate::types::UserPoolConfig) -> Self {
155        self.inner = self.inner.user_pool_config(input);
156        self
157    }
158    /// <p>The Amazon Cognito user pool configuration.</p>
159    pub fn set_user_pool_config(mut self, input: ::std::option::Option<crate::types::UserPoolConfig>) -> Self {
160        self.inner = self.inner.set_user_pool_config(input);
161        self
162    }
163    /// <p>The Amazon Cognito user pool configuration.</p>
164    pub fn get_user_pool_config(&self) -> &::std::option::Option<crate::types::UserPoolConfig> {
165        self.inner.get_user_pool_config()
166    }
167    /// <p>The OIDC configuration.</p>
168    pub fn open_id_connect_config(mut self, input: crate::types::OpenIdConnectConfig) -> Self {
169        self.inner = self.inner.open_id_connect_config(input);
170        self
171    }
172    /// <p>The OIDC configuration.</p>
173    pub fn set_open_id_connect_config(mut self, input: ::std::option::Option<crate::types::OpenIdConnectConfig>) -> Self {
174        self.inner = self.inner.set_open_id_connect_config(input);
175        self
176    }
177    /// <p>The OIDC configuration.</p>
178    pub fn get_open_id_connect_config(&self) -> &::std::option::Option<crate::types::OpenIdConnectConfig> {
179        self.inner.get_open_id_connect_config()
180    }
181    ///
182    /// Adds a key-value pair to `tags`.
183    ///
184    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
185    ///
186    /// <p>A <code>TagMap</code> object.</p>
187    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.tags(k.into(), v.into());
189        self
190    }
191    /// <p>A <code>TagMap</code> object.</p>
192    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
193        self.inner = self.inner.set_tags(input);
194        self
195    }
196    /// <p>A <code>TagMap</code> object.</p>
197    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
198        self.inner.get_tags()
199    }
200    ///
201    /// Appends an item to `additionalAuthenticationProviders`.
202    ///
203    /// To override the contents of this collection use [`set_additional_authentication_providers`](Self::set_additional_authentication_providers).
204    ///
205    /// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
206    pub fn additional_authentication_providers(mut self, input: crate::types::AdditionalAuthenticationProvider) -> Self {
207        self.inner = self.inner.additional_authentication_providers(input);
208        self
209    }
210    /// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
211    pub fn set_additional_authentication_providers(
212        mut self,
213        input: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalAuthenticationProvider>>,
214    ) -> Self {
215        self.inner = self.inner.set_additional_authentication_providers(input);
216        self
217    }
218    /// <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
219    pub fn get_additional_authentication_providers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AdditionalAuthenticationProvider>> {
220        self.inner.get_additional_authentication_providers()
221    }
222    /// <p>A flag indicating whether to use X-Ray tracing for the <code>GraphqlApi</code>.</p>
223    pub fn xray_enabled(mut self, input: bool) -> Self {
224        self.inner = self.inner.xray_enabled(input);
225        self
226    }
227    /// <p>A flag indicating whether to use X-Ray tracing for the <code>GraphqlApi</code>.</p>
228    pub fn set_xray_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
229        self.inner = self.inner.set_xray_enabled(input);
230        self
231    }
232    /// <p>A flag indicating whether to use X-Ray tracing for the <code>GraphqlApi</code>.</p>
233    pub fn get_xray_enabled(&self) -> &::std::option::Option<bool> {
234        self.inner.get_xray_enabled()
235    }
236    /// <p>Configuration for Lambda function authorization.</p>
237    pub fn lambda_authorizer_config(mut self, input: crate::types::LambdaAuthorizerConfig) -> Self {
238        self.inner = self.inner.lambda_authorizer_config(input);
239        self
240    }
241    /// <p>Configuration for Lambda function authorization.</p>
242    pub fn set_lambda_authorizer_config(mut self, input: ::std::option::Option<crate::types::LambdaAuthorizerConfig>) -> Self {
243        self.inner = self.inner.set_lambda_authorizer_config(input);
244        self
245    }
246    /// <p>Configuration for Lambda function authorization.</p>
247    pub fn get_lambda_authorizer_config(&self) -> &::std::option::Option<crate::types::LambdaAuthorizerConfig> {
248        self.inner.get_lambda_authorizer_config()
249    }
250    /// <p>The value that indicates whether the GraphQL API is a standard API (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>
251    pub fn api_type(mut self, input: crate::types::GraphQlApiType) -> Self {
252        self.inner = self.inner.api_type(input);
253        self
254    }
255    /// <p>The value that indicates whether the GraphQL API is a standard API (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>
256    pub fn set_api_type(mut self, input: ::std::option::Option<crate::types::GraphQlApiType>) -> Self {
257        self.inner = self.inner.set_api_type(input);
258        self
259    }
260    /// <p>The value that indicates whether the GraphQL API is a standard API (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>
261    pub fn get_api_type(&self) -> &::std::option::Option<crate::types::GraphQlApiType> {
262        self.inner.get_api_type()
263    }
264    /// <p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>
265    pub fn merged_api_execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266        self.inner = self.inner.merged_api_execution_role_arn(input.into());
267        self
268    }
269    /// <p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>
270    pub fn set_merged_api_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.inner = self.inner.set_merged_api_execution_role_arn(input);
272        self
273    }
274    /// <p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>
275    pub fn get_merged_api_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
276        self.inner.get_merged_api_execution_role_arn()
277    }
278    /// <p>Sets the value of the GraphQL API to public (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API has been created.</p>
279    pub fn visibility(mut self, input: crate::types::GraphQlApiVisibility) -> Self {
280        self.inner = self.inner.visibility(input);
281        self
282    }
283    /// <p>Sets the value of the GraphQL API to public (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API has been created.</p>
284    pub fn set_visibility(mut self, input: ::std::option::Option<crate::types::GraphQlApiVisibility>) -> Self {
285        self.inner = self.inner.set_visibility(input);
286        self
287    }
288    /// <p>Sets the value of the GraphQL API to public (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API has been created.</p>
289    pub fn get_visibility(&self) -> &::std::option::Option<crate::types::GraphQlApiVisibility> {
290        self.inner.get_visibility()
291    }
292    /// <p>The owner contact information for an API resource.</p>
293    /// <p>This field accepts any string input with a length of 0 - 256 characters.</p>
294    pub fn owner_contact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
295        self.inner = self.inner.owner_contact(input.into());
296        self
297    }
298    /// <p>The owner contact information for an API resource.</p>
299    /// <p>This field accepts any string input with a length of 0 - 256 characters.</p>
300    pub fn set_owner_contact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301        self.inner = self.inner.set_owner_contact(input);
302        self
303    }
304    /// <p>The owner contact information for an API resource.</p>
305    /// <p>This field accepts any string input with a length of 0 - 256 characters.</p>
306    pub fn get_owner_contact(&self) -> &::std::option::Option<::std::string::String> {
307        self.inner.get_owner_contact()
308    }
309    /// <p>Sets the value of the GraphQL API to enable (<code>ENABLED</code>) or disable (<code>DISABLED</code>) introspection. If no value is provided, the introspection configuration will be set to <code>ENABLED</code> by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.</p>
310    /// <p>For more information about introspection, see <a href="https://graphql.org/learn/introspection/">GraphQL introspection</a>.</p>
311    pub fn introspection_config(mut self, input: crate::types::GraphQlApiIntrospectionConfig) -> Self {
312        self.inner = self.inner.introspection_config(input);
313        self
314    }
315    /// <p>Sets the value of the GraphQL API to enable (<code>ENABLED</code>) or disable (<code>DISABLED</code>) introspection. If no value is provided, the introspection configuration will be set to <code>ENABLED</code> by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.</p>
316    /// <p>For more information about introspection, see <a href="https://graphql.org/learn/introspection/">GraphQL introspection</a>.</p>
317    pub fn set_introspection_config(mut self, input: ::std::option::Option<crate::types::GraphQlApiIntrospectionConfig>) -> Self {
318        self.inner = self.inner.set_introspection_config(input);
319        self
320    }
321    /// <p>Sets the value of the GraphQL API to enable (<code>ENABLED</code>) or disable (<code>DISABLED</code>) introspection. If no value is provided, the introspection configuration will be set to <code>ENABLED</code> by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.</p>
322    /// <p>For more information about introspection, see <a href="https://graphql.org/learn/introspection/">GraphQL introspection</a>.</p>
323    pub fn get_introspection_config(&self) -> &::std::option::Option<crate::types::GraphQlApiIntrospectionConfig> {
324        self.inner.get_introspection_config()
325    }
326    /// <p>The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is <code>0</code> (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between <code>1</code> and <code>75</code> nested levels. This field will produce a limit error if the operation falls out of bounds.</p>
327    /// <p>Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.</p>
328    pub fn query_depth_limit(mut self, input: i32) -> Self {
329        self.inner = self.inner.query_depth_limit(input);
330        self
331    }
332    /// <p>The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is <code>0</code> (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between <code>1</code> and <code>75</code> nested levels. This field will produce a limit error if the operation falls out of bounds.</p>
333    /// <p>Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.</p>
334    pub fn set_query_depth_limit(mut self, input: ::std::option::Option<i32>) -> Self {
335        self.inner = self.inner.set_query_depth_limit(input);
336        self
337    }
338    /// <p>The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is <code>0</code> (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between <code>1</code> and <code>75</code> nested levels. This field will produce a limit error if the operation falls out of bounds.</p>
339    /// <p>Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.</p>
340    pub fn get_query_depth_limit(&self) -> &::std::option::Option<i32> {
341        self.inner.get_query_depth_limit()
342    }
343    /// <p>The maximum number of resolvers that can be invoked in a single request. The default value is <code>0</code> (or unspecified), which will set the limit to <code>10000</code>. When specified, the limit value can be between <code>1</code> and <code>10000</code>. This field will produce a limit error if the operation falls out of bounds.</p>
344    pub fn resolver_count_limit(mut self, input: i32) -> Self {
345        self.inner = self.inner.resolver_count_limit(input);
346        self
347    }
348    /// <p>The maximum number of resolvers that can be invoked in a single request. The default value is <code>0</code> (or unspecified), which will set the limit to <code>10000</code>. When specified, the limit value can be between <code>1</code> and <code>10000</code>. This field will produce a limit error if the operation falls out of bounds.</p>
349    pub fn set_resolver_count_limit(mut self, input: ::std::option::Option<i32>) -> Self {
350        self.inner = self.inner.set_resolver_count_limit(input);
351        self
352    }
353    /// <p>The maximum number of resolvers that can be invoked in a single request. The default value is <code>0</code> (or unspecified), which will set the limit to <code>10000</code>. When specified, the limit value can be between <code>1</code> and <code>10000</code>. This field will produce a limit error if the operation falls out of bounds.</p>
354    pub fn get_resolver_count_limit(&self) -> &::std::option::Option<i32> {
355        self.inner.get_resolver_count_limit()
356    }
357    /// <p>The <code>enhancedMetricsConfig</code> object.</p>
358    pub fn enhanced_metrics_config(mut self, input: crate::types::EnhancedMetricsConfig) -> Self {
359        self.inner = self.inner.enhanced_metrics_config(input);
360        self
361    }
362    /// <p>The <code>enhancedMetricsConfig</code> object.</p>
363    pub fn set_enhanced_metrics_config(mut self, input: ::std::option::Option<crate::types::EnhancedMetricsConfig>) -> Self {
364        self.inner = self.inner.set_enhanced_metrics_config(input);
365        self
366    }
367    /// <p>The <code>enhancedMetricsConfig</code> object.</p>
368    pub fn get_enhanced_metrics_config(&self) -> &::std::option::Option<crate::types::EnhancedMetricsConfig> {
369        self.inner.get_enhanced_metrics_config()
370    }
371}