Class: CyberSource::Boardingv1registrationsOrganizationInformationBusinessInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Boardingv1registrationsOrganizationInformationBusinessInformation

Initializes the object

Parameters:

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

    Model attributes in the form of hash



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 110

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#addressObject

Returns the value of attribute address.



25
26
27
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 25

def address
  @address
end

#business_contactObject

Returns the value of attribute business_contact.



39
40
41
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 39

def business_contact
  @business_contact
end

#descriptionObject

Returns the value of attribute description.



20
21
22
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 20

def description
  @description
end

#doing_business_asObject

Returns the value of attribute doing_business_as.



18
19
20
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 18

def doing_business_as
  @doing_business_as
end

#emergency_contactObject

Returns the value of attribute emergency_contact.



43
44
45
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 43

def emergency_contact
  @emergency_contact
end

#merchant_category_codeObject

Industry standard Merchant Category Code (MCC)



46
47
48
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 46

def merchant_category_code
  @merchant_category_code
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 16

def name
  @name
end

#phone_numberObject

Returns the value of attribute phone_number.



37
38
39
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 37

def phone_number
  @phone_number
end

#start_dateObject

‘Format: YYYY-MM-DD` Example 2016-08-11 equals August 11, 2016



23
24
25
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 23

def start_date
  @start_date
end

#tax_idObject

Returns the value of attribute tax_id.



35
36
37
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 35

def tax_id
  @tax_id
end

#technical_contactObject

Returns the value of attribute technical_contact.



41
42
43
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 41

def technical_contact
  @technical_contact
end

#time_zoneObject

Merchant perferred time zone Possible Values: - ‘Pacific/Pago_Pago’ - ‘Pacific/Honolulu’ - ‘America/Anchorage’ - ‘America/Vancouver’ - ‘America/Los_Angeles’ - ‘America/Phoenix’ - ‘America/Edmonton’ - ‘America/Denver’ - ‘America/Winnipeg’ - ‘America/Mexico_City’ - ‘America/Chicago’ - ‘America/Bogota’ - ‘America/Indianapolis’ - ‘America/New_York’ - ‘America/La_Paz’ - ‘America/Halifax’ - ‘America/St_Johns’ - ‘America/Buenos_Aires’ - ‘America/Godthab’ - ‘America/Sao_Paulo’ - ‘America/Noronha’ - ‘Atlantic/Cape_Verde’ - ‘GMT’ - ‘Europe/Dublin’ - ‘Europe/Lisbon’ - ‘Europe/London’ - ‘Africa/Tunis’ - ‘Europe/Vienna’ - ‘Europe/Brussels’ - ‘Europe/Zurich’ - ‘Europe/Prague’ - ‘Europe/Berlin’ - ‘Europe/Copenhagen’ - ‘Europe/Madrid’ - ‘Europe/Budapest’ - ‘Europe/Rome’ - ‘Africa/Tripoli’ - ‘Europe/Monaco’ - ‘Europe/Malta’ - ‘Europe/Amsterdam’ - ‘Europe/Oslo’ - ‘Europe/Warsaw’ - ‘Europe/Stockholm’ - ‘Europe/Belgrade’ - ‘Europe/Paris’ - ‘Africa/Johannesburg’ - ‘Europe/Minsk’ - ‘Africa/Cairo’ - ‘Europe/Helsinki’ - ‘Europe/Athens’ - ‘Asia/Jerusalem’ - ‘Europe/Riga’ - ‘Europe/Bucharest’ - ‘Europe/Istanbul’ - ‘Asia/Riyadh’ - ‘Europe/Moscow’ - ‘Asia/Dubai’ - ‘Asia/Baku’ - ‘Asia/Tbilisi’ - ‘Asia/Calcutta’ - ‘Asia/Katmandu’ - ‘Asia/Dacca’ - ‘Asia/Rangoon’ - ‘Asia/Jakarta’ - ‘Asia/Saigon’ - ‘Asia/Bangkok’ - ‘Australia/Perth’ - ‘Asia/Hong_Kong’ - ‘Asia/Macao’ - ‘Asia/Kuala_Lumpur’ - ‘Asia/Manila’ - ‘Asia/Singapore’ - ‘Asia/Taipei’ - ‘Asia/Shanghai’ - ‘Asia/Seoul’ - ‘Asia/Tokyo’ - ‘Asia/Yakutsk’ - ‘Australia/Adelaide’ - ‘Australia/Brisbane’ - ‘Australia/Broken_Hill’ - ‘Australia/Darwin’ - ‘Australia/Eucla’ - ‘Australia/Hobart’ - ‘Australia/Lindeman’ - ‘Australia/Sydney’ - ‘Australia/Lord_Howe’ - ‘Australia/Melbourne’ - ‘Asia/Magadan’ - ‘Pacific/Norfolk’ - ‘Pacific/Auckland’



28
29
30
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 28

def time_zone
  @time_zone
end

#typeObject

Business type Possible Values: - ‘PARTNERSHIP’ - ‘SOLE_PROPRIETORSHIP’ - ‘CORPORATION’ - ‘LLC’ - ‘NON_PROFIT’ - ‘TRUST’



33
34
35
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 33

def type
  @type
end

#website_urlObject

Returns the value of attribute website_url.



30
31
32
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 30

def website_url
  @website_url
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 49

def self.attribute_map
  {
    :'name' => :'name',
    :'doing_business_as' => :'doingBusinessAs',
    :'description' => :'description',
    :'start_date' => :'startDate',
    :'address' => :'address',
    :'time_zone' => :'timeZone',
    :'website_url' => :'websiteUrl',
    :'type' => :'type',
    :'tax_id' => :'taxId',
    :'phone_number' => :'phoneNumber',
    :'business_contact' => :'businessContact',
    :'technical_contact' => :'technicalContact',
    :'emergency_contact' => :'emergencyContact',
    :'merchant_category_code' => :'merchantCategoryCode'
  }
end

.json_mapObject

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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 69

def self.json_map
  {
    :'name' => :'name',
    :'doing_business_as' => :'doing_business_as',
    :'description' => :'description',
    :'start_date' => :'start_date',
    :'address' => :'address',
    :'time_zone' => :'time_zone',
    :'website_url' => :'website_url',
    :'type' => :'type',
    :'tax_id' => :'tax_id',
    :'phone_number' => :'phone_number',
    :'business_contact' => :'business_contact',
    :'technical_contact' => :'technical_contact',
    :'emergency_contact' => :'emergency_contact',
    :'merchant_category_code' => :'merchant_category_code'
  }
end

.swagger_typesObject

Attribute type mapping.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 89

def self.swagger_types
  {
    :'name' => :'String',
    :'doing_business_as' => :'String',
    :'description' => :'String',
    :'start_date' => :'Date',
    :'address' => :'Boardingv1registrationsOrganizationInformationBusinessInformationAddress',
    :'time_zone' => :'String',
    :'website_url' => :'String',
    :'type' => :'String',
    :'tax_id' => :'String',
    :'phone_number' => :'String',
    :'business_contact' => :'Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact',
    :'technical_contact' => :'Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact',
    :'emergency_contact' => :'Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact',
    :'merchant_category_code' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 302

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      doing_business_as == o.doing_business_as &&
      description == o.description &&
      start_date == o.start_date &&
      address == o.address &&
      time_zone == o.time_zone &&
      website_url == o.website_url &&
      type == o.type &&
      tax_id == o.tax_id &&
      phone_number == o.phone_number &&
      business_contact == o.business_contact &&
      technical_contact == o.technical_contact &&
      emergency_contact == o.emergency_contact &&
      merchant_category_code == o.merchant_category_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



357
358
359
360
361
362
363
364
365
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
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 357

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



423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 423

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



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 336

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("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{self.class.json_map[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


323
324
325
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 323

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



329
330
331
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 329

def hash
  [name, doing_business_as, description, start_date, address, time_zone, website_url, type, tax_id, phone_number, business_contact, technical_contact, emergency_contact, merchant_category_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



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
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 175

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

  #if @name !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
    #invalid_properties.push('invalid value for "name", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.')
  #end

  #if !@doing_business_as.nil? && @doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
    #invalid_properties.push('invalid value for "doing_business_as", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.')
  #end

  #if [email protected]? && @description !~ Regexp.new(/[À-ÖØ-öø-ǿÀ-ÖØ-öø-ǿ\\n\\ra-zA-Z0-9().\\-_#,;\/\\\\@$:&amp;!?%«»€₣«»€₣ ]{1,}$/)
    #invalid_properties.push('invalid value for "description", must conform to the pattern /[À-ÖØ-öø-ǿÀ-ÖØ-öø-ǿ\\n\\ra-zA-Z0-9().\\-_#,;\/\\\\@$:&amp;!?%«»€₣«»€₣ ]{1,}$/.')
  #end

  #if !@website_url.nil? && @website_url !~ Regexp.new(/\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/)
    #invalid_properties.push('invalid value for "website_url", must conform to the pattern /\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/.')
  #end

  #if !@tax_id.nil? && @tax_id !~ Regexp.new(/\\d{9}/)
    #invalid_properties.push('invalid value for "tax_id", must conform to the pattern /\\d{9}/.')
  #end

  #if !@phone_number.nil? && @phone_number !~ Regexp.new(/^[0-9a-zA-Z\\\\+\\\\-]+$/)
    #invalid_properties.push('invalid value for "phone_number", must conform to the pattern /^[0-9a-zA-Z\\\\+\\\\-]+$/.')
  #end

  #if !@merchant_category_code.nil? && @merchant_category_code !~ Regexp.new(/^\\d{3,4}$/)
    #invalid_properties.push('invalid value for "merchant_category_code", must conform to the pattern /^\\d{3,4}$/.')
  #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



403
404
405
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 403

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



409
410
411
412
413
414
415
416
417
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 409

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



397
398
399
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 397

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



214
215
216
217
218
219
220
221
222
223
224
# File 'lib/cybersource_rest_client/models/boardingv1registrations_organization_information_business_information.rb', line 214

def valid?
  return false if @name.nil?
  #return false if @name !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
  #return false if !@doing_business_as.nil? && @doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/)
  #return false if [email protected]? && @description !~ Regexp.new(/[À-ÖØ-öø-ǿÀ-ÖØ-öø-ǿ\\n\\ra-zA-Z0-9().\\-_#,;\/\\\\@$:&amp;!?%«»€₣«»€₣ ]{1,}$/)
  #return false if !@website_url.nil? && @website_url !~ Regexp.new(/\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/)
  #return false if !@tax_id.nil? && @tax_id !~ Regexp.new(/\\d{9}/)
  #return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^[0-9a-zA-Z\\\\+\\\\-]+$/)
  #return false if !@merchant_category_code.nil? && @merchant_category_code !~ Regexp.new(/^\\d{3,4}$/)
  true
end