All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.s3control.model.KeyNameConstraint.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.s3control.model



/**
 * If provided, the generated manifest includes only source bucket objects whose object keys match the string constraints specified for `MatchAnyPrefix`, `MatchAnySuffix`, and `MatchAnySubstring`.
 */
public class KeyNameConstraint private constructor(builder: Builder) {
    /**
     * If provided, the generated manifest includes objects where the specified string appears at the start of the object key string.
     */
    public val matchAnyPrefix: List? = builder.matchAnyPrefix
    /**
     * If provided, the generated manifest includes objects where the specified string appears anywhere within the object key string.
     */
    public val matchAnySubstring: List? = builder.matchAnySubstring
    /**
     * If provided, the generated manifest includes objects where the specified string appears at the end of the object key string.
     */
    public val matchAnySuffix: List? = builder.matchAnySuffix

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3control.model.KeyNameConstraint = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("KeyNameConstraint(")
        append("matchAnyPrefix=$matchAnyPrefix,")
        append("matchAnySubstring=$matchAnySubstring,")
        append("matchAnySuffix=$matchAnySuffix")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = matchAnyPrefix?.hashCode() ?: 0
        result = 31 * result + (matchAnySubstring?.hashCode() ?: 0)
        result = 31 * result + (matchAnySuffix?.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 KeyNameConstraint

        if (matchAnyPrefix != other.matchAnyPrefix) return false
        if (matchAnySubstring != other.matchAnySubstring) return false
        if (matchAnySuffix != other.matchAnySuffix) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3control.model.KeyNameConstraint = Builder(this).apply(block).build()

    public class Builder {
        /**
         * If provided, the generated manifest includes objects where the specified string appears at the start of the object key string.
         */
        public var matchAnyPrefix: List? = null
        /**
         * If provided, the generated manifest includes objects where the specified string appears anywhere within the object key string.
         */
        public var matchAnySubstring: List? = null
        /**
         * If provided, the generated manifest includes objects where the specified string appears at the end of the object key string.
         */
        public var matchAnySuffix: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3control.model.KeyNameConstraint) : this() {
            this.matchAnyPrefix = x.matchAnyPrefix
            this.matchAnySubstring = x.matchAnySubstring
            this.matchAnySuffix = x.matchAnySuffix
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.s3control.model.KeyNameConstraint = KeyNameConstraint(this)

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy