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

commonMain.aws.sdk.kotlin.services.appsync.model.AppSyncRuntime.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

/**
 * 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 class AppSyncRuntime private constructor(builder: Builder) {
    /**
     * The `name` of the runtime to use. Currently, the only allowed value is `APPSYNC_JS`.
     */
    public val name: aws.sdk.kotlin.services.appsync.model.RuntimeName = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The `version` of the runtime to use. Currently, the only allowed version is `1.0.0`.
     */
    public val runtimeVersion: kotlin.String = requireNotNull(builder.runtimeVersion) { "A non-null value must be provided for runtimeVersion" }

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

    override fun toString(): kotlin.String = buildString {
        append("AppSyncRuntime(")
        append("name=$name,")
        append("runtimeVersion=$runtimeVersion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = name.hashCode()
        result = 31 * result + (runtimeVersion.hashCode())
        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 AppSyncRuntime

        if (name != other.name) return false
        if (runtimeVersion != other.runtimeVersion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The `name` of the runtime to use. Currently, the only allowed value is `APPSYNC_JS`.
         */
        public var name: aws.sdk.kotlin.services.appsync.model.RuntimeName? = null
        /**
         * The `version` of the runtime to use. Currently, the only allowed version is `1.0.0`.
         */
        public var runtimeVersion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime) : this() {
            this.name = x.name
            this.runtimeVersion = x.runtimeVersion
        }

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

        internal fun correctErrors(): Builder {
            if (name == null) name = RuntimeName.SdkUnknown("no value provided")
            if (runtimeVersion == null) runtimeVersion = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy