Class: WalmartApIs::ShippingConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::ShippingConfiguration
- Defined in:
- lib/walmart_ap_is/models/shipping_configuration.rb
Overview
The shipping configurations supported for the packing option.
Instance Attribute Summary collapse
-
#shipping_mode ⇒ String
Mode of shipment transportation.
-
#shipping_solution ⇒ String
Shipping program for the option.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(shipping_mode: SKIP, shipping_solution: SKIP, additional_properties: nil) ⇒ ShippingConfiguration
constructor
A new instance of ShippingConfiguration.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(shipping_mode: SKIP, shipping_solution: SKIP, additional_properties: nil) ⇒ ShippingConfiguration
Returns a new instance of ShippingConfiguration.
44 45 46 47 48 49 50 51 52 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 44 def initialize(shipping_mode: SKIP, shipping_solution: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @shipping_mode = shipping_mode unless shipping_mode == SKIP @shipping_solution = shipping_solution unless shipping_solution == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#shipping_mode ⇒ String
Mode of shipment transportation. Possible values: GROUND_SMALL_PARCEL,
FREIGHT_LTL, FREIGHT_FTL_PALLET, FREIGHT_FTL_NONPALLET, OCEAN_LCL,
OCEAN_FCL, AIR_SMALL_PARCEL, AIR_SMALL_PARCEL_EXPRESS.
16 17 18 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 16 def shipping_mode @shipping_mode end |
#shipping_solution ⇒ String
Shipping program for the option. Possible values:
WALMART_PARTNERED_CARRIER, USE_YOUR_OWN_CARRIER.
21 22 23 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 21 def shipping_solution @shipping_solution end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. shipping_mode = hash.key?('shippingMode') ? hash['shippingMode'] : SKIP shipping_solution = hash.key?('shippingSolution') ? hash['shippingSolution'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ShippingConfiguration.new(shipping_mode: shipping_mode, shipping_solution: shipping_solution, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['shipping_mode'] = 'shippingMode' @_hash['shipping_solution'] = 'shippingSolution' @_hash end |
.nullables ⇒ Object
An array for nullable fields
40 41 42 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 40 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
32 33 34 35 36 37 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 32 def self.optionals %w[ shipping_mode shipping_solution ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
84 85 86 87 88 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 84 def inspect class_name = self.class.name.split('::').last "<#{class_name} shipping_mode: #{@shipping_mode.inspect}, shipping_solution:"\ " #{@shipping_solution.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
77 78 79 80 81 |
# File 'lib/walmart_ap_is/models/shipping_configuration.rb', line 77 def to_s class_name = self.class.name.split('::').last "<#{class_name} shipping_mode: #{@shipping_mode}, shipping_solution: #{@shipping_solution},"\ " additional_properties: #{@additional_properties}>" end |