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

commonMain.aws.sdk.kotlin.services.codebuild.model.CreateWebhookRequest.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

public class CreateWebhookRequest private constructor(builder: Builder) {
    /**
     * A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If `branchFilter` is empty, then all branches are built.
     *
     * It is recommended that you use `filterGroups` instead of `branchFilter`.
     */
    public val branchFilter: kotlin.String? = builder.branchFilter
    /**
     * Specifies the type of build this webhook will trigger.
     */
    public val buildType: aws.sdk.kotlin.services.codebuild.model.WebhookBuildType? = builder.buildType
    /**
     * An array of arrays of `WebhookFilter` objects used to determine which webhooks are triggered. At least one `WebhookFilter` in the array must specify `EVENT` as its `type`.
     *
     * For a build to be triggered, at least one filter group in the `filterGroups` array must pass. For a filter group to pass, each of its filters must pass.
     */
    public val filterGroups: List>? = builder.filterGroups
    /**
     * If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns `payloadUrl` and `secret` values for the webhook. The `payloadUrl` and `secret` values in the output can be used to manually create a webhook within GitHub.
     *
     * `manualCreation` is only available for GitHub webhooks.
     */
    public val manualCreation: kotlin.Boolean? = builder.manualCreation
    /**
     * The name of the CodeBuild project.
     */
    public val projectName: kotlin.String? = builder.projectName
    /**
     * The scope configuration for global or organization webhooks.
     *
     * Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
     */
    public val scopeConfiguration: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration? = builder.scopeConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("CreateWebhookRequest(")
        append("branchFilter=$branchFilter,")
        append("buildType=$buildType,")
        append("filterGroups=$filterGroups,")
        append("manualCreation=$manualCreation,")
        append("projectName=$projectName,")
        append("scopeConfiguration=$scopeConfiguration")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = branchFilter?.hashCode() ?: 0
        result = 31 * result + (buildType?.hashCode() ?: 0)
        result = 31 * result + (filterGroups?.hashCode() ?: 0)
        result = 31 * result + (manualCreation?.hashCode() ?: 0)
        result = 31 * result + (projectName?.hashCode() ?: 0)
        result = 31 * result + (scopeConfiguration?.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 CreateWebhookRequest

        if (branchFilter != other.branchFilter) return false
        if (buildType != other.buildType) return false
        if (filterGroups != other.filterGroups) return false
        if (manualCreation != other.manualCreation) return false
        if (projectName != other.projectName) return false
        if (scopeConfiguration != other.scopeConfiguration) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If `branchFilter` is empty, then all branches are built.
         *
         * It is recommended that you use `filterGroups` instead of `branchFilter`.
         */
        public var branchFilter: kotlin.String? = null
        /**
         * Specifies the type of build this webhook will trigger.
         */
        public var buildType: aws.sdk.kotlin.services.codebuild.model.WebhookBuildType? = null
        /**
         * An array of arrays of `WebhookFilter` objects used to determine which webhooks are triggered. At least one `WebhookFilter` in the array must specify `EVENT` as its `type`.
         *
         * For a build to be triggered, at least one filter group in the `filterGroups` array must pass. For a filter group to pass, each of its filters must pass.
         */
        public var filterGroups: List>? = null
        /**
         * If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns `payloadUrl` and `secret` values for the webhook. The `payloadUrl` and `secret` values in the output can be used to manually create a webhook within GitHub.
         *
         * `manualCreation` is only available for GitHub webhooks.
         */
        public var manualCreation: kotlin.Boolean? = null
        /**
         * The name of the CodeBuild project.
         */
        public var projectName: kotlin.String? = null
        /**
         * The scope configuration for global or organization webhooks.
         *
         * Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
         */
        public var scopeConfiguration: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codebuild.model.CreateWebhookRequest) : this() {
            this.branchFilter = x.branchFilter
            this.buildType = x.buildType
            this.filterGroups = x.filterGroups
            this.manualCreation = x.manualCreation
            this.projectName = x.projectName
            this.scopeConfiguration = x.scopeConfiguration
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration] inside the given [block]
         */
        public fun scopeConfiguration(block: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration.Builder.() -> kotlin.Unit) {
            this.scopeConfiguration = aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration.invoke(block)
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy