commonMain.aws.sdk.kotlin.services.migrationhubconfig.model.Target.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of migrationhubconfig-jvm Show documentation
Show all versions of migrationhubconfig-jvm Show documentation
The AWS SDK for Kotlin client for MigrationHub Config
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.migrationhubconfig.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The target parameter specifies the identifier to which the home region is applied, which is always an `ACCOUNT`. It applies the home region to the current `ACCOUNT`.
*/
public class Target private constructor(builder: Builder) {
/**
* The `TargetID` is a 12-character identifier of the `ACCOUNT` for which the control was created. (This must be the current account.)
*/
public val id: kotlin.String? = builder.id
/**
* The target type is always an `ACCOUNT`.
*/
public val type: aws.sdk.kotlin.services.migrationhubconfig.model.TargetType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.migrationhubconfig.model.Target = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Target(")
append("id=$id,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = id?.hashCode() ?: 0
result = 31 * result + (type.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 Target
if (id != other.id) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.migrationhubconfig.model.Target = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The `TargetID` is a 12-character identifier of the `ACCOUNT` for which the control was created. (This must be the current account.)
*/
public var id: kotlin.String? = null
/**
* The target type is always an `ACCOUNT`.
*/
public var type: aws.sdk.kotlin.services.migrationhubconfig.model.TargetType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.migrationhubconfig.model.Target) : this() {
this.id = x.id
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.migrationhubconfig.model.Target = Target(this)
internal fun correctErrors(): Builder {
if (type == null) type = TargetType.SdkUnknown("no value provided")
return this
}
}
}