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.

/// <p>Describes a resolver.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Resolver {
    /// <p>The resolver type name.</p>
    pub type_name: ::std::option::Option<::std::string::String>,
    /// <p>The resolver field name.</p>
    pub field_name: ::std::option::Option<::std::string::String>,
    /// <p>The resolver data source name.</p>
    pub data_source_name: ::std::option::Option<::std::string::String>,
    /// <p>The resolver Amazon Resource Name (ARN).</p>
    pub resolver_arn: ::std::option::Option<::std::string::String>,
    /// <p>The request mapping template.</p>
    pub request_mapping_template: ::std::option::Option<::std::string::String>,
    /// <p>The response mapping template.</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: 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 Resolver {
    /// <p>The resolver type name.</p>
    pub fn type_name(&self) -> ::std::option::Option<&str> {
        self.type_name.as_deref()
    }
    /// <p>The resolver field name.</p>
    pub fn field_name(&self) -> ::std::option::Option<&str> {
        self.field_name.as_deref()
    }
    /// <p>The resolver data source name.</p>
    pub fn data_source_name(&self) -> ::std::option::Option<&str> {
        self.data_source_name.as_deref()
    }
    /// <p>The resolver Amazon Resource Name (ARN).</p>
    pub fn resolver_arn(&self) -> ::std::option::Option<&str> {
        self.resolver_arn.as_deref()
    }
    /// <p>The request mapping template.</p>
    pub fn request_mapping_template(&self) -> ::std::option::Option<&str> {
        self.request_mapping_template.as_deref()
    }
    /// <p>The response mapping template.</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) -> 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 Resolver {
    /// Creates a new builder-style object to manufacture [`Resolver`](crate::types::Resolver).
    pub fn builder() -> crate::types::builders::ResolverBuilder {
        crate::types::builders::ResolverBuilder::default()
    }
}

/// A builder for [`Resolver`](crate::types::Resolver).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ResolverBuilder {
    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) resolver_arn: ::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 ResolverBuilder {
    /// <p>The resolver type name.</p>
    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 resolver type name.</p>
    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.type_name = input;
        self
    }
    /// <p>The resolver type name.</p>
    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.type_name
    }
    /// <p>The resolver field name.</p>
    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 resolver field name.</p>
    pub fn set_field_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.field_name = input;
        self
    }
    /// <p>The resolver field name.</p>
    pub fn get_field_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.field_name
    }
    /// <p>The resolver data source name.</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 resolver data source name.</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 resolver data source name.</p>
    pub fn get_data_source_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_source_name
    }
    /// <p>The resolver Amazon Resource Name (ARN).</p>
    pub fn resolver_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resolver_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The resolver Amazon Resource Name (ARN).</p>
    pub fn set_resolver_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resolver_arn = input;
        self
    }
    /// <p>The resolver Amazon Resource Name (ARN).</p>
    pub fn get_resolver_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resolver_arn
    }
    /// <p>The request mapping template.</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 request mapping template.</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 request mapping template.</p>
    pub fn get_request_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
        &self.request_mapping_template
    }
    /// <p>The response mapping template.</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 response mapping template.</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 response mapping template.</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 [`Resolver`](crate::types::Resolver).
    pub fn build(self) -> crate::types::Resolver {
        crate::types::Resolver {
            type_name: self.type_name,
            field_name: self.field_name,
            data_source_name: self.data_source_name,
            resolver_arn: self.resolver_arn,
            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.unwrap_or_default(),
            runtime: self.runtime,
            code: self.code,
            metrics_config: self.metrics_config,
        }
    }
}