Class: Google::Apis::MerchantapiAccountsV1beta::RateGroup

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

Shipping rate group definitions. Only the last one is allowed to have an empty applicable_shipping_labels, which means "everything else". The other applicable_shipping_labels must not overlap.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ RateGroup

Returns a new instance of RateGroup.



3531
3532
3533
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3531

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

Instance Attribute Details

#applicable_shipping_labelsArray<String>

Required. A list of shipping labels defining the products to which this rate group applies to. This is a disjunction: only one of the labels has to match for the rate group to apply. May only be empty for the last rate group of a service. Corresponds to the JSON property applicableShippingLabels

Returns:

  • (Array<String>)


3499
3500
3501
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3499

def applicable_shipping_labels
  @applicable_shipping_labels
end

#carrier_ratesArray<Google::Apis::MerchantapiAccountsV1beta::CarrierRate>

Optional. A list of carrier rates that can be referred to by main_table or single_value. Corresponds to the JSON property carrierRates



3505
3506
3507
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3505

def carrier_rates
  @carrier_rates
end

#main_tableGoogle::Apis::MerchantapiAccountsV1beta::Table

A table defining the rate group, when single_value is not expressive enough. Corresponds to the JSON property mainTable



3510
3511
3512
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3510

def main_table
  @main_table
end

#nameString

Optional. Name of the rate group. If set has to be unique within shipping service. Corresponds to the JSON property name

Returns:

  • (String)


3516
3517
3518
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3516

def name
  @name
end

#single_valueGoogle::Apis::MerchantapiAccountsV1beta::Value

The single value of a rate group or the value of a rate group table's cell. Exactly one of no_shipping, flat_rate, price_percentage, carrier_rateName, subtable_name must be set. Corresponds to the JSON property singleValue



3523
3524
3525
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3523

def single_value
  @single_value
end

#subtablesArray<Google::Apis::MerchantapiAccountsV1beta::Table>

Optional. A list of subtables referred to by main_table. Can only be set if main_table is set. Corresponds to the JSON property subtables



3529
3530
3531
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3529

def subtables
  @subtables
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3536
3537
3538
3539
3540
3541
3542
3543
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 3536

def update!(**args)
  @applicable_shipping_labels = args[:applicable_shipping_labels] if args.key?(:applicable_shipping_labels)
  @carrier_rates = args[:carrier_rates] if args.key?(:carrier_rates)
  @main_table = args[:main_table] if args.key?(:main_table)
  @name = args[:name] if args.key?(:name)
  @single_value = args[:single_value] if args.key?(:single_value)
  @subtables = args[:subtables] if args.key?(:subtables)
end