wine_shipping 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +128 -0
  4. data/Rakefile +8 -0
  5. data/docs/Authentication.md +10 -0
  6. data/docs/BillingContactInfo.md +18 -0
  7. data/docs/DeliveryContactInfo.md +17 -0
  8. data/docs/Inventory.md +20 -0
  9. data/docs/InventoryApi.md +102 -0
  10. data/docs/InventoryMovementApi.md +100 -0
  11. data/docs/InventoryStatusRequest.md +13 -0
  12. data/docs/InventoryStatusResult.md +12 -0
  13. data/docs/ItemInfo.md +10 -0
  14. data/docs/OrderOnHold.md +19 -0
  15. data/docs/OrderOnHoldItem.md +11 -0
  16. data/docs/PackageItem.md +10 -0
  17. data/docs/PurchaseOrderDetails.md +10 -0
  18. data/docs/PurchaseOrderInfo.md +24 -0
  19. data/docs/PurchaseOrderItemInfo.md +10 -0
  20. data/docs/RecipientContactInfo.md +18 -0
  21. data/docs/RequestorInfo.md +11 -0
  22. data/docs/ReturnResult.md +12 -0
  23. data/docs/ReturnSalesOrderHeader.md +31 -0
  24. data/docs/ReturnSalesOrderLine.md +13 -0
  25. data/docs/ReturnsRequest.md +16 -0
  26. data/docs/SKUApi.md +54 -0
  27. data/docs/SKUDetails.md +10 -0
  28. data/docs/SKUInfo.md +20 -0
  29. data/docs/SalesOrderApi.md +240 -0
  30. data/docs/SalesOrderCancelRequest.md +9 -0
  31. data/docs/SalesOrderDetails.md +14 -0
  32. data/docs/SalesOrderInfo.md +20 -0
  33. data/docs/ShipmentInfo.md +13 -0
  34. data/docs/TrackingApi.md +55 -0
  35. data/docs/TrackingRequest.md +9 -0
  36. data/docs/TrackingResult.md +28 -0
  37. data/docs/TransferOrderDetails.md +10 -0
  38. data/docs/TransferOrderInfo.md +17 -0
  39. data/docs/TransferOrderItemInfo.md +10 -0
  40. data/docs/WarehouseInventoryStatus.md +19 -0
  41. data/git_push.sh +55 -0
  42. data/lib/.DS_Store +0 -0
  43. data/lib/wine_shipping.rb +75 -0
  44. data/lib/wine_shipping/api/inventory_api.rb +127 -0
  45. data/lib/wine_shipping/api/inventory_movement_api.rb +125 -0
  46. data/lib/wine_shipping/api/sales_order_api.rb +280 -0
  47. data/lib/wine_shipping/api/sku_api.rb +74 -0
  48. data/lib/wine_shipping/api/tracking_api.rb +75 -0
  49. data/lib/wine_shipping/api_client.rb +388 -0
  50. data/lib/wine_shipping/api_error.rb +38 -0
  51. data/lib/wine_shipping/configuration.rb +202 -0
  52. data/lib/wine_shipping/models/authentication.rb +201 -0
  53. data/lib/wine_shipping/models/billing_contact_info.rb +273 -0
  54. data/lib/wine_shipping/models/delivery_contact_info.rb +298 -0
  55. data/lib/wine_shipping/models/inventory.rb +291 -0
  56. data/lib/wine_shipping/models/inventory_status_request.rb +230 -0
  57. data/lib/wine_shipping/models/inventory_status_result.rb +221 -0
  58. data/lib/wine_shipping/models/item_info.rb +201 -0
  59. data/lib/wine_shipping/models/order_on_hold.rb +284 -0
  60. data/lib/wine_shipping/models/order_on_hold_item.rb +210 -0
  61. data/lib/wine_shipping/models/package_item.rb +201 -0
  62. data/lib/wine_shipping/models/purchase_order_details.rb +203 -0
  63. data/lib/wine_shipping/models/purchase_order_info.rb +361 -0
  64. data/lib/wine_shipping/models/purchase_order_item_info.rb +201 -0
  65. data/lib/wine_shipping/models/recipient_contact_info.rb +273 -0
  66. data/lib/wine_shipping/models/requestor_info.rb +210 -0
  67. data/lib/wine_shipping/models/return_result.rb +221 -0
  68. data/lib/wine_shipping/models/return_sales_order_header.rb +392 -0
  69. data/lib/wine_shipping/models/return_sales_order_line.rb +228 -0
  70. data/lib/wine_shipping/models/returns_request.rb +257 -0
  71. data/lib/wine_shipping/models/sales_order_cancel_request.rb +192 -0
  72. data/lib/wine_shipping/models/sales_order_details.rb +239 -0
  73. data/lib/wine_shipping/models/sales_order_info.rb +325 -0
  74. data/lib/wine_shipping/models/shipment_info.rb +274 -0
  75. data/lib/wine_shipping/models/sku_details.rb +201 -0
  76. data/lib/wine_shipping/models/sku_info.rb +325 -0
  77. data/lib/wine_shipping/models/tracking_request.rb +192 -0
  78. data/lib/wine_shipping/models/tracking_result.rb +365 -0
  79. data/lib/wine_shipping/models/transfer_order_details.rb +203 -0
  80. data/lib/wine_shipping/models/transfer_order_info.rb +264 -0
  81. data/lib/wine_shipping/models/transfer_order_item_info.rb +201 -0
  82. data/lib/wine_shipping/models/warehouse_inventory_status.rb +282 -0
  83. data/lib/wine_shipping/version.rb +15 -0
  84. data/spec/api/inventory_api_spec.rb +57 -0
  85. data/spec/api/inventory_movement_api_spec.rb +57 -0
  86. data/spec/api/sales_order_api_spec.rb +90 -0
  87. data/spec/api/sku_api_spec.rb +46 -0
  88. data/spec/api/tracking_api_spec.rb +46 -0
  89. data/spec/api_client_spec.rb +226 -0
  90. data/spec/configuration_spec.rb +42 -0
  91. data/spec/models/authentication_spec.rb +53 -0
  92. data/spec/models/billing_contact_info_spec.rb +101 -0
  93. data/spec/models/delivery_contact_info_spec.rb +99 -0
  94. data/spec/models/inventory_spec.rb +113 -0
  95. data/spec/models/inventory_status_request_spec.rb +71 -0
  96. data/spec/models/inventory_status_result_spec.rb +65 -0
  97. data/spec/models/item_info_spec.rb +53 -0
  98. data/spec/models/order_on_hold_item_spec.rb +59 -0
  99. data/spec/models/order_on_hold_spec.rb +107 -0
  100. data/spec/models/package_item_spec.rb +53 -0
  101. data/spec/models/purchase_order_details_spec.rb +53 -0
  102. data/spec/models/purchase_order_info_spec.rb +141 -0
  103. data/spec/models/purchase_order_item_info_spec.rb +53 -0
  104. data/spec/models/recipient_contact_info_spec.rb +101 -0
  105. data/spec/models/requestor_info_spec.rb +59 -0
  106. data/spec/models/return_result_spec.rb +65 -0
  107. data/spec/models/return_sales_order_header_spec.rb +179 -0
  108. data/spec/models/return_sales_order_line_spec.rb +71 -0
  109. data/spec/models/returns_request_spec.rb +89 -0
  110. data/spec/models/sales_order_cancel_request_spec.rb +47 -0
  111. data/spec/models/sales_order_details_spec.rb +77 -0
  112. data/spec/models/sales_order_info_spec.rb +117 -0
  113. data/spec/models/shipment_info_spec.rb +79 -0
  114. data/spec/models/sku_details_spec.rb +53 -0
  115. data/spec/models/sku_info_spec.rb +117 -0
  116. data/spec/models/tracking_request_spec.rb +47 -0
  117. data/spec/models/tracking_result_spec.rb +161 -0
  118. data/spec/models/transfer_order_details_spec.rb +53 -0
  119. data/spec/models/transfer_order_info_spec.rb +95 -0
  120. data/spec/models/transfer_order_item_info_spec.rb +53 -0
  121. data/spec/models/warehouse_inventory_status_spec.rb +107 -0
  122. data/spec/spec_helper.rb +111 -0
  123. data/wine_shipping.gemspec +45 -0
  124. metadata +390 -0
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #API from Wineshipping
3
+
4
+ #Wineshipping API is a programmatically consumable service or an Application Programming Interface (API) platform designed to enable Wineshipping LLC's client applications to natively transmit and manage their order, view inventory, track shipments etc.<br /><br />In order to access API operations request a UserKey and Password from Wineshipping. For any questions please contact Wineshipping Helpdesk at <a href='mailto:IT-Help@wineshipping.com?Subject=API from Wineshipping'>IT-Help@wineshipping.com</a>.
5
+
6
+ OpenAPI spec version: V3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.7
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module WineShipping
16
+ class ReturnResult
17
+ attr_accessor :total_record_count
18
+
19
+ attr_accessor :skip
20
+
21
+ attr_accessor :top
22
+
23
+ attr_accessor :more_records
24
+
25
+ attr_accessor :return_sales_order_headers
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'total_record_count' => :'TotalRecordCount',
31
+ :'skip' => :'Skip',
32
+ :'top' => :'Top',
33
+ :'more_records' => :'MoreRecords',
34
+ :'return_sales_order_headers' => :'ReturnSalesOrderHeaders'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'total_record_count' => :'Integer',
42
+ :'skip' => :'Integer',
43
+ :'top' => :'Integer',
44
+ :'more_records' => :'BOOLEAN',
45
+ :'return_sales_order_headers' => :'Array<ReturnSalesOrderHeader>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'TotalRecordCount')
58
+ self.total_record_count = attributes[:'TotalRecordCount']
59
+ end
60
+
61
+ if attributes.has_key?(:'Skip')
62
+ self.skip = attributes[:'Skip']
63
+ end
64
+
65
+ if attributes.has_key?(:'Top')
66
+ self.top = attributes[:'Top']
67
+ end
68
+
69
+ if attributes.has_key?(:'MoreRecords')
70
+ self.more_records = attributes[:'MoreRecords']
71
+ end
72
+
73
+ if attributes.has_key?(:'ReturnSalesOrderHeaders')
74
+ if (value = attributes[:'ReturnSalesOrderHeaders']).is_a?(Array)
75
+ self.return_sales_order_headers = value
76
+ end
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ total_record_count == o.total_record_count &&
99
+ skip == o.skip &&
100
+ top == o.top &&
101
+ more_records == o.more_records &&
102
+ return_sales_order_headers == o.return_sales_order_headers
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [total_record_count, skip, top, more_records, return_sales_order_headers].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.swagger_types.each_pair do |key, type|
123
+ if type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ DateTime.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :BOOLEAN
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ temp_model = WineShipping.const_get(type).new
175
+ temp_model.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ next if value.nil?
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,392 @@
1
+ =begin
2
+ #API from Wineshipping
3
+
4
+ #Wineshipping API is a programmatically consumable service or an Application Programming Interface (API) platform designed to enable Wineshipping LLC's client applications to natively transmit and manage their order, view inventory, track shipments etc.<br /><br />In order to access API operations request a UserKey and Password from Wineshipping. For any questions please contact Wineshipping Helpdesk at <a href='mailto:IT-Help@wineshipping.com?Subject=API from Wineshipping'>IT-Help@wineshipping.com</a>.
5
+
6
+ OpenAPI spec version: V3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.7
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module WineShipping
16
+ class ReturnSalesOrderHeader
17
+ attr_accessor :customer_no
18
+
19
+ attr_accessor :customer_name
20
+
21
+ attr_accessor :rma_number
22
+
23
+ attr_accessor :order_no
24
+
25
+ attr_accessor :received_date
26
+
27
+ attr_accessor :close_date
28
+
29
+ attr_accessor :ship_to_name
30
+
31
+ attr_accessor :ship_to_company
32
+
33
+ attr_accessor :ship_to_address
34
+
35
+ attr_accessor :ship_to_address2
36
+
37
+ attr_accessor :ship_to_city
38
+
39
+ attr_accessor :ship_to_state
40
+
41
+ attr_accessor :ship_to_zip_code
42
+
43
+ attr_accessor :ship_to_country
44
+
45
+ attr_accessor :email_address
46
+
47
+ attr_accessor :phone_number
48
+
49
+ attr_accessor :return_warehouse
50
+
51
+ attr_accessor :return_status
52
+
53
+ attr_accessor :disposition_code
54
+
55
+ attr_accessor :return_reason
56
+
57
+ attr_accessor :original_tracking_number
58
+
59
+ attr_accessor :shipping_carrier_code
60
+
61
+ attr_accessor :shippng_service_code
62
+
63
+ attr_accessor :return_sales_order_lines
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'customer_no' => :'CustomerNo',
69
+ :'customer_name' => :'CustomerName',
70
+ :'rma_number' => :'RMANumber',
71
+ :'order_no' => :'OrderNo',
72
+ :'received_date' => :'ReceivedDate',
73
+ :'close_date' => :'CloseDate',
74
+ :'ship_to_name' => :'ShipToName',
75
+ :'ship_to_company' => :'ShipToCompany',
76
+ :'ship_to_address' => :'ShipToAddress',
77
+ :'ship_to_address2' => :'ShipToAddress2',
78
+ :'ship_to_city' => :'ShipToCity',
79
+ :'ship_to_state' => :'ShipToState',
80
+ :'ship_to_zip_code' => :'ShipToZipCode',
81
+ :'ship_to_country' => :'ShipToCountry',
82
+ :'email_address' => :'EmailAddress',
83
+ :'phone_number' => :'PhoneNumber',
84
+ :'return_warehouse' => :'ReturnWarehouse',
85
+ :'return_status' => :'ReturnStatus',
86
+ :'disposition_code' => :'DispositionCode',
87
+ :'return_reason' => :'ReturnReason',
88
+ :'original_tracking_number' => :'OriginalTrackingNumber',
89
+ :'shipping_carrier_code' => :'ShippingCarrierCode',
90
+ :'shippng_service_code' => :'ShippngServiceCode',
91
+ :'return_sales_order_lines' => :'ReturnSalesOrderLines'
92
+ }
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.swagger_types
97
+ {
98
+ :'customer_no' => :'String',
99
+ :'customer_name' => :'String',
100
+ :'rma_number' => :'String',
101
+ :'order_no' => :'String',
102
+ :'received_date' => :'String',
103
+ :'close_date' => :'String',
104
+ :'ship_to_name' => :'String',
105
+ :'ship_to_company' => :'String',
106
+ :'ship_to_address' => :'String',
107
+ :'ship_to_address2' => :'String',
108
+ :'ship_to_city' => :'String',
109
+ :'ship_to_state' => :'String',
110
+ :'ship_to_zip_code' => :'String',
111
+ :'ship_to_country' => :'String',
112
+ :'email_address' => :'String',
113
+ :'phone_number' => :'String',
114
+ :'return_warehouse' => :'String',
115
+ :'return_status' => :'String',
116
+ :'disposition_code' => :'String',
117
+ :'return_reason' => :'String',
118
+ :'original_tracking_number' => :'String',
119
+ :'shipping_carrier_code' => :'String',
120
+ :'shippng_service_code' => :'String',
121
+ :'return_sales_order_lines' => :'Array<ReturnSalesOrderLine>'
122
+ }
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ return unless attributes.is_a?(Hash)
129
+
130
+ # convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
132
+
133
+ if attributes.has_key?(:'CustomerNo')
134
+ self.customer_no = attributes[:'CustomerNo']
135
+ end
136
+
137
+ if attributes.has_key?(:'CustomerName')
138
+ self.customer_name = attributes[:'CustomerName']
139
+ end
140
+
141
+ if attributes.has_key?(:'RMANumber')
142
+ self.rma_number = attributes[:'RMANumber']
143
+ end
144
+
145
+ if attributes.has_key?(:'OrderNo')
146
+ self.order_no = attributes[:'OrderNo']
147
+ end
148
+
149
+ if attributes.has_key?(:'ReceivedDate')
150
+ self.received_date = attributes[:'ReceivedDate']
151
+ end
152
+
153
+ if attributes.has_key?(:'CloseDate')
154
+ self.close_date = attributes[:'CloseDate']
155
+ end
156
+
157
+ if attributes.has_key?(:'ShipToName')
158
+ self.ship_to_name = attributes[:'ShipToName']
159
+ end
160
+
161
+ if attributes.has_key?(:'ShipToCompany')
162
+ self.ship_to_company = attributes[:'ShipToCompany']
163
+ end
164
+
165
+ if attributes.has_key?(:'ShipToAddress')
166
+ self.ship_to_address = attributes[:'ShipToAddress']
167
+ end
168
+
169
+ if attributes.has_key?(:'ShipToAddress2')
170
+ self.ship_to_address2 = attributes[:'ShipToAddress2']
171
+ end
172
+
173
+ if attributes.has_key?(:'ShipToCity')
174
+ self.ship_to_city = attributes[:'ShipToCity']
175
+ end
176
+
177
+ if attributes.has_key?(:'ShipToState')
178
+ self.ship_to_state = attributes[:'ShipToState']
179
+ end
180
+
181
+ if attributes.has_key?(:'ShipToZipCode')
182
+ self.ship_to_zip_code = attributes[:'ShipToZipCode']
183
+ end
184
+
185
+ if attributes.has_key?(:'ShipToCountry')
186
+ self.ship_to_country = attributes[:'ShipToCountry']
187
+ end
188
+
189
+ if attributes.has_key?(:'EmailAddress')
190
+ self.email_address = attributes[:'EmailAddress']
191
+ end
192
+
193
+ if attributes.has_key?(:'PhoneNumber')
194
+ self.phone_number = attributes[:'PhoneNumber']
195
+ end
196
+
197
+ if attributes.has_key?(:'ReturnWarehouse')
198
+ self.return_warehouse = attributes[:'ReturnWarehouse']
199
+ end
200
+
201
+ if attributes.has_key?(:'ReturnStatus')
202
+ self.return_status = attributes[:'ReturnStatus']
203
+ end
204
+
205
+ if attributes.has_key?(:'DispositionCode')
206
+ self.disposition_code = attributes[:'DispositionCode']
207
+ end
208
+
209
+ if attributes.has_key?(:'ReturnReason')
210
+ self.return_reason = attributes[:'ReturnReason']
211
+ end
212
+
213
+ if attributes.has_key?(:'OriginalTrackingNumber')
214
+ self.original_tracking_number = attributes[:'OriginalTrackingNumber']
215
+ end
216
+
217
+ if attributes.has_key?(:'ShippingCarrierCode')
218
+ self.shipping_carrier_code = attributes[:'ShippingCarrierCode']
219
+ end
220
+
221
+ if attributes.has_key?(:'ShippngServiceCode')
222
+ self.shippng_service_code = attributes[:'ShippngServiceCode']
223
+ end
224
+
225
+ if attributes.has_key?(:'ReturnSalesOrderLines')
226
+ if (value = attributes[:'ReturnSalesOrderLines']).is_a?(Array)
227
+ self.return_sales_order_lines = value
228
+ end
229
+ end
230
+ end
231
+
232
+ # Show invalid properties with the reasons. Usually used together with valid?
233
+ # @return Array for valid properties with the reasons
234
+ def list_invalid_properties
235
+ invalid_properties = Array.new
236
+ invalid_properties
237
+ end
238
+
239
+ # Check to see if the all the properties in the model are valid
240
+ # @return true if the model is valid
241
+ def valid?
242
+ true
243
+ end
244
+
245
+ # Checks equality by comparing each attribute.
246
+ # @param [Object] Object to be compared
247
+ def ==(o)
248
+ return true if self.equal?(o)
249
+ self.class == o.class &&
250
+ customer_no == o.customer_no &&
251
+ customer_name == o.customer_name &&
252
+ rma_number == o.rma_number &&
253
+ order_no == o.order_no &&
254
+ received_date == o.received_date &&
255
+ close_date == o.close_date &&
256
+ ship_to_name == o.ship_to_name &&
257
+ ship_to_company == o.ship_to_company &&
258
+ ship_to_address == o.ship_to_address &&
259
+ ship_to_address2 == o.ship_to_address2 &&
260
+ ship_to_city == o.ship_to_city &&
261
+ ship_to_state == o.ship_to_state &&
262
+ ship_to_zip_code == o.ship_to_zip_code &&
263
+ ship_to_country == o.ship_to_country &&
264
+ email_address == o.email_address &&
265
+ phone_number == o.phone_number &&
266
+ return_warehouse == o.return_warehouse &&
267
+ return_status == o.return_status &&
268
+ disposition_code == o.disposition_code &&
269
+ return_reason == o.return_reason &&
270
+ original_tracking_number == o.original_tracking_number &&
271
+ shipping_carrier_code == o.shipping_carrier_code &&
272
+ shippng_service_code == o.shippng_service_code &&
273
+ return_sales_order_lines == o.return_sales_order_lines
274
+ end
275
+
276
+ # @see the `==` method
277
+ # @param [Object] Object to be compared
278
+ def eql?(o)
279
+ self == o
280
+ end
281
+
282
+ # Calculates hash code according to all attributes.
283
+ # @return [Fixnum] Hash code
284
+ def hash
285
+ [customer_no, customer_name, rma_number, order_no, received_date, close_date, ship_to_name, ship_to_company, ship_to_address, ship_to_address2, ship_to_city, ship_to_state, ship_to_zip_code, ship_to_country, email_address, phone_number, return_warehouse, return_status, disposition_code, return_reason, original_tracking_number, shipping_carrier_code, shippng_service_code, return_sales_order_lines].hash
286
+ end
287
+
288
+ # Builds the object from hash
289
+ # @param [Hash] attributes Model attributes in the form of hash
290
+ # @return [Object] Returns the model itself
291
+ def build_from_hash(attributes)
292
+ return nil unless attributes.is_a?(Hash)
293
+ self.class.swagger_types.each_pair do |key, type|
294
+ if type =~ /\AArray<(.*)>/i
295
+ # check to ensure the input is an array given that the the attribute
296
+ # is documented as an array but the input is not
297
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
298
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
299
+ end
300
+ elsif !attributes[self.class.attribute_map[key]].nil?
301
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
302
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
303
+ end
304
+
305
+ self
306
+ end
307
+
308
+ # Deserializes the data based on type
309
+ # @param string type Data type
310
+ # @param string value Value to be deserialized
311
+ # @return [Object] Deserialized data
312
+ def _deserialize(type, value)
313
+ case type.to_sym
314
+ when :DateTime
315
+ DateTime.parse(value)
316
+ when :Date
317
+ Date.parse(value)
318
+ when :String
319
+ value.to_s
320
+ when :Integer
321
+ value.to_i
322
+ when :Float
323
+ value.to_f
324
+ when :BOOLEAN
325
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
326
+ true
327
+ else
328
+ false
329
+ end
330
+ when :Object
331
+ # generic object (usually a Hash), return directly
332
+ value
333
+ when /\AArray<(?<inner_type>.+)>\z/
334
+ inner_type = Regexp.last_match[:inner_type]
335
+ value.map { |v| _deserialize(inner_type, v) }
336
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
337
+ k_type = Regexp.last_match[:k_type]
338
+ v_type = Regexp.last_match[:v_type]
339
+ {}.tap do |hash|
340
+ value.each do |k, v|
341
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
342
+ end
343
+ end
344
+ else # model
345
+ temp_model = WineShipping.const_get(type).new
346
+ temp_model.build_from_hash(value)
347
+ end
348
+ end
349
+
350
+ # Returns the string representation of the object
351
+ # @return [String] String presentation of the object
352
+ def to_s
353
+ to_hash.to_s
354
+ end
355
+
356
+ # to_body is an alias to to_hash (backward compatibility)
357
+ # @return [Hash] Returns the object in the form of hash
358
+ def to_body
359
+ to_hash
360
+ end
361
+
362
+ # Returns the object in the form of hash
363
+ # @return [Hash] Returns the object in the form of hash
364
+ def to_hash
365
+ hash = {}
366
+ self.class.attribute_map.each_pair do |attr, param|
367
+ value = self.send(attr)
368
+ next if value.nil?
369
+ hash[param] = _to_hash(value)
370
+ end
371
+ hash
372
+ end
373
+
374
+ # Outputs non-array value in the form of hash
375
+ # For object, use to_hash. Otherwise, just return the value
376
+ # @param [Object] value Any valid value
377
+ # @return [Hash] Returns the value in the form of hash
378
+ def _to_hash(value)
379
+ if value.is_a?(Array)
380
+ value.compact.map { |v| _to_hash(v) }
381
+ elsif value.is_a?(Hash)
382
+ {}.tap do |hash|
383
+ value.each { |k, v| hash[k] = _to_hash(v) }
384
+ end
385
+ elsif value.respond_to? :to_hash
386
+ value.to_hash
387
+ else
388
+ value
389
+ end
390
+ end
391
+ end
392
+ end