commonMain.aws.sdk.kotlin.services.codebuild.model.SourceAuth.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
/**
* Information about the authorization settings for CodeBuild to access the source code to be built.
*/
public class SourceAuth private constructor(builder: Builder) {
/**
* The resource value that applies to the specified authorization type.
*/
public val resource: kotlin.String? = builder.resource
/**
* The authorization type to use. Valid options are OAUTH, CODECONNECTIONS, or SECRETS_MANAGER.
*/
public val type: aws.sdk.kotlin.services.codebuild.model.SourceAuthType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.codebuild.model.SourceAuth = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SourceAuth(")
append("resource=$resource,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = resource?.hashCode() ?: 0
result = 31 * result + (type.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 SourceAuth
if (resource != other.resource) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.codebuild.model.SourceAuth = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The resource value that applies to the specified authorization type.
*/
public var resource: kotlin.String? = null
/**
* The authorization type to use. Valid options are OAUTH, CODECONNECTIONS, or SECRETS_MANAGER.
*/
public var type: aws.sdk.kotlin.services.codebuild.model.SourceAuthType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.codebuild.model.SourceAuth) : this() {
this.resource = x.resource
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.codebuild.model.SourceAuth = SourceAuth(this)
internal fun correctErrors(): Builder {
if (type == null) type = SourceAuthType.SdkUnknown("no value provided")
return this
}
}
}