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.



3119
3120
3121
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3119

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)


3112
3113
3114
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3112

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)


3117
3118
3119
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3117

def unit
  @unit
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3124
3125
3126
3127
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3124

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