commonMain.aws.sdk.kotlin.services.vpclattice.model.Target.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vpclattice-jvm Show documentation
Show all versions of vpclattice-jvm Show documentation
The AWS SDK for Kotlin client for VPC Lattice
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.vpclattice.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Describes a target.
*/
public class Target private constructor(builder: Builder) {
/**
* The ID of the target. If the target group type is `INSTANCE`, this is an instance ID. If the target group type is `IP`, this is an IP address. If the target group type is `LAMBDA`, this is the ARN of a Lambda function. If the target group type is `ALB`, this is the ARN of an Application Load Balancer.
*/
public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
/**
* The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443.
*/
public val port: kotlin.Int? = builder.port
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.vpclattice.model.Target = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Target(")
append("id=$id,")
append("port=$port")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = id.hashCode()
result = 31 * result + (port ?: 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 Target
if (id != other.id) return false
if (port != other.port) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.vpclattice.model.Target = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ID of the target. If the target group type is `INSTANCE`, this is an instance ID. If the target group type is `IP`, this is an IP address. If the target group type is `LAMBDA`, this is the ARN of a Lambda function. If the target group type is `ALB`, this is the ARN of an Application Load Balancer.
*/
public var id: kotlin.String? = null
/**
* The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443.
*/
public var port: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.Target) : this() {
this.id = x.id
this.port = x.port
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.vpclattice.model.Target = Target(this)
internal fun correctErrors(): Builder {
if (id == null) id = ""
return this
}
}
}