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.



2083
2084
2085
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2083

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>)


2051
2052
2053
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2051

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



2057
2058
2059
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2057

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



2062
2063
2064
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2062

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)


2068
2069
2070
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2068

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



2075
2076
2077
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2075

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



2081
2082
2083
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2081

def subtables
  @subtables
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2088
2089
2090
2091
2092
2093
2094
2095
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 2088

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