
commonMain.aws.sdk.kotlin.services.appmesh.model.Duration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appmesh.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* An object that represents a duration of time.
*/
public class Duration private constructor(builder: Builder) {
/**
* A unit of time.
*/
public val unit: aws.sdk.kotlin.services.appmesh.model.DurationUnit? = builder.unit
/**
* A number of time units.
*/
public val value: kotlin.Long? = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.Duration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Duration(")
append("unit=$unit,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = unit?.hashCode() ?: 0
result = 31 * result + (value?.hashCode() ?: 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 Duration
if (unit != other.unit) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.Duration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A unit of time.
*/
public var unit: aws.sdk.kotlin.services.appmesh.model.DurationUnit? = null
/**
* A number of time units.
*/
public var value: kotlin.Long? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appmesh.model.Duration) : this() {
this.unit = x.unit
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appmesh.model.Duration = Duration(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy