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

com.pulumi.gcp.bigquery.kotlin.TableArgs.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.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.bigquery.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.bigquery.TableArgs.builder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableEncryptionConfigurationArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableEncryptionConfigurationArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableExternalDataConfigurationArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableExternalDataConfigurationArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableMaterializedViewArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableMaterializedViewArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableRangePartitioningArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableRangePartitioningArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableTableConstraintsArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableTableConstraintsArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableTableReplicationInfoArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableTableReplicationInfoArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableTimePartitioningArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableTimePartitioningArgsBuilder
import com.pulumi.gcp.bigquery.kotlin.inputs.TableViewArgs
import com.pulumi.gcp.bigquery.kotlin.inputs.TableViewArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Creates a table resource in a dataset for Google BigQuery. For more information see
 * [the official documentation](https://cloud.google.com/bigquery/docs/) and
 * [API](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables).
 * > **Note**: On newer versions of the provider, you must explicitly set `deletion_protection=false`
 * (and run `pulumi update` to write the field to state) in order to destroy an instance.
 * It is recommended to not set this field (or set it to true) until you're ready to destroy.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.bigquery.Dataset("default", {
 *     datasetId: "foo",
 *     friendlyName: "test",
 *     description: "This is a test description",
 *     location: "EU",
 *     defaultTableExpirationMs: 3600000,
 *     labels: {
 *         env: "default",
 *     },
 * });
 * const defaultTable = new gcp.bigquery.Table("default", {
 *     datasetId: _default.datasetId,
 *     tableId: "bar",
 *     timePartitioning: {
 *         type: "DAY",
 *     },
 *     labels: {
 *         env: "default",
 *     },
 *     schema: `[
 *   {
 *     "name": "permalink",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The Permalink"
 *   },
 *   {
 *     "name": "state",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "State where the head office is located"
 *   }
 * ]
 * `,
 * });
 * const sheet = new gcp.bigquery.Table("sheet", {
 *     datasetId: _default.datasetId,
 *     tableId: "sheet",
 *     externalDataConfiguration: {
 *         autodetect: true,
 *         sourceFormat: "GOOGLE_SHEETS",
 *         googleSheetsOptions: {
 *             skipLeadingRows: 1,
 *         },
 *         sourceUris: ["https://docs.google.com/spreadsheets/d/123456789012345"],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.bigquery.Dataset("default",
 *     dataset_id="foo",
 *     friendly_name="test",
 *     description="This is a test description",
 *     location="EU",
 *     default_table_expiration_ms=3600000,
 *     labels={
 *         "env": "default",
 *     })
 * default_table = gcp.bigquery.Table("default",
 *     dataset_id=default.dataset_id,
 *     table_id="bar",
 *     time_partitioning=gcp.bigquery.TableTimePartitioningArgs(
 *         type="DAY",
 *     ),
 *     labels={
 *         "env": "default",
 *     },
 *     schema="""[
 *   {
 *     "name": "permalink",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The Permalink"
 *   },
 *   {
 *     "name": "state",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "State where the head office is located"
 *   }
 * ]
 * """)
 * sheet = gcp.bigquery.Table("sheet",
 *     dataset_id=default.dataset_id,
 *     table_id="sheet",
 *     external_data_configuration=gcp.bigquery.TableExternalDataConfigurationArgs(
 *         autodetect=True,
 *         source_format="GOOGLE_SHEETS",
 *         google_sheets_options=gcp.bigquery.TableExternalDataConfigurationGoogleSheetsOptionsArgs(
 *             skip_leading_rows=1,
 *         ),
 *         source_uris=["https://docs.google.com/spreadsheets/d/123456789012345"],
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.BigQuery.Dataset("default", new()
 *     {
 *         DatasetId = "foo",
 *         FriendlyName = "test",
 *         Description = "This is a test description",
 *         Location = "EU",
 *         DefaultTableExpirationMs = 3600000,
 *         Labels =
 *         {
 *             { "env", "default" },
 *         },
 *     });
 *     var defaultTable = new Gcp.BigQuery.Table("default", new()
 *     {
 *         DatasetId = @default.DatasetId,
 *         TableId = "bar",
 *         TimePartitioning = new Gcp.BigQuery.Inputs.TableTimePartitioningArgs
 *         {
 *             Type = "DAY",
 *         },
 *         Labels =
 *         {
 *             { "env", "default" },
 *         },
 *         Schema = @"[
 *   {
 *     ""name"": ""permalink"",
 *     ""type"": ""STRING"",
 *     ""mode"": ""NULLABLE"",
 *     ""description"": ""The Permalink""
 *   },
 *   {
 *     ""name"": ""state"",
 *     ""type"": ""STRING"",
 *     ""mode"": ""NULLABLE"",
 *     ""description"": ""State where the head office is located""
 *   }
 * ]
 * ",
 *     });
 *     var sheet = new Gcp.BigQuery.Table("sheet", new()
 *     {
 *         DatasetId = @default.DatasetId,
 *         TableId = "sheet",
 *         ExternalDataConfiguration = new Gcp.BigQuery.Inputs.TableExternalDataConfigurationArgs
 *         {
 *             Autodetect = true,
 *             SourceFormat = "GOOGLE_SHEETS",
 *             GoogleSheetsOptions = new Gcp.BigQuery.Inputs.TableExternalDataConfigurationGoogleSheetsOptionsArgs
 *             {
 *                 SkipLeadingRows = 1,
 *             },
 *             SourceUris = new[]
 *             {
 *                 "https://docs.google.com/spreadsheets/d/123456789012345",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := bigquery.NewDataset(ctx, "default", &bigquery.DatasetArgs{
 * 			DatasetId:                pulumi.String("foo"),
 * 			FriendlyName:             pulumi.String("test"),
 * 			Description:              pulumi.String("This is a test description"),
 * 			Location:                 pulumi.String("EU"),
 * 			DefaultTableExpirationMs: pulumi.Int(3600000),
 * 			Labels: pulumi.StringMap{
 * 				"env": pulumi.String("default"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bigquery.NewTable(ctx, "default", &bigquery.TableArgs{
 * 			DatasetId: _default.DatasetId,
 * 			TableId:   pulumi.String("bar"),
 * 			TimePartitioning: &bigquery.TableTimePartitioningArgs{
 * 				Type: pulumi.String("DAY"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"env": pulumi.String("default"),
 * 			},
 * 			Schema: pulumi.String(`[
 *   {
 *     "name": "permalink",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The Permalink"
 *   },
 *   {
 *     "name": "state",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "State where the head office is located"
 *   }
 * ]
 * `),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bigquery.NewTable(ctx, "sheet", &bigquery.TableArgs{
 * 			DatasetId: _default.DatasetId,
 * 			TableId:   pulumi.String("sheet"),
 * 			ExternalDataConfiguration: &bigquery.TableExternalDataConfigurationArgs{
 * 				Autodetect:   pulumi.Bool(true),
 * 				SourceFormat: pulumi.String("GOOGLE_SHEETS"),
 * 				GoogleSheetsOptions: &bigquery.TableExternalDataConfigurationGoogleSheetsOptionsArgs{
 * 					SkipLeadingRows: pulumi.Int(1),
 * 				},
 * 				SourceUris: pulumi.StringArray{
 * 					pulumi.String("https://docs.google.com/spreadsheets/d/123456789012345"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.bigquery.Dataset;
 * import com.pulumi.gcp.bigquery.DatasetArgs;
 * import com.pulumi.gcp.bigquery.Table;
 * import com.pulumi.gcp.bigquery.TableArgs;
 * import com.pulumi.gcp.bigquery.inputs.TableTimePartitioningArgs;
 * import com.pulumi.gcp.bigquery.inputs.TableExternalDataConfigurationArgs;
 * import com.pulumi.gcp.bigquery.inputs.TableExternalDataConfigurationGoogleSheetsOptionsArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var default_ = new Dataset("default", DatasetArgs.builder()
 *             .datasetId("foo")
 *             .friendlyName("test")
 *             .description("This is a test description")
 *             .location("EU")
 *             .defaultTableExpirationMs(3600000)
 *             .labels(Map.of("env", "default"))
 *             .build());
 *         var defaultTable = new Table("defaultTable", TableArgs.builder()
 *             .datasetId(default_.datasetId())
 *             .tableId("bar")
 *             .timePartitioning(TableTimePartitioningArgs.builder()
 *                 .type("DAY")
 *                 .build())
 *             .labels(Map.of("env", "default"))
 *             .schema("""
 * [
 *   {
 *     "name": "permalink",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The Permalink"
 *   },
 *   {
 *     "name": "state",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "State where the head office is located"
 *   }
 * ]
 *             """)
 *             .build());
 *         var sheet = new Table("sheet", TableArgs.builder()
 *             .datasetId(default_.datasetId())
 *             .tableId("sheet")
 *             .externalDataConfiguration(TableExternalDataConfigurationArgs.builder()
 *                 .autodetect(true)
 *                 .sourceFormat("GOOGLE_SHEETS")
 *                 .googleSheetsOptions(TableExternalDataConfigurationGoogleSheetsOptionsArgs.builder()
 *                     .skipLeadingRows(1)
 *                     .build())
 *                 .sourceUris("https://docs.google.com/spreadsheets/d/123456789012345")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:bigquery:Dataset
 *     properties:
 *       datasetId: foo
 *       friendlyName: test
 *       description: This is a test description
 *       location: EU
 *       defaultTableExpirationMs: 3.6e+06
 *       labels:
 *         env: default
 *   defaultTable:
 *     type: gcp:bigquery:Table
 *     name: default
 *     properties:
 *       datasetId: ${default.datasetId}
 *       tableId: bar
 *       timePartitioning:
 *         type: DAY
 *       labels:
 *         env: default
 *       schema: |
 *         [
 *           {
 *             "name": "permalink",
 *             "type": "STRING",
 *             "mode": "NULLABLE",
 *             "description": "The Permalink"
 *           },
 *           {
 *             "name": "state",
 *             "type": "STRING",
 *             "mode": "NULLABLE",
 *             "description": "State where the head office is located"
 *           }
 *         ]
 *   sheet:
 *     type: gcp:bigquery:Table
 *     properties:
 *       datasetId: ${default.datasetId}
 *       tableId: sheet
 *       externalDataConfiguration:
 *         autodetect: true
 *         sourceFormat: GOOGLE_SHEETS
 *         googleSheetsOptions:
 *           skipLeadingRows: 1
 *         sourceUris:
 *           - https://docs.google.com/spreadsheets/d/123456789012345
 * ```
 * 
 * ## Import
 * BigQuery tables can be imported using any of these accepted formats:
 * * `projects/{{project}}/datasets/{{dataset_id}}/tables/{{table_id}}`
 * * `{{project}}/{{dataset_id}}/{{table_id}}`
 * * `{{dataset_id}}/{{table_id}}`
 * When using the `pulumi import` command, BigQuery tables can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:bigquery/table:Table default projects/{{project}}/datasets/{{dataset_id}}/tables/{{table_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigquery/table:Table default {{project}}/{{dataset_id}}/{{table_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:bigquery/table:Table default {{dataset_id}}/{{table_id}}
 * ```
 * @property allowResourceTagsOnDeletion Whether or not to allow table deletion when there are still resource tags attached.
 * @property clusterings Specifies column names to use for data clustering.
 * Up to four top-level columns are allowed, and should be specified in
 * descending priority order.
 * @property datasetId The dataset ID to create the table in.
 * Changing this forces a new resource to be created.
 * @property deletionProtection Whether or not to allow the provider to destroy the instance. Unless this field is set to false
 * in state, a `=destroy` or `=update` that would delete the instance will fail.
 * @property description The field description.
 * @property encryptionConfiguration Specifies how the table should be encrypted.
 * If left blank, the table will be encrypted with a Google-managed key; that process
 * is transparent to the user.  Structure is documented below.
 * @property expirationTime The time when this table expires, in
 * milliseconds since the epoch. If not present, the table will persist
 * indefinitely. Expired tables will be deleted and their storage
 * reclaimed.
 * @property externalDataConfiguration Describes the data format,
 * location, and other properties of a table stored outside of BigQuery.
 * By defining these properties, the data source can then be queried as
 * if it were a standard BigQuery table. Structure is documented below.
 * @property friendlyName A descriptive name for the table.
 * @property labels A mapping of labels to assign to the resource.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field 'effective_labels' for all of the labels present on the resource.
 * @property materializedView If specified, configures this table as a materialized view.
 * Structure is documented below.
 * @property maxStaleness The maximum staleness of data that could be
 * returned when the table (or stale MV) is queried. Staleness encoded as a
 * string encoding of [SQL IntervalValue
 * type](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#interval_type).
 * @property project The ID of the project in which the resource belongs. If it
 * is not provided, the provider project is used.
 * @property rangePartitioning If specified, configures range-based
 * partitioning for this table. Structure is documented below.
 * @property requirePartitionFilter If set to true, queries over this table
 * require a partition filter that can be used for partition elimination to be
 * specified.
 * @property resourceTags The tags attached to this table. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for
 * example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this
 * tag key. Tag value is expected to be the short name, for example "Production".
 * @property schema A JSON schema for the table.
 * @property tableConstraints Defines the primary key and foreign keys.
 * Structure is documented below.
 * @property tableId A unique ID for the resource.
 * Changing this forces a new resource to be created.
 * @property tableReplicationInfo Replication info of a table created using "AS REPLICA" DDL like: "CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv".
 * @property timePartitioning If specified, configures time-based
 * partitioning for this table. Structure is documented below.
 * @property view If specified, configures this table as a view.
 * Structure is documented below.
 */
public data class TableArgs(
    public val allowResourceTagsOnDeletion: Output? = null,
    public val clusterings: Output>? = null,
    public val datasetId: Output? = null,
    public val deletionProtection: Output? = null,
    public val description: Output? = null,
    public val encryptionConfiguration: Output? = null,
    public val expirationTime: Output? = null,
    public val externalDataConfiguration: Output? = null,
    public val friendlyName: Output? = null,
    public val labels: Output>? = null,
    public val materializedView: Output? = null,
    public val maxStaleness: Output? = null,
    public val project: Output? = null,
    public val rangePartitioning: Output? = null,
    public val requirePartitionFilter: Output? = null,
    public val resourceTags: Output>? = null,
    public val schema: Output? = null,
    public val tableConstraints: Output? = null,
    public val tableId: Output? = null,
    public val tableReplicationInfo: Output? = null,
    public val timePartitioning: Output? = null,
    public val view: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.bigquery.TableArgs =
        com.pulumi.gcp.bigquery.TableArgs.builder()
            .allowResourceTagsOnDeletion(allowResourceTagsOnDeletion?.applyValue({ args0 -> args0 }))
            .clusterings(clusterings?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .datasetId(datasetId?.applyValue({ args0 -> args0 }))
            .deletionProtection(deletionProtection?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .encryptionConfiguration(
                encryptionConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .expirationTime(expirationTime?.applyValue({ args0 -> args0 }))
            .externalDataConfiguration(
                externalDataConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .friendlyName(friendlyName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .materializedView(materializedView?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .maxStaleness(maxStaleness?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .rangePartitioning(rangePartitioning?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .requirePartitionFilter(requirePartitionFilter?.applyValue({ args0 -> args0 }))
            .resourceTags(
                resourceTags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .schema(schema?.applyValue({ args0 -> args0 }))
            .tableConstraints(tableConstraints?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tableId(tableId?.applyValue({ args0 -> args0 }))
            .tableReplicationInfo(
                tableReplicationInfo?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .timePartitioning(timePartitioning?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .view(view?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [TableArgs].
 */
@PulumiTagMarker
public class TableArgsBuilder internal constructor() {
    private var allowResourceTagsOnDeletion: Output? = null

    private var clusterings: Output>? = null

    private var datasetId: Output? = null

    private var deletionProtection: Output? = null

    private var description: Output? = null

    private var encryptionConfiguration: Output? = null

    private var expirationTime: Output? = null

    private var externalDataConfiguration: Output? = null

    private var friendlyName: Output? = null

    private var labels: Output>? = null

    private var materializedView: Output? = null

    private var maxStaleness: Output? = null

    private var project: Output? = null

    private var rangePartitioning: Output? = null

    private var requirePartitionFilter: Output? = null

    private var resourceTags: Output>? = null

    private var schema: Output? = null

    private var tableConstraints: Output? = null

    private var tableId: Output? = null

    private var tableReplicationInfo: Output? = null

    private var timePartitioning: Output? = null

    private var view: Output? = null

    /**
     * @param value Whether or not to allow table deletion when there are still resource tags attached.
     */
    @JvmName("rnhnylscbavtyolx")
    public suspend fun allowResourceTagsOnDeletion(`value`: Output) {
        this.allowResourceTagsOnDeletion = value
    }

    /**
     * @param value Specifies column names to use for data clustering.
     * Up to four top-level columns are allowed, and should be specified in
     * descending priority order.
     */
    @JvmName("gdpllpqhyfmpuchy")
    public suspend fun clusterings(`value`: Output>) {
        this.clusterings = value
    }

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

    /**
     * @param values Specifies column names to use for data clustering.
     * Up to four top-level columns are allowed, and should be specified in
     * descending priority order.
     */
    @JvmName("flpweesmvfdrxcbt")
    public suspend fun clusterings(values: List>) {
        this.clusterings = Output.all(values)
    }

    /**
     * @param value The dataset ID to create the table in.
     * Changing this forces a new resource to be created.
     */
    @JvmName("kvpgauglehponrqb")
    public suspend fun datasetId(`value`: Output) {
        this.datasetId = value
    }

    /**
     * @param value Whether or not to allow the provider to destroy the instance. Unless this field is set to false
     * in state, a `=destroy` or `=update` that would delete the instance will fail.
     */
    @JvmName("fccmctwwcqsnfgoe")
    public suspend fun deletionProtection(`value`: Output) {
        this.deletionProtection = value
    }

    /**
     * @param value The field description.
     */
    @JvmName("arfctixftevpbjyc")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies how the table should be encrypted.
     * If left blank, the table will be encrypted with a Google-managed key; that process
     * is transparent to the user.  Structure is documented below.
     */
    @JvmName("soadftnjqqooloqd")
    public suspend fun encryptionConfiguration(`value`: Output) {
        this.encryptionConfiguration = value
    }

    /**
     * @param value The time when this table expires, in
     * milliseconds since the epoch. If not present, the table will persist
     * indefinitely. Expired tables will be deleted and their storage
     * reclaimed.
     */
    @JvmName("xaerqtuyufoxijuj")
    public suspend fun expirationTime(`value`: Output) {
        this.expirationTime = value
    }

    /**
     * @param value Describes the data format,
     * location, and other properties of a table stored outside of BigQuery.
     * By defining these properties, the data source can then be queried as
     * if it were a standard BigQuery table. Structure is documented below.
     */
    @JvmName("lfluwuppvwhcpoge")
    public suspend fun externalDataConfiguration(`value`: Output) {
        this.externalDataConfiguration = value
    }

    /**
     * @param value A descriptive name for the table.
     */
    @JvmName("fpgwssntdduotvpw")
    public suspend fun friendlyName(`value`: Output) {
        this.friendlyName = value
    }

    /**
     * @param value A mapping of labels to assign to the resource.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("jrscfuksxdkotech")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value If specified, configures this table as a materialized view.
     * Structure is documented below.
     */
    @JvmName("jgvhxgifsocflflw")
    public suspend fun materializedView(`value`: Output) {
        this.materializedView = value
    }

    /**
     * @param value The maximum staleness of data that could be
     * returned when the table (or stale MV) is queried. Staleness encoded as a
     * string encoding of [SQL IntervalValue
   * type](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#interval_type).
     */
    @JvmName("tgftvftoplncrkef")
    public suspend fun maxStaleness(`value`: Output) {
        this.maxStaleness = value
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("ryjycaghbpxhsllf")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value If specified, configures range-based
     * partitioning for this table. Structure is documented below.
     */
    @JvmName("ndkxmxyjyjcytuwy")
    public suspend fun rangePartitioning(`value`: Output) {
        this.rangePartitioning = value
    }

    /**
     * @param value If set to true, queries over this table
     * require a partition filter that can be used for partition elimination to be
     * specified.
     */
    @JvmName("ofauymrcjfbblwbp")
    public suspend fun requirePartitionFilter(`value`: Output) {
        this.requirePartitionFilter = value
    }

    /**
     * @param value The tags attached to this table. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for
     * example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this
     * tag key. Tag value is expected to be the short name, for example "Production".
     */
    @JvmName("chaocfdxydwhifio")
    public suspend fun resourceTags(`value`: Output>) {
        this.resourceTags = value
    }

    /**
     * @param value A JSON schema for the table.
     */
    @JvmName("otbncvvicpbpnood")
    public suspend fun schema(`value`: Output) {
        this.schema = value
    }

    /**
     * @param value Defines the primary key and foreign keys.
     * Structure is documented below.
     */
    @JvmName("gxtncuveainfbyxc")
    public suspend fun tableConstraints(`value`: Output) {
        this.tableConstraints = value
    }

    /**
     * @param value A unique ID for the resource.
     * Changing this forces a new resource to be created.
     */
    @JvmName("ytpfttuxcdbvnrbo")
    public suspend fun tableId(`value`: Output) {
        this.tableId = value
    }

    /**
     * @param value Replication info of a table created using "AS REPLICA" DDL like: "CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv".
     */
    @JvmName("xhimhsbrcmcobvuj")
    public suspend fun tableReplicationInfo(`value`: Output) {
        this.tableReplicationInfo = value
    }

    /**
     * @param value If specified, configures time-based
     * partitioning for this table. Structure is documented below.
     */
    @JvmName("ashuleywgqfncowu")
    public suspend fun timePartitioning(`value`: Output) {
        this.timePartitioning = value
    }

    /**
     * @param value If specified, configures this table as a view.
     * Structure is documented below.
     */
    @JvmName("ngmsepjlkqjoyyhr")
    public suspend fun view(`value`: Output) {
        this.view = value
    }

    /**
     * @param value Whether or not to allow table deletion when there are still resource tags attached.
     */
    @JvmName("tkmlpbyypeveoaox")
    public suspend fun allowResourceTagsOnDeletion(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowResourceTagsOnDeletion = mapped
    }

    /**
     * @param value Specifies column names to use for data clustering.
     * Up to four top-level columns are allowed, and should be specified in
     * descending priority order.
     */
    @JvmName("uepycrthcqokvcsj")
    public suspend fun clusterings(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterings = mapped
    }

    /**
     * @param values Specifies column names to use for data clustering.
     * Up to four top-level columns are allowed, and should be specified in
     * descending priority order.
     */
    @JvmName("jdfutbotheltomyc")
    public suspend fun clusterings(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.clusterings = mapped
    }

    /**
     * @param value The dataset ID to create the table in.
     * Changing this forces a new resource to be created.
     */
    @JvmName("hujsishefogtclkt")
    public suspend fun datasetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.datasetId = mapped
    }

    /**
     * @param value Whether or not to allow the provider to destroy the instance. Unless this field is set to false
     * in state, a `=destroy` or `=update` that would delete the instance will fail.
     */
    @JvmName("hptkccjdqunbkwxp")
    public suspend fun deletionProtection(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deletionProtection = mapped
    }

    /**
     * @param value The field description.
     */
    @JvmName("kyskleuwcjogljme")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies how the table should be encrypted.
     * If left blank, the table will be encrypted with a Google-managed key; that process
     * is transparent to the user.  Structure is documented below.
     */
    @JvmName("jiryklwpdenwcjnj")
    public suspend fun encryptionConfiguration(`value`: TableEncryptionConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.encryptionConfiguration = mapped
    }

    /**
     * @param argument Specifies how the table should be encrypted.
     * If left blank, the table will be encrypted with a Google-managed key; that process
     * is transparent to the user.  Structure is documented below.
     */
    @JvmName("wvqnrnsmghsvtnri")
    public suspend fun encryptionConfiguration(argument: suspend TableEncryptionConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = TableEncryptionConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.encryptionConfiguration = mapped
    }

    /**
     * @param value The time when this table expires, in
     * milliseconds since the epoch. If not present, the table will persist
     * indefinitely. Expired tables will be deleted and their storage
     * reclaimed.
     */
    @JvmName("dpewcrboqownuvys")
    public suspend fun expirationTime(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expirationTime = mapped
    }

    /**
     * @param value Describes the data format,
     * location, and other properties of a table stored outside of BigQuery.
     * By defining these properties, the data source can then be queried as
     * if it were a standard BigQuery table. Structure is documented below.
     */
    @JvmName("ghfoqbyodmfbntkj")
    public suspend fun externalDataConfiguration(`value`: TableExternalDataConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.externalDataConfiguration = mapped
    }

    /**
     * @param argument Describes the data format,
     * location, and other properties of a table stored outside of BigQuery.
     * By defining these properties, the data source can then be queried as
     * if it were a standard BigQuery table. Structure is documented below.
     */
    @JvmName("lqxvmcifyqylxkjk")
    public suspend fun externalDataConfiguration(argument: suspend TableExternalDataConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = TableExternalDataConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.externalDataConfiguration = mapped
    }

    /**
     * @param value A descriptive name for the table.
     */
    @JvmName("jiijxdpgarfhfptf")
    public suspend fun friendlyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.friendlyName = mapped
    }

    /**
     * @param value A mapping of labels to assign to the resource.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("skmeidghsdalfyev")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values A mapping of labels to assign to the resource.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("xsfjbwbqdgrimvhf")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value If specified, configures this table as a materialized view.
     * Structure is documented below.
     */
    @JvmName("arfsmejvxpsgbhib")
    public suspend fun materializedView(`value`: TableMaterializedViewArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.materializedView = mapped
    }

    /**
     * @param argument If specified, configures this table as a materialized view.
     * Structure is documented below.
     */
    @JvmName("hsuiwecovqtpxdaw")
    public suspend fun materializedView(argument: suspend TableMaterializedViewArgsBuilder.() -> Unit) {
        val toBeMapped = TableMaterializedViewArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.materializedView = mapped
    }

    /**
     * @param value The maximum staleness of data that could be
     * returned when the table (or stale MV) is queried. Staleness encoded as a
     * string encoding of [SQL IntervalValue
   * type](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#interval_type).
     */
    @JvmName("dqjfocxeoguhjssn")
    public suspend fun maxStaleness(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxStaleness = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("gotwaiggkakomumy")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value If specified, configures range-based
     * partitioning for this table. Structure is documented below.
     */
    @JvmName("hrmttwlfhtoypxhl")
    public suspend fun rangePartitioning(`value`: TableRangePartitioningArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rangePartitioning = mapped
    }

    /**
     * @param argument If specified, configures range-based
     * partitioning for this table. Structure is documented below.
     */
    @JvmName("yblkbykoasdkirew")
    public suspend fun rangePartitioning(argument: suspend TableRangePartitioningArgsBuilder.() -> Unit) {
        val toBeMapped = TableRangePartitioningArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rangePartitioning = mapped
    }

    /**
     * @param value If set to true, queries over this table
     * require a partition filter that can be used for partition elimination to be
     * specified.
     */
    @JvmName("dgvnbakuksehtjfc")
    public suspend fun requirePartitionFilter(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requirePartitionFilter = mapped
    }

    /**
     * @param value The tags attached to this table. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for
     * example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this
     * tag key. Tag value is expected to be the short name, for example "Production".
     */
    @JvmName("nnnnixlwucsljkaf")
    public suspend fun resourceTags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceTags = mapped
    }

    /**
     * @param values The tags attached to this table. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for
     * example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this
     * tag key. Tag value is expected to be the short name, for example "Production".
     */
    @JvmName("qojceuhdghksxfsu")
    public fun resourceTags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceTags = mapped
    }

    /**
     * @param value A JSON schema for the table.
     */
    @JvmName("yrowxdhsvwxhvhof")
    public suspend fun schema(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schema = mapped
    }

    /**
     * @param value Defines the primary key and foreign keys.
     * Structure is documented below.
     */
    @JvmName("adisytscxqhrmeow")
    public suspend fun tableConstraints(`value`: TableTableConstraintsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tableConstraints = mapped
    }

    /**
     * @param argument Defines the primary key and foreign keys.
     * Structure is documented below.
     */
    @JvmName("rpptnfpqhfjotouv")
    public suspend fun tableConstraints(argument: suspend TableTableConstraintsArgsBuilder.() -> Unit) {
        val toBeMapped = TableTableConstraintsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.tableConstraints = mapped
    }

    /**
     * @param value A unique ID for the resource.
     * Changing this forces a new resource to be created.
     */
    @JvmName("xpddklyuvsgagato")
    public suspend fun tableId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tableId = mapped
    }

    /**
     * @param value Replication info of a table created using "AS REPLICA" DDL like: "CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv".
     */
    @JvmName("ykvqamulhjagvgaj")
    public suspend fun tableReplicationInfo(`value`: TableTableReplicationInfoArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tableReplicationInfo = mapped
    }

    /**
     * @param argument Replication info of a table created using "AS REPLICA" DDL like: "CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv".
     */
    @JvmName("fsvjlfrrajumkvxk")
    public suspend fun tableReplicationInfo(argument: suspend TableTableReplicationInfoArgsBuilder.() -> Unit) {
        val toBeMapped = TableTableReplicationInfoArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.tableReplicationInfo = mapped
    }

    /**
     * @param value If specified, configures time-based
     * partitioning for this table. Structure is documented below.
     */
    @JvmName("xccykyvspycxjfto")
    public suspend fun timePartitioning(`value`: TableTimePartitioningArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timePartitioning = mapped
    }

    /**
     * @param argument If specified, configures time-based
     * partitioning for this table. Structure is documented below.
     */
    @JvmName("muowpdyjsrjwdiij")
    public suspend fun timePartitioning(argument: suspend TableTimePartitioningArgsBuilder.() -> Unit) {
        val toBeMapped = TableTimePartitioningArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.timePartitioning = mapped
    }

    /**
     * @param value If specified, configures this table as a view.
     * Structure is documented below.
     */
    @JvmName("vxaospnskgwtywmj")
    public suspend fun view(`value`: TableViewArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.view = mapped
    }

    /**
     * @param argument If specified, configures this table as a view.
     * Structure is documented below.
     */
    @JvmName("dhmmuukiqkiancsk")
    public suspend fun view(argument: suspend TableViewArgsBuilder.() -> Unit) {
        val toBeMapped = TableViewArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.view = mapped
    }

    internal fun build(): TableArgs = TableArgs(
        allowResourceTagsOnDeletion = allowResourceTagsOnDeletion,
        clusterings = clusterings,
        datasetId = datasetId,
        deletionProtection = deletionProtection,
        description = description,
        encryptionConfiguration = encryptionConfiguration,
        expirationTime = expirationTime,
        externalDataConfiguration = externalDataConfiguration,
        friendlyName = friendlyName,
        labels = labels,
        materializedView = materializedView,
        maxStaleness = maxStaleness,
        project = project,
        rangePartitioning = rangePartitioning,
        requirePartitionFilter = requirePartitionFilter,
        resourceTags = resourceTags,
        schema = schema,
        tableConstraints = tableConstraints,
        tableId = tableId,
        tableReplicationInfo = tableReplicationInfo,
        timePartitioning = timePartitioning,
        view = view,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy