commonMain.aws.sdk.kotlin.services.timestreamwrite.model.Endpoint.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreamwrite-jvm Show documentation
Show all versions of timestreamwrite-jvm Show documentation
The AWS SDK for Kotlin client for Timestream Write
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.timestreamwrite.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Represents an available endpoint against which to make API calls against, as well as the TTL for that endpoint.
*/
public class Endpoint private constructor(builder: Builder) {
/**
* An endpoint address.
*/
public val address: kotlin.String = requireNotNull(builder.address) { "A non-null value must be provided for address" }
/**
* The TTL for the endpoint, in minutes.
*/
public val cachePeriodInMinutes: kotlin.Long = builder.cachePeriodInMinutes
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.timestreamwrite.model.Endpoint = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Endpoint(")
append("address=$address,")
append("cachePeriodInMinutes=$cachePeriodInMinutes")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = address.hashCode()
result = 31 * result + (cachePeriodInMinutes.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 Endpoint
if (address != other.address) return false
if (cachePeriodInMinutes != other.cachePeriodInMinutes) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.timestreamwrite.model.Endpoint = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* An endpoint address.
*/
public var address: kotlin.String? = null
/**
* The TTL for the endpoint, in minutes.
*/
public var cachePeriodInMinutes: kotlin.Long = 0L
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.timestreamwrite.model.Endpoint) : this() {
this.address = x.address
this.cachePeriodInMinutes = x.cachePeriodInMinutes
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.timestreamwrite.model.Endpoint = Endpoint(this)
internal fun correctErrors(): Builder {
if (address == null) address = ""
return this
}
}
}