freeclimb 4.2.0 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +23 -5
  5. data/docs/DefaultApi.md +437 -1
  6. data/docs/IncomingNumberRequest.md +3 -1
  7. data/docs/SMSTenDLCBrand.md +78 -0
  8. data/docs/SMSTenDLCBrandsListResult.md +32 -0
  9. data/docs/SMSTenDLCBrandsListResultAllOf.md +18 -0
  10. data/docs/SMSTenDLCCampaign.md +78 -0
  11. data/docs/SMSTenDLCCampaignsListResult.md +32 -0
  12. data/docs/SMSTenDLCCampaignsListResultAllOf.md +18 -0
  13. data/docs/SMSTenDLCPartnerCampaign.md +74 -0
  14. data/docs/SMSTenDLCPartnerCampaignBrand.md +38 -0
  15. data/docs/SMSTenDLCPartnerCampaignsListResult.md +32 -0
  16. data/docs/SMSTenDLCPartnerCampaignsListResultAllOf.md +18 -0
  17. data/lib/freeclimb/api/default_api.rb +367 -0
  18. data/lib/freeclimb/models/account_result.rb +2 -0
  19. data/lib/freeclimb/models/account_result_all_of.rb +2 -0
  20. data/lib/freeclimb/models/call_result.rb +3 -0
  21. data/lib/freeclimb/models/call_result_all_of.rb +3 -0
  22. data/lib/freeclimb/models/conference_result.rb +2 -0
  23. data/lib/freeclimb/models/conference_result_all_of.rb +2 -0
  24. data/lib/freeclimb/models/create_conference.rb +1 -0
  25. data/lib/freeclimb/models/create_conference_all_of.rb +1 -0
  26. data/lib/freeclimb/models/create_conference_request.rb +1 -0
  27. data/lib/freeclimb/models/get_speech.rb +1 -0
  28. data/lib/freeclimb/models/get_speech_all_of.rb +1 -0
  29. data/lib/freeclimb/models/incoming_number_request.rb +15 -4
  30. data/lib/freeclimb/models/log_result.rb +1 -0
  31. data/lib/freeclimb/models/message_result.rb +1 -0
  32. data/lib/freeclimb/models/message_result_all_of.rb +1 -0
  33. data/lib/freeclimb/models/sms_ten_dlc_brand.rb +960 -0
  34. data/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb +306 -0
  35. data/lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb +221 -0
  36. data/lib/freeclimb/models/sms_ten_dlc_campaign.rb +814 -0
  37. data/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb +306 -0
  38. data/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb +221 -0
  39. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb +807 -0
  40. data/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb +445 -0
  41. data/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb +306 -0
  42. data/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb +221 -0
  43. data/lib/freeclimb/models/update_conference_request.rb +1 -0
  44. data/lib/freeclimb/version.rb +1 -1
  45. data/lib/freeclimb.rb +10 -0
  46. data/openapi.json +1200 -27
  47. data/spec/api/default_api_spec.rb +156 -2
  48. data/spec/models/sms_ten_dlc_brand_spec.rb +234 -0
  49. data/spec/models/sms_ten_dlc_brands_list_result_spec.rb +76 -0
  50. data/spec/models/sms_ten_dlc_campaign_spec.rb +218 -0
  51. data/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +76 -0
  52. data/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +94 -0
  53. data/spec/models/sms_ten_dlc_partner_campaign_spec.rb +206 -0
  54. data/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +76 -0
  55. data/spec/utils/signature_information_spec.rb +4 -3
  56. metadata +107 -73
@@ -0,0 +1,814 @@
1
+ =begin
2
+ #FreeClimb API
3
+
4
+ #FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class SMSTenDLCCampaign
18
+ # ID of the account that created this Queue.
19
+ attr_accessor :account_id
20
+
21
+ # Alphanumeric identifier assigned by the registry for a campaign. This identifier is required by the NetNumber OSR SMS enabling process of 10DLC.
22
+ attr_accessor :campaign_id
23
+
24
+ # Alphanumeric identifier of the CSP associated with this campaign.
25
+ attr_accessor :csp_id
26
+
27
+ # Alphanumeric identifier of the reseller that you want to associate with this campaign.
28
+ attr_accessor :reseller_id
29
+
30
+ # Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status.
31
+ attr_accessor :status
32
+
33
+ # Unix timestamp when campaign was created.
34
+ attr_accessor :create_date
35
+
36
+ # Campaign subscription auto-renewal status.
37
+ attr_accessor :auto_renewal
38
+
39
+ # Campaign recent billed date.
40
+ attr_accessor :billed_date
41
+
42
+ # Alphanumeric identifier of the brand associated with this campaign.
43
+ attr_accessor :brand_id
44
+
45
+ # Campaign usecase. Must be of defined valid types. Use `/registry/enum/usecase` operation to retrieve usecases available for given brand.
46
+ attr_accessor :usecase
47
+
48
+ # Campaign sub-usecases. Must be of defined valid sub-usecase types. Use `/registry/enum/usecase` operation to retrieve list of valid sub-usecases
49
+ attr_accessor :sub_usecases
50
+
51
+ # Summary description of this campaign.
52
+ attr_accessor :description
53
+
54
+ # Does message generated by the campaign include URL link in SMS?
55
+ attr_accessor :embedded_link
56
+
57
+ # Does message generated by the campaign include phone number in SMS?
58
+ attr_accessor :embedded_phone
59
+
60
+ # Does message content controlled by affiliate marketing other than the brand?
61
+ attr_accessor :affiliate_marketing
62
+
63
+ # Does campaign utilize pool of phone nubers?
64
+ attr_accessor :number_pool
65
+
66
+ # Age gated content in campaign.
67
+ attr_accessor :age_gated
68
+
69
+ attr_accessor :direct_lending
70
+
71
+ # Does campaign require subscriber to opt-in before SMS is sent to subscriber?
72
+ attr_accessor :subscriber_optin
73
+
74
+ # Does campaign support subscriber opt-out keyword(s)?
75
+ attr_accessor :subscriber_optout
76
+
77
+ # Does campaign responds to help keyword(s)?
78
+ attr_accessor :subscriber_help
79
+
80
+ # Message sample. Some campaign tiers require 1 or more message samples.
81
+ attr_accessor :sample1
82
+
83
+ # Message sample. Some campaign tiers require 2 or more message samples.
84
+ attr_accessor :sample2
85
+
86
+ # Message sample. Some campaign tiers require 3 or more message samples.
87
+ attr_accessor :sample3
88
+
89
+ # Message sample. Some campaign tiers require 4 or more message samples.
90
+ attr_accessor :sample4
91
+
92
+ # Message sample. Some campaign tiers require 5 or more message samples.
93
+ attr_accessor :sample5
94
+
95
+ # Message flow description.
96
+ attr_accessor :message_flow
97
+
98
+ # Help message of the campaign.
99
+ attr_accessor :help_message
100
+
101
+ # Caller supplied campaign reference ID. If supplied, the value must be unique across all submitted campaigns. Can be used to prevent duplicate campaign registrations.
102
+ attr_accessor :reference_id
103
+
104
+ # Campaign created from mock brand. Mocked campaign cannot be shared with an upstream CNP.
105
+ attr_accessor :mock
106
+
107
+ # When the campaign would be due for its next renew/bill date.
108
+ attr_accessor :next_renewal_or_expiration_date
109
+
110
+ class EnumAttributeValidator
111
+ attr_reader :datatype
112
+ attr_reader :allowable_values
113
+
114
+ def initialize(datatype, allowable_values)
115
+ @allowable_values = allowable_values.map do |value|
116
+ case datatype.to_s
117
+ when /Integer/i
118
+ value.to_i
119
+ when /Float/i
120
+ value.to_f
121
+ else
122
+ value
123
+ end
124
+ end
125
+ end
126
+
127
+ def valid?(value)
128
+ !value || allowable_values.include?(value)
129
+ end
130
+ end
131
+
132
+ # Attribute mapping from ruby-style variable name to JSON key.
133
+ def self.attribute_map
134
+ {
135
+ :'account_id' => :'accountId',
136
+ :'campaign_id' => :'campaignId',
137
+ :'csp_id' => :'cspId',
138
+ :'reseller_id' => :'resellerId',
139
+ :'status' => :'status',
140
+ :'create_date' => :'createDate',
141
+ :'auto_renewal' => :'autoRenewal',
142
+ :'billed_date' => :'billedDate',
143
+ :'brand_id' => :'brandId',
144
+ :'usecase' => :'usecase',
145
+ :'sub_usecases' => :'subUsecases',
146
+ :'description' => :'description',
147
+ :'embedded_link' => :'embeddedLink',
148
+ :'embedded_phone' => :'embeddedPhone',
149
+ :'affiliate_marketing' => :'affiliateMarketing',
150
+ :'number_pool' => :'numberPool',
151
+ :'age_gated' => :'ageGated',
152
+ :'direct_lending' => :'directLending',
153
+ :'subscriber_optin' => :'subscriberOptin',
154
+ :'subscriber_optout' => :'subscriberOptout',
155
+ :'subscriber_help' => :'subscriberHelp',
156
+ :'sample1' => :'sample1',
157
+ :'sample2' => :'sample2',
158
+ :'sample3' => :'sample3',
159
+ :'sample4' => :'sample4',
160
+ :'sample5' => :'sample5',
161
+ :'message_flow' => :'messageFlow',
162
+ :'help_message' => :'helpMessage',
163
+ :'reference_id' => :'referenceId',
164
+ :'mock' => :'mock',
165
+ :'next_renewal_or_expiration_date' => :'nextRenewalOrExpirationDate'
166
+ }
167
+ end
168
+
169
+ # Returns all the JSON keys this model knows about
170
+ def self.acceptable_attributes
171
+ attribute_map.values
172
+ end
173
+
174
+ # Attribute type mapping.
175
+ def self.openapi_types
176
+ {
177
+ :'account_id' => :'String',
178
+ :'campaign_id' => :'String',
179
+ :'csp_id' => :'String',
180
+ :'reseller_id' => :'String',
181
+ :'status' => :'String',
182
+ :'create_date' => :'Time',
183
+ :'auto_renewal' => :'Boolean',
184
+ :'billed_date' => :'Time',
185
+ :'brand_id' => :'String',
186
+ :'usecase' => :'String',
187
+ :'sub_usecases' => :'Array<String>',
188
+ :'description' => :'String',
189
+ :'embedded_link' => :'Boolean',
190
+ :'embedded_phone' => :'Boolean',
191
+ :'affiliate_marketing' => :'Boolean',
192
+ :'number_pool' => :'Boolean',
193
+ :'age_gated' => :'Boolean',
194
+ :'direct_lending' => :'Boolean',
195
+ :'subscriber_optin' => :'Boolean',
196
+ :'subscriber_optout' => :'Boolean',
197
+ :'subscriber_help' => :'Boolean',
198
+ :'sample1' => :'String',
199
+ :'sample2' => :'String',
200
+ :'sample3' => :'String',
201
+ :'sample4' => :'String',
202
+ :'sample5' => :'String',
203
+ :'message_flow' => :'String',
204
+ :'help_message' => :'String',
205
+ :'reference_id' => :'String',
206
+ :'mock' => :'Boolean',
207
+ :'next_renewal_or_expiration_date' => :'Date'
208
+ }
209
+ end
210
+
211
+ # List of attributes with nullable: true
212
+ def self.openapi_nullable
213
+ Set.new([
214
+ :'account_id',
215
+ :'reseller_id',
216
+ :'billed_date',
217
+ :'sample2',
218
+ :'sample3',
219
+ :'sample4',
220
+ :'sample5',
221
+ :'message_flow',
222
+ :'help_message',
223
+ :'reference_id',
224
+ :'next_renewal_or_expiration_date'
225
+ ])
226
+ end
227
+
228
+ # Initializes the object
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ def initialize(attributes = {})
231
+ if (!attributes.is_a?(Hash))
232
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SMSTenDLCCampaign` initialize method"
233
+ end
234
+
235
+ # check to see if the attribute exists and convert string to symbol for hash key
236
+ attributes = attributes.each_with_object({}) { |(k, v), h|
237
+ if (!self.class.attribute_map.key?(k.to_sym))
238
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SMSTenDLCCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
239
+ end
240
+ h[k.to_sym] = v
241
+ }
242
+
243
+ if attributes.key?(:'account_id')
244
+ self.account_id = attributes[:'account_id']
245
+ end
246
+
247
+ if attributes.key?(:'campaign_id')
248
+ self.campaign_id = attributes[:'campaign_id']
249
+ end
250
+
251
+ if attributes.key?(:'csp_id')
252
+ self.csp_id = attributes[:'csp_id']
253
+ end
254
+
255
+ if attributes.key?(:'reseller_id')
256
+ self.reseller_id = attributes[:'reseller_id']
257
+ end
258
+
259
+ if attributes.key?(:'status')
260
+ self.status = attributes[:'status']
261
+ end
262
+
263
+ if attributes.key?(:'create_date')
264
+ self.create_date = attributes[:'create_date']
265
+ end
266
+
267
+ if attributes.key?(:'auto_renewal')
268
+ self.auto_renewal = attributes[:'auto_renewal']
269
+ end
270
+
271
+ if attributes.key?(:'billed_date')
272
+ self.billed_date = attributes[:'billed_date']
273
+ end
274
+
275
+ if attributes.key?(:'brand_id')
276
+ self.brand_id = attributes[:'brand_id']
277
+ end
278
+
279
+ if attributes.key?(:'usecase')
280
+ self.usecase = attributes[:'usecase']
281
+ end
282
+
283
+ if attributes.key?(:'sub_usecases')
284
+ if (value = attributes[:'sub_usecases']).is_a?(Array)
285
+ self.sub_usecases = value
286
+ end
287
+ end
288
+
289
+ if attributes.key?(:'description')
290
+ self.description = attributes[:'description']
291
+ end
292
+
293
+ if attributes.key?(:'embedded_link')
294
+ self.embedded_link = attributes[:'embedded_link']
295
+ else
296
+ self.embedded_link = false
297
+ end
298
+
299
+ if attributes.key?(:'embedded_phone')
300
+ self.embedded_phone = attributes[:'embedded_phone']
301
+ else
302
+ self.embedded_phone = false
303
+ end
304
+
305
+ if attributes.key?(:'affiliate_marketing')
306
+ self.affiliate_marketing = attributes[:'affiliate_marketing']
307
+ end
308
+
309
+ if attributes.key?(:'number_pool')
310
+ self.number_pool = attributes[:'number_pool']
311
+ else
312
+ self.number_pool = false
313
+ end
314
+
315
+ if attributes.key?(:'age_gated')
316
+ self.age_gated = attributes[:'age_gated']
317
+ end
318
+
319
+ if attributes.key?(:'direct_lending')
320
+ self.direct_lending = attributes[:'direct_lending']
321
+ end
322
+
323
+ if attributes.key?(:'subscriber_optin')
324
+ self.subscriber_optin = attributes[:'subscriber_optin']
325
+ else
326
+ self.subscriber_optin = false
327
+ end
328
+
329
+ if attributes.key?(:'subscriber_optout')
330
+ self.subscriber_optout = attributes[:'subscriber_optout']
331
+ else
332
+ self.subscriber_optout = false
333
+ end
334
+
335
+ if attributes.key?(:'subscriber_help')
336
+ self.subscriber_help = attributes[:'subscriber_help']
337
+ else
338
+ self.subscriber_help = false
339
+ end
340
+
341
+ if attributes.key?(:'sample1')
342
+ self.sample1 = attributes[:'sample1']
343
+ end
344
+
345
+ if attributes.key?(:'sample2')
346
+ self.sample2 = attributes[:'sample2']
347
+ end
348
+
349
+ if attributes.key?(:'sample3')
350
+ self.sample3 = attributes[:'sample3']
351
+ end
352
+
353
+ if attributes.key?(:'sample4')
354
+ self.sample4 = attributes[:'sample4']
355
+ end
356
+
357
+ if attributes.key?(:'sample5')
358
+ self.sample5 = attributes[:'sample5']
359
+ end
360
+
361
+ if attributes.key?(:'message_flow')
362
+ self.message_flow = attributes[:'message_flow']
363
+ end
364
+
365
+ if attributes.key?(:'help_message')
366
+ self.help_message = attributes[:'help_message']
367
+ end
368
+
369
+ if attributes.key?(:'reference_id')
370
+ self.reference_id = attributes[:'reference_id']
371
+ end
372
+
373
+ if attributes.key?(:'mock')
374
+ self.mock = attributes[:'mock']
375
+ end
376
+
377
+ if attributes.key?(:'next_renewal_or_expiration_date')
378
+ self.next_renewal_or_expiration_date = attributes[:'next_renewal_or_expiration_date']
379
+ end
380
+ end
381
+
382
+ # Show invalid properties with the reasons. Usually used together with valid?
383
+ # @return Array for valid properties with the reasons
384
+ def list_invalid_properties
385
+ invalid_properties = Array.new
386
+ if @campaign_id.nil?
387
+ invalid_properties.push('invalid value for "campaign_id", campaign_id cannot be nil.')
388
+ end
389
+
390
+ if @csp_id.nil?
391
+ invalid_properties.push('invalid value for "csp_id", csp_id cannot be nil.')
392
+ end
393
+
394
+ if !@reseller_id.nil? && @reseller_id.to_s.length > 8
395
+ invalid_properties.push('invalid value for "reseller_id", the character length must be smaller than or equal to 8.')
396
+ end
397
+
398
+ if @brand_id.nil?
399
+ invalid_properties.push('invalid value for "brand_id", brand_id cannot be nil.')
400
+ end
401
+
402
+ if @brand_id.to_s.length > 8
403
+ invalid_properties.push('invalid value for "brand_id", the character length must be smaller than or equal to 8.')
404
+ end
405
+
406
+ if @usecase.nil?
407
+ invalid_properties.push('invalid value for "usecase", usecase cannot be nil.')
408
+ end
409
+
410
+ if @usecase.to_s.length > 20
411
+ invalid_properties.push('invalid value for "usecase", the character length must be smaller than or equal to 20.')
412
+ end
413
+
414
+ if @sub_usecases.nil?
415
+ invalid_properties.push('invalid value for "sub_usecases", sub_usecases cannot be nil.')
416
+ end
417
+
418
+ if @description.nil?
419
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
420
+ end
421
+
422
+ if @description.to_s.length > 4096
423
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 4096.')
424
+ end
425
+
426
+ if !@sample1.nil? && @sample1.to_s.length > 1024
427
+ invalid_properties.push('invalid value for "sample1", the character length must be smaller than or equal to 1024.')
428
+ end
429
+
430
+ if !@sample2.nil? && @sample2.to_s.length > 1024
431
+ invalid_properties.push('invalid value for "sample2", the character length must be smaller than or equal to 1024.')
432
+ end
433
+
434
+ if !@sample3.nil? && @sample3.to_s.length > 1024
435
+ invalid_properties.push('invalid value for "sample3", the character length must be smaller than or equal to 1024.')
436
+ end
437
+
438
+ if !@sample4.nil? && @sample4.to_s.length > 1024
439
+ invalid_properties.push('invalid value for "sample4", the character length must be smaller than or equal to 1024.')
440
+ end
441
+
442
+ if !@sample5.nil? && @sample5.to_s.length > 1024
443
+ invalid_properties.push('invalid value for "sample5", the character length must be smaller than or equal to 1024.')
444
+ end
445
+
446
+ if !@message_flow.nil? && @message_flow.to_s.length > 2048
447
+ invalid_properties.push('invalid value for "message_flow", the character length must be smaller than or equal to 2048.')
448
+ end
449
+
450
+ if !@help_message.nil? && @help_message.to_s.length > 255
451
+ invalid_properties.push('invalid value for "help_message", the character length must be smaller than or equal to 255.')
452
+ end
453
+
454
+ if !@reference_id.nil? && @reference_id.to_s.length > 50
455
+ invalid_properties.push('invalid value for "reference_id", the character length must be smaller than or equal to 50.')
456
+ end
457
+
458
+ if @mock.nil?
459
+ invalid_properties.push('invalid value for "mock", mock cannot be nil.')
460
+ end
461
+
462
+ invalid_properties
463
+ end
464
+
465
+ # Check to see if the all the properties in the model are valid
466
+ # @return true if the model is valid
467
+ def valid?
468
+ return false if @campaign_id.nil?
469
+ return false if @csp_id.nil?
470
+ return false if !@reseller_id.nil? && @reseller_id.to_s.length > 8
471
+ status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "EXPIRED"])
472
+ return false unless status_validator.valid?(@status)
473
+ return false if @brand_id.nil?
474
+ return false if @brand_id.to_s.length > 8
475
+ return false if @usecase.nil?
476
+ return false if @usecase.to_s.length > 20
477
+ return false if @sub_usecases.nil?
478
+ return false if @description.nil?
479
+ return false if @description.to_s.length > 4096
480
+ return false if !@sample1.nil? && @sample1.to_s.length > 1024
481
+ return false if !@sample2.nil? && @sample2.to_s.length > 1024
482
+ return false if !@sample3.nil? && @sample3.to_s.length > 1024
483
+ return false if !@sample4.nil? && @sample4.to_s.length > 1024
484
+ return false if !@sample5.nil? && @sample5.to_s.length > 1024
485
+ return false if !@message_flow.nil? && @message_flow.to_s.length > 2048
486
+ return false if !@help_message.nil? && @help_message.to_s.length > 255
487
+ return false if !@reference_id.nil? && @reference_id.to_s.length > 50
488
+ return false if @mock.nil?
489
+ true
490
+ end
491
+
492
+ # Custom attribute writer method with validation
493
+ # @param [Object] reseller_id Value to be assigned
494
+ def reseller_id=(reseller_id)
495
+ if !reseller_id.nil? && reseller_id.to_s.length > 8
496
+ fail ArgumentError, 'invalid value for "reseller_id", the character length must be smaller than or equal to 8.'
497
+ end
498
+
499
+ @reseller_id = reseller_id
500
+ end
501
+
502
+ # Custom attribute writer method checking allowed values (enum).
503
+ # @param [Object] status Object to be assigned
504
+ def status=(status)
505
+ validator = EnumAttributeValidator.new('String', ["ACTIVE", "EXPIRED"])
506
+ unless validator.valid?(status)
507
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
508
+ end
509
+ @status = status
510
+ end
511
+
512
+ # Custom attribute writer method with validation
513
+ # @param [Object] brand_id Value to be assigned
514
+ def brand_id=(brand_id)
515
+ if brand_id.nil?
516
+ fail ArgumentError, 'brand_id cannot be nil'
517
+ end
518
+
519
+ if brand_id.to_s.length > 8
520
+ fail ArgumentError, 'invalid value for "brand_id", the character length must be smaller than or equal to 8.'
521
+ end
522
+
523
+ @brand_id = brand_id
524
+ end
525
+
526
+ # Custom attribute writer method with validation
527
+ # @param [Object] usecase Value to be assigned
528
+ def usecase=(usecase)
529
+ if usecase.nil?
530
+ fail ArgumentError, 'usecase cannot be nil'
531
+ end
532
+
533
+ if usecase.to_s.length > 20
534
+ fail ArgumentError, 'invalid value for "usecase", the character length must be smaller than or equal to 20.'
535
+ end
536
+
537
+ @usecase = usecase
538
+ end
539
+
540
+ # Custom attribute writer method with validation
541
+ # @param [Object] sub_usecases Value to be assigned
542
+ def sub_usecases=(sub_usecases)
543
+ if sub_usecases.nil?
544
+ fail ArgumentError, 'sub_usecases cannot be nil'
545
+ end
546
+
547
+ @sub_usecases = sub_usecases
548
+ end
549
+
550
+ # Custom attribute writer method with validation
551
+ # @param [Object] description Value to be assigned
552
+ def description=(description)
553
+ if description.nil?
554
+ fail ArgumentError, 'description cannot be nil'
555
+ end
556
+
557
+ if description.to_s.length > 4096
558
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4096.'
559
+ end
560
+
561
+ @description = description
562
+ end
563
+
564
+ # Custom attribute writer method with validation
565
+ # @param [Object] sample1 Value to be assigned
566
+ def sample1=(sample1)
567
+ if !sample1.nil? && sample1.to_s.length > 1024
568
+ fail ArgumentError, 'invalid value for "sample1", the character length must be smaller than or equal to 1024.'
569
+ end
570
+
571
+ @sample1 = sample1
572
+ end
573
+
574
+ # Custom attribute writer method with validation
575
+ # @param [Object] sample2 Value to be assigned
576
+ def sample2=(sample2)
577
+ if !sample2.nil? && sample2.to_s.length > 1024
578
+ fail ArgumentError, 'invalid value for "sample2", the character length must be smaller than or equal to 1024.'
579
+ end
580
+
581
+ @sample2 = sample2
582
+ end
583
+
584
+ # Custom attribute writer method with validation
585
+ # @param [Object] sample3 Value to be assigned
586
+ def sample3=(sample3)
587
+ if !sample3.nil? && sample3.to_s.length > 1024
588
+ fail ArgumentError, 'invalid value for "sample3", the character length must be smaller than or equal to 1024.'
589
+ end
590
+
591
+ @sample3 = sample3
592
+ end
593
+
594
+ # Custom attribute writer method with validation
595
+ # @param [Object] sample4 Value to be assigned
596
+ def sample4=(sample4)
597
+ if !sample4.nil? && sample4.to_s.length > 1024
598
+ fail ArgumentError, 'invalid value for "sample4", the character length must be smaller than or equal to 1024.'
599
+ end
600
+
601
+ @sample4 = sample4
602
+ end
603
+
604
+ # Custom attribute writer method with validation
605
+ # @param [Object] sample5 Value to be assigned
606
+ def sample5=(sample5)
607
+ if !sample5.nil? && sample5.to_s.length > 1024
608
+ fail ArgumentError, 'invalid value for "sample5", the character length must be smaller than or equal to 1024.'
609
+ end
610
+
611
+ @sample5 = sample5
612
+ end
613
+
614
+ # Custom attribute writer method with validation
615
+ # @param [Object] message_flow Value to be assigned
616
+ def message_flow=(message_flow)
617
+ if !message_flow.nil? && message_flow.to_s.length > 2048
618
+ fail ArgumentError, 'invalid value for "message_flow", the character length must be smaller than or equal to 2048.'
619
+ end
620
+
621
+ @message_flow = message_flow
622
+ end
623
+
624
+ # Custom attribute writer method with validation
625
+ # @param [Object] help_message Value to be assigned
626
+ def help_message=(help_message)
627
+ if !help_message.nil? && help_message.to_s.length > 255
628
+ fail ArgumentError, 'invalid value for "help_message", the character length must be smaller than or equal to 255.'
629
+ end
630
+
631
+ @help_message = help_message
632
+ end
633
+
634
+ # Custom attribute writer method with validation
635
+ # @param [Object] reference_id Value to be assigned
636
+ def reference_id=(reference_id)
637
+ if !reference_id.nil? && reference_id.to_s.length > 50
638
+ fail ArgumentError, 'invalid value for "reference_id", the character length must be smaller than or equal to 50.'
639
+ end
640
+
641
+ @reference_id = reference_id
642
+ end
643
+
644
+ # Checks equality by comparing each attribute.
645
+ # @param [Object] Object to be compared
646
+ def ==(o)
647
+ return true if self.equal?(o)
648
+ self.class == o.class &&
649
+ account_id == o.account_id &&
650
+ campaign_id == o.campaign_id &&
651
+ csp_id == o.csp_id &&
652
+ reseller_id == o.reseller_id &&
653
+ status == o.status &&
654
+ create_date == o.create_date &&
655
+ auto_renewal == o.auto_renewal &&
656
+ billed_date == o.billed_date &&
657
+ brand_id == o.brand_id &&
658
+ usecase == o.usecase &&
659
+ sub_usecases == o.sub_usecases &&
660
+ description == o.description &&
661
+ embedded_link == o.embedded_link &&
662
+ embedded_phone == o.embedded_phone &&
663
+ affiliate_marketing == o.affiliate_marketing &&
664
+ number_pool == o.number_pool &&
665
+ age_gated == o.age_gated &&
666
+ direct_lending == o.direct_lending &&
667
+ subscriber_optin == o.subscriber_optin &&
668
+ subscriber_optout == o.subscriber_optout &&
669
+ subscriber_help == o.subscriber_help &&
670
+ sample1 == o.sample1 &&
671
+ sample2 == o.sample2 &&
672
+ sample3 == o.sample3 &&
673
+ sample4 == o.sample4 &&
674
+ sample5 == o.sample5 &&
675
+ message_flow == o.message_flow &&
676
+ help_message == o.help_message &&
677
+ reference_id == o.reference_id &&
678
+ mock == o.mock &&
679
+ next_renewal_or_expiration_date == o.next_renewal_or_expiration_date
680
+ end
681
+
682
+ # @see the `==` method
683
+ # @param [Object] Object to be compared
684
+ def eql?(o)
685
+ self == o
686
+ end
687
+
688
+ # Calculates hash code according to all attributes.
689
+ # @return [Integer] Hash code
690
+ def hash
691
+ [account_id, campaign_id, csp_id, reseller_id, status, create_date, auto_renewal, billed_date, brand_id, usecase, sub_usecases, description, embedded_link, embedded_phone, affiliate_marketing, number_pool, age_gated, direct_lending, subscriber_optin, subscriber_optout, subscriber_help, sample1, sample2, sample3, sample4, sample5, message_flow, help_message, reference_id, mock, next_renewal_or_expiration_date].hash
692
+ end
693
+
694
+ # Builds the object from hash
695
+ # @param [Hash] attributes Model attributes in the form of hash
696
+ # @return [Object] Returns the model itself
697
+ def self.build_from_hash(attributes)
698
+ new.build_from_hash(attributes)
699
+ end
700
+
701
+ # Builds the object from hash
702
+ # @param [Hash] attributes Model attributes in the form of hash
703
+ # @return [Object] Returns the model itself
704
+ def build_from_hash(attributes)
705
+ return nil unless attributes.is_a?(Hash)
706
+ self.class.openapi_types.each_pair do |key, type|
707
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
708
+ self.send("#{key}=", nil)
709
+ elsif type =~ /\AArray<(.*)>/i
710
+ # check to ensure the input is an array given that the attribute
711
+ # is documented as an array but the input is not
712
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
713
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
714
+ end
715
+ elsif !attributes[self.class.attribute_map[key]].nil?
716
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
717
+ end
718
+ end
719
+
720
+ self
721
+ end
722
+
723
+ # Deserializes the data based on type
724
+ # @param string type Data type
725
+ # @param string value Value to be deserialized
726
+ # @return [Object] Deserialized data
727
+ def _deserialize(type, value)
728
+ case type.to_sym
729
+ when :Time
730
+ Time.parse(value)
731
+ when :Date
732
+ Date.parse(value)
733
+ when :String
734
+ value.to_s
735
+ when :Integer
736
+ value.to_i
737
+ when :Float
738
+ value.to_f
739
+ when :Boolean
740
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
741
+ true
742
+ else
743
+ false
744
+ end
745
+ when :Object
746
+ # generic object (usually a Hash), return directly
747
+ value
748
+ when /\AArray<(?<inner_type>.+)>\z/
749
+ inner_type = Regexp.last_match[:inner_type]
750
+ value.map { |v| _deserialize(inner_type, v) }
751
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
752
+ k_type = Regexp.last_match[:k_type]
753
+ v_type = Regexp.last_match[:v_type]
754
+ {}.tap do |hash|
755
+ value.each do |k, v|
756
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
757
+ end
758
+ end
759
+ else # model
760
+ # models (e.g. Pet) or oneOf
761
+ klass = Freeclimb.const_get(type)
762
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
763
+ end
764
+ end
765
+
766
+ # Returns the string representation of the object
767
+ # @return [String] String presentation of the object
768
+ def to_s
769
+ to_hash.to_s
770
+ end
771
+
772
+ # to_body is an alias to to_hash (backward compatibility)
773
+ # @return [Hash] Returns the object in the form of hash
774
+ def to_body
775
+ to_hash
776
+ end
777
+
778
+ # Returns the object in the form of hash
779
+ # @return [Hash] Returns the object in the form of hash
780
+ def to_hash
781
+ hash = {}
782
+ self.class.attribute_map.each_pair do |attr, param|
783
+ value = self.send(attr)
784
+ if value.nil?
785
+ is_nullable = self.class.openapi_nullable.include?(attr)
786
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
787
+ end
788
+
789
+ hash[param] = _to_hash(value)
790
+ end
791
+ hash
792
+ end
793
+
794
+ # Outputs non-array value in the form of hash
795
+ # For object, use to_hash. Otherwise, just return the value
796
+ # @param [Object] value Any valid value
797
+ # @return [Hash] Returns the value in the form of hash
798
+ def _to_hash(value)
799
+ if value.is_a?(Array)
800
+ value.compact.map { |v| _to_hash(v) }
801
+ elsif value.is_a?(Hash)
802
+ {}.tap do |hash|
803
+ value.each { |k, v| hash[k] = _to_hash(v) }
804
+ end
805
+ elsif value.respond_to? :to_hash
806
+ value.to_hash
807
+ else
808
+ value
809
+ end
810
+ end
811
+
812
+ end
813
+
814
+ end