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

commonMain.aws.sdk.kotlin.services.iotfleetwise.model.IamRegistrationResponse.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 registering an Identity and Access Management (IAM) resource so Amazon Web Services IoT FleetWise edge agent software can transfer your vehicle data to Amazon Timestream.
 */
public class IamRegistrationResponse private constructor(builder: Builder) {
    /**
     * A message associated with a registration error.
     */
    public val errorMessage: kotlin.String? = builder.errorMessage
    /**
     * The status of registering your IAM resource. 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 IAM role to register.
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }

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

    override fun toString(): kotlin.String = buildString {
        append("IamRegistrationResponse(")
        append("errorMessage=$errorMessage,")
        append("registrationStatus=$registrationStatus,")
        append("roleArn=$roleArn")
        append(")")
    }

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

        if (errorMessage != other.errorMessage) return false
        if (registrationStatus != other.registrationStatus) return false
        if (roleArn != other.roleArn) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iotfleetwise.model.IamRegistrationResponse = 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 IAM resource. 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 IAM role to register.
         */
        public var roleArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotfleetwise.model.IamRegistrationResponse) : this() {
            this.errorMessage = x.errorMessage
            this.registrationStatus = x.registrationStatus
            this.roleArn = x.roleArn
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy