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

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/discovery_v1/classes.rb,
lib/google/apis/discovery_v1/representations.rb,
lib/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

Constructor Details

#initialize(**args) ⇒ Variant

Returns a new instance of Variant.



364
365
366
# File 'lib/google/apis/discovery_v1/classes.rb', line 364

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)


357
358
359
# File 'lib/google/apis/discovery_v1/classes.rb', line 357

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



362
363
364
# File 'lib/google/apis/discovery_v1/classes.rb', line 362

def map
  @map
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



369
370
371
372
# File 'lib/google/apis/discovery_v1/classes.rb', line 369

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