Class: Zernio::StartSmsRegistrationRequestTollFree

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

Overview

Required for toll_free.

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 = {}) ⇒ StartSmsRegistrationRequestTollFree

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::StartSmsRegistrationRequestTollFree` 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::StartSmsRegistrationRequestTollFree`. 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?(:'business_name')
    self.business_name = attributes[:'business_name']
  else
    self.business_name = nil
  end

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

  if attributes.key?(:'phone_numbers')
    if (value = attributes[:'phone_numbers']).is_a?(Array)
      self.phone_numbers = value
    end
  else
    self.phone_numbers = nil
  end

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

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

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

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

  if attributes.key?(:'opt_in_workflow_image_urls')
    if (value = attributes[:'opt_in_workflow_image_urls']).is_a?(Array)
      self.opt_in_workflow_image_urls = value
    end
  else
    self.opt_in_workflow_image_urls = nil
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#additional_informationObject

Returns the value of attribute additional_information.



40
41
42
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 40

def additional_information
  @additional_information
end

#business_addr1Object

Returns the value of attribute business_addr1.



42
43
44
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 42

def business_addr1
  @business_addr1
end

#business_addr2Object

Returns the value of attribute business_addr2.



44
45
46
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 44

def business_addr2
  @business_addr2
end

#business_cityObject

Returns the value of attribute business_city.



46
47
48
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 46

def business_city
  @business_city
end

#business_contact_emailObject

Returns the value of attribute business_contact_email.



56
57
58
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 56

def business_contact_email
  @business_contact_email
end

#business_contact_first_nameObject

Returns the value of attribute business_contact_first_name.



52
53
54
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 52

def business_contact_first_name
  @business_contact_first_name
end

#business_contact_last_nameObject

Returns the value of attribute business_contact_last_name.



54
55
56
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 54

def business_contact_last_name
  @business_contact_last_name
end

#business_contact_phoneObject

Returns the value of attribute business_contact_phone.



58
59
60
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 58

def business_contact_phone
  @business_contact_phone
end

#business_nameObject

Returns the value of attribute business_name.



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

def business_name
  @business_name
end

#business_registration_countryObject

ISO 3166-1 alpha-2.



66
67
68
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 66

def business_registration_country
  @business_registration_country
end

#business_registration_numberObject

Returns the value of attribute business_registration_number.



60
61
62
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 60

def business_registration_number
  @business_registration_number
end

#business_registration_typeObject

e.g. EIN (US), Companies House (UK), ABN (AU).



63
64
65
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 63

def business_registration_type
  @business_registration_type
end

#business_stateObject

Returns the value of attribute business_state.



48
49
50
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 48

def business_state
  @business_state
end

#business_zipObject

Returns the value of attribute business_zip.



50
51
52
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 50

def business_zip
  @business_zip
end

#corporate_websiteObject

Returns the value of attribute corporate_website.



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

def corporate_website
  @corporate_website
end

#message_volumeObject

Expected monthly message volume tier.



38
39
40
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 38

def message_volume
  @message_volume
end

#opt_in_workflowObject

How recipients opt in to your messages.



32
33
34
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 32

def opt_in_workflow
  @opt_in_workflow
end

#opt_in_workflow_image_urlsObject

Screenshot URL(s) showing the opt-in flow (at least one).



35
36
37
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 35

def opt_in_workflow_image_urls
  @opt_in_workflow_image_urls
end

#phone_numbersObject

Returns the value of attribute phone_numbers.



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

def phone_numbers
  @phone_numbers
end

#production_message_contentObject

Returns the value of attribute production_message_content.



29
30
31
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 29

def production_message_content
  @production_message_content
end

#use_caseObject

Returns the value of attribute use_case.



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

def use_case
  @use_case
end

#use_case_summaryObject

Returns the value of attribute use_case_summary.



27
28
29
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 27

def use_case_summary
  @use_case_summary
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



119
120
121
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 119

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 91

def self.attribute_map
  {
    :'business_name' => :'businessName',
    :'corporate_website' => :'corporateWebsite',
    :'phone_numbers' => :'phoneNumbers',
    :'use_case' => :'useCase',
    :'use_case_summary' => :'useCaseSummary',
    :'production_message_content' => :'productionMessageContent',
    :'opt_in_workflow' => :'optInWorkflow',
    :'opt_in_workflow_image_urls' => :'optInWorkflowImageUrls',
    :'message_volume' => :'messageVolume',
    :'additional_information' => :'additionalInformation',
    :'business_addr1' => :'businessAddr1',
    :'business_addr2' => :'businessAddr2',
    :'business_city' => :'businessCity',
    :'business_state' => :'businessState',
    :'business_zip' => :'businessZip',
    :'business_contact_first_name' => :'businessContactFirstName',
    :'business_contact_last_name' => :'businessContactLastName',
    :'business_contact_email' => :'businessContactEmail',
    :'business_contact_phone' => :'businessContactPhone',
    :'business_registration_number' => :'businessRegistrationNumber',
    :'business_registration_type' => :'businessRegistrationType',
    :'business_registration_country' => :'businessRegistrationCountry'
  }
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



716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 716

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_nullableObject

List of attributes with nullable: true



157
158
159
160
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 157

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'business_name' => :'String',
    :'corporate_website' => :'String',
    :'phone_numbers' => :'Array<String>',
    :'use_case' => :'String',
    :'use_case_summary' => :'String',
    :'production_message_content' => :'String',
    :'opt_in_workflow' => :'String',
    :'opt_in_workflow_image_urls' => :'Array<String>',
    :'message_volume' => :'String',
    :'additional_information' => :'String',
    :'business_addr1' => :'String',
    :'business_addr2' => :'String',
    :'business_city' => :'String',
    :'business_state' => :'String',
    :'business_zip' => :'String',
    :'business_contact_first_name' => :'String',
    :'business_contact_last_name' => :'String',
    :'business_contact_email' => :'String',
    :'business_contact_phone' => :'String',
    :'business_registration_number' => :'String',
    :'business_registration_type' => :'String',
    :'business_registration_country' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 674

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      business_name == o.business_name &&
      corporate_website == o.corporate_website &&
      phone_numbers == o.phone_numbers &&
      use_case == o.use_case &&
      use_case_summary == o.use_case_summary &&
      production_message_content == o.production_message_content &&
      opt_in_workflow == o.opt_in_workflow &&
      opt_in_workflow_image_urls == o.opt_in_workflow_image_urls &&
      message_volume == o.message_volume &&
      additional_information == o.additional_information &&
      business_addr1 == o.business_addr1 &&
      business_addr2 == o.business_addr2 &&
      business_city == o.business_city &&
      business_state == o.business_state &&
      business_zip == o.business_zip &&
      business_contact_first_name == o.business_contact_first_name &&
      business_contact_last_name == o.business_contact_last_name &&
      business_contact_email == o.business_contact_email &&
      business_contact_phone == o.business_contact_phone &&
      business_registration_number == o.business_registration_number &&
      business_registration_type == o.business_registration_type &&
      business_registration_country == o.business_registration_country
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


703
704
705
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 703

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



709
710
711
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 709

def hash
  [business_name, corporate_website, phone_numbers, use_case, use_case_summary, production_message_content, opt_in_workflow, opt_in_workflow_image_urls, message_volume, additional_information, business_addr1, business_addr2, business_city, business_state, business_zip, business_contact_first_name, business_contact_last_name, business_contact_email, business_contact_phone, business_registration_number, business_registration_type, business_registration_country].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
347
348
349
350
351
352
353
354
355
356
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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 315

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

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

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

  if @phone_numbers.length < 1
    invalid_properties.push('invalid value for "phone_numbers", number of items must be greater than or equal to 1.')
  end

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

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

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

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

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

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

  if @opt_in_workflow_image_urls.length < 1
    invalid_properties.push('invalid value for "opt_in_workflow_image_urls", number of items must be greater than or equal to 1.')
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



738
739
740
741
742
743
744
745
746
747
748
749
750
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 738

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



419
420
421
422
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
# File 'lib/zernio-sdk/models/start_sms_registration_request_toll_free.rb', line 419

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @business_name.nil?
  return false if @corporate_website.nil?
  return false if @phone_numbers.nil?
  return false if @phone_numbers.length < 1
  return false if @use_case.nil?
  return false if @use_case_summary.nil?
  return false if @production_message_content.nil?
  return false if @opt_in_workflow.nil?
  return false if @opt_in_workflow.to_s.length > 500
  return false if @opt_in_workflow_image_urls.nil?
  return false if @opt_in_workflow_image_urls.length < 1
  return false if @message_volume.nil?
  message_volume_validator = EnumAttributeValidator.new('String', ["10", "100", "1,000", "10,000", "100,000", "250,000", "500,000", "750,000", "1,000,000", "5,000,000", "10,000,000+"])
  return false unless message_volume_validator.valid?(@message_volume)
  return false if @additional_information.nil?
  return false if @business_addr1.nil?
  return false if @business_city.nil?
  return false if @business_state.nil?
  return false if @business_zip.nil?
  return false if @business_contact_first_name.nil?
  return false if @business_contact_last_name.nil?
  return false if @business_contact_email.nil?
  return false if @business_contact_phone.nil?
  return false if @business_registration_number.nil?
  return false if @business_registration_type.nil?
  return false if @business_registration_country.nil?
  true
end