Class: Google::Apis::ComputeBeta::FixedOrPercent

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



5001
5002
5003
# File 'generated/google/apis/compute_beta/classes.rb', line 5001

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)


4989
4990
4991
# File 'generated/google/apis/compute_beta/classes.rb', line 4989

def calculated
  @calculated
end

#fixedFixnum

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

Returns:

  • (Fixnum)


4994
4995
4996
# File 'generated/google/apis/compute_beta/classes.rb', line 4994

def fixed
  @fixed
end

#percentFixnum

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

Returns:

  • (Fixnum)


4999
5000
5001
# File 'generated/google/apis/compute_beta/classes.rb', line 4999

def percent
  @percent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5006
5007
5008
5009
5010
# File 'generated/google/apis/compute_beta/classes.rb', line 5006

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