/// <summary> /// Adds a single field value to the row. /// </summary> /// <param name="key">The name of the field. Must be a valid BigQuery field name.</param> /// <param name="value">The value for the field, which must be <c>null</c> or one of the supported types.</param> public void Add(string key, object value) { TableSchemaBuilder.ValidateFieldName(key, nameof(key)); ValidateValue(value, nameof(value)); _fields.Add(key, value); }
/// <summary> /// Creates a nested field with the specified schema, and adds it to the schema being built. /// This method simply delegates to <see cref="Add(string, TableSchema, BigQueryFieldMode, string)"/> after calling <see cref="Build"/> /// on <paramref name="nestedSchema"/>. /// </summary> /// <param name="name">The name of the field. Must be a valid field name.</param> /// <param name="nestedSchema">The schema for the nested field, in the form of a <see cref="TableSchemaBuilder"/>. Must not be null.</param> /// <param name="mode">The mode of the field. Must be a defined member within <see cref="BigQueryFieldMode"/>.</param> /// <param name="description">The description of the field. May be null.</param> public void Add(string name, TableSchemaBuilder nestedSchema, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null) { var builtSchema = GaxPreconditions.CheckNotNull(nestedSchema, nameof(nestedSchema)).Build(); Add(name, builtSchema, mode, description); }