Class: Google::Apis::ContentV2_1::CarrierRate

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/content_v2_1/classes.rb,
lib/google/apis/content_v2_1/representations.rb,
lib/google/apis/content_v2_1/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CarrierRate

Returns a new instance of CarrierRate.



2839
2840
2841
# File 'lib/google/apis/content_v2_1/classes.rb', line 2839

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

Instance Attribute Details

#carrier_nameString

Carrier service, such as "UPS" or "Fedex". The list of supported carriers can be retrieved through the getSupportedCarriers method. Required. Corresponds to the JSON property carrierName

Returns:

  • (String)


2806
2807
2808
# File 'lib/google/apis/content_v2_1/classes.rb', line 2806

def carrier_name
  @carrier_name
end

#carrier_serviceString

Carrier service, such as "ground" or "2 days". The list of supported services for a carrier can be retrieved through the getSupportedCarriers method. Required. Corresponds to the JSON property carrierService

Returns:

  • (String)


2813
2814
2815
# File 'lib/google/apis/content_v2_1/classes.rb', line 2813

def carrier_service
  @carrier_service
end

#flat_adjustmentGoogle::Apis::ContentV2_1::Price

Additive shipping rate modifier. Can be negative. For example "value": "1", "currency" : "USD" adds $1 to the rate, "value": "-3", "currency" : "USD" removes $3 from the rate. Optional. Corresponds to the JSON property flatAdjustment



2820
2821
2822
# File 'lib/google/apis/content_v2_1/classes.rb', line 2820

def flat_adjustment
  @flat_adjustment
end

#nameString

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

Returns:

  • (String)


2825
2826
2827
# File 'lib/google/apis/content_v2_1/classes.rb', line 2825

def name
  @name
end

#origin_postal_codeString

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

Returns:

  • (String)


2830
2831
2832
# File 'lib/google/apis/content_v2_1/classes.rb', line 2830

def origin_postal_code
  @origin_postal_code
end

#percentage_adjustmentString

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%. Optional. Corresponds to the JSON property percentageAdjustment

Returns:

  • (String)


2837
2838
2839
# File 'lib/google/apis/content_v2_1/classes.rb', line 2837

def percentage_adjustment
  @percentage_adjustment
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2844
2845
2846
2847
2848
2849
2850
2851
# File 'lib/google/apis/content_v2_1/classes.rb', line 2844

def update!(**args)
  @carrier_name = args[:carrier_name] if args.key?(:carrier_name)
  @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