Class: ColorMeShop::SaleDelivery

Inherits:
Object
  • Object
show all
Defined in:
lib/color_me_shop/models/sale_delivery.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SaleDelivery

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
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
275
276
277
278
279
280
281
# File 'lib/color_me_shop/models/sale_delivery.rb', line 166

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?(:'id')
    self.id = attributes[:'id']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#account_idObject

ショップアカウントID



21
22
23
# File 'lib/color_me_shop/models/sale_delivery.rb', line 21

def 
  @account_id
end

#address1Object

住所1



48
49
50
# File 'lib/color_me_shop/models/sale_delivery.rb', line 48

def address1
  @address1
end

#address2Object

住所2



51
52
53
# File 'lib/color_me_shop/models/sale_delivery.rb', line 51

def address2
  @address2
end

#card_chargeObject

メッセージカードの料金



78
79
80
# File 'lib/color_me_shop/models/sale_delivery.rb', line 78

def card_charge
  @card_charge
end

#card_nameObject

メッセージカードの表示名



72
73
74
# File 'lib/color_me_shop/models/sale_delivery.rb', line 72

def card_name
  @card_name
end

#card_textObject

メッセージカードのテキスト



75
76
77
# File 'lib/color_me_shop/models/sale_delivery.rb', line 75

def card_text
  @card_text
end

#deliveredObject

発送済みであるか否か



96
97
98
# File 'lib/color_me_shop/models/sale_delivery.rb', line 96

def delivered
  @delivered
end

#delivery_chargeObject

配送料



87
88
89
# File 'lib/color_me_shop/models/sale_delivery.rb', line 87

def delivery_charge
  @delivery_charge
end

#delivery_idObject

使用された配送方法ID



27
28
29
# File 'lib/color_me_shop/models/sale_delivery.rb', line 27

def delivery_id
  @delivery_id
end

#detail_idsObject

この配送に含まれる受注明細IDの配列



30
31
32
# File 'lib/color_me_shop/models/sale_delivery.rb', line 30

def detail_ids
  @detail_ids
end

#furiganaObject

宛名のフリガナ



36
37
38
# File 'lib/color_me_shop/models/sale_delivery.rb', line 36

def furigana
  @furigana
end

#idObject

配送ID



18
19
20
# File 'lib/color_me_shop/models/sale_delivery.rb', line 18

def id
  @id
end

#memoObject

備考



93
94
95
# File 'lib/color_me_shop/models/sale_delivery.rb', line 93

def memo
  @memo
end

#nameObject

宛名



33
34
35
# File 'lib/color_me_shop/models/sale_delivery.rb', line 33

def name
  @name
end

#noshi_chargeObject

熨斗の料金



69
70
71
# File 'lib/color_me_shop/models/sale_delivery.rb', line 69

def noshi_charge
  @noshi_charge
end

#noshi_textObject

熨斗の文言



66
67
68
# File 'lib/color_me_shop/models/sale_delivery.rb', line 66

def noshi_text
  @noshi_text
end

#postalObject

郵便番号



39
40
41
# File 'lib/color_me_shop/models/sale_delivery.rb', line 39

def postal
  @postal
end

#pref_idObject

都道府県の通し番号。北海道が1、沖縄が47



42
43
44
# File 'lib/color_me_shop/models/sale_delivery.rb', line 42

def pref_id
  @pref_id
end

#pref_nameObject

都道府県名



45
46
47
# File 'lib/color_me_shop/models/sale_delivery.rb', line 45

def pref_name
  @pref_name
end

#preferred_dateObject

配送希望日



57
58
59
# File 'lib/color_me_shop/models/sale_delivery.rb', line 57

def preferred_date
  @preferred_date
end

#preferred_periodObject

配送希望時間帯



60
61
62
# File 'lib/color_me_shop/models/sale_delivery.rb', line 60

def preferred_period
  @preferred_period
end

#sale_idObject

売上ID



24
25
26
# File 'lib/color_me_shop/models/sale_delivery.rb', line 24

def sale_id
  @sale_id
end

#slip_numberObject

配送伝票番号



63
64
65
# File 'lib/color_me_shop/models/sale_delivery.rb', line 63

def slip_number
  @slip_number
end

#telObject

電話番号



54
55
56
# File 'lib/color_me_shop/models/sale_delivery.rb', line 54

def tel
  @tel
end

#total_chargeObject

配送料・手数料の小計



90
91
92
# File 'lib/color_me_shop/models/sale_delivery.rb', line 90

def total_charge
  @total_charge
end

#wrapping_chargeObject

ラッピングの料金



84
85
86
# File 'lib/color_me_shop/models/sale_delivery.rb', line 84

def wrapping_charge
  @wrapping_charge
end

#wrapping_nameObject

ラッピングの表示名



81
82
83
# File 'lib/color_me_shop/models/sale_delivery.rb', line 81

def wrapping_name
  @wrapping_name
end

Class Method Details

.attribute_mapObject

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



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
124
125
126
127
128
129
# File 'lib/color_me_shop/models/sale_delivery.rb', line 99

def self.attribute_map
  {
    :'id' => :'id',
    :'account_id' => :'account_id',
    :'sale_id' => :'sale_id',
    :'delivery_id' => :'delivery_id',
    :'detail_ids' => :'detail_ids',
    :'name' => :'name',
    :'furigana' => :'furigana',
    :'postal' => :'postal',
    :'pref_id' => :'pref_id',
    :'pref_name' => :'pref_name',
    :'address1' => :'address1',
    :'address2' => :'address2',
    :'tel' => :'tel',
    :'preferred_date' => :'preferred_date',
    :'preferred_period' => :'preferred_period',
    :'slip_number' => :'slip_number',
    :'noshi_text' => :'noshi_text',
    :'noshi_charge' => :'noshi_charge',
    :'card_name' => :'card_name',
    :'card_text' => :'card_text',
    :'card_charge' => :'card_charge',
    :'wrapping_name' => :'wrapping_name',
    :'wrapping_charge' => :'wrapping_charge',
    :'delivery_charge' => :'delivery_charge',
    :'total_charge' => :'total_charge',
    :'memo' => :'memo',
    :'delivered' => :'delivered'
  }
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/color_me_shop/models/sale_delivery.rb', line 132

def self.openapi_types
  {
    :'id' => :'Integer',
    :'account_id' => :'String',
    :'sale_id' => :'Integer',
    :'delivery_id' => :'Integer',
    :'detail_ids' => :'Array<Integer>',
    :'name' => :'String',
    :'furigana' => :'String',
    :'postal' => :'String',
    :'pref_id' => :'Integer',
    :'pref_name' => :'String',
    :'address1' => :'String',
    :'address2' => :'String',
    :'tel' => :'String',
    :'preferred_date' => :'String',
    :'preferred_period' => :'String',
    :'slip_number' => :'String',
    :'noshi_text' => :'String',
    :'noshi_charge' => :'Integer',
    :'card_name' => :'String',
    :'card_text' => :'String',
    :'card_charge' => :'Integer',
    :'wrapping_name' => :'String',
    :'wrapping_charge' => :'Integer',
    :'delivery_charge' => :'Integer',
    :'total_charge' => :'Integer',
    :'memo' => :'String',
    :'delivered' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/color_me_shop/models/sale_delivery.rb', line 298

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
       == o. &&
      sale_id == o.sale_id &&
      delivery_id == o.delivery_id &&
      detail_ids == o.detail_ids &&
      name == o.name &&
      furigana == o.furigana &&
      postal == o.postal &&
      pref_id == o.pref_id &&
      pref_name == o.pref_name &&
      address1 == o.address1 &&
      address2 == o.address2 &&
      tel == o.tel &&
      preferred_date == o.preferred_date &&
      preferred_period == o.preferred_period &&
      slip_number == o.slip_number &&
      noshi_text == o.noshi_text &&
      noshi_charge == o.noshi_charge &&
      card_name == o.card_name &&
      card_text == o.card_text &&
      card_charge == o.card_charge &&
      wrapping_name == o.wrapping_name &&
      wrapping_charge == o.wrapping_charge &&
      delivery_charge == o.delivery_charge &&
      total_charge == o.total_charge &&
      memo == o.memo &&
      delivered == o.delivered
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



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/color_me_shop/models/sale_delivery.rb', line 366

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 = ColorMeShop.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



432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/color_me_shop/models/sale_delivery.rb', line 432

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



345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/color_me_shop/models/sale_delivery.rb', line 345

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_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


332
333
334
# File 'lib/color_me_shop/models/sale_delivery.rb', line 332

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



338
339
340
# File 'lib/color_me_shop/models/sale_delivery.rb', line 338

def hash
  [id, , sale_id, delivery_id, detail_ids, name, furigana, postal, pref_id, pref_name, address1, address2, tel, preferred_date, preferred_period, slip_number, noshi_text, noshi_charge, card_name, card_text, card_charge, wrapping_name, wrapping_charge, delivery_charge, total_charge, memo, delivered].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



285
286
287
288
# File 'lib/color_me_shop/models/sale_delivery.rb', line 285

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



412
413
414
# File 'lib/color_me_shop/models/sale_delivery.rb', line 412

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



418
419
420
421
422
423
424
425
426
# File 'lib/color_me_shop/models/sale_delivery.rb', line 418

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



406
407
408
# File 'lib/color_me_shop/models/sale_delivery.rb', line 406

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



292
293
294
# File 'lib/color_me_shop/models/sale_delivery.rb', line 292

def valid?
  true
end