Class: SplititWebApiV4::UpdateOrderRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SplititWebApiV4::UpdateOrderRequest
- Defined in:
- lib/splitit_web_api_v4/models/update_order_request.rb
Overview
UpdateOrderRequest Model.
Instance Attribute Summary collapse
-
#merchant_order_reference ⇒ String
TODO: Write general description for this method.
-
#metadata ⇒ Array[MetadataItem]
TODO: Write general description for this method.
-
#shipping_status ⇒ ShippingStatus
TODO: Write general description for this method.
-
#tracking_number ⇒ String
TODO: Write general description for this method.
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_status:, tracking_number: SKIP, metadata: SKIP, merchant_order_reference: SKIP, additional_properties: nil) ⇒ UpdateOrderRequest
constructor
A new instance of UpdateOrderRequest.
-
#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_status:, tracking_number: SKIP, metadata: SKIP, merchant_order_reference: SKIP, additional_properties: nil) ⇒ UpdateOrderRequest
Returns a new instance of UpdateOrderRequest.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 52 def initialize(shipping_status:, tracking_number: SKIP, metadata: SKIP, merchant_order_reference: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @tracking_number = tracking_number unless tracking_number == SKIP @shipping_status = shipping_status @metadata = unless == SKIP @merchant_order_reference = merchant_order_reference unless merchant_order_reference == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#merchant_order_reference ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 26 def merchant_order_reference @merchant_order_reference end |
#metadata ⇒ Array[MetadataItem]
TODO: Write general description for this method
22 23 24 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 22 def @metadata end |
#shipping_status ⇒ ShippingStatus
TODO: Write general description for this method
18 19 20 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 18 def shipping_status @shipping_status end |
#tracking_number ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 14 def tracking_number @tracking_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. shipping_status = hash.key?('ShippingStatus') ? hash['ShippingStatus'] : nil tracking_number = hash.key?('TrackingNumber') ? hash['TrackingNumber'] : SKIP # Parameter is an array, so we need to iterate through it = nil unless hash['Metadata'].nil? = [] hash['Metadata'].each do |structure| << (MetadataItem.from_hash(structure) if structure) end end = SKIP unless hash.key?('Metadata') merchant_order_reference = hash.key?('MerchantOrderReference') ? hash['MerchantOrderReference'] : 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. UpdateOrderRequest.new(shipping_status: shipping_status, tracking_number: tracking_number, metadata: , merchant_order_reference: merchant_order_reference, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['tracking_number'] = 'TrackingNumber' @_hash['shipping_status'] = 'ShippingStatus' @_hash['metadata'] = 'Metadata' @_hash['merchant_order_reference'] = 'MerchantOrderReference' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 39 def self.optionals %w[ tracking_number metadata merchant_order_reference ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 115 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} tracking_number: #{@tracking_number.inspect}, shipping_status:"\ " #{@shipping_status.inspect}, metadata: #{@metadata.inspect}, merchant_order_reference:"\ " #{@merchant_order_reference.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
102 103 104 105 106 107 |
# File 'lib/splitit_web_api_v4/models/update_order_request.rb', line 102 def to_s class_name = self.class.name.split('::').last "<#{class_name} tracking_number: #{@tracking_number}, shipping_status: #{@shipping_status},"\ " metadata: #{@metadata}, merchant_order_reference: #{@merchant_order_reference},"\ " additional_properties: #{@additional_properties}>" end |