Class: Google::Apis::DatamigrationV1::ConstraintEntity

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

Overview

Constraint is not used as an independent entity, it is retrieved as part of another entity such as Table or View.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ConstraintEntity

Returns a new instance of ConstraintEntity.



1070
1071
1072
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1070

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

Instance Attribute Details

#custom_featuresHash<String,Object>

Custom engine specific features. Corresponds to the JSON property customFeatures

Returns:

  • (Hash<String,Object>)


1029
1030
1031
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1029

def custom_features
  @custom_features
end

#nameString

The name of the table constraint. Corresponds to the JSON property name

Returns:

  • (String)


1034
1035
1036
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1034

def name
  @name
end

#reference_columnsArray<String>

Reference columns which may be associated with the constraint. For example, if the constraint is a FOREIGN_KEY, this represents the list of full names of referenced columns by the foreign key. Corresponds to the JSON property referenceColumns

Returns:

  • (Array<String>)


1041
1042
1043
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1041

def reference_columns
  @reference_columns
end

#reference_tableString

Reference table which may be associated with the constraint. For example, if the constraint is a FOREIGN_KEY, this represents the list of full name of the referenced table by the foreign key. Corresponds to the JSON property referenceTable

Returns:

  • (String)


1048
1049
1050
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1048

def reference_table
  @reference_table
end

#table_columnsArray<String>

Table columns used as part of the Constraint, for example primary key constraint should list the columns which constitutes the key. Corresponds to the JSON property tableColumns

Returns:

  • (Array<String>)


1054
1055
1056
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1054

def table_columns
  @table_columns
end

#table_nameString

Table which is associated with the constraint. In case the constraint is defined on a table, this field is left empty as this information is stored in parent_name. However, if constraint is defined on a view, this field stores the table name on which the view is defined. Corresponds to the JSON property tableName

Returns:

  • (String)


1062
1063
1064
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1062

def table_name
  @table_name
end

#typeString

Type of constraint, for example unique, primary key, foreign key (currently only primary key is supported). Corresponds to the JSON property type

Returns:

  • (String)


1068
1069
1070
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1068

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1075
1076
1077
1078
1079
1080
1081
1082
1083
# File 'lib/google/apis/datamigration_v1/classes.rb', line 1075

def update!(**args)
  @custom_features = args[:custom_features] if args.key?(:custom_features)
  @name = args[:name] if args.key?(:name)
  @reference_columns = args[:reference_columns] if args.key?(:reference_columns)
  @reference_table = args[:reference_table] if args.key?(:reference_table)
  @table_columns = args[:table_columns] if args.key?(:table_columns)
  @table_name = args[:table_name] if args.key?(:table_name)
  @type = args[:type] if args.key?(:type)
end