All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.appsync.model.CreateResolverRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.appsync.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateResolverRequest private constructor(builder: Builder) {
    /**
     * The ID for the GraphQL API for which the resolver is being created.
     */
    public val apiId: kotlin.String? = builder.apiId
    /**
     * The caching configuration for the resolver.
     */
    public val cachingConfig: aws.sdk.kotlin.services.appsync.model.CachingConfig? = builder.cachingConfig
    /**
     * The `resolver` code that contains the request and response functions. When code is used, the `runtime` is required. The `runtime` value must be `APPSYNC_JS`.
     */
    public val code: kotlin.String? = builder.code
    /**
     * The name of the data source for which the resolver is being created.
     */
    public val dataSourceName: kotlin.String? = builder.dataSourceName
    /**
     * The name of the field to attach the resolver to.
     */
    public val fieldName: kotlin.String? = builder.fieldName
    /**
     * The resolver type.
     * + **UNIT**: 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.
     * + **PIPELINE**: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of `Function` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
     */
    public val kind: aws.sdk.kotlin.services.appsync.model.ResolverKind? = builder.kind
    /**
     * The maximum batching size for a resolver.
     */
    public val maxBatchSize: kotlin.Int? = builder.maxBatchSize
    /**
     * Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its value.
     *
     * `metricsConfig` can be `ENABLED` or `DISABLED`.
     */
    public val metricsConfig: aws.sdk.kotlin.services.appsync.model.ResolverLevelMetricsConfig? = builder.metricsConfig
    /**
     * The `PipelineConfig`.
     */
    public val pipelineConfig: aws.sdk.kotlin.services.appsync.model.PipelineConfig? = builder.pipelineConfig
    /**
     * The mapping template to use for requests.
     *
     * 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).
     *
     * 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.
     */
    public val requestMappingTemplate: kotlin.String? = builder.requestMappingTemplate
    /**
     * The mapping template to use for responses from the data source.
     */
    public val responseMappingTemplate: kotlin.String? = builder.responseMappingTemplate
    /**
     * 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.
     */
    public val runtime: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime? = builder.runtime
    /**
     * The `SyncConfig` for a resolver attached to a versioned data source.
     */
    public val syncConfig: aws.sdk.kotlin.services.appsync.model.SyncConfig? = builder.syncConfig
    /**
     * The name of the `Type`.
     */
    public val typeName: kotlin.String? = builder.typeName

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appsync.model.CreateResolverRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreateResolverRequest(")
        append("apiId=$apiId,")
        append("cachingConfig=$cachingConfig,")
        append("code=$code,")
        append("dataSourceName=$dataSourceName,")
        append("fieldName=$fieldName,")
        append("kind=$kind,")
        append("maxBatchSize=$maxBatchSize,")
        append("metricsConfig=$metricsConfig,")
        append("pipelineConfig=$pipelineConfig,")
        append("requestMappingTemplate=$requestMappingTemplate,")
        append("responseMappingTemplate=$responseMappingTemplate,")
        append("runtime=$runtime,")
        append("syncConfig=$syncConfig,")
        append("typeName=$typeName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = apiId?.hashCode() ?: 0
        result = 31 * result + (cachingConfig?.hashCode() ?: 0)
        result = 31 * result + (code?.hashCode() ?: 0)
        result = 31 * result + (dataSourceName?.hashCode() ?: 0)
        result = 31 * result + (fieldName?.hashCode() ?: 0)
        result = 31 * result + (kind?.hashCode() ?: 0)
        result = 31 * result + (maxBatchSize ?: 0)
        result = 31 * result + (metricsConfig?.hashCode() ?: 0)
        result = 31 * result + (pipelineConfig?.hashCode() ?: 0)
        result = 31 * result + (requestMappingTemplate?.hashCode() ?: 0)
        result = 31 * result + (responseMappingTemplate?.hashCode() ?: 0)
        result = 31 * result + (runtime?.hashCode() ?: 0)
        result = 31 * result + (syncConfig?.hashCode() ?: 0)
        result = 31 * result + (typeName?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as CreateResolverRequest

        if (apiId != other.apiId) return false
        if (cachingConfig != other.cachingConfig) return false
        if (code != other.code) return false
        if (dataSourceName != other.dataSourceName) return false
        if (fieldName != other.fieldName) return false
        if (kind != other.kind) return false
        if (maxBatchSize != other.maxBatchSize) return false
        if (metricsConfig != other.metricsConfig) return false
        if (pipelineConfig != other.pipelineConfig) return false
        if (requestMappingTemplate != other.requestMappingTemplate) return false
        if (responseMappingTemplate != other.responseMappingTemplate) return false
        if (runtime != other.runtime) return false
        if (syncConfig != other.syncConfig) return false
        if (typeName != other.typeName) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appsync.model.CreateResolverRequest = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The ID for the GraphQL API for which the resolver is being created.
         */
        public var apiId: kotlin.String? = null
        /**
         * The caching configuration for the resolver.
         */
        public var cachingConfig: aws.sdk.kotlin.services.appsync.model.CachingConfig? = null
        /**
         * The `resolver` code that contains the request and response functions. When code is used, the `runtime` is required. The `runtime` value must be `APPSYNC_JS`.
         */
        public var code: kotlin.String? = null
        /**
         * The name of the data source for which the resolver is being created.
         */
        public var dataSourceName: kotlin.String? = null
        /**
         * The name of the field to attach the resolver to.
         */
        public var fieldName: kotlin.String? = null
        /**
         * The resolver type.
         * + **UNIT**: 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.
         * + **PIPELINE**: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of `Function` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
         */
        public var kind: aws.sdk.kotlin.services.appsync.model.ResolverKind? = null
        /**
         * The maximum batching size for a resolver.
         */
        public var maxBatchSize: kotlin.Int? = null
        /**
         * Enables or disables enhanced resolver metrics for specified resolvers. Note that `metricsConfig` won't be used unless the `resolverLevelMetricsBehavior` value is set to `PER_RESOLVER_METRICS`. If the `resolverLevelMetricsBehavior` is set to `FULL_REQUEST_RESOLVER_METRICS` instead, `metricsConfig` will be ignored. However, you can still set its value.
         *
         * `metricsConfig` can be `ENABLED` or `DISABLED`.
         */
        public var metricsConfig: aws.sdk.kotlin.services.appsync.model.ResolverLevelMetricsConfig? = null
        /**
         * The `PipelineConfig`.
         */
        public var pipelineConfig: aws.sdk.kotlin.services.appsync.model.PipelineConfig? = null
        /**
         * The mapping template to use for requests.
         *
         * 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).
         *
         * 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.
         */
        public var requestMappingTemplate: kotlin.String? = null
        /**
         * The mapping template to use for responses from the data source.
         */
        public var responseMappingTemplate: kotlin.String? = null
        /**
         * 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.
         */
        public var runtime: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime? = null
        /**
         * The `SyncConfig` for a resolver attached to a versioned data source.
         */
        public var syncConfig: aws.sdk.kotlin.services.appsync.model.SyncConfig? = null
        /**
         * The name of the `Type`.
         */
        public var typeName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appsync.model.CreateResolverRequest) : this() {
            this.apiId = x.apiId
            this.cachingConfig = x.cachingConfig
            this.code = x.code
            this.dataSourceName = x.dataSourceName
            this.fieldName = x.fieldName
            this.kind = x.kind
            this.maxBatchSize = x.maxBatchSize
            this.metricsConfig = x.metricsConfig
            this.pipelineConfig = x.pipelineConfig
            this.requestMappingTemplate = x.requestMappingTemplate
            this.responseMappingTemplate = x.responseMappingTemplate
            this.runtime = x.runtime
            this.syncConfig = x.syncConfig
            this.typeName = x.typeName
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.appsync.model.CreateResolverRequest = CreateResolverRequest(this)

        /**
         * construct an [aws.sdk.kotlin.services.appsync.model.CachingConfig] inside the given [block]
         */
        public fun cachingConfig(block: aws.sdk.kotlin.services.appsync.model.CachingConfig.Builder.() -> kotlin.Unit) {
            this.cachingConfig = aws.sdk.kotlin.services.appsync.model.CachingConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.appsync.model.PipelineConfig] inside the given [block]
         */
        public fun pipelineConfig(block: aws.sdk.kotlin.services.appsync.model.PipelineConfig.Builder.() -> kotlin.Unit) {
            this.pipelineConfig = aws.sdk.kotlin.services.appsync.model.PipelineConfig.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.appsync.model.AppSyncRuntime] inside the given [block]
         */
        public fun runtime(block: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime.Builder.() -> kotlin.Unit) {
            this.runtime = aws.sdk.kotlin.services.appsync.model.AppSyncRuntime.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.appsync.model.SyncConfig] inside the given [block]
         */
        public fun syncConfig(block: aws.sdk.kotlin.services.appsync.model.SyncConfig.Builder.() -> kotlin.Unit) {
            this.syncConfig = aws.sdk.kotlin.services.appsync.model.SyncConfig.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy