Class: Google::Apis::ComputeAlpha::FixedOrPercent

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

Overview

Encapsulates numeric value that can be either absolute or relative.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ FixedOrPercent

Returns a new instance of FixedOrPercent



5346
5347
5348
# File 'generated/google/apis/compute_alpha/classes.rb', line 5346

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

Instance Attribute Details

#calculatedFixnum

[Output Only] Absolute value calculated based on mode: mode = fixed -> calculated = fixed = percent -> calculated = ceiling(percent/100 * base_value) Corresponds to the JSON property calculated

Returns:

  • (Fixnum)


5334
5335
5336
# File 'generated/google/apis/compute_alpha/classes.rb', line 5334

def calculated
  @calculated
end

#fixedFixnum

fixed must be non-negative. Corresponds to the JSON property fixed

Returns:

  • (Fixnum)


5339
5340
5341
# File 'generated/google/apis/compute_alpha/classes.rb', line 5339

def fixed
  @fixed
end

#percentFixnum

percent must belong to [0, 100]. Corresponds to the JSON property percent

Returns:

  • (Fixnum)


5344
5345
5346
# File 'generated/google/apis/compute_alpha/classes.rb', line 5344

def percent
  @percent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5351
5352
5353
5354
5355
# File 'generated/google/apis/compute_alpha/classes.rb', line 5351

def update!(**args)
  @calculated = args[:calculated] if args.key?(:calculated)
  @fixed = args[:fixed] if args.key?(:fixed)
  @percent = args[:percent] if args.key?(:percent)
end