Class: ColorMeShop::Shop

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Shop

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/color_me_shop/models/shop.rb', line 213

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#address1Object

住所1



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

def address1
  @address1
end

#address2Object

住所2



99
100
101
# File 'lib/color_me_shop/models/shop.rb', line 99

def address2
  @address2
end

#contract_end_dateObject

契約終了日時



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

def contract_end_date
  @contract_end_date
end

#contract_planObject

契約プラン



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

def contract_plan
  @contract_plan
end

#contract_start_dateObject

契約開始日時



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

def contract_start_date
  @contract_start_date
end

#contract_termObject

契約期間



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

def contract_term
  @contract_term
end

#domain_planObject

ドメインプラン



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

def domain_plan
  @domain_plan
end

#faxObject

登録者FAX番号



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

def fax
  @fax
end

#hojinObject

法人名



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

def hojin
  @hojin
end

#hojin_kanaObject

法人名カナ



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

def hojin_kana
  @hojin_kana
end

#idObject

ショップアカウントID



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

def id
  @id
end

#last_login_dateObject

最終ログイン日時



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

def 
  @last_login_date
end

#login_idObject

ログインID



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

def 
  @login_id
end

#make_dateObject

アカウント作成日時



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

def make_date
  @make_date
end

#mobile_open_stateObject

モバイルショップ開店状態



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

def mobile_open_state
  @mobile_open_state
end

#name1Object

登録者氏名(姓)



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

def name1
  @name1
end

#name1_kanaObject

登録者氏名カナ(姓)



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

def name1_kana
  @name1_kana
end

#name2Object

登録者氏名(名)



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

def name2
  @name2
end

#name2_kanaObject

登録者氏名カナ(名)



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

def name2_kana
  @name2_kana
end

#open_stateObject

開店状態



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

def open_state
  @open_state
end

#postalObject

郵便番号



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

def postal
  @postal
end

#pref_idObject

都道府県ID



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

def pref_id
  @pref_id
end

#pref_nameObject

都道府県名



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

def pref_name
  @pref_name
end

#setup_dateObject

申し込み完了日時



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

def setup_date
  @setup_date
end

#shop_mail_1Object

管理者メールアドレス



108
109
110
# File 'lib/color_me_shop/models/shop.rb', line 108

def shop_mail_1
  @shop_mail_1
end

#shop_mail_2Object

管理者携帯メールアドレス



111
112
113
# File 'lib/color_me_shop/models/shop.rb', line 111

def shop_mail_2
  @shop_mail_2
end

#stateObject

アカウント状態



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

def state
  @state
end

#telObject

登録者電話番号



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

def tel
  @tel
end

#titleObject

ショップ名



102
103
104
# File 'lib/color_me_shop/models/shop.rb', line 102

def title
  @title
end

#title_shortObject

メールタイトル用ショップ名



105
106
107
# File 'lib/color_me_shop/models/shop.rb', line 105

def title_short
  @title_short
end

#urlObject

ショップURL



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

def url
  @url
end

#user_mailObject

登録者メールアドレス



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

def user_mail
  @user_mail
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'id' => :'id',
    :'state' => :'state',
    :'domain_plan' => :'domain_plan',
    :'contract_plan' => :'contract_plan',
    :'contract_start_date' => :'contract_start_date',
    :'contract_end_date' => :'contract_end_date',
    :'contract_term' => :'contract_term',
    :'last_login_date' => :'last_login_date',
    :'setup_date' => :'setup_date',
    :'make_date' => :'make_date',
    :'url' => :'url',
    :'open_state' => :'open_state',
    :'mobile_open_state' => :'mobile_open_state',
    :'login_id' => :'login_id',
    :'name1' => :'name1',
    :'name2' => :'name2',
    :'name1_kana' => :'name1_kana',
    :'name2_kana' => :'name2_kana',
    :'hojin' => :'hojin',
    :'hojin_kana' => :'hojin_kana',
    :'user_mail' => :'user_mail',
    :'tel' => :'tel',
    :'fax' => :'fax',
    :'postal' => :'postal',
    :'pref_id' => :'pref_id',
    :'pref_name' => :'pref_name',
    :'address1' => :'address1',
    :'address2' => :'address2',
    :'title' => :'title',
    :'title_short' => :'title_short',
    :'shop_mail_1' => :'shop_mail_1',
    :'shop_mail_2' => :'shop_mail_2'
  }
end

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'id' => :'String',
    :'state' => :'String',
    :'domain_plan' => :'String',
    :'contract_plan' => :'String',
    :'contract_start_date' => :'Integer',
    :'contract_end_date' => :'Integer',
    :'contract_term' => :'Integer',
    :'last_login_date' => :'Integer',
    :'setup_date' => :'Integer',
    :'make_date' => :'Integer',
    :'url' => :'String',
    :'open_state' => :'String',
    :'mobile_open_state' => :'String',
    :'login_id' => :'String',
    :'name1' => :'String',
    :'name2' => :'String',
    :'name1_kana' => :'String',
    :'name2_kana' => :'String',
    :'hojin' => :'String',
    :'hojin_kana' => :'String',
    :'user_mail' => :'String',
    :'tel' => :'String',
    :'fax' => :'String',
    :'postal' => :'String',
    :'pref_id' => :'Integer',
    :'pref_name' => :'String',
    :'address1' => :'String',
    :'address2' => :'String',
    :'title' => :'String',
    :'title_short' => :'String',
    :'shop_mail_1' => :'String',
    :'shop_mail_2' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/color_me_shop/models/shop.rb', line 423

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      state == o.state &&
      domain_plan == o.domain_plan &&
      contract_plan == o.contract_plan &&
      contract_start_date == o.contract_start_date &&
      contract_end_date == o.contract_end_date &&
      contract_term == o.contract_term &&
       == o. &&
      setup_date == o.setup_date &&
      make_date == o.make_date &&
      url == o.url &&
      open_state == o.open_state &&
      mobile_open_state == o.mobile_open_state &&
       == o. &&
      name1 == o.name1 &&
      name2 == o.name2 &&
      name1_kana == o.name1_kana &&
      name2_kana == o.name2_kana &&
      hojin == o.hojin &&
      hojin_kana == o.hojin_kana &&
      user_mail == o.user_mail &&
      tel == o.tel &&
      fax == o.fax &&
      postal == o.postal &&
      pref_id == o.pref_id &&
      pref_name == o.pref_name &&
      address1 == o.address1 &&
      address2 == o.address2 &&
      title == o.title &&
      title_short == o.title_short &&
      shop_mail_1 == o.shop_mail_1 &&
      shop_mail_2 == o.shop_mail_2
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



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/color_me_shop/models/shop.rb', line 496

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



562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/color_me_shop/models/shop.rb', line 562

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



475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/color_me_shop/models/shop.rb', line 475

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


462
463
464
# File 'lib/color_me_shop/models/shop.rb', line 462

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



468
469
470
# File 'lib/color_me_shop/models/shop.rb', line 468

def hash
  [id, state, domain_plan, contract_plan, contract_start_date, contract_end_date, contract_term, , setup_date, make_date, url, open_state, mobile_open_state, , name1, name2, name1_kana, name2_kana, hojin, hojin_kana, user_mail, tel, fax, postal, pref_id, pref_name, address1, address2, title, title_short, shop_mail_1, shop_mail_2].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



350
351
352
353
# File 'lib/color_me_shop/models/shop.rb', line 350

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



542
543
544
# File 'lib/color_me_shop/models/shop.rb', line 542

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



548
549
550
551
552
553
554
555
556
# File 'lib/color_me_shop/models/shop.rb', line 548

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



536
537
538
# File 'lib/color_me_shop/models/shop.rb', line 536

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



357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/color_me_shop/models/shop.rb', line 357

def valid?
  state_validator = EnumAttributeValidator.new('String', ['enabled', 'suspended', 'unsigned'])
  return false unless state_validator.valid?(@state)
  domain_plan_validator = EnumAttributeValidator.new('String', ['cmsp_sub_domain', 'own_domain', 'own_sub_domain'])
  return false unless domain_plan_validator.valid?(@domain_plan)
  contract_plan_validator = EnumAttributeValidator.new('String', ['unknown', 'economy', 'small', 'regular', 'lolipop', 'heteml', 'platinum', 'goope', 'large'])
  return false unless contract_plan_validator.valid?(@contract_plan)
  open_state_validator = EnumAttributeValidator.new('String', ['opened', 'closed', 'prepare', 'paused'])
  return false unless open_state_validator.valid?(@open_state)
  mobile_open_state_validator = EnumAttributeValidator.new('String', ['opened', 'closed', 'prepare', 'paused'])
  return false unless mobile_open_state_validator.valid?(@mobile_open_state)
  true
end