Class: Google::Apis::DiscoveryV1::JsonSchema::Variant

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

Overview

In a variant data type, the value of one property is used to determine how to interpret the entire entity. Its value must exist in a map of descriminant values to schema names.

Defined Under Namespace

Classes: Map

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) ⇒ Variant

Returns a new instance of Variant



350
351
352
# File 'generated/google/apis/discovery_v1/classes.rb', line 350

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

Instance Attribute Details

#discriminantString

The name of the type discriminant property. Corresponds to the JSON property discriminant

Returns:

  • (String)


343
344
345
# File 'generated/google/apis/discovery_v1/classes.rb', line 343

def discriminant
  @discriminant
end

#mapArray<Google::Apis::DiscoveryV1::JsonSchema::Variant::Map>

The map of discriminant value to schema to use for parsing.. Corresponds to the JSON property map



348
349
350
# File 'generated/google/apis/discovery_v1/classes.rb', line 348

def map
  @map
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



355
356
357
358
# File 'generated/google/apis/discovery_v1/classes.rb', line 355

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