freeclimb 4.3.0 → 4.4.1

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