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.



10894
10895
10896
# File 'lib/google/apis/bigquery_v2/classes.rb', line 10894

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



10887
10888
10889
# File 'lib/google/apis/bigquery_v2/classes.rb', line 10887

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



10892
10893
10894
# File 'lib/google/apis/bigquery_v2/classes.rb', line 10892

def primary_key
  @primary_key
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



10899
10900
10901
10902
# File 'lib/google/apis/bigquery_v2/classes.rb', line 10899

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