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

commonMain.aws.sdk.kotlin.services.partnercentralselling.model.ValidationExceptionError.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.partnercentralselling.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Indicates an invalid value for a field.
 * + *REQUIRED_FIELD_MISSING:* The request is missing a required field.Fix: Verify your request payload includes all required fields.
 * + *INVALID_ENUM_VALUE:* The enum field value isn't an accepted values.Fix: Check the documentation for the list of valid enum values, and update your request with a valid value.
 * + *INVALID_STRING_FORMAT:* The string format is invalid.Fix: Confirm that the string is in the expected format (For example: email address, date).
 * + *INVALID_VALUE:* The value isn't valid.Fix: Confirm that the value meets the expected criteria and is within the allowable range or set.
 * + *TOO_MANY_VALUES:* There are too many values in a field that expects fewer entries.Fix: Reduce the number of values to match the expected limit.
 * + *ACTION_NOT_PERMITTED:* The action isn't permitted due to current state or permissions.Fix: Verify that the action is appropriate for the current state, and that you have the necessary permissions to perform it.
 * + *DUPLICATE_KEY_VALUE:* The value in a field duplicates a value that must be unique.Fix: Verify that the value is unique and doesn't duplicate an existing value in the system.
 */
public class ValidationExceptionError private constructor(builder: Builder) {
    /**
     * Specifies the error code for the invalid field value.
     */
    public val code: aws.sdk.kotlin.services.partnercentralselling.model.ValidationExceptionErrorCode = requireNotNull(builder.code) { "A non-null value must be provided for code" }
    /**
     * Specifies the field name with the invalid value.
     */
    public val fieldName: kotlin.String? = builder.fieldName
    /**
     * Specifies the detailed error message for the invalid field value.
     */
    public val message: kotlin.String = requireNotNull(builder.message) { "A non-null value must be provided for message" }

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

    override fun toString(): kotlin.String = buildString {
        append("ValidationExceptionError(")
        append("code=$code,")
        append("fieldName=$fieldName,")
        append("message=$message")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = code.hashCode()
        result = 31 * result + (fieldName?.hashCode() ?: 0)
        result = 31 * result + (message.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 ValidationExceptionError

        if (code != other.code) return false
        if (fieldName != other.fieldName) return false
        if (message != other.message) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies the error code for the invalid field value.
         */
        public var code: aws.sdk.kotlin.services.partnercentralselling.model.ValidationExceptionErrorCode? = null
        /**
         * Specifies the field name with the invalid value.
         */
        public var fieldName: kotlin.String? = null
        /**
         * Specifies the detailed error message for the invalid field value.
         */
        public var message: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.partnercentralselling.model.ValidationExceptionError) : this() {
            this.code = x.code
            this.fieldName = x.fieldName
            this.message = x.message
        }

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

        internal fun correctErrors(): Builder {
            if (code == null) code = ValidationExceptionErrorCode.SdkUnknown("no value provided")
            if (message == null) message = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy