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

commonMain.aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codebuild.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains configuration information about the scope for a webhook.
 */
public class ScopeConfiguration private constructor(builder: Builder) {
    /**
     * The domain of the GitHub Enterprise organization or the GitLab Self Managed group. Note that this parameter is only required if your project's source type is GITHUB_ENTERPRISE or GITLAB_SELF_MANAGED.
     */
    public val domain: kotlin.String? = builder.domain
    /**
     * The name of either the group, enterprise, or organization that will send webhook events to CodeBuild, depending on the type of webhook.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The type of scope for a GitHub or GitLab webhook.
     */
    public val scope: aws.sdk.kotlin.services.codebuild.model.WebhookScopeType = requireNotNull(builder.scope) { "A non-null value must be provided for scope" }

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

    override fun toString(): kotlin.String = buildString {
        append("ScopeConfiguration(")
        append("domain=$domain,")
        append("name=$name,")
        append("scope=$scope")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = domain?.hashCode() ?: 0
        result = 31 * result + (name.hashCode())
        result = 31 * result + (scope.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 ScopeConfiguration

        if (domain != other.domain) return false
        if (name != other.name) return false
        if (scope != other.scope) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The domain of the GitHub Enterprise organization or the GitLab Self Managed group. Note that this parameter is only required if your project's source type is GITHUB_ENTERPRISE or GITLAB_SELF_MANAGED.
         */
        public var domain: kotlin.String? = null
        /**
         * The name of either the group, enterprise, or organization that will send webhook events to CodeBuild, depending on the type of webhook.
         */
        public var name: kotlin.String? = null
        /**
         * The type of scope for a GitHub or GitLab webhook.
         */
        public var scope: aws.sdk.kotlin.services.codebuild.model.WebhookScopeType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration) : this() {
            this.domain = x.domain
            this.name = x.name
            this.scope = x.scope
        }

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (scope == null) scope = WebhookScopeType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy