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

commonMain.aws.sdk.kotlin.services.appsync.model.CodeError.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 an AppSync error.
 */
public class CodeError private constructor(builder: Builder) {
    /**
     * The type of code error.
     *
     * Examples include, but aren't limited to: `LINT_ERROR`, `PARSER_ERROR`.
     */
    public val errorType: kotlin.String? = builder.errorType
    /**
     * The line, column, and span location of the error in the code.
     */
    public val location: aws.sdk.kotlin.services.appsync.model.CodeErrorLocation? = builder.location
    /**
     * A user presentable error.
     *
     * Examples include, but aren't limited to: `Parsing error: Unterminated string literal`.
     */
    public val value: kotlin.String? = builder.value

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

    override fun toString(): kotlin.String = buildString {
        append("CodeError(")
        append("errorType=$errorType,")
        append("location=$location,")
        append("value=$value")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorType?.hashCode() ?: 0
        result = 31 * result + (location?.hashCode() ?: 0)
        result = 31 * result + (value?.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 CodeError

        if (errorType != other.errorType) return false
        if (location != other.location) return false
        if (value != other.value) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of code error.
         *
         * Examples include, but aren't limited to: `LINT_ERROR`, `PARSER_ERROR`.
         */
        public var errorType: kotlin.String? = null
        /**
         * The line, column, and span location of the error in the code.
         */
        public var location: aws.sdk.kotlin.services.appsync.model.CodeErrorLocation? = null
        /**
         * A user presentable error.
         *
         * Examples include, but aren't limited to: `Parsing error: Unterminated string literal`.
         */
        public var value: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appsync.model.CodeError) : this() {
            this.errorType = x.errorType
            this.location = x.location
            this.value = x.value
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy