Class: Google::Apis::RunV1alpha1::IntOrString

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

Overview

IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.

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

Returns a new instance of IntOrString.



1907
1908
1909
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1907

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

Instance Attribute Details

#int_valFixnum

The int value. Corresponds to the JSON property intVal

Returns:

  • (Fixnum)


1895
1896
1897
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1895

def int_val
  @int_val
end

#str_valString

The string value. Corresponds to the JSON property strVal

Returns:

  • (String)


1900
1901
1902
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1900

def str_val
  @str_val
end

#typeFixnum

The type of the value. Corresponds to the JSON property type

Returns:

  • (Fixnum)


1905
1906
1907
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1905

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1912
1913
1914
1915
1916
# File 'generated/google/apis/run_v1alpha1/classes.rb', line 1912

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