Class: Zernio::CreateBrandedCallingEnterpriseRequest

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ CreateBrandedCallingEnterpriseRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 131

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

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

  if attributes.key?(:'legal_name')
    self.legal_name = attributes[:'legal_name']
  else
    self.legal_name = nil
  end

  if attributes.key?(:'doing_business_as')
    self.doing_business_as = attributes[:'doing_business_as']
  else
    self.doing_business_as = nil
  end

  if attributes.key?(:'organization_type')
    self.organization_type = attributes[:'organization_type']
  else
    self.organization_type = nil
  end

  if attributes.key?(:'organization_legal_type')
    self.organization_legal_type = attributes[:'organization_legal_type']
  else
    self.organization_legal_type = nil
  end

  if attributes.key?(:'country_code')
    self.country_code = attributes[:'country_code']
  else
    self.country_code = nil
  end

  if attributes.key?(:'jurisdiction_of_incorporation')
    self.jurisdiction_of_incorporation = attributes[:'jurisdiction_of_incorporation']
  else
    self.jurisdiction_of_incorporation = nil
  end

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

  if attributes.key?(:'fein')
    self.fein = attributes[:'fein']
  else
    self.fein = nil
  end

  if attributes.key?(:'industry')
    self.industry = attributes[:'industry']
  else
    self.industry = nil
  end

  if attributes.key?(:'number_of_employees')
    self.number_of_employees = attributes[:'number_of_employees']
  else
    self.number_of_employees = nil
  end

  if attributes.key?(:'organization_contact')
    self.organization_contact = attributes[:'organization_contact']
  else
    self.organization_contact = nil
  end

  if attributes.key?(:'billing_contact')
    self.billing_contact = attributes[:'billing_contact']
  else
    self.billing_contact = nil
  end

  if attributes.key?(:'physical_address')
    self.physical_address = attributes[:'physical_address']
  else
    self.physical_address = nil
  end

  if attributes.key?(:'billing_address')
    self.billing_address = attributes[:'billing_address']
  else
    self.billing_address = nil
  end
end

Instance Attribute Details

#billing_address ⇒ Object

Returns the value of attribute billing_address.



49
50
51
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 49

def billing_address
  @billing_address
end

#billing_contact ⇒ Object

Returns the value of attribute billing_contact.



45
46
47
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 45

def billing_contact
  @billing_contact
end

#country_code ⇒ Object

ISO 3166-1 alpha-2. US or CA.



28
29
30
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 28

def country_code
  @country_code
end

#doing_business_as ⇒ Object

Returns the value of attribute doing_business_as.



21
22
23
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 21

def doing_business_as
  @doing_business_as
end

#fein ⇒ Object

US Federal Employer Identification Number (NN-NNNNNNN) or the Canadian equivalent. Stored encrypted; only the last four digits are ever returned.



36
37
38
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 36

def fein
  @fein
end

#industry ⇒ Object

One of the carrier industry labels, e.g. technology, healthcare, retail, finance, legal, insurance, real estate, logistics, education.



39
40
41
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 39

def industry
  @industry
end

#jurisdiction_of_incorporation ⇒ Object

State, province or country of registration.



31
32
33
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 31

def jurisdiction_of_incorporation
  @jurisdiction_of_incorporation
end

Exactly as on the tax record.



19
20
21
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 19

def legal_name
  @legal_name
end

#number_of_employees ⇒ Object

Returns the value of attribute number_of_employees.



41
42
43
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 41

def number_of_employees
  @number_of_employees
end

#organization_contact ⇒ Object

Returns the value of attribute organization_contact.



43
44
45
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 43

def organization_contact
  @organization_contact
end

Returns the value of attribute organization_legal_type.



25
26
27
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 25

def organization_legal_type
  @organization_legal_type
end

#organization_type ⇒ Object

Returns the value of attribute organization_type.



23
24
25
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 23

def organization_type
  @organization_type
end

#physical_address ⇒ Object

Returns the value of attribute physical_address.



47
48
49
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 47

def physical_address
  @physical_address
end

#website ⇒ Object

Returns the value of attribute website.



33
34
35
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 33

def website
  @website
end

Class Method Details

.acceptable_attribute_map ⇒ Object

Returns attribute mapping this model knows about



94
95
96
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 94

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



99
100
101
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 99

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_map ⇒ Object

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 74

def self.attribute_map
  {
    :'legal_name' => :'legalName',
    :'doing_business_as' => :'doingBusinessAs',
    :'organization_type' => :'organizationType',
    :'organization_legal_type' => :'organizationLegalType',
    :'country_code' => :'countryCode',
    :'jurisdiction_of_incorporation' => :'jurisdictionOfIncorporation',
    :'website' => :'website',
    :'fein' => :'fein',
    :'industry' => :'industry',
    :'number_of_employees' => :'numberOfEmployees',
    :'organization_contact' => :'organizationContact',
    :'billing_contact' => :'billingContact',
    :'physical_address' => :'physicalAddress',
    :'billing_address' => :'billingAddress'
  }
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



533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 533

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{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[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullable ⇒ Object

List of attributes with nullable: true



124
125
126
127
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 124

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

.openapi_types ⇒ Object

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 104

def self.openapi_types
  {
    :'legal_name' => :'String',
    :'doing_business_as' => :'String',
    :'organization_type' => :'String',
    :'organization_legal_type' => :'String',
    :'country_code' => :'String',
    :'jurisdiction_of_incorporation' => :'String',
    :'website' => :'String',
    :'fein' => :'String',
    :'industry' => :'String',
    :'number_of_employees' => :'String',
    :'organization_contact' => :'BrandedCallingContact',
    :'billing_contact' => :'BrandedCallingContact',
    :'physical_address' => :'BrandedCallingAddress',
    :'billing_address' => :'BrandedCallingAddress'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 499

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      legal_name == o.legal_name &&
      doing_business_as == o.doing_business_as &&
      organization_type == o.organization_type &&
      organization_legal_type == o.organization_legal_type &&
      country_code == o.country_code &&
      jurisdiction_of_incorporation == o.jurisdiction_of_incorporation &&
      website == o.website &&
      fein == o.fein &&
      industry == o.industry &&
      number_of_employees == o.number_of_employees &&
      organization_contact == o.organization_contact &&
      billing_contact == o.billing_contact &&
      physical_address == o.physical_address &&
      billing_address == o.billing_address
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


520
521
522
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 520

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



526
527
528
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 526

def hash
  [legal_name, doing_business_as, organization_type, organization_legal_type, country_code, jurisdiction_of_incorporation, website, fein, industry, number_of_employees, organization_contact, billing_contact, physical_address, billing_address].hash
end

#list_invalid_properties ⇒ Object

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 232

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @legal_name.nil?
    invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.')
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  invalid_properties
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 555

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

#valid? ⇒ Boolean

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

Returns:

  • (Boolean) —

    true if the model is valid



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
# File 'lib/zernio-sdk/models/create_branded_calling_enterprise_request.rb', line 312

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @legal_name.nil?
  return false if @legal_name.to_s.length > 64
  return false if @legal_name.to_s.length < 3
  return false if @doing_business_as.nil?
  return false if @doing_business_as.to_s.length > 255
  return false if @organization_type.nil?
  organization_type_validator = EnumAttributeValidator.new('String', ["commercial", "government", "non_profit"])
  return false unless organization_type_validator.valid?(@organization_type)
  return false if @organization_legal_type.nil?
  organization_legal_type_validator = EnumAttributeValidator.new('String', ["corporation", "llc", "partnership", "nonprofit", "other"])
  return false unless organization_legal_type_validator.valid?(@organization_legal_type)
  return false if @country_code.nil?
  return false if @jurisdiction_of_incorporation.nil?
  return false if @jurisdiction_of_incorporation.to_s.length > 255
  return false if @website.nil?
  return false if @fein.nil?
  return false if @industry.nil?
  return false if @number_of_employees.nil?
  number_of_employees_validator = EnumAttributeValidator.new('String', ["1-10", "11-50", "51-200", "201-500", "501-2000", "2001-10000", "10001+"])
  return false unless number_of_employees_validator.valid?(@number_of_employees)
  return false if @organization_contact.nil?
  return false if @billing_contact.nil?
  return false if @physical_address.nil?
  return false if @billing_address.nil?
  true
end