Class: WineShipping::ReturnSalesOrderHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/wine_shipping/models/return_sales_order_header.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ReturnSalesOrderHeader

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 127

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'CustomerNo')
    self.customer_no = attributes[:'CustomerNo']
  end

  if attributes.has_key?(:'CustomerName')
    self.customer_name = attributes[:'CustomerName']
  end

  if attributes.has_key?(:'RMANumber')
    self.rma_number = attributes[:'RMANumber']
  end

  if attributes.has_key?(:'OrderNo')
    self.order_no = attributes[:'OrderNo']
  end

  if attributes.has_key?(:'ReceivedDate')
    self.received_date = attributes[:'ReceivedDate']
  end

  if attributes.has_key?(:'CloseDate')
    self.close_date = attributes[:'CloseDate']
  end

  if attributes.has_key?(:'ShipToName')
    self.ship_to_name = attributes[:'ShipToName']
  end

  if attributes.has_key?(:'ShipToCompany')
    self.ship_to_company = attributes[:'ShipToCompany']
  end

  if attributes.has_key?(:'ShipToAddress')
    self.ship_to_address = attributes[:'ShipToAddress']
  end

  if attributes.has_key?(:'ShipToAddress2')
    self.ship_to_address2 = attributes[:'ShipToAddress2']
  end

  if attributes.has_key?(:'ShipToCity')
    self.ship_to_city = attributes[:'ShipToCity']
  end

  if attributes.has_key?(:'ShipToState')
    self.ship_to_state = attributes[:'ShipToState']
  end

  if attributes.has_key?(:'ShipToZipCode')
    self.ship_to_zip_code = attributes[:'ShipToZipCode']
  end

  if attributes.has_key?(:'ShipToCountry')
    self.ship_to_country = attributes[:'ShipToCountry']
  end

  if attributes.has_key?(:'EmailAddress')
    self.email_address = attributes[:'EmailAddress']
  end

  if attributes.has_key?(:'PhoneNumber')
    self.phone_number = attributes[:'PhoneNumber']
  end

  if attributes.has_key?(:'ReturnWarehouse')
    self.return_warehouse = attributes[:'ReturnWarehouse']
  end

  if attributes.has_key?(:'ReturnStatus')
    self.return_status = attributes[:'ReturnStatus']
  end

  if attributes.has_key?(:'DispositionCode')
    self.disposition_code = attributes[:'DispositionCode']
  end

  if attributes.has_key?(:'ReturnReason')
    self.return_reason = attributes[:'ReturnReason']
  end

  if attributes.has_key?(:'OriginalTrackingNumber')
    self.original_tracking_number = attributes[:'OriginalTrackingNumber']
  end

  if attributes.has_key?(:'ShippingCarrierCode')
    self.shipping_carrier_code = attributes[:'ShippingCarrierCode']
  end

  if attributes.has_key?(:'ShippngServiceCode')
    self.shippng_service_code = attributes[:'ShippngServiceCode']
  end

  if attributes.has_key?(:'ReturnSalesOrderLines')
    if (value = attributes[:'ReturnSalesOrderLines']).is_a?(Array)
      self.return_sales_order_lines = value
    end
  end
end

Instance Attribute Details

#close_dateObject

Returns the value of attribute close_date.



27
28
29
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 27

def close_date
  @close_date
end

#customer_nameObject

Returns the value of attribute customer_name.



19
20
21
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 19

def customer_name
  @customer_name
end

#customer_noObject

Returns the value of attribute customer_no.



17
18
19
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 17

def customer_no
  @customer_no
end

#disposition_codeObject

Returns the value of attribute disposition_code.



53
54
55
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 53

def disposition_code
  @disposition_code
end

#email_addressObject

Returns the value of attribute email_address.



45
46
47
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 45

def email_address
  @email_address
end

#order_noObject

Returns the value of attribute order_no.



23
24
25
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 23

def order_no
  @order_no
end

#original_tracking_numberObject

Returns the value of attribute original_tracking_number.



57
58
59
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 57

def original_tracking_number
  @original_tracking_number
end

#phone_numberObject

Returns the value of attribute phone_number.



47
48
49
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 47

def phone_number
  @phone_number
end

#received_dateObject

Returns the value of attribute received_date.



25
26
27
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 25

def received_date
  @received_date
end

#return_reasonObject

Returns the value of attribute return_reason.



55
56
57
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 55

def return_reason
  @return_reason
end

#return_sales_order_linesObject

Returns the value of attribute return_sales_order_lines.



63
64
65
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 63

def return_sales_order_lines
  @return_sales_order_lines
end

#return_statusObject

Returns the value of attribute return_status.



51
52
53
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 51

def return_status
  @return_status
end

#return_warehouseObject

Returns the value of attribute return_warehouse.



49
50
51
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 49

def return_warehouse
  @return_warehouse
end

#rma_numberObject

Returns the value of attribute rma_number.



21
22
23
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 21

def rma_number
  @rma_number
end

#ship_to_addressObject

Returns the value of attribute ship_to_address.



33
34
35
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 33

def ship_to_address
  @ship_to_address
end

#ship_to_address2Object

Returns the value of attribute ship_to_address2.



35
36
37
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 35

def ship_to_address2
  @ship_to_address2
end

#ship_to_cityObject

Returns the value of attribute ship_to_city.



37
38
39
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 37

def ship_to_city
  @ship_to_city
end

#ship_to_companyObject

Returns the value of attribute ship_to_company.



31
32
33
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 31

def ship_to_company
  @ship_to_company
end

#ship_to_countryObject

Returns the value of attribute ship_to_country.



43
44
45
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 43

def ship_to_country
  @ship_to_country
end

#ship_to_nameObject

Returns the value of attribute ship_to_name.



29
30
31
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 29

def ship_to_name
  @ship_to_name
end

#ship_to_stateObject

Returns the value of attribute ship_to_state.



39
40
41
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 39

def ship_to_state
  @ship_to_state
end

#ship_to_zip_codeObject

Returns the value of attribute ship_to_zip_code.



41
42
43
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 41

def ship_to_zip_code
  @ship_to_zip_code
end

#shipping_carrier_codeObject

Returns the value of attribute shipping_carrier_code.



59
60
61
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 59

def shipping_carrier_code
  @shipping_carrier_code
end

#shippng_service_codeObject

Returns the value of attribute shippng_service_code.



61
62
63
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 61

def shippng_service_code
  @shippng_service_code
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 66

def self.attribute_map
  {
    :'customer_no' => :'CustomerNo',
    :'customer_name' => :'CustomerName',
    :'rma_number' => :'RMANumber',
    :'order_no' => :'OrderNo',
    :'received_date' => :'ReceivedDate',
    :'close_date' => :'CloseDate',
    :'ship_to_name' => :'ShipToName',
    :'ship_to_company' => :'ShipToCompany',
    :'ship_to_address' => :'ShipToAddress',
    :'ship_to_address2' => :'ShipToAddress2',
    :'ship_to_city' => :'ShipToCity',
    :'ship_to_state' => :'ShipToState',
    :'ship_to_zip_code' => :'ShipToZipCode',
    :'ship_to_country' => :'ShipToCountry',
    :'email_address' => :'EmailAddress',
    :'phone_number' => :'PhoneNumber',
    :'return_warehouse' => :'ReturnWarehouse',
    :'return_status' => :'ReturnStatus',
    :'disposition_code' => :'DispositionCode',
    :'return_reason' => :'ReturnReason',
    :'original_tracking_number' => :'OriginalTrackingNumber',
    :'shipping_carrier_code' => :'ShippingCarrierCode',
    :'shippng_service_code' => :'ShippngServiceCode',
    :'return_sales_order_lines' => :'ReturnSalesOrderLines'
  }
end

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 96

def self.swagger_types
  {
    :'customer_no' => :'String',
    :'customer_name' => :'String',
    :'rma_number' => :'String',
    :'order_no' => :'String',
    :'received_date' => :'String',
    :'close_date' => :'String',
    :'ship_to_name' => :'String',
    :'ship_to_company' => :'String',
    :'ship_to_address' => :'String',
    :'ship_to_address2' => :'String',
    :'ship_to_city' => :'String',
    :'ship_to_state' => :'String',
    :'ship_to_zip_code' => :'String',
    :'ship_to_country' => :'String',
    :'email_address' => :'String',
    :'phone_number' => :'String',
    :'return_warehouse' => :'String',
    :'return_status' => :'String',
    :'disposition_code' => :'String',
    :'return_reason' => :'String',
    :'original_tracking_number' => :'String',
    :'shipping_carrier_code' => :'String',
    :'shippng_service_code' => :'String',
    :'return_sales_order_lines' => :'Array<ReturnSalesOrderLine>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 247

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      customer_no == o.customer_no &&
      customer_name == o.customer_name &&
      rma_number == o.rma_number &&
      order_no == o.order_no &&
      received_date == o.received_date &&
      close_date == o.close_date &&
      ship_to_name == o.ship_to_name &&
      ship_to_company == o.ship_to_company &&
      ship_to_address == o.ship_to_address &&
      ship_to_address2 == o.ship_to_address2 &&
      ship_to_city == o.ship_to_city &&
      ship_to_state == o.ship_to_state &&
      ship_to_zip_code == o.ship_to_zip_code &&
      ship_to_country == o.ship_to_country &&
      email_address == o.email_address &&
      phone_number == o.phone_number &&
      return_warehouse == o.return_warehouse &&
      return_status == o.return_status &&
      disposition_code == o.disposition_code &&
      return_reason == o.return_reason &&
      original_tracking_number == o.original_tracking_number &&
      shipping_carrier_code == o.shipping_carrier_code &&
      shippng_service_code == o.shippng_service_code &&
      return_sales_order_lines == o.return_sales_order_lines
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 312

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = WineShipping.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 378

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 291

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


278
279
280
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 278

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



284
285
286
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 284

def hash
  [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
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



234
235
236
237
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 234

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



358
359
360
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 358

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



364
365
366
367
368
369
370
371
372
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 364

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



352
353
354
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 352

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



241
242
243
# File 'lib/wine_shipping/models/return_sales_order_header.rb', line 241

def valid?
  true
end