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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CarrierRate

Returns a new instance of CarrierRate.



490
491
492
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 490

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)


461
462
463
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 461

def carrier
  @carrier
end

#carrier_serviceString

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

Returns:

  • (String)


466
467
468
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 466

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



471
472
473
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 471

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)


476
477
478
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 476

def name
  @name
end

#origin_postal_codeString

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

Returns:

  • (String)


481
482
483
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 481

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)


488
489
490
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 488

def percentage_adjustment
  @percentage_adjustment
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



495
496
497
498
499
500
501
502
# File 'lib/google/apis/merchantapi_accounts_v1beta/classes.rb', line 495

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