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

commonMain.aws.sdk.kotlin.services.rum.model.BatchCreateRumMetricDefinitionsError.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.rum.model



/**
 * A structure that defines one error caused by a [BatchCreateRumMetricsDefinitions](https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_BatchCreateRumMetricsDefinitions.html) operation.
 */
public class BatchCreateRumMetricDefinitionsError private constructor(builder: Builder) {
    /**
     * The error code.
     */
    public val errorCode: kotlin.String = requireNotNull(builder.errorCode) { "A non-null value must be provided for errorCode" }
    /**
     * The error message for this metric definition.
     */
    public val errorMessage: kotlin.String = requireNotNull(builder.errorMessage) { "A non-null value must be provided for errorMessage" }
    /**
     * The metric definition that caused this error.
     */
    public val metricDefinition: aws.sdk.kotlin.services.rum.model.MetricDefinitionRequest? = builder.metricDefinition

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

    override fun toString(): kotlin.String = buildString {
        append("BatchCreateRumMetricDefinitionsError(")
        append("errorCode=$errorCode,")
        append("errorMessage=$errorMessage,")
        append("metricDefinition=$metricDefinition")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorCode.hashCode()
        result = 31 * result + (errorMessage.hashCode())
        result = 31 * result + (metricDefinition?.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 BatchCreateRumMetricDefinitionsError

        if (errorCode != other.errorCode) return false
        if (errorMessage != other.errorMessage) return false
        if (metricDefinition != other.metricDefinition) return false

        return true
    }

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

    public class Builder {
        /**
         * The error code.
         */
        public var errorCode: kotlin.String? = null
        /**
         * The error message for this metric definition.
         */
        public var errorMessage: kotlin.String? = null
        /**
         * The metric definition that caused this error.
         */
        public var metricDefinition: aws.sdk.kotlin.services.rum.model.MetricDefinitionRequest? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.rum.model.BatchCreateRumMetricDefinitionsError) : this() {
            this.errorCode = x.errorCode
            this.errorMessage = x.errorMessage
            this.metricDefinition = x.metricDefinition
        }

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

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

        internal fun correctErrors(): Builder {
            if (errorCode == null) errorCode = ""
            if (errorMessage == null) errorMessage = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy