commonMain.aws.sdk.kotlin.services.nimble.model.ValidationResult.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nimble-jvm Show documentation
Show all versions of nimble-jvm Show documentation
The AWS SDK for Kotlin client for nimble
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.nimble.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The launch profile validation result.
*/
public class ValidationResult private constructor(builder: Builder) {
/**
* The current state.
*/
public val state: aws.sdk.kotlin.services.nimble.model.LaunchProfileValidationState = requireNotNull(builder.state) { "A non-null value must be provided for state" }
/**
* The status code. This will contain the failure reason if the state is `VALIDATION_FAILED`.
*/
public val statusCode: aws.sdk.kotlin.services.nimble.model.LaunchProfileValidationStatusCode = requireNotNull(builder.statusCode) { "A non-null value must be provided for statusCode" }
/**
* The status message for the validation result.
*/
public val statusMessage: kotlin.String = requireNotNull(builder.statusMessage) { "A non-null value must be provided for statusMessage" }
/**
* The type of the validation result.
*/
public val type: aws.sdk.kotlin.services.nimble.model.LaunchProfileValidationType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.nimble.model.ValidationResult = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ValidationResult(")
append("state=$state,")
append("statusCode=$statusCode,")
append("statusMessage=$statusMessage,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = state.hashCode()
result = 31 * result + (statusCode.hashCode())
result = 31 * result + (statusMessage.hashCode())
result = 31 * result + (type.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 ValidationResult
if (state != other.state) return false
if (statusCode != other.statusCode) return false
if (statusMessage != other.statusMessage) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.nimble.model.ValidationResult = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The current state.
*/
public var state: aws.sdk.kotlin.services.nimble.model.LaunchProfileValidationState? = null
/**
* The status code. This will contain the failure reason if the state is `VALIDATION_FAILED`.
*/
public var statusCode: aws.sdk.kotlin.services.nimble.model.LaunchProfileValidationStatusCode? = null
/**
* The status message for the validation result.
*/
public var statusMessage: kotlin.String? = null
/**
* The type of the validation result.
*/
public var type: aws.sdk.kotlin.services.nimble.model.LaunchProfileValidationType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.nimble.model.ValidationResult) : this() {
this.state = x.state
this.statusCode = x.statusCode
this.statusMessage = x.statusMessage
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.nimble.model.ValidationResult = ValidationResult(this)
internal fun correctErrors(): Builder {
if (state == null) state = LaunchProfileValidationState.SdkUnknown("no value provided")
if (statusCode == null) statusCode = LaunchProfileValidationStatusCode.SdkUnknown("no value provided")
if (statusMessage == null) statusMessage = ""
if (type == null) type = LaunchProfileValidationType.SdkUnknown("no value provided")
return this
}
}
}