
commonMain.aws.sdk.kotlin.services.cloudfront.model.CreateFunctionRequest.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
public class CreateFunctionRequest private constructor(builder: Builder) {
/**
* The function code. For more information about writing a CloudFront function, see [Writing function code for CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html) in the *Amazon CloudFront Developer Guide*.
*/
public val functionCode: kotlin.ByteArray? = builder.functionCode
/**
* Configuration information about the function, including an optional comment and the function's runtime.
*/
public val functionConfig: aws.sdk.kotlin.services.cloudfront.model.FunctionConfig? = builder.functionConfig
/**
* A name to identify the function.
*/
public val name: kotlin.String? = builder.name
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudfront.model.CreateFunctionRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateFunctionRequest(")
append("functionCode=*** Sensitive Data Redacted ***,")
append("functionConfig=$functionConfig,")
append("name=$name")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = functionCode?.contentHashCode() ?: 0
result = 31 * result + (functionConfig?.hashCode() ?: 0)
result = 31 * result + (name?.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 CreateFunctionRequest
if (functionCode != null) {
if (other.functionCode == null) return false
if (!functionCode.contentEquals(other.functionCode)) return false
} else if (other.functionCode != null) return false
if (functionConfig != other.functionConfig) return false
if (name != other.name) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudfront.model.CreateFunctionRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The function code. For more information about writing a CloudFront function, see [Writing function code for CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html) in the *Amazon CloudFront Developer Guide*.
*/
public var functionCode: kotlin.ByteArray? = null
/**
* Configuration information about the function, including an optional comment and the function's runtime.
*/
public var functionConfig: aws.sdk.kotlin.services.cloudfront.model.FunctionConfig? = null
/**
* A name to identify the function.
*/
public var name: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudfront.model.CreateFunctionRequest) : this() {
this.functionCode = x.functionCode
this.functionConfig = x.functionConfig
this.name = x.name
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudfront.model.CreateFunctionRequest = CreateFunctionRequest(this)
/**
* construct an [aws.sdk.kotlin.services.cloudfront.model.FunctionConfig] inside the given [block]
*/
public fun functionConfig(block: aws.sdk.kotlin.services.cloudfront.model.FunctionConfig.Builder.() -> kotlin.Unit) {
this.functionConfig = aws.sdk.kotlin.services.cloudfront.model.FunctionConfig.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy