Class: Google::Apis::BigqueryV2::TableConstraints

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/bigquery_v2/classes.rb,
lib/google/apis/bigquery_v2/representations.rb,
lib/google/apis/bigquery_v2/representations.rb

Overview

The TableConstraints defines the primary key and foreign key.

Defined Under Namespace

Classes: ForeignKey, PrimaryKey

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TableConstraints

Returns a new instance of TableConstraints.



9692
9693
9694
# File 'lib/google/apis/bigquery_v2/classes.rb', line 9692

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#foreign_keysArray<Google::Apis::BigqueryV2::TableConstraints::ForeignKey>

Optional. Present only if the table has a foreign key. The foreign key is not enforced. Corresponds to the JSON property foreignKeys



9685
9686
9687
# File 'lib/google/apis/bigquery_v2/classes.rb', line 9685

def foreign_keys
  @foreign_keys
end

#primary_keyGoogle::Apis::BigqueryV2::TableConstraints::PrimaryKey

Represents the primary key constraint on a table's columns. Corresponds to the JSON property primaryKey



9690
9691
9692
# File 'lib/google/apis/bigquery_v2/classes.rb', line 9690

def primary_key
  @primary_key
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9697
9698
9699
9700
# File 'lib/google/apis/bigquery_v2/classes.rb', line 9697

def update!(**args)
  @foreign_keys = args[:foreign_keys] if args.key?(:foreign_keys)
  @primary_key = args[:primary_key] if args.key?(:primary_key)
end