
commonMain.aws.sdk.kotlin.services.cloudfront.model.FunctionConfig.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudfront.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Contains configuration information about a CloudFront function.
*/
public class FunctionConfig private constructor(builder: Builder) {
/**
* A comment to describe the function.
*/
public val comment: kotlin.String = requireNotNull(builder.comment) { "A non-null value must be provided for comment" }
/**
* The configuration for the key value store associations.
*/
public val keyValueStoreAssociations: aws.sdk.kotlin.services.cloudfront.model.KeyValueStoreAssociations? = builder.keyValueStoreAssociations
/**
* The function's runtime environment version.
*/
public val runtime: aws.sdk.kotlin.services.cloudfront.model.FunctionRuntime = requireNotNull(builder.runtime) { "A non-null value must be provided for runtime" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudfront.model.FunctionConfig = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("FunctionConfig(")
append("comment=$comment,")
append("keyValueStoreAssociations=$keyValueStoreAssociations,")
append("runtime=$runtime")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = comment.hashCode()
result = 31 * result + (keyValueStoreAssociations?.hashCode() ?: 0)
result = 31 * result + (runtime.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 FunctionConfig
if (comment != other.comment) return false
if (keyValueStoreAssociations != other.keyValueStoreAssociations) return false
if (runtime != other.runtime) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudfront.model.FunctionConfig = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A comment to describe the function.
*/
public var comment: kotlin.String? = null
/**
* The configuration for the key value store associations.
*/
public var keyValueStoreAssociations: aws.sdk.kotlin.services.cloudfront.model.KeyValueStoreAssociations? = null
/**
* The function's runtime environment version.
*/
public var runtime: aws.sdk.kotlin.services.cloudfront.model.FunctionRuntime? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudfront.model.FunctionConfig) : this() {
this.comment = x.comment
this.keyValueStoreAssociations = x.keyValueStoreAssociations
this.runtime = x.runtime
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudfront.model.FunctionConfig = FunctionConfig(this)
/**
* construct an [aws.sdk.kotlin.services.cloudfront.model.KeyValueStoreAssociations] inside the given [block]
*/
public fun keyValueStoreAssociations(block: aws.sdk.kotlin.services.cloudfront.model.KeyValueStoreAssociations.Builder.() -> kotlin.Unit) {
this.keyValueStoreAssociations = aws.sdk.kotlin.services.cloudfront.model.KeyValueStoreAssociations.invoke(block)
}
internal fun correctErrors(): Builder {
if (comment == null) comment = ""
if (runtime == null) runtime = FunctionRuntime.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy