late-sdk 0.0.684 → 0.0.686

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/docs/AccountsApi.md +76 -0
  4. data/docs/CommentAutomationAudience.md +22 -0
  5. data/docs/CommentAutomationFollowGate.md +22 -0
  6. data/docs/CommentAutomationsApi.md +2 -2
  7. data/docs/ConversionEvent.md +1 -1
  8. data/docs/ConversionEventUser.md +2 -0
  9. data/docs/CreateCommentAutomation200ResponseAutomation.md +8 -0
  10. data/docs/CreateCommentAutomationRequest.md +9 -1
  11. data/docs/GetCommentAutomation200ResponseAutomation.md +8 -0
  12. data/docs/GetCommentAutomation200ResponseLogsInner.md +9 -1
  13. data/docs/GetInstagramFollowStatus200Response.md +34 -0
  14. data/docs/ListCommentAutomations200ResponseAutomationsInner.md +4 -0
  15. data/docs/UpdateCommentAutomation200ResponseAutomation.md +4 -0
  16. data/docs/UpdateCommentAutomationRequest.md +8 -0
  17. data/docs/WebhookPayloadCommentCommentAuthor.md +3 -1
  18. data/docs/WebhookPayloadCommentCommentAuthorInstagramProfile.md +24 -0
  19. data/lib/zernio-sdk/api/accounts_api.rb +72 -0
  20. data/lib/zernio-sdk/api/comment_automations_api.rb +3 -3
  21. data/lib/zernio-sdk/models/comment_automation_audience.rb +237 -0
  22. data/lib/zernio-sdk/models/comment_automation_follow_gate.rb +226 -0
  23. data/lib/zernio-sdk/models/conversion_event.rb +1 -1
  24. data/lib/zernio-sdk/models/conversion_event_user.rb +11 -1
  25. data/lib/zernio-sdk/models/create_comment_automation200_response_automation.rb +39 -1
  26. data/lib/zernio-sdk/models/create_comment_automation_request.rb +98 -4
  27. data/lib/zernio-sdk/models/get_comment_automation200_response_automation.rb +39 -1
  28. data/lib/zernio-sdk/models/get_comment_automation200_response_logs_inner.rb +55 -4
  29. data/lib/zernio-sdk/models/get_instagram_follow_status200_response.rb +299 -0
  30. data/lib/zernio-sdk/models/list_comment_automations200_response_automations_inner.rb +21 -1
  31. data/lib/zernio-sdk/models/update_comment_automation200_response_automation.rb +19 -1
  32. data/lib/zernio-sdk/models/update_comment_automation_request.rb +95 -1
  33. data/lib/zernio-sdk/models/webhook_payload_comment_comment_author.rb +14 -5
  34. data/lib/zernio-sdk/models/webhook_payload_comment_comment_author_instagram_profile.rb +181 -0
  35. data/lib/zernio-sdk/version.rb +1 -1
  36. data/lib/zernio-sdk.rb +4 -0
  37. data/openapi.yaml +189 -4
  38. data/spec/api/accounts_api_spec.rb +14 -0
  39. data/spec/api/comment_automations_api_spec.rb +1 -1
  40. data/spec/models/comment_automation_audience_spec.rb +56 -0
  41. data/spec/models/comment_automation_follow_gate_spec.rb +48 -0
  42. data/spec/models/conversion_event_user_spec.rb +6 -0
  43. data/spec/models/create_comment_automation200_response_automation_spec.rb +24 -0
  44. data/spec/models/create_comment_automation_request_spec.rb +24 -0
  45. data/spec/models/get_comment_automation200_response_automation_spec.rb +24 -0
  46. data/spec/models/get_comment_automation200_response_logs_inner_spec.rb +29 -1
  47. data/spec/models/get_instagram_follow_status200_response_spec.rb +88 -0
  48. data/spec/models/list_comment_automations200_response_automations_inner_spec.rb +12 -0
  49. data/spec/models/update_comment_automation200_response_automation_spec.rb +12 -0
  50. data/spec/models/update_comment_automation_request_spec.rb +24 -0
  51. data/spec/models/webhook_payload_comment_comment_author_instagram_profile_spec.rb +54 -0
  52. data/spec/models/webhook_payload_comment_comment_author_spec.rb +6 -0
  53. data/zernio-sdk-0.0.686.gem +0 -0
  54. metadata +1579 -1563
  55. data/zernio-sdk-0.0.684.gem +0 -0
@@ -68,6 +68,16 @@ module Zernio
68
68
  # Optional tag applied to a contact when they click a tracked link (requires linkTracking). Lets you segment clickers for broadcasts/sequences.
69
69
  attr_accessor :click_tag
70
70
 
71
+ # Seconds to wait after the trigger before sending the DM. Omit or send 0 to reply immediately (the default). Max 86400 (24h). The trigger is still matched and deduplicated the moment the comment arrives, so a delay only moves when the response is sent.
72
+ attr_accessor :dm_delay_seconds
73
+
74
+ # Seconds to wait before posting the public comment reply. Omit or send 0 to post it right after the DM (the default). The reply never goes out before the DM, so a value below dmDelaySeconds is raised to it. Ignored when trigger=story_reply, which has no public reply.
75
+ attr_accessor :comment_reply_delay_seconds
76
+
77
+ attr_accessor :audience
78
+
79
+ attr_accessor :follow_gate
80
+
71
81
  class EnumAttributeValidator
72
82
  attr_reader :datatype
73
83
  attr_reader :allowable_values
@@ -110,7 +120,11 @@ module Zernio
110
120
  :'dm_message_variations' => :'dmMessageVariations',
111
121
  :'comment_reply_variations' => :'commentReplyVariations',
112
122
  :'link_tracking' => :'linkTracking',
113
- :'click_tag' => :'clickTag'
123
+ :'click_tag' => :'clickTag',
124
+ :'dm_delay_seconds' => :'dmDelaySeconds',
125
+ :'comment_reply_delay_seconds' => :'commentReplyDelaySeconds',
126
+ :'audience' => :'audience',
127
+ :'follow_gate' => :'followGate'
114
128
  }
115
129
  end
116
130
 
@@ -144,7 +158,11 @@ module Zernio
144
158
  :'dm_message_variations' => :'Array<String>',
145
159
  :'comment_reply_variations' => :'Array<String>',
146
160
  :'link_tracking' => :'Boolean',
147
- :'click_tag' => :'String'
161
+ :'click_tag' => :'String',
162
+ :'dm_delay_seconds' => :'Integer',
163
+ :'comment_reply_delay_seconds' => :'Integer',
164
+ :'audience' => :'CommentAutomationAudience',
165
+ :'follow_gate' => :'CommentAutomationFollowGate'
148
166
  }
149
167
  end
150
168
 
@@ -265,6 +283,22 @@ module Zernio
265
283
  if attributes.key?(:'click_tag')
266
284
  self.click_tag = attributes[:'click_tag']
267
285
  end
286
+
287
+ if attributes.key?(:'dm_delay_seconds')
288
+ self.dm_delay_seconds = attributes[:'dm_delay_seconds']
289
+ end
290
+
291
+ if attributes.key?(:'comment_reply_delay_seconds')
292
+ self.comment_reply_delay_seconds = attributes[:'comment_reply_delay_seconds']
293
+ end
294
+
295
+ if attributes.key?(:'audience')
296
+ self.audience = attributes[:'audience']
297
+ end
298
+
299
+ if attributes.key?(:'follow_gate')
300
+ self.follow_gate = attributes[:'follow_gate']
301
+ end
268
302
  end
269
303
 
270
304
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -300,6 +334,22 @@ module Zernio
300
334
  invalid_properties.push('invalid value for "comment_reply_variations", number of items must be less than or equal to 5.')
301
335
  end
302
336
 
337
+ if !@dm_delay_seconds.nil? && @dm_delay_seconds > 86400
338
+ invalid_properties.push('invalid value for "dm_delay_seconds", must be smaller than or equal to 86400.')
339
+ end
340
+
341
+ if !@dm_delay_seconds.nil? && @dm_delay_seconds < 0
342
+ invalid_properties.push('invalid value for "dm_delay_seconds", must be greater than or equal to 0.')
343
+ end
344
+
345
+ if !@comment_reply_delay_seconds.nil? && @comment_reply_delay_seconds > 86400
346
+ invalid_properties.push('invalid value for "comment_reply_delay_seconds", must be smaller than or equal to 86400.')
347
+ end
348
+
349
+ if !@comment_reply_delay_seconds.nil? && @comment_reply_delay_seconds < 0
350
+ invalid_properties.push('invalid value for "comment_reply_delay_seconds", must be greater than or equal to 0.')
351
+ end
352
+
303
353
  invalid_properties
304
354
  end
305
355
 
@@ -318,6 +368,10 @@ module Zernio
318
368
  return false if !@buttons.nil? && @buttons.length > 3
319
369
  return false if !@dm_message_variations.nil? && @dm_message_variations.length > 5
320
370
  return false if !@comment_reply_variations.nil? && @comment_reply_variations.length > 5
371
+ return false if !@dm_delay_seconds.nil? && @dm_delay_seconds > 86400
372
+ return false if !@dm_delay_seconds.nil? && @dm_delay_seconds < 0
373
+ return false if !@comment_reply_delay_seconds.nil? && @comment_reply_delay_seconds > 86400
374
+ return false if !@comment_reply_delay_seconds.nil? && @comment_reply_delay_seconds < 0
321
375
  true
322
376
  end
323
377
 
@@ -423,6 +477,42 @@ module Zernio
423
477
  @comment_reply_variations = comment_reply_variations
424
478
  end
425
479
 
480
+ # Custom attribute writer method with validation
481
+ # @param [Object] dm_delay_seconds Value to be assigned
482
+ def dm_delay_seconds=(dm_delay_seconds)
483
+ if dm_delay_seconds.nil?
484
+ fail ArgumentError, 'dm_delay_seconds cannot be nil'
485
+ end
486
+
487
+ if dm_delay_seconds > 86400
488
+ fail ArgumentError, 'invalid value for "dm_delay_seconds", must be smaller than or equal to 86400.'
489
+ end
490
+
491
+ if dm_delay_seconds < 0
492
+ fail ArgumentError, 'invalid value for "dm_delay_seconds", must be greater than or equal to 0.'
493
+ end
494
+
495
+ @dm_delay_seconds = dm_delay_seconds
496
+ end
497
+
498
+ # Custom attribute writer method with validation
499
+ # @param [Object] comment_reply_delay_seconds Value to be assigned
500
+ def comment_reply_delay_seconds=(comment_reply_delay_seconds)
501
+ if comment_reply_delay_seconds.nil?
502
+ fail ArgumentError, 'comment_reply_delay_seconds cannot be nil'
503
+ end
504
+
505
+ if comment_reply_delay_seconds > 86400
506
+ fail ArgumentError, 'invalid value for "comment_reply_delay_seconds", must be smaller than or equal to 86400.'
507
+ end
508
+
509
+ if comment_reply_delay_seconds < 0
510
+ fail ArgumentError, 'invalid value for "comment_reply_delay_seconds", must be greater than or equal to 0.'
511
+ end
512
+
513
+ @comment_reply_delay_seconds = comment_reply_delay_seconds
514
+ end
515
+
426
516
  # Checks equality by comparing each attribute.
427
517
  # @param [Object] Object to be compared
428
518
  def ==(o)
@@ -445,7 +535,11 @@ module Zernio
445
535
  dm_message_variations == o.dm_message_variations &&
446
536
  comment_reply_variations == o.comment_reply_variations &&
447
537
  link_tracking == o.link_tracking &&
448
- click_tag == o.click_tag
538
+ click_tag == o.click_tag &&
539
+ dm_delay_seconds == o.dm_delay_seconds &&
540
+ comment_reply_delay_seconds == o.comment_reply_delay_seconds &&
541
+ audience == o.audience &&
542
+ follow_gate == o.follow_gate
449
543
  end
450
544
 
451
545
  # @see the `==` method
@@ -457,7 +551,7 @@ module Zernio
457
551
  # Calculates hash code according to all attributes.
458
552
  # @return [Integer] Hash code
459
553
  def hash
460
- [profile_id, account_id, trigger, platform_post_id, post_id, post_title, name, keywords, match_mode, exclude_keywords, typo_tolerance, dm_message, buttons, comment_reply, dm_message_variations, comment_reply_variations, link_tracking, click_tag].hash
554
+ [profile_id, account_id, trigger, platform_post_id, post_id, post_title, name, keywords, match_mode, exclude_keywords, typo_tolerance, dm_message, buttons, comment_reply, dm_message_variations, comment_reply_variations, link_tracking, click_tag, dm_delay_seconds, comment_reply_delay_seconds, audience, follow_gate].hash
461
555
  end
462
556
 
463
557
  # Builds the object from hash
@@ -59,6 +59,16 @@ module Zernio
59
59
 
60
60
  attr_accessor :click_tag
61
61
 
62
+ # Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
63
+ attr_accessor :dm_delay_seconds
64
+
65
+ # Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
66
+ attr_accessor :comment_reply_delay_seconds
67
+
68
+ attr_accessor :audience
69
+
70
+ attr_accessor :follow_gate
71
+
62
72
  attr_accessor :is_active
63
73
 
64
74
  attr_accessor :stats
@@ -111,6 +121,10 @@ module Zernio
111
121
  :'comment_reply_variations' => :'commentReplyVariations',
112
122
  :'link_tracking' => :'linkTracking',
113
123
  :'click_tag' => :'clickTag',
124
+ :'dm_delay_seconds' => :'dmDelaySeconds',
125
+ :'comment_reply_delay_seconds' => :'commentReplyDelaySeconds',
126
+ :'audience' => :'audience',
127
+ :'follow_gate' => :'followGate',
114
128
  :'is_active' => :'isActive',
115
129
  :'stats' => :'stats',
116
130
  :'created_at' => :'createdAt',
@@ -150,6 +164,10 @@ module Zernio
150
164
  :'comment_reply_variations' => :'Array<String>',
151
165
  :'link_tracking' => :'Boolean',
152
166
  :'click_tag' => :'String',
167
+ :'dm_delay_seconds' => :'Integer',
168
+ :'comment_reply_delay_seconds' => :'Integer',
169
+ :'audience' => :'CommentAutomationAudience',
170
+ :'follow_gate' => :'CommentAutomationFollowGate',
153
171
  :'is_active' => :'Boolean',
154
172
  :'stats' => :'CreateCommentAutomation200ResponseAutomationStats',
155
173
  :'created_at' => :'Time',
@@ -265,6 +283,22 @@ module Zernio
265
283
  self.click_tag = attributes[:'click_tag']
266
284
  end
267
285
 
286
+ if attributes.key?(:'dm_delay_seconds')
287
+ self.dm_delay_seconds = attributes[:'dm_delay_seconds']
288
+ end
289
+
290
+ if attributes.key?(:'comment_reply_delay_seconds')
291
+ self.comment_reply_delay_seconds = attributes[:'comment_reply_delay_seconds']
292
+ end
293
+
294
+ if attributes.key?(:'audience')
295
+ self.audience = attributes[:'audience']
296
+ end
297
+
298
+ if attributes.key?(:'follow_gate')
299
+ self.follow_gate = attributes[:'follow_gate']
300
+ end
301
+
268
302
  if attributes.key?(:'is_active')
269
303
  self.is_active = attributes[:'is_active']
270
304
  end
@@ -345,6 +379,10 @@ module Zernio
345
379
  comment_reply_variations == o.comment_reply_variations &&
346
380
  link_tracking == o.link_tracking &&
347
381
  click_tag == o.click_tag &&
382
+ dm_delay_seconds == o.dm_delay_seconds &&
383
+ comment_reply_delay_seconds == o.comment_reply_delay_seconds &&
384
+ audience == o.audience &&
385
+ follow_gate == o.follow_gate &&
348
386
  is_active == o.is_active &&
349
387
  stats == o.stats &&
350
388
  created_at == o.created_at &&
@@ -360,7 +398,7 @@ module Zernio
360
398
  # Calculates hash code according to all attributes.
361
399
  # @return [Integer] Hash code
362
400
  def hash
363
- [id, name, platform, trigger, account_id, platform_post_id, post_id, post_title, keywords, match_mode, exclude_keywords, typo_tolerance, dm_message, buttons, comment_reply, dm_message_variations, comment_reply_variations, link_tracking, click_tag, is_active, stats, created_at, updated_at].hash
401
+ [id, name, platform, trigger, account_id, platform_post_id, post_id, post_title, keywords, match_mode, exclude_keywords, typo_tolerance, dm_message, buttons, comment_reply, dm_message_variations, comment_reply_variations, link_tracking, click_tag, dm_delay_seconds, comment_reply_delay_seconds, audience, follow_gate, is_active, stats, created_at, updated_at].hash
364
402
  end
365
403
 
366
404
  # Builds the object from hash
@@ -25,9 +25,17 @@ module Zernio
25
25
 
26
26
  attr_accessor :comment_text
27
27
 
28
- # DM outcome
28
+ # DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
29
29
  attr_accessor :status
30
30
 
31
+ # How the audience rule resolved. Absent on automations without one.
32
+ attr_accessor :audience_outcome
33
+
34
+ # Follow relationship at decision time. Absent when Instagram would not tell us (the commenter never messaged the account).
35
+ attr_accessor :commenter_is_follower
36
+
37
+ attr_accessor :commenter_follower_count
38
+
31
39
  # DM error message if status is failed
32
40
  attr_accessor :error
33
41
 
@@ -37,6 +45,9 @@ module Zernio
37
45
  # Public-reply error message if commentReplyStatus is failed
38
46
  attr_accessor :comment_reply_error
39
47
 
48
+ # When the next queued send fires. Present only while something is still pending.
49
+ attr_accessor :next_due_at
50
+
40
51
  attr_accessor :created_at
41
52
 
42
53
  class EnumAttributeValidator
@@ -70,9 +81,13 @@ module Zernio
70
81
  :'commenter_name' => :'commenterName',
71
82
  :'comment_text' => :'commentText',
72
83
  :'status' => :'status',
84
+ :'audience_outcome' => :'audienceOutcome',
85
+ :'commenter_is_follower' => :'commenterIsFollower',
86
+ :'commenter_follower_count' => :'commenterFollowerCount',
73
87
  :'error' => :'error',
74
88
  :'comment_reply_status' => :'commentReplyStatus',
75
89
  :'comment_reply_error' => :'commentReplyError',
90
+ :'next_due_at' => :'nextDueAt',
76
91
  :'created_at' => :'createdAt'
77
92
  }
78
93
  end
@@ -96,9 +111,13 @@ module Zernio
96
111
  :'commenter_name' => :'String',
97
112
  :'comment_text' => :'String',
98
113
  :'status' => :'String',
114
+ :'audience_outcome' => :'String',
115
+ :'commenter_is_follower' => :'Boolean',
116
+ :'commenter_follower_count' => :'Integer',
99
117
  :'error' => :'String',
100
118
  :'comment_reply_status' => :'String',
101
119
  :'comment_reply_error' => :'String',
120
+ :'next_due_at' => :'Time',
102
121
  :'created_at' => :'Time'
103
122
  }
104
123
  end
@@ -149,6 +168,18 @@ module Zernio
149
168
  self.status = attributes[:'status']
150
169
  end
151
170
 
171
+ if attributes.key?(:'audience_outcome')
172
+ self.audience_outcome = attributes[:'audience_outcome']
173
+ end
174
+
175
+ if attributes.key?(:'commenter_is_follower')
176
+ self.commenter_is_follower = attributes[:'commenter_is_follower']
177
+ end
178
+
179
+ if attributes.key?(:'commenter_follower_count')
180
+ self.commenter_follower_count = attributes[:'commenter_follower_count']
181
+ end
182
+
152
183
  if attributes.key?(:'error')
153
184
  self.error = attributes[:'error']
154
185
  end
@@ -161,6 +192,10 @@ module Zernio
161
192
  self.comment_reply_error = attributes[:'comment_reply_error']
162
193
  end
163
194
 
195
+ if attributes.key?(:'next_due_at')
196
+ self.next_due_at = attributes[:'next_due_at']
197
+ end
198
+
164
199
  if attributes.key?(:'created_at')
165
200
  self.created_at = attributes[:'created_at']
166
201
  end
@@ -178,8 +213,10 @@ module Zernio
178
213
  # @return true if the model is valid
179
214
  def valid?
180
215
  warn '[DEPRECATED] the `valid?` method is obsolete'
181
- status_validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped"])
216
+ status_validator = EnumAttributeValidator.new('String', ["pending", "sent", "failed", "skipped", "gated"])
182
217
  return false unless status_validator.valid?(@status)
218
+ audience_outcome_validator = EnumAttributeValidator.new('String', ["passed", "blocked", "gate_sent", "gate_passed", "gate_failed"])
219
+ return false unless audience_outcome_validator.valid?(@audience_outcome)
183
220
  comment_reply_status_validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped"])
184
221
  return false unless comment_reply_status_validator.valid?(@comment_reply_status)
185
222
  true
@@ -188,13 +225,23 @@ module Zernio
188
225
  # Custom attribute writer method checking allowed values (enum).
189
226
  # @param [Object] status Object to be assigned
190
227
  def status=(status)
191
- validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped"])
228
+ validator = EnumAttributeValidator.new('String', ["pending", "sent", "failed", "skipped", "gated"])
192
229
  unless validator.valid?(status)
193
230
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
194
231
  end
195
232
  @status = status
196
233
  end
197
234
 
235
+ # Custom attribute writer method checking allowed values (enum).
236
+ # @param [Object] audience_outcome Object to be assigned
237
+ def audience_outcome=(audience_outcome)
238
+ validator = EnumAttributeValidator.new('String', ["passed", "blocked", "gate_sent", "gate_passed", "gate_failed"])
239
+ unless validator.valid?(audience_outcome)
240
+ fail ArgumentError, "invalid value for \"audience_outcome\", must be one of #{validator.allowable_values}."
241
+ end
242
+ @audience_outcome = audience_outcome
243
+ end
244
+
198
245
  # Custom attribute writer method checking allowed values (enum).
199
246
  # @param [Object] comment_reply_status Object to be assigned
200
247
  def comment_reply_status=(comment_reply_status)
@@ -216,9 +263,13 @@ module Zernio
216
263
  commenter_name == o.commenter_name &&
217
264
  comment_text == o.comment_text &&
218
265
  status == o.status &&
266
+ audience_outcome == o.audience_outcome &&
267
+ commenter_is_follower == o.commenter_is_follower &&
268
+ commenter_follower_count == o.commenter_follower_count &&
219
269
  error == o.error &&
220
270
  comment_reply_status == o.comment_reply_status &&
221
271
  comment_reply_error == o.comment_reply_error &&
272
+ next_due_at == o.next_due_at &&
222
273
  created_at == o.created_at
223
274
  end
224
275
 
@@ -231,7 +282,7 @@ module Zernio
231
282
  # Calculates hash code according to all attributes.
232
283
  # @return [Integer] Hash code
233
284
  def hash
234
- [id, comment_id, commenter_id, commenter_name, comment_text, status, error, comment_reply_status, comment_reply_error, created_at].hash
285
+ [id, comment_id, commenter_id, commenter_name, comment_text, status, audience_outcome, commenter_is_follower, commenter_follower_count, error, comment_reply_status, comment_reply_error, next_due_at, created_at].hash
235
286
  end
236
287
 
237
288
  # Builds the object from hash
@@ -0,0 +1,299 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetInstagramFollowStatus200Response < ApiModelBase
18
+ attr_accessor :user_id
19
+
20
+ attr_accessor :account_id
21
+
22
+ # The user follows this account. Null = unknown, never \"no\".
23
+ attr_accessor :is_follower
24
+
25
+ # This account follows the user.
26
+ attr_accessor :is_followed_by_account
27
+
28
+ attr_accessor :follower_count
29
+
30
+ attr_accessor :is_verified
31
+
32
+ attr_accessor :username
33
+
34
+ attr_accessor :name
35
+
36
+ # Why the follow relationship could not be resolved. Null when it was.
37
+ attr_accessor :unavailable_reason
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'user_id' => :'userId',
65
+ :'account_id' => :'accountId',
66
+ :'is_follower' => :'isFollower',
67
+ :'is_followed_by_account' => :'isFollowedByAccount',
68
+ :'follower_count' => :'followerCount',
69
+ :'is_verified' => :'isVerified',
70
+ :'username' => :'username',
71
+ :'name' => :'name',
72
+ :'unavailable_reason' => :'unavailableReason'
73
+ }
74
+ end
75
+
76
+ # Returns attribute mapping this model knows about
77
+ def self.acceptable_attribute_map
78
+ attribute_map
79
+ end
80
+
81
+ # Returns all the JSON keys this model knows about
82
+ def self.acceptable_attributes
83
+ acceptable_attribute_map.values
84
+ end
85
+
86
+ # Attribute type mapping.
87
+ def self.openapi_types
88
+ {
89
+ :'user_id' => :'String',
90
+ :'account_id' => :'String',
91
+ :'is_follower' => :'Boolean',
92
+ :'is_followed_by_account' => :'Boolean',
93
+ :'follower_count' => :'Integer',
94
+ :'is_verified' => :'Boolean',
95
+ :'username' => :'String',
96
+ :'name' => :'String',
97
+ :'unavailable_reason' => :'String'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ :'is_follower',
105
+ :'is_followed_by_account',
106
+ :'follower_count',
107
+ :'is_verified',
108
+ :'username',
109
+ :'name',
110
+ :'unavailable_reason'
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetInstagramFollowStatus200Response` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ acceptable_attribute_map = self.class.acceptable_attribute_map
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!acceptable_attribute_map.key?(k.to_sym))
125
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetInstagramFollowStatus200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
126
+ end
127
+ h[k.to_sym] = v
128
+ }
129
+
130
+ if attributes.key?(:'user_id')
131
+ self.user_id = attributes[:'user_id']
132
+ else
133
+ self.user_id = nil
134
+ end
135
+
136
+ if attributes.key?(:'account_id')
137
+ self.account_id = attributes[:'account_id']
138
+ else
139
+ self.account_id = nil
140
+ end
141
+
142
+ if attributes.key?(:'is_follower')
143
+ self.is_follower = attributes[:'is_follower']
144
+ else
145
+ self.is_follower = nil
146
+ end
147
+
148
+ if attributes.key?(:'is_followed_by_account')
149
+ self.is_followed_by_account = attributes[:'is_followed_by_account']
150
+ end
151
+
152
+ if attributes.key?(:'follower_count')
153
+ self.follower_count = attributes[:'follower_count']
154
+ end
155
+
156
+ if attributes.key?(:'is_verified')
157
+ self.is_verified = attributes[:'is_verified']
158
+ end
159
+
160
+ if attributes.key?(:'username')
161
+ self.username = attributes[:'username']
162
+ end
163
+
164
+ if attributes.key?(:'name')
165
+ self.name = attributes[:'name']
166
+ end
167
+
168
+ if attributes.key?(:'unavailable_reason')
169
+ self.unavailable_reason = attributes[:'unavailable_reason']
170
+ end
171
+ end
172
+
173
+ # Show invalid properties with the reasons. Usually used together with valid?
174
+ # @return Array for valid properties with the reasons
175
+ def list_invalid_properties
176
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
177
+ invalid_properties = Array.new
178
+ if @user_id.nil?
179
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
180
+ end
181
+
182
+ if @account_id.nil?
183
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
184
+ end
185
+
186
+ invalid_properties
187
+ end
188
+
189
+ # Check to see if the all the properties in the model are valid
190
+ # @return true if the model is valid
191
+ def valid?
192
+ warn '[DEPRECATED] the `valid?` method is obsolete'
193
+ return false if @user_id.nil?
194
+ return false if @account_id.nil?
195
+ unavailable_reason_validator = EnumAttributeValidator.new('String', ["consent_required", "dm_access_disabled", "not_messageable", "error"])
196
+ return false unless unavailable_reason_validator.valid?(@unavailable_reason)
197
+ true
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] user_id Value to be assigned
202
+ def user_id=(user_id)
203
+ if user_id.nil?
204
+ fail ArgumentError, 'user_id cannot be nil'
205
+ end
206
+
207
+ @user_id = user_id
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] account_id Value to be assigned
212
+ def account_id=(account_id)
213
+ if account_id.nil?
214
+ fail ArgumentError, 'account_id cannot be nil'
215
+ end
216
+
217
+ @account_id = account_id
218
+ end
219
+
220
+ # Custom attribute writer method checking allowed values (enum).
221
+ # @param [Object] unavailable_reason Object to be assigned
222
+ def unavailable_reason=(unavailable_reason)
223
+ validator = EnumAttributeValidator.new('String', ["consent_required", "dm_access_disabled", "not_messageable", "error"])
224
+ unless validator.valid?(unavailable_reason)
225
+ fail ArgumentError, "invalid value for \"unavailable_reason\", must be one of #{validator.allowable_values}."
226
+ end
227
+ @unavailable_reason = unavailable_reason
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ user_id == o.user_id &&
236
+ account_id == o.account_id &&
237
+ is_follower == o.is_follower &&
238
+ is_followed_by_account == o.is_followed_by_account &&
239
+ follower_count == o.follower_count &&
240
+ is_verified == o.is_verified &&
241
+ username == o.username &&
242
+ name == o.name &&
243
+ unavailable_reason == o.unavailable_reason
244
+ end
245
+
246
+ # @see the `==` method
247
+ # @param [Object] Object to be compared
248
+ def eql?(o)
249
+ self == o
250
+ end
251
+
252
+ # Calculates hash code according to all attributes.
253
+ # @return [Integer] Hash code
254
+ def hash
255
+ [user_id, account_id, is_follower, is_followed_by_account, follower_count, is_verified, username, name, unavailable_reason].hash
256
+ end
257
+
258
+ # Builds the object from hash
259
+ # @param [Hash] attributes Model attributes in the form of hash
260
+ # @return [Object] Returns the model itself
261
+ def self.build_from_hash(attributes)
262
+ return nil unless attributes.is_a?(Hash)
263
+ attributes = attributes.transform_keys(&:to_sym)
264
+ transformed_hash = {}
265
+ openapi_types.each_pair do |key, type|
266
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
267
+ transformed_hash["#{key}"] = nil
268
+ elsif type =~ /\AArray<(.*)>/i
269
+ # check to ensure the input is an array given that the attribute
270
+ # is documented as an array but the input is not
271
+ if attributes[attribute_map[key]].is_a?(Array)
272
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
273
+ end
274
+ elsif !attributes[attribute_map[key]].nil?
275
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
276
+ end
277
+ end
278
+ new(transformed_hash)
279
+ end
280
+
281
+ # Returns the object in the form of hash
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_hash
284
+ hash = {}
285
+ self.class.attribute_map.each_pair do |attr, param|
286
+ value = self.send(attr)
287
+ if value.nil?
288
+ is_nullable = self.class.openapi_nullable.include?(attr)
289
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
290
+ end
291
+
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ end
298
+
299
+ end