Class: Google::Apis::MerchantapiAccountsV1beta::Weight

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

Overview

The weight represented as the value in string and the unit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Weight

Returns a new instance of Weight.



4755
4756
4757
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4755

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

Instance Attribute Details

#amount_microsFixnum

Required. The weight represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 kg = 1000000 micros) . This field can also be set as infinity by setting to -1. This field only support -1 and positive value. Corresponds to the JSON property amountMicros

Returns:

  • (Fixnum)


4748
4749
4750
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4748

def amount_micros
  @amount_micros
end

#unitString

Required. The weight unit. Acceptable values are: kg and lb Corresponds to the JSON property unit

Returns:

  • (String)


4753
4754
4755
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4753

def unit
  @unit
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4760
4761
4762
4763
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4760

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