commonMain.aws.sdk.kotlin.services.appsync.model.EvaluateCodeRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appsync-jvm Show documentation
Show all versions of appsync-jvm Show documentation
The AWS SDK for Kotlin client for AppSync
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appsync.model
import aws.smithy.kotlin.runtime.SdkDsl
public class EvaluateCodeRequest private constructor(builder: Builder) {
/**
* The code definition to be evaluated. Note that `code` and `runtime` are both required for this action. The `runtime` value must be `APPSYNC_JS`.
*/
public val code: kotlin.String? = builder.code
/**
* The map that holds all of the contextual information for your resolver invocation. A `context` is required for this action.
*/
public val context: kotlin.String? = builder.context
/**
* The function within the code to be evaluated. If provided, the valid values are `request` and `response`.
*/
public val function: kotlin.String? = builder.function
/**
* The runtime to be used when evaluating the code. Currently, only the `APPSYNC_JS` runtime is supported.
*/
public val runtime: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime? = builder.runtime
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appsync.model.EvaluateCodeRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("EvaluateCodeRequest(")
append("code=$code,")
append("context=$context,")
append("function=$function,")
append("runtime=$runtime")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = code?.hashCode() ?: 0
result = 31 * result + (context?.hashCode() ?: 0)
result = 31 * result + (function?.hashCode() ?: 0)
result = 31 * result + (runtime?.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 EvaluateCodeRequest
if (code != other.code) return false
if (context != other.context) return false
if (function != other.function) return false
if (runtime != other.runtime) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appsync.model.EvaluateCodeRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The code definition to be evaluated. Note that `code` and `runtime` are both required for this action. The `runtime` value must be `APPSYNC_JS`.
*/
public var code: kotlin.String? = null
/**
* The map that holds all of the contextual information for your resolver invocation. A `context` is required for this action.
*/
public var context: kotlin.String? = null
/**
* The function within the code to be evaluated. If provided, the valid values are `request` and `response`.
*/
public var function: kotlin.String? = null
/**
* The runtime to be used when evaluating the code. Currently, only the `APPSYNC_JS` runtime is supported.
*/
public var runtime: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appsync.model.EvaluateCodeRequest) : this() {
this.code = x.code
this.context = x.context
this.function = x.function
this.runtime = x.runtime
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appsync.model.EvaluateCodeRequest = EvaluateCodeRequest(this)
/**
* construct an [aws.sdk.kotlin.services.appsync.model.AppSyncRuntime] inside the given [block]
*/
public fun runtime(block: aws.sdk.kotlin.services.appsync.model.AppSyncRuntime.Builder.() -> kotlin.Unit) {
this.runtime = aws.sdk.kotlin.services.appsync.model.AppSyncRuntime.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}