Google BigQuery v2 API - Class TableSchemaBuilder (3.2.0)

public sealed class TableSchemaBuilder : IEnumerable

Reference documentation and code samples for the Google BigQuery v2 API class TableSchemaBuilder.

Class making it simple to create a Google.Apis.Bigquery.v2.Data.TableSchema.

Inheritance

Object > TableSchemaBuilder

Implements

IEnumerable

Namespace

Google.Cloud.BigQuery.V2

Assembly

Google.Cloud.BigQuery.V2.dll

Remarks

This class only implements IEnumerable in order to allow it to be used in collection initializers.

Methods

Add(TableFieldSchema)

public void Add(TableFieldSchema field)

Adds the given field to the schema being built.

Parameter
NameDescription
fieldGoogle.Apis.Bigquery.v2.Data.TableFieldSchema

The field to add. Must not be null.

Add(String, TableSchema, BigQueryFieldMode, String)

public void Add(string name, TableSchema nestedSchema, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null)

Creates a nested field with the specified schema, and adds it to the schema being built.

Parameters
NameDescription
nameString

The name of the field. Must be a valid field name.

nestedSchemaGoogle.Apis.Bigquery.v2.Data.TableSchema

The schema for the nested field. Must not be null.

modeBigQueryFieldMode

The mode of the field. Must be a defined member within BigQueryFieldMode.

descriptionString

The description of the field. May be null.

Add(String, BigQueryDbType, BigQueryFieldMode, String)

public void Add(string name, BigQueryDbType type, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null)

Creates a field with the specified details, and adds it to the schema being built.

Parameters
NameDescription
nameString

The name of the field. Must be a valid field name.

typeBigQueryDbType

The type of the field. Must be a defined member within BigQueryDbType, other than Struct or Array.

modeBigQueryFieldMode

The mode of the field. Must be a defined member within BigQueryFieldMode.

descriptionString

The description of the field. May be null.

Add(String, TableSchemaBuilder, BigQueryFieldMode, String)

public void Add(string name, TableSchemaBuilder nestedSchema, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null)

Creates a nested field with the specified schema, and adds it to the schema being built. This method simply delegates to Add(String, TableSchema, BigQueryFieldMode, String) after calling Build() on nestedSchema.

Parameters
NameDescription
nameString

The name of the field. Must be a valid field name.

nestedSchemaTableSchemaBuilder

The schema for the nested field, in the form of a TableSchemaBuilder. Must not be null.

modeBigQueryFieldMode

The mode of the field. Must be a defined member within BigQueryFieldMode.

descriptionString

The description of the field. May be null.

Build()

public TableSchema Build()

Constructs a Google.Apis.Bigquery.v2.Data.TableSchema from this builder.

Returns
TypeDescription
Google.Apis.Bigquery.v2.Data.TableSchema

A Google.Apis.Bigquery.v2.Data.TableSchema from the fields added to this builder.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns an iterator over the fields in this builder.

Returns
TypeDescription
IEnumerator

An iterator over the fields in this builder.

Remarks

This method only exists to satisfy the C# language rules on collection initializers.