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

commonMain.aws.sdk.kotlin.services.datapipeline.model.Field.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.datapipeline.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A key-value pair that describes a property of a pipeline object. The value is specified as either a string value (`StringValue`) or a reference to another object (`RefValue`) but not as both.
 */
public class Field private constructor(builder: Builder) {
    /**
     * The field identifier.
     */
    public val key: kotlin.String = requireNotNull(builder.key) { "A non-null value must be provided for key" }
    /**
     * The field value, expressed as the identifier of another object.
     */
    public val refValue: kotlin.String? = builder.refValue
    /**
     * The field value, expressed as a String.
     */
    public val stringValue: kotlin.String? = builder.stringValue

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

    override fun toString(): kotlin.String = buildString {
        append("Field(")
        append("key=$key,")
        append("refValue=$refValue,")
        append("stringValue=$stringValue")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = key.hashCode()
        result = 31 * result + (refValue?.hashCode() ?: 0)
        result = 31 * result + (stringValue?.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 Field

        if (key != other.key) return false
        if (refValue != other.refValue) return false
        if (stringValue != other.stringValue) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The field identifier.
         */
        public var key: kotlin.String? = null
        /**
         * The field value, expressed as the identifier of another object.
         */
        public var refValue: kotlin.String? = null
        /**
         * The field value, expressed as a String.
         */
        public var stringValue: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.datapipeline.model.Field) : this() {
            this.key = x.key
            this.refValue = x.refValue
            this.stringValue = x.stringValue
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy