Class: Google::Apis::ContentV2::CarrierRate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ CarrierRate

Returns a new instance of CarrierRate



1116
1117
1118
# File 'generated/google/apis/content_v2/classes.rb', line 1116

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 via the getSupportedCarriers method. Required. Corresponds to the JSON property carrierName

Returns:

  • (String)


1084
1085
1086
# File 'generated/google/apis/content_v2/classes.rb', line 1084

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 via the getSupportedCarriers method. Required. Corresponds to the JSON property carrierService

Returns:

  • (String)


1090
1091
1092
# File 'generated/google/apis/content_v2/classes.rb', line 1090

def carrier_service
  @carrier_service
end

#flat_adjustmentGoogle::Apis::ContentV2::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



1097
1098
1099
# File 'generated/google/apis/content_v2/classes.rb', line 1097

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)


1102
1103
1104
# File 'generated/google/apis/content_v2/classes.rb', line 1102

def name
  @name
end

#origin_postal_codeString

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

Returns:

  • (String)


1107
1108
1109
# File 'generated/google/apis/content_v2/classes.rb', line 1107

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)


1114
1115
1116
# File 'generated/google/apis/content_v2/classes.rb', line 1114

def percentage_adjustment
  @percentage_adjustment
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1121
1122
1123
1124
1125
1126
1127
1128
# File 'generated/google/apis/content_v2/classes.rb', line 1121

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