Class: Google::Apis::MerchantapiAccountsV1beta::Weight
- Inherits:
-
Object
- Object
- Google::Apis::MerchantapiAccountsV1beta::Weight
- 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
-
#amount_micros ⇒ Fixnum
Required.
-
#unit ⇒ String
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Weight
constructor
A new instance of Weight.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Weight
Returns a new instance of Weight.
3121 3122 3123 |
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3121 def initialize(**args) update!(**args) end |
Instance Attribute Details
#amount_micros ⇒ Fixnum
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
3114 3115 3116 |
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3114 def amount_micros @amount_micros end |
#unit ⇒ String
Required. The weight unit. Acceptable values are: kg and lb
Corresponds to the JSON property unit
3119 3120 3121 |
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3119 def unit @unit end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3126 3127 3128 3129 |
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3126 def update!(**args) @amount_micros = args[:amount_micros] if args.key?(:amount_micros) @unit = args[:unit] if args.key?(:unit) end |