Class: MfkOpenapiRubyClient::CustomerExaminationPayload

Inherits:
Object
  • Object
show all
Defined in:
lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb

Overview

与信枠審査申請情報です。与信枠審査申請で利用します。

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CustomerExaminationPayload

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `MfkOpenapiRubyClient::CustomerExaminationPayload` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `MfkOpenapiRubyClient::CustomerExaminationPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

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

  if attributes.key?(:'amount')
    self.amount = attributes[:'amount']
  end

  if attributes.key?(:'business_description')
    self.business_description = attributes[:'business_description']
  end

  if attributes.key?(:'business_type')
    self.business_type = attributes[:'business_type']
  end

  if attributes.key?(:'corporate_number')
    self.corporate_number = attributes[:'corporate_number']
  end

  if attributes.key?(:'customer_id')
    self.customer_id = attributes[:'customer_id']
  end

  if attributes.key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.key?(:'end_date')
    self.end_date = attributes[:'end_date']
  end

  if attributes.key?(:'remark')
    self.remark = attributes[:'remark']
  end

  if attributes.key?(:'representative_name')
    self.representative_name = attributes[:'representative_name']
  end

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

  if attributes.key?(:'website')
    self.website = attributes[:'website']
  end

  if attributes.key?(:'zip_code')
    self.zip_code = attributes[:'zip_code']
  end
end

Instance Attribute Details

#address1Object

都道府県・市区町村・番地です。必ず都道府県名から始めてください。



20
21
22
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 20

def address1
  @address1
end

#address2Object

建物名・部屋番号などです。



23
24
25
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 23

def address2
  @address2
end

#amountObject

希望与信額です。審査通過の場合に付与される与信枠の金額になります。現在与信枠が適用中の場合は、その与信額以下の金額は指定できません。 審査の結果減額されて与信枠付与されることもあります。



26
27
28
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 26

def amount
  @amount
end

#business_descriptionObject

事業内容です。顧客の主なサービス、商材などを記載してください。



29
30
31
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 29

def business_description
  @business_description
end

#business_typeObject

事業所区分です。法人(‘corporate`)または、個人(`individual`)で指定してください。不明な場合は空にしてください。



32
33
34
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 32

def business_type
  @business_type
end

#corporate_numberObject

法人番号です。事業所区分(‘business_type`)が法人(`corporate`)の場合にのみ指定してください。



35
36
37
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 35

def corporate_number
  @corporate_number
end

#customer_idObject

与信枠審査を申請する顧客のIDです。



38
39
40
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 38

def customer_id
  @customer_id
end

#emailObject

メールアドレスです。email形式で指定してください。



41
42
43
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 41

def email
  @email
end

#end_dateObject

希望取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。 直近三ヶ月の月末のみ指定できます。



44
45
46
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 44

def end_date
  @end_date
end

#remarkObject



47
48
49
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 47

def remark
  @remark
end

#representative_nameObject

代表者氏名です。



50
51
52
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 50

def representative_name
  @representative_name
end

#telObject

電話番号です。ハイフン有無は任意になります。



53
54
55
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 53

def tel
  @tel
end

#websiteObject

顧客企業のwebサイトです。



56
57
58
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 56

def website
  @website
end

#zip_codeObject

郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。



59
60
61
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 59

def zip_code
  @zip_code
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



104
105
106
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 104

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 84

def self.attribute_map
  {
    :'address1' => :'address1',
    :'address2' => :'address2',
    :'amount' => :'amount',
    :'business_description' => :'business_description',
    :'business_type' => :'business_type',
    :'corporate_number' => :'corporate_number',
    :'customer_id' => :'customer_id',
    :'email' => :'email',
    :'end_date' => :'end_date',
    :'remark' => :'remark',
    :'representative_name' => :'representative_name',
    :'tel' => :'tel',
    :'website' => :'website',
    :'zip_code' => :'zip_code'
  }
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



563
564
565
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 563

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



129
130
131
132
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 129

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 109

def self.openapi_types
  {
    :'address1' => :'String',
    :'address2' => :'String',
    :'amount' => :'Integer',
    :'business_description' => :'String',
    :'business_type' => :'String',
    :'corporate_number' => :'String',
    :'customer_id' => :'String',
    :'email' => :'String',
    :'end_date' => :'Date',
    :'remark' => :'String',
    :'representative_name' => :'String',
    :'tel' => :'String',
    :'website' => :'String',
    :'zip_code' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 529

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      address1 == o.address1 &&
      address2 == o.address2 &&
      amount == o.amount &&
      business_description == o.business_description &&
      business_type == o.business_type &&
      corporate_number == o.corporate_number &&
      customer_id == o.customer_id &&
      email == o.email &&
      end_date == o.end_date &&
      remark == o.remark &&
      representative_name == o.representative_name &&
      tel == o.tel &&
      website == o.website &&
      zip_code == o.zip_code
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



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 593

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = MfkOpenapiRubyClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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



664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 664

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



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 570

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that 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
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


550
551
552
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 550

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



556
557
558
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 556

def hash
  [address1, address2, amount, business_description, business_type, corporate_number, customer_id, email, end_date, remark, representative_name, tel, website, zip_code].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
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
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 208

def list_invalid_properties
  invalid_properties = Array.new
  if @address1.nil?
    invalid_properties.push('invalid value for "address1", address1 cannot be nil.')
  end

  if @address1.to_s.length > 100
    invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 100.')
  end

  if @address1.to_s.length < 1
    invalid_properties.push('invalid value for "address1", the character length must be great than or equal to 1.')
  end

  pattern = Regexp.new(/^(北海道|青森県|岩手県|宮城県|秋田県|山形県|福島県|茨城県|栃木県|群馬県|埼玉県|千葉県|東京都|神奈川県|新潟県|富山県|石川県|福井県|山梨県|長野県|岐阜県|静岡県|愛知県|三重県|滋賀県|京都府|大阪府|兵庫県|奈良県|和歌山県|鳥取県|島根県|岡山県|広島県|山口県|徳島県|香川県|愛媛県|高知県|福岡県|佐賀県|長崎県|熊本県|大分県|宮崎県|鹿児島県|沖縄県).+$/)
  if @address1 !~ pattern
    invalid_properties.push("invalid value for \"address1\", must conform to the pattern #{pattern}.")
  end

  if !@address2.nil? && @address2.to_s.length > 100
    invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 100.')
  end

  if @amount.nil?
    invalid_properties.push('invalid value for "amount", amount cannot be nil.')
  end

  if @amount > 150000000
    invalid_properties.push('invalid value for "amount", must be smaller than or equal to 150000000.')
  end

  if @amount < 1
    invalid_properties.push('invalid value for "amount", must be greater than or equal to 1.')
  end

  if !@business_description.nil? && @business_description.to_s.length > 500
    invalid_properties.push('invalid value for "business_description", the character length must be smaller than or equal to 500.')
  end

  pattern = Regexp.new(/^\d{13}$/)
  if !@corporate_number.nil? && @corporate_number !~ pattern
    invalid_properties.push("invalid value for \"corporate_number\", must conform to the pattern #{pattern}.")
  end

  if @customer_id.nil?
    invalid_properties.push('invalid value for "customer_id", customer_id cannot be nil.')
  end

  if @customer_id.to_s.length < 1
    invalid_properties.push('invalid value for "customer_id", the character length must be great than or equal to 1.')
  end

  if @email.nil?
    invalid_properties.push('invalid value for "email", email cannot be nil.')
  end

  if @email.to_s.length > 255
    invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 255.')
  end

  pattern = Regexp.new(/^[\w.+-]{1,64}@[a-z\d](?:[a-z\d-]{0,253}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,253}[a-z\d])?)+$/)
  if @email !~ pattern
    invalid_properties.push("invalid value for \"email\", must conform to the pattern #{pattern}.")
  end

  if @end_date.nil?
    invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
  end

  if !@remark.nil? && @remark.to_s.length > 500
    invalid_properties.push('invalid value for "remark", the character length must be smaller than or equal to 500.')
  end

  if !@representative_name.nil? && @representative_name.to_s.length > 30
    invalid_properties.push('invalid value for "representative_name", the character length must be smaller than or equal to 30.')
  end

  if @tel.nil?
    invalid_properties.push('invalid value for "tel", tel cannot be nil.')
  end

  pattern = Regexp.new(/^((0(\d{1}-?\d{4}|\d{2}-?\d{3}|\d{3}-?\d{2}|\d{4}-?\d{1}|[5789]0-?\d{4})-?\d{4})|(0120-?\d{3}-?\d{3}))$/)
  if @tel !~ pattern
    invalid_properties.push("invalid value for \"tel\", must conform to the pattern #{pattern}.")
  end

  if !@website.nil? && @website.to_s.length > 500
    invalid_properties.push('invalid value for "website", the character length must be smaller than or equal to 500.')
  end

  pattern = Regexp.new(/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,9}\b([-a-zA-Z0-9()@:%_+.~#?&\/=]*)$/)
  if !@website.nil? && @website !~ pattern
    invalid_properties.push("invalid value for \"website\", must conform to the pattern #{pattern}.")
  end

  if @zip_code.nil?
    invalid_properties.push('invalid value for "zip_code", zip_code cannot be nil.')
  end

  pattern = Regexp.new(/^\d{3}-?\d{4}$/)
  if @zip_code !~ pattern
    invalid_properties.push("invalid value for \"zip_code\", must conform to the pattern #{pattern}.")
  end

  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



640
641
642
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 640

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



646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 646

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



634
635
636
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 634

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



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
# File 'lib/mfk_openapi_ruby_client/models/customer_examination_payload.rb', line 317

def valid?
  return false if @address1.nil?
  return false if @address1.to_s.length > 100
  return false if @address1.to_s.length < 1
  return false if @address1 !~ Regexp.new(/^(北海道|青森県|岩手県|宮城県|秋田県|山形県|福島県|茨城県|栃木県|群馬県|埼玉県|千葉県|東京都|神奈川県|新潟県|富山県|石川県|福井県|山梨県|長野県|岐阜県|静岡県|愛知県|三重県|滋賀県|京都府|大阪府|兵庫県|奈良県|和歌山県|鳥取県|島根県|岡山県|広島県|山口県|徳島県|香川県|愛媛県|高知県|福岡県|佐賀県|長崎県|熊本県|大分県|宮崎県|鹿児島県|沖縄県).+$/)
  return false if !@address2.nil? && @address2.to_s.length > 100
  return false if @amount.nil?
  return false if @amount > 150000000
  return false if @amount < 1
  return false if !@business_description.nil? && @business_description.to_s.length > 500
  business_type_validator = EnumAttributeValidator.new('String', ["corporate", "individual"])
  return false unless business_type_validator.valid?(@business_type)
  return false if !@corporate_number.nil? && @corporate_number !~ Regexp.new(/^\d{13}$/)
  return false if @customer_id.nil?
  return false if @customer_id.to_s.length < 1
  return false if @email.nil?
  return false if @email.to_s.length > 255
  return false if @email !~ Regexp.new(/^[\w.+-]{1,64}@[a-z\d](?:[a-z\d-]{0,253}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,253}[a-z\d])?)+$/)
  return false if @end_date.nil?
  return false if !@remark.nil? && @remark.to_s.length > 500
  return false if !@representative_name.nil? && @representative_name.to_s.length > 30
  return false if @tel.nil?
  return false if @tel !~ Regexp.new(/^((0(\d{1}-?\d{4}|\d{2}-?\d{3}|\d{3}-?\d{2}|\d{4}-?\d{1}|[5789]0-?\d{4})-?\d{4})|(0120-?\d{3}-?\d{3}))$/)
  return false if !@website.nil? && @website.to_s.length > 500
  return false if !@website.nil? && @website !~ Regexp.new(/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,9}\b([-a-zA-Z0-9()@:%_+.~#?&\/=]*)$/)
  return false if @zip_code.nil?
  return false if @zip_code !~ Regexp.new(/^\d{3}-?\d{4}$/)
  true
end