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.



4736
4737
4738
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4736

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)


4729
4730
4731
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4729

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)


4734
4735
4736
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4734

def unit
  @unit
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4741
4742
4743
4744
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 4741

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