Class: Google::Apis::MerchantapiAccountsV1beta::CarrierRate

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

A list of carrier rates that can be referred to by main_table or single_value. Supported carrier services are defined in https://support. google.com/merchants/answer/12577710?ref_topic=12570808&sjid= 10662598224319463032-NC#zippy=%2Cdelivery-cost-rate-type%2Ccarrier-rate-au-de- uk-and-us-only.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CarrierRate

Returns a new instance of CarrierRate.



1025
1026
1027
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1025

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

Instance Attribute Details

#carrierString

Required. Carrier service, such as "UPS" or "Fedex". Corresponds to the JSON property carrier

Returns:

  • (String)


996
997
998
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 996

def carrier
  @carrier
end

#carrier_serviceString

Required. Carrier service, such as "ground" or "2 days". Corresponds to the JSON property carrierService

Returns:

  • (String)


1001
1002
1003
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1001

def carrier_service
  @carrier_service
end

#flat_adjustmentGoogle::Apis::MerchantapiAccountsV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property flatAdjustment



1006
1007
1008
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1006

def flat_adjustment
  @flat_adjustment
end

#nameString

Required. Name of the carrier rate. Must be unique per rate group. Corresponds to the JSON property name

Returns:

  • (String)


1011
1012
1013
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1011

def name
  @name
end

#origin_postal_codeString

Required. Shipping origin for this carrier rate. Corresponds to the JSON property originPostalCode

Returns:

  • (String)


1016
1017
1018
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1016

def origin_postal_code
  @origin_postal_code
end

#percentage_adjustmentString

Optional. Multiplicative shipping rate modifier as a number in decimal notation. Can be negative. For example "5.4" increases the rate by 5.4%, "- 3" decreases the rate by 3%. Corresponds to the JSON property percentageAdjustment

Returns:

  • (String)


1023
1024
1025
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1023

def percentage_adjustment
  @percentage_adjustment
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1030
1031
1032
1033
1034
1035
1036
1037
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 1030

def update!(**args)
  @carrier = args[:carrier] if args.key?(:carrier)
  @carrier_service = args[:carrier_service] if args.key?(:carrier_service)
  @flat_adjustment = args[:flat_adjustment] if args.key?(:flat_adjustment)
  @name = args[:name] if args.key?(:name)
  @origin_postal_code = args[:origin_postal_code] if args.key?(:origin_postal_code)
  @percentage_adjustment = args[:percentage_adjustment] if args.key?(:percentage_adjustment)
end