
commonMain.aws.sdk.kotlin.services.appmesh.model.RouteData.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 route returned by a describe operation.
*/
public class RouteData private constructor(builder: Builder) {
/**
* The name of the service mesh that the route resides in.
*/
public val meshName: kotlin.String = requireNotNull(builder.meshName) { "A non-null value must be provided for meshName" }
/**
* The associated metadata for the route.
*/
public val metadata: aws.sdk.kotlin.services.appmesh.model.ResourceMetadata? = builder.metadata
/**
* The name of the route.
*/
public val routeName: kotlin.String = requireNotNull(builder.routeName) { "A non-null value must be provided for routeName" }
/**
* The specifications of the route.
*/
public val spec: aws.sdk.kotlin.services.appmesh.model.RouteSpec? = builder.spec
/**
* The status of the route.
*/
public val status: aws.sdk.kotlin.services.appmesh.model.RouteStatus? = builder.status
/**
* The virtual router that the route is associated with.
*/
public val virtualRouterName: kotlin.String = requireNotNull(builder.virtualRouterName) { "A non-null value must be provided for virtualRouterName" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.RouteData = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RouteData(")
append("meshName=$meshName,")
append("metadata=$metadata,")
append("routeName=$routeName,")
append("spec=$spec,")
append("status=$status,")
append("virtualRouterName=$virtualRouterName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = meshName.hashCode()
result = 31 * result + (metadata?.hashCode() ?: 0)
result = 31 * result + (routeName.hashCode())
result = 31 * result + (spec?.hashCode() ?: 0)
result = 31 * result + (status?.hashCode() ?: 0)
result = 31 * result + (virtualRouterName.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 RouteData
if (meshName != other.meshName) return false
if (metadata != other.metadata) return false
if (routeName != other.routeName) return false
if (spec != other.spec) return false
if (status != other.status) return false
if (virtualRouterName != other.virtualRouterName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.RouteData = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the service mesh that the route resides in.
*/
public var meshName: kotlin.String? = null
/**
* The associated metadata for the route.
*/
public var metadata: aws.sdk.kotlin.services.appmesh.model.ResourceMetadata? = null
/**
* The name of the route.
*/
public var routeName: kotlin.String? = null
/**
* The specifications of the route.
*/
public var spec: aws.sdk.kotlin.services.appmesh.model.RouteSpec? = null
/**
* The status of the route.
*/
public var status: aws.sdk.kotlin.services.appmesh.model.RouteStatus? = null
/**
* The virtual router that the route is associated with.
*/
public var virtualRouterName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appmesh.model.RouteData) : this() {
this.meshName = x.meshName
this.metadata = x.metadata
this.routeName = x.routeName
this.spec = x.spec
this.status = x.status
this.virtualRouterName = x.virtualRouterName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appmesh.model.RouteData = RouteData(this)
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.ResourceMetadata] inside the given [block]
*/
public fun metadata(block: aws.sdk.kotlin.services.appmesh.model.ResourceMetadata.Builder.() -> kotlin.Unit) {
this.metadata = aws.sdk.kotlin.services.appmesh.model.ResourceMetadata.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.RouteSpec] inside the given [block]
*/
public fun spec(block: aws.sdk.kotlin.services.appmesh.model.RouteSpec.Builder.() -> kotlin.Unit) {
this.spec = aws.sdk.kotlin.services.appmesh.model.RouteSpec.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.RouteStatus] inside the given [block]
*/
public fun status(block: aws.sdk.kotlin.services.appmesh.model.RouteStatus.Builder.() -> kotlin.Unit) {
this.status = aws.sdk.kotlin.services.appmesh.model.RouteStatus.invoke(block)
}
internal fun correctErrors(): Builder {
if (meshName == null) meshName = ""
if (routeName == null) routeName = ""
if (virtualRouterName == null) virtualRouterName = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy