Class: Google::Apis::DiscoveryV1::JsonSchema::Variant
- Inherits:
- 
      Object
      
        - Object
- Google::Apis::DiscoveryV1::JsonSchema::Variant
 
- 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
- 
  
    
      #discriminant  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The name of the type discriminant property. 
- 
  
    
      #map  ⇒ Array<Google::Apis::DiscoveryV1::JsonSchema::Variant::Map> 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The map of discriminant value to schema to use for parsing.. 
Instance Method Summary collapse
- 
  
    
      #initialize(**args)  ⇒ Variant 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Variant. 
- 
  
    
      #update!(**args)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Update properties of this object. 
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
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
#discriminant ⇒ String
The name of the type discriminant property.
Corresponds to the JSON property discriminant
| 343 344 345 | # File 'generated/google/apis/discovery_v1/classes.rb', line 343 def discriminant @discriminant end | 
#map ⇒ Array<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 |