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

com.pulumi.gcp.bigquery.kotlin.inputs.JobCopyArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.bigquery.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.bigquery.inputs.JobCopyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property createDisposition Specifies whether the job is allowed to create new tables. The following values are supported:
 * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
 * CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result.
 * Creation, truncation and append actions occur as one atomic update upon job completion
 * Default value is `CREATE_IF_NEEDED`.
 * Possible values are: `CREATE_IF_NEEDED`, `CREATE_NEVER`.
 * @property destinationEncryptionConfiguration Custom encryption configuration (e.g., Cloud KMS keys)
 * Structure is documented below.
 * @property destinationTable The destination table.
 * Structure is documented below.
 * @property sourceTables Source tables to copy.
 * Structure is documented below.
 * @property writeDisposition Specifies the action that occurs if the destination table already exists. The following values are supported:
 * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result.
 * WRITE_APPEND: If the table already exists, BigQuery appends the data to the table.
 * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result.
 * Each action is atomic and only occurs if BigQuery is able to complete the job successfully.
 * Creation, truncation and append actions occur as one atomic update upon job completion.
 * Default value is `WRITE_EMPTY`.
 * Possible values are: `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`.
 */
public data class JobCopyArgs(
    public val createDisposition: Output? = null,
    public val destinationEncryptionConfiguration: Output? = null,
    public val destinationTable: Output? = null,
    public val sourceTables: Output>,
    public val writeDisposition: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.bigquery.inputs.JobCopyArgs =
        com.pulumi.gcp.bigquery.inputs.JobCopyArgs.builder()
            .createDisposition(createDisposition?.applyValue({ args0 -> args0 }))
            .destinationEncryptionConfiguration(
                destinationEncryptionConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            )
            .destinationTable(destinationTable?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .sourceTables(
                sourceTables.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .writeDisposition(writeDisposition?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [JobCopyArgs].
 */
@PulumiTagMarker
public class JobCopyArgsBuilder internal constructor() {
    private var createDisposition: Output? = null

    private var destinationEncryptionConfiguration:
        Output? = null

    private var destinationTable: Output? = null

    private var sourceTables: Output>? = null

    private var writeDisposition: Output? = null

    /**
     * @param value Specifies whether the job is allowed to create new tables. The following values are supported:
     * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
     * CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result.
     * Creation, truncation and append actions occur as one atomic update upon job completion
     * Default value is `CREATE_IF_NEEDED`.
     * Possible values are: `CREATE_IF_NEEDED`, `CREATE_NEVER`.
     */
    @JvmName("tedfkmudwrdtbkqd")
    public suspend fun createDisposition(`value`: Output) {
        this.createDisposition = value
    }

    /**
     * @param value Custom encryption configuration (e.g., Cloud KMS keys)
     * Structure is documented below.
     */
    @JvmName("ykmjujscxsqwcpop")
    public suspend fun destinationEncryptionConfiguration(`value`: Output) {
        this.destinationEncryptionConfiguration = value
    }

    /**
     * @param value The destination table.
     * Structure is documented below.
     */
    @JvmName("pwcadnausgtwhehp")
    public suspend fun destinationTable(`value`: Output) {
        this.destinationTable = value
    }

    /**
     * @param value Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("svgsnqljuynhewrq")
    public suspend fun sourceTables(`value`: Output>) {
        this.sourceTables = value
    }

    @JvmName("soouvfppfphgphyr")
    public suspend fun sourceTables(vararg values: Output) {
        this.sourceTables = Output.all(values.asList())
    }

    /**
     * @param values Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("rkufavxwuovedqni")
    public suspend fun sourceTables(values: List>) {
        this.sourceTables = Output.all(values)
    }

    /**
     * @param value Specifies the action that occurs if the destination table already exists. The following values are supported:
     * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result.
     * WRITE_APPEND: If the table already exists, BigQuery appends the data to the table.
     * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result.
     * Each action is atomic and only occurs if BigQuery is able to complete the job successfully.
     * Creation, truncation and append actions occur as one atomic update upon job completion.
     * Default value is `WRITE_EMPTY`.
     * Possible values are: `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`.
     */
    @JvmName("kkisfydtcvswbmob")
    public suspend fun writeDisposition(`value`: Output) {
        this.writeDisposition = value
    }

    /**
     * @param value Specifies whether the job is allowed to create new tables. The following values are supported:
     * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table.
     * CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result.
     * Creation, truncation and append actions occur as one atomic update upon job completion
     * Default value is `CREATE_IF_NEEDED`.
     * Possible values are: `CREATE_IF_NEEDED`, `CREATE_NEVER`.
     */
    @JvmName("cireorackkdyemre")
    public suspend fun createDisposition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.createDisposition = mapped
    }

    /**
     * @param value Custom encryption configuration (e.g., Cloud KMS keys)
     * Structure is documented below.
     */
    @JvmName("efcgeicpseohxjej")
    public suspend fun destinationEncryptionConfiguration(`value`: JobCopyDestinationEncryptionConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationEncryptionConfiguration = mapped
    }

    /**
     * @param argument Custom encryption configuration (e.g., Cloud KMS keys)
     * Structure is documented below.
     */
    @JvmName("cahjtstshdjwoqyw")
    public suspend fun destinationEncryptionConfiguration(argument: suspend JobCopyDestinationEncryptionConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = JobCopyDestinationEncryptionConfigurationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.destinationEncryptionConfiguration = mapped
    }

    /**
     * @param value The destination table.
     * Structure is documented below.
     */
    @JvmName("sxmgdhconhkfkjco")
    public suspend fun destinationTable(`value`: JobCopyDestinationTableArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationTable = mapped
    }

    /**
     * @param argument The destination table.
     * Structure is documented below.
     */
    @JvmName("vbifeqkdgqgatrdr")
    public suspend fun destinationTable(argument: suspend JobCopyDestinationTableArgsBuilder.() -> Unit) {
        val toBeMapped = JobCopyDestinationTableArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.destinationTable = mapped
    }

    /**
     * @param value Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("ibklgxasacetmvva")
    public suspend fun sourceTables(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceTables = mapped
    }

    /**
     * @param argument Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("viaqkpwdfxmwisdn")
    public suspend fun sourceTables(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            JobCopySourceTableArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceTables = mapped
    }

    /**
     * @param argument Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("ptmrnrtdpyhbgpkj")
    public suspend fun sourceTables(vararg argument: suspend JobCopySourceTableArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            JobCopySourceTableArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceTables = mapped
    }

    /**
     * @param argument Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("vibtlgtrlaaeriqu")
    public suspend fun sourceTables(argument: suspend JobCopySourceTableArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(JobCopySourceTableArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.sourceTables = mapped
    }

    /**
     * @param values Source tables to copy.
     * Structure is documented below.
     */
    @JvmName("iuyqxjdfksxjmbbf")
    public suspend fun sourceTables(vararg values: JobCopySourceTableArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceTables = mapped
    }

    /**
     * @param value Specifies the action that occurs if the destination table already exists. The following values are supported:
     * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result.
     * WRITE_APPEND: If the table already exists, BigQuery appends the data to the table.
     * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result.
     * Each action is atomic and only occurs if BigQuery is able to complete the job successfully.
     * Creation, truncation and append actions occur as one atomic update upon job completion.
     * Default value is `WRITE_EMPTY`.
     * Possible values are: `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`.
     */
    @JvmName("tlirbcbqaeaxxfwj")
    public suspend fun writeDisposition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.writeDisposition = mapped
    }

    internal fun build(): JobCopyArgs = JobCopyArgs(
        createDisposition = createDisposition,
        destinationEncryptionConfiguration = destinationEncryptionConfiguration,
        destinationTable = destinationTable,
        sourceTables = sourceTables ?: throw PulumiNullFieldException("sourceTables"),
        writeDisposition = writeDisposition,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy