commonMain.aws.sdk.kotlin.services.deadline.model.GetWorkerResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deadline-jvm Show documentation
Show all versions of deadline-jvm Show documentation
The AWS SDK for Kotlin client for deadline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.deadline.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
public class GetWorkerResponse private constructor(builder: Builder) {
/**
* The date and time the resource was created.
*/
public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
/**
* The user or system that created this resource.
*/
public val createdBy: kotlin.String = requireNotNull(builder.createdBy) { "A non-null value must be provided for createdBy" }
/**
* The farm ID.
*/
public val farmId: kotlin.String = requireNotNull(builder.farmId) { "A non-null value must be provided for farmId" }
/**
* The fleet ID.
*/
public val fleetId: kotlin.String = requireNotNull(builder.fleetId) { "A non-null value must be provided for fleetId" }
/**
* The host properties for the worker.
*/
public val hostProperties: aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse? = builder.hostProperties
/**
* The logs for the associated worker.
*/
public val log: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = builder.log
/**
* The status of the worker.
*/
public val status: aws.sdk.kotlin.services.deadline.model.WorkerStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
/**
* The date and time the resource was updated.
*/
public val updatedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.updatedAt
/**
* The user or system that updated this resource.
*/
public val updatedBy: kotlin.String? = builder.updatedBy
/**
* The worker ID.
*/
public val workerId: kotlin.String = requireNotNull(builder.workerId) { "A non-null value must be provided for workerId" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.deadline.model.GetWorkerResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GetWorkerResponse(")
append("createdAt=$createdAt,")
append("createdBy=$createdBy,")
append("farmId=$farmId,")
append("fleetId=$fleetId,")
append("hostProperties=$hostProperties,")
append("log=$log,")
append("status=$status,")
append("updatedAt=$updatedAt,")
append("updatedBy=$updatedBy,")
append("workerId=$workerId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = createdAt.hashCode()
result = 31 * result + (createdBy.hashCode())
result = 31 * result + (farmId.hashCode())
result = 31 * result + (fleetId.hashCode())
result = 31 * result + (hostProperties?.hashCode() ?: 0)
result = 31 * result + (log?.hashCode() ?: 0)
result = 31 * result + (status.hashCode())
result = 31 * result + (updatedAt?.hashCode() ?: 0)
result = 31 * result + (updatedBy?.hashCode() ?: 0)
result = 31 * result + (workerId.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 GetWorkerResponse
if (createdAt != other.createdAt) return false
if (createdBy != other.createdBy) return false
if (farmId != other.farmId) return false
if (fleetId != other.fleetId) return false
if (hostProperties != other.hostProperties) return false
if (log != other.log) return false
if (status != other.status) return false
if (updatedAt != other.updatedAt) return false
if (updatedBy != other.updatedBy) return false
if (workerId != other.workerId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.GetWorkerResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The date and time the resource was created.
*/
public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The user or system that created this resource.
*/
public var createdBy: kotlin.String? = null
/**
* The farm ID.
*/
public var farmId: kotlin.String? = null
/**
* The fleet ID.
*/
public var fleetId: kotlin.String? = null
/**
* The host properties for the worker.
*/
public var hostProperties: aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse? = null
/**
* The logs for the associated worker.
*/
public var log: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = null
/**
* The status of the worker.
*/
public var status: aws.sdk.kotlin.services.deadline.model.WorkerStatus? = null
/**
* The date and time the resource was updated.
*/
public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The user or system that updated this resource.
*/
public var updatedBy: kotlin.String? = null
/**
* The worker ID.
*/
public var workerId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.deadline.model.GetWorkerResponse) : this() {
this.createdAt = x.createdAt
this.createdBy = x.createdBy
this.farmId = x.farmId
this.fleetId = x.fleetId
this.hostProperties = x.hostProperties
this.log = x.log
this.status = x.status
this.updatedAt = x.updatedAt
this.updatedBy = x.updatedBy
this.workerId = x.workerId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.deadline.model.GetWorkerResponse = GetWorkerResponse(this)
/**
* construct an [aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse] inside the given [block]
*/
public fun hostProperties(block: aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse.Builder.() -> kotlin.Unit) {
this.hostProperties = aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.deadline.model.LogConfiguration] inside the given [block]
*/
public fun log(block: aws.sdk.kotlin.services.deadline.model.LogConfiguration.Builder.() -> kotlin.Unit) {
this.log = aws.sdk.kotlin.services.deadline.model.LogConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
if (createdBy == null) createdBy = ""
if (farmId == null) farmId = ""
if (fleetId == null) fleetId = ""
if (status == null) status = WorkerStatus.SdkUnknown("no value provided")
if (workerId == null) workerId = ""
return this
}
}
}