Class: Google::Apis::SpannerV1::Field

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

Overview

Message representing a single field of a struct.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Field

Returns a new instance of Field



1120
1121
1122
# File 'generated/google/apis/spanner_v1/classes.rb', line 1120

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

Instance Attribute Details

#nameString

The name of the field. For reads, this is the column name. For SQL queries, it is the column alias (e.g., "Word" in the query "SELECT 'hello' AS Word"), or the column name (e.g., "ColName" in the query "SELECT ColName FROM Table"). Some columns might have an empty name (e.g., !"SELECT UPPER(ColName)"). Note that a query result can contain multiple fields with the same name. Corresponds to the JSON propertyname`

Returns:

  • (String)


1112
1113
1114
# File 'generated/google/apis/spanner_v1/classes.rb', line 1112

def name
  @name
end

#typeGoogle::Apis::SpannerV1::Type

Type indicates the type of a Cloud Spanner value, as might be stored in a table cell or returned from an SQL query. Corresponds to the JSON property type



1118
1119
1120
# File 'generated/google/apis/spanner_v1/classes.rb', line 1118

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1125
1126
1127
1128
# File 'generated/google/apis/spanner_v1/classes.rb', line 1125

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