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

commonMain.aws.sdk.kotlin.services.iotfleetwise.model.TimestreamRegistrationResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotfleetwise.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about the registered Amazon Timestream resources or errors, if any.
 */
public class TimestreamRegistrationResponse private constructor(builder: Builder) {
    /**
     * A message associated with a registration error.
     */
    public val errorMessage: kotlin.String? = builder.errorMessage
    /**
     * The status of registering your Amazon Timestream resources. The status can be one of `REGISTRATION_SUCCESS`, `REGISTRATION_PENDING`, `REGISTRATION_FAILURE`.
     */
    public val registrationStatus: aws.sdk.kotlin.services.iotfleetwise.model.RegistrationStatus = requireNotNull(builder.registrationStatus) { "A non-null value must be provided for registrationStatus" }
    /**
     * The Amazon Resource Name (ARN) of the Timestream database.
     */
    public val timestreamDatabaseArn: kotlin.String? = builder.timestreamDatabaseArn
    /**
     * The name of the Timestream database.
     */
    public val timestreamDatabaseName: kotlin.String = requireNotNull(builder.timestreamDatabaseName) { "A non-null value must be provided for timestreamDatabaseName" }
    /**
     * The ARN of the Timestream database table.
     */
    public val timestreamTableArn: kotlin.String? = builder.timestreamTableArn
    /**
     * The name of the Timestream database table.
     */
    public val timestreamTableName: kotlin.String = requireNotNull(builder.timestreamTableName) { "A non-null value must be provided for timestreamTableName" }

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

    override fun toString(): kotlin.String = buildString {
        append("TimestreamRegistrationResponse(")
        append("errorMessage=$errorMessage,")
        append("registrationStatus=$registrationStatus,")
        append("timestreamDatabaseArn=$timestreamDatabaseArn,")
        append("timestreamDatabaseName=$timestreamDatabaseName,")
        append("timestreamTableArn=$timestreamTableArn,")
        append("timestreamTableName=$timestreamTableName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorMessage?.hashCode() ?: 0
        result = 31 * result + (registrationStatus.hashCode())
        result = 31 * result + (timestreamDatabaseArn?.hashCode() ?: 0)
        result = 31 * result + (timestreamDatabaseName.hashCode())
        result = 31 * result + (timestreamTableArn?.hashCode() ?: 0)
        result = 31 * result + (timestreamTableName.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 TimestreamRegistrationResponse

        if (errorMessage != other.errorMessage) return false
        if (registrationStatus != other.registrationStatus) return false
        if (timestreamDatabaseArn != other.timestreamDatabaseArn) return false
        if (timestreamDatabaseName != other.timestreamDatabaseName) return false
        if (timestreamTableArn != other.timestreamTableArn) return false
        if (timestreamTableName != other.timestreamTableName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A message associated with a registration error.
         */
        public var errorMessage: kotlin.String? = null
        /**
         * The status of registering your Amazon Timestream resources. The status can be one of `REGISTRATION_SUCCESS`, `REGISTRATION_PENDING`, `REGISTRATION_FAILURE`.
         */
        public var registrationStatus: aws.sdk.kotlin.services.iotfleetwise.model.RegistrationStatus? = null
        /**
         * The Amazon Resource Name (ARN) of the Timestream database.
         */
        public var timestreamDatabaseArn: kotlin.String? = null
        /**
         * The name of the Timestream database.
         */
        public var timestreamDatabaseName: kotlin.String? = null
        /**
         * The ARN of the Timestream database table.
         */
        public var timestreamTableArn: kotlin.String? = null
        /**
         * The name of the Timestream database table.
         */
        public var timestreamTableName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotfleetwise.model.TimestreamRegistrationResponse) : this() {
            this.errorMessage = x.errorMessage
            this.registrationStatus = x.registrationStatus
            this.timestreamDatabaseArn = x.timestreamDatabaseArn
            this.timestreamDatabaseName = x.timestreamDatabaseName
            this.timestreamTableArn = x.timestreamTableArn
            this.timestreamTableName = x.timestreamTableName
        }

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

        internal fun correctErrors(): Builder {
            if (registrationStatus == null) registrationStatus = RegistrationStatus.SdkUnknown("no value provided")
            if (timestreamDatabaseName == null) timestreamDatabaseName = ""
            if (timestreamTableName == null) timestreamTableName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy