aws-sdk-appsync 1.111.0

AWS SDK for AWS AppSync
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateResolverInput {
    /// <p>The ID for the GraphQL API for which the resolver is being created.</p>
    pub api_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the <code>Type</code>.</p>
    pub type_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the field to attach the resolver to.</p>
    pub field_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the data source for which the resolver is being created.</p>
    pub data_source_name: ::std::option::Option<::std::string::String>,
    /// <p>The mapping template to use for requests.</p>
    /// <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>
    /// <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>
    pub request_mapping_template: ::std::option::Option<::std::string::String>,
    /// <p>The mapping template to use for responses from the data source.</p>
    pub response_mapping_template: ::std::option::Option<::std::string::String>,
    /// <p>The resolver type.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <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>
    /// </ul>
    pub kind: ::std::option::Option<crate::types::ResolverKind>,
    /// <p>The <code>PipelineConfig</code>.</p>
    pub pipeline_config: ::std::option::Option<crate::types::PipelineConfig>,
    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
    pub sync_config: ::std::option::Option<crate::types::SyncConfig>,
    /// <p>The caching configuration for the resolver.</p>
    pub caching_config: ::std::option::Option<crate::types::CachingConfig>,
    /// <p>The maximum batching size for a resolver.</p>
    pub max_batch_size: ::std::option::Option<i32>,
    /// <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>
    pub runtime: ::std::option::Option<crate::types::AppSyncRuntime>,
    /// <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>
    pub code: ::std::option::Option<::std::string::String>,
    /// <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>
    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub metrics_config: ::std::option::Option<crate::types::ResolverLevelMetricsConfig>,
}
impl CreateResolverInput {
    /// <p>The ID for the GraphQL API for which the resolver is being created.</p>
    pub fn api_id(&self) -> ::std::option::Option<&str> {
        self.api_id.as_deref()
    }
    /// <p>The name of the <code>Type</code>.</p>
    pub fn type_name(&self) -> ::std::option::Option<&str> {
        self.type_name.as_deref()
    }
    /// <p>The name of the field to attach the resolver to.</p>
    pub fn field_name(&self) -> ::std::option::Option<&str> {
        self.field_name.as_deref()
    }
    /// <p>The name of the data source for which the resolver is being created.</p>
    pub fn data_source_name(&self) -> ::std::option::Option<&str> {
        self.data_source_name.as_deref()
    }
    /// <p>The mapping template to use for requests.</p>
    /// <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>
    /// <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>
    pub fn request_mapping_template(&self) -> ::std::option::Option<&str> {
        self.request_mapping_template.as_deref()
    }
    /// <p>The mapping template to use for responses from the data source.</p>
    pub fn response_mapping_template(&self) -> ::std::option::Option<&str> {
        self.response_mapping_template.as_deref()
    }
    /// <p>The resolver type.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <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>
    /// </ul>
    pub fn kind(&self) -> ::std::option::Option<&crate::types::ResolverKind> {
        self.kind.as_ref()
    }
    /// <p>The <code>PipelineConfig</code>.</p>
    pub fn pipeline_config(&self) -> ::std::option::Option<&crate::types::PipelineConfig> {
        self.pipeline_config.as_ref()
    }
    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
    pub fn sync_config(&self) -> ::std::option::Option<&crate::types::SyncConfig> {
        self.sync_config.as_ref()
    }
    /// <p>The caching configuration for the resolver.</p>
    pub fn caching_config(&self) -> ::std::option::Option<&crate::types::CachingConfig> {
        self.caching_config.as_ref()
    }
    /// <p>The maximum batching size for a resolver.</p>
    pub fn max_batch_size(&self) -> ::std::option::Option<i32> {
        self.max_batch_size
    }
    /// <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>
    pub fn runtime(&self) -> ::std::option::Option<&crate::types::AppSyncRuntime> {
        self.runtime.as_ref()
    }
    /// <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>
    pub fn code(&self) -> ::std::option::Option<&str> {
        self.code.as_deref()
    }
    /// <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>
    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn metrics_config(&self) -> ::std::option::Option<&crate::types::ResolverLevelMetricsConfig> {
        self.metrics_config.as_ref()
    }
}
impl CreateResolverInput {
    /// Creates a new builder-style object to manufacture [`CreateResolverInput`](crate::operation::create_resolver::CreateResolverInput).
    pub fn builder() -> crate::operation::create_resolver::builders::CreateResolverInputBuilder {
        crate::operation::create_resolver::builders::CreateResolverInputBuilder::default()
    }
}

/// A builder for [`CreateResolverInput`](crate::operation::create_resolver::CreateResolverInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateResolverInputBuilder {
    pub(crate) api_id: ::std::option::Option<::std::string::String>,
    pub(crate) type_name: ::std::option::Option<::std::string::String>,
    pub(crate) field_name: ::std::option::Option<::std::string::String>,
    pub(crate) data_source_name: ::std::option::Option<::std::string::String>,
    pub(crate) request_mapping_template: ::std::option::Option<::std::string::String>,
    pub(crate) response_mapping_template: ::std::option::Option<::std::string::String>,
    pub(crate) kind: ::std::option::Option<crate::types::ResolverKind>,
    pub(crate) pipeline_config: ::std::option::Option<crate::types::PipelineConfig>,
    pub(crate) sync_config: ::std::option::Option<crate::types::SyncConfig>,
    pub(crate) caching_config: ::std::option::Option<crate::types::CachingConfig>,
    pub(crate) max_batch_size: ::std::option::Option<i32>,
    pub(crate) runtime: ::std::option::Option<crate::types::AppSyncRuntime>,
    pub(crate) code: ::std::option::Option<::std::string::String>,
    pub(crate) metrics_config: ::std::option::Option<crate::types::ResolverLevelMetricsConfig>,
}
impl CreateResolverInputBuilder {
    /// <p>The ID for the GraphQL API for which the resolver is being created.</p>
    /// This field is required.
    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.api_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID for the GraphQL API for which the resolver is being created.</p>
    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.api_id = input;
        self
    }
    /// <p>The ID for the GraphQL API for which the resolver is being created.</p>
    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.api_id
    }
    /// <p>The name of the <code>Type</code>.</p>
    /// This field is required.
    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.type_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the <code>Type</code>.</p>
    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.type_name = input;
        self
    }
    /// <p>The name of the <code>Type</code>.</p>
    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.type_name
    }
    /// <p>The name of the field to attach the resolver to.</p>
    /// This field is required.
    pub fn field_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.field_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the field to attach the resolver to.</p>
    pub fn set_field_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.field_name = input;
        self
    }
    /// <p>The name of the field to attach the resolver to.</p>
    pub fn get_field_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.field_name
    }
    /// <p>The name of the data source for which the resolver is being created.</p>
    pub fn data_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.data_source_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the data source for which the resolver is being created.</p>
    pub fn set_data_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.data_source_name = input;
        self
    }
    /// <p>The name of the data source for which the resolver is being created.</p>
    pub fn get_data_source_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_source_name
    }
    /// <p>The mapping template to use for requests.</p>
    /// <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>
    /// <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>
    pub fn request_mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.request_mapping_template = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The mapping template to use for requests.</p>
    /// <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>
    /// <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>
    pub fn set_request_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.request_mapping_template = input;
        self
    }
    /// <p>The mapping template to use for requests.</p>
    /// <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>
    /// <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>
    pub fn get_request_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
        &self.request_mapping_template
    }
    /// <p>The mapping template to use for responses from the data source.</p>
    pub fn response_mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.response_mapping_template = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The mapping template to use for responses from the data source.</p>
    pub fn set_response_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.response_mapping_template = input;
        self
    }
    /// <p>The mapping template to use for responses from the data source.</p>
    pub fn get_response_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
        &self.response_mapping_template
    }
    /// <p>The resolver type.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <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>
    /// </ul>
    pub fn kind(mut self, input: crate::types::ResolverKind) -> Self {
        self.kind = ::std::option::Option::Some(input);
        self
    }
    /// <p>The resolver type.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <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>
    /// </ul>
    pub fn set_kind(mut self, input: ::std::option::Option<crate::types::ResolverKind>) -> Self {
        self.kind = input;
        self
    }
    /// <p>The resolver type.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <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>
    /// </ul>
    pub fn get_kind(&self) -> &::std::option::Option<crate::types::ResolverKind> {
        &self.kind
    }
    /// <p>The <code>PipelineConfig</code>.</p>
    pub fn pipeline_config(mut self, input: crate::types::PipelineConfig) -> Self {
        self.pipeline_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The <code>PipelineConfig</code>.</p>
    pub fn set_pipeline_config(mut self, input: ::std::option::Option<crate::types::PipelineConfig>) -> Self {
        self.pipeline_config = input;
        self
    }
    /// <p>The <code>PipelineConfig</code>.</p>
    pub fn get_pipeline_config(&self) -> &::std::option::Option<crate::types::PipelineConfig> {
        &self.pipeline_config
    }
    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
    pub fn sync_config(mut self, input: crate::types::SyncConfig) -> Self {
        self.sync_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
    pub fn set_sync_config(mut self, input: ::std::option::Option<crate::types::SyncConfig>) -> Self {
        self.sync_config = input;
        self
    }
    /// <p>The <code>SyncConfig</code> for a resolver attached to a versioned data source.</p>
    pub fn get_sync_config(&self) -> &::std::option::Option<crate::types::SyncConfig> {
        &self.sync_config
    }
    /// <p>The caching configuration for the resolver.</p>
    pub fn caching_config(mut self, input: crate::types::CachingConfig) -> Self {
        self.caching_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The caching configuration for the resolver.</p>
    pub fn set_caching_config(mut self, input: ::std::option::Option<crate::types::CachingConfig>) -> Self {
        self.caching_config = input;
        self
    }
    /// <p>The caching configuration for the resolver.</p>
    pub fn get_caching_config(&self) -> &::std::option::Option<crate::types::CachingConfig> {
        &self.caching_config
    }
    /// <p>The maximum batching size for a resolver.</p>
    pub fn max_batch_size(mut self, input: i32) -> Self {
        self.max_batch_size = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum batching size for a resolver.</p>
    pub fn set_max_batch_size(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_batch_size = input;
        self
    }
    /// <p>The maximum batching size for a resolver.</p>
    pub fn get_max_batch_size(&self) -> &::std::option::Option<i32> {
        &self.max_batch_size
    }
    /// <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>
    pub fn runtime(mut self, input: crate::types::AppSyncRuntime) -> Self {
        self.runtime = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    pub fn set_runtime(mut self, input: ::std::option::Option<crate::types::AppSyncRuntime>) -> Self {
        self.runtime = input;
        self
    }
    /// <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>
    pub fn get_runtime(&self) -> &::std::option::Option<crate::types::AppSyncRuntime> {
        &self.runtime
    }
    /// <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>
    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.code = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.code = input;
        self
    }
    /// <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>
    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.code
    }
    /// <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>
    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn metrics_config(mut self, input: crate::types::ResolverLevelMetricsConfig) -> Self {
        self.metrics_config = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn set_metrics_config(mut self, input: ::std::option::Option<crate::types::ResolverLevelMetricsConfig>) -> Self {
        self.metrics_config = input;
        self
    }
    /// <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>
    /// <p><code>metricsConfig</code> can be <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn get_metrics_config(&self) -> &::std::option::Option<crate::types::ResolverLevelMetricsConfig> {
        &self.metrics_config
    }
    /// Consumes the builder and constructs a [`CreateResolverInput`](crate::operation::create_resolver::CreateResolverInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_resolver::CreateResolverInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_resolver::CreateResolverInput {
            api_id: self.api_id,
            type_name: self.type_name,
            field_name: self.field_name,
            data_source_name: self.data_source_name,
            request_mapping_template: self.request_mapping_template,
            response_mapping_template: self.response_mapping_template,
            kind: self.kind,
            pipeline_config: self.pipeline_config,
            sync_config: self.sync_config,
            caching_config: self.caching_config,
            max_batch_size: self.max_batch_size,
            runtime: self.runtime,
            code: self.code,
            metrics_config: self.metrics_config,
        })
    }
}