commonMain.aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codebuild-jvm Show documentation
Show all versions of codebuild-jvm Show documentation
The AWS SDK for Kotlin client for CodeBuild
// 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. Note that this parameter is only required if your project's source type is GITHUB_ENTERPRISE
*/
public val domain: kotlin.String? = builder.domain
/**
* The name of either the enterprise or organization that will send webhook events to CodeBuild, depending on if the webhook is a global or organization webhook respectively.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The type of scope for a GitHub 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. Note that this parameter is only required if your project's source type is GITHUB_ENTERPRISE
*/
public var domain: kotlin.String? = null
/**
* The name of either the enterprise or organization that will send webhook events to CodeBuild, depending on if the webhook is a global or organization webhook respectively.
*/
public var name: kotlin.String? = null
/**
* The type of scope for a GitHub 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
}
}
}