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

commonMain.aws.sdk.kotlin.services.devicefarm.model.Problem.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.devicefarm.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Represents a specific warning or failure.
 */
public class Problem private constructor(builder: Builder) {
    /**
     * Information about the associated device.
     */
    public val device: aws.sdk.kotlin.services.devicefarm.model.Device? = builder.device
    /**
     * Information about the associated job.
     */
    public val job: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = builder.job
    /**
     * A message about the problem's result.
     */
    public val message: kotlin.String? = builder.message
    /**
     * The problem's result.
     *
     * Allowed values include:
     * + PENDING
     * + PASSED
     * + WARNED
     * + FAILED
     * + SKIPPED
     * + ERRORED
     * + STOPPED
     */
    public val result: aws.sdk.kotlin.services.devicefarm.model.ExecutionResult? = builder.result
    /**
     * Information about the associated run.
     */
    public val run: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = builder.run
    /**
     * Information about the associated suite.
     */
    public val suite: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = builder.suite
    /**
     * Information about the associated test.
     */
    public val test: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = builder.test

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

    override fun toString(): kotlin.String = buildString {
        append("Problem(")
        append("device=$device,")
        append("job=$job,")
        append("message=$message,")
        append("result=$result,")
        append("run=$run,")
        append("suite=$suite,")
        append("test=$test")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = device?.hashCode() ?: 0
        result = 31 * result + (job?.hashCode() ?: 0)
        result = 31 * result + (message?.hashCode() ?: 0)
        result = 31 * result + (result?.hashCode() ?: 0)
        result = 31 * result + (run?.hashCode() ?: 0)
        result = 31 * result + (suite?.hashCode() ?: 0)
        result = 31 * result + (test?.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 Problem

        if (device != other.device) return false
        if (job != other.job) return false
        if (message != other.message) return false
        if (result != other.result) return false
        if (run != other.run) return false
        if (suite != other.suite) return false
        if (test != other.test) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Information about the associated device.
         */
        public var device: aws.sdk.kotlin.services.devicefarm.model.Device? = null
        /**
         * Information about the associated job.
         */
        public var job: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = null
        /**
         * A message about the problem's result.
         */
        public var message: kotlin.String? = null
        /**
         * The problem's result.
         *
         * Allowed values include:
         * + PENDING
         * + PASSED
         * + WARNED
         * + FAILED
         * + SKIPPED
         * + ERRORED
         * + STOPPED
         */
        public var result: aws.sdk.kotlin.services.devicefarm.model.ExecutionResult? = null
        /**
         * Information about the associated run.
         */
        public var run: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = null
        /**
         * Information about the associated suite.
         */
        public var suite: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = null
        /**
         * Information about the associated test.
         */
        public var test: aws.sdk.kotlin.services.devicefarm.model.ProblemDetail? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.devicefarm.model.Problem) : this() {
            this.device = x.device
            this.job = x.job
            this.message = x.message
            this.result = x.result
            this.run = x.run
            this.suite = x.suite
            this.test = x.test
        }

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy