late-sdk 0.0.683 → 0.0.685

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -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 +1 -1
  7. data/docs/CreateCommentAutomation200ResponseAutomation.md +4 -0
  8. data/docs/CreateCommentAutomationRequest.md +5 -1
  9. data/docs/GetCommentAutomation200ResponseAutomation.md +4 -0
  10. data/docs/GetCommentAutomation200ResponseLogsInner.md +7 -1
  11. data/docs/GetInstagramFollowStatus200Response.md +34 -0
  12. data/docs/ListCommentAutomationLogs200Response.md +3 -1
  13. data/docs/ListCommentAutomationLogs200ResponseMisses.md +22 -0
  14. data/docs/ListCommentAutomationLogs200ResponseMissesSamplesInner.md +24 -0
  15. data/docs/UpdateCommentAutomation200ResponseAutomation.md +4 -0
  16. data/docs/UpdateCommentAutomationRequest.md +4 -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 +15 -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/create_comment_automation200_response_automation.rb +19 -1
  24. data/lib/zernio-sdk/models/create_comment_automation_request.rb +22 -4
  25. data/lib/zernio-sdk/models/get_comment_automation200_response_automation.rb +19 -1
  26. data/lib/zernio-sdk/models/get_comment_automation200_response_logs_inner.rb +45 -4
  27. data/lib/zernio-sdk/models/get_instagram_follow_status200_response.rb +299 -0
  28. data/lib/zernio-sdk/models/list_comment_automation_logs200_response.rb +13 -4
  29. data/lib/zernio-sdk/models/list_comment_automation_logs200_response_misses.rb +171 -0
  30. data/lib/zernio-sdk/models/list_comment_automation_logs200_response_misses_samples_inner.rb +175 -0
  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 +19 -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 +6 -0
  37. data/openapi.yaml +181 -5
  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/create_comment_automation200_response_automation_spec.rb +12 -0
  43. data/spec/models/create_comment_automation_request_spec.rb +12 -0
  44. data/spec/models/get_comment_automation200_response_automation_spec.rb +12 -0
  45. data/spec/models/get_comment_automation200_response_logs_inner_spec.rb +23 -1
  46. data/spec/models/get_instagram_follow_status200_response_spec.rb +88 -0
  47. data/spec/models/list_comment_automation_logs200_response_misses_samples_inner_spec.rb +54 -0
  48. data/spec/models/list_comment_automation_logs200_response_misses_spec.rb +48 -0
  49. data/spec/models/list_comment_automation_logs200_response_spec.rb +6 -0
  50. data/spec/models/update_comment_automation200_response_automation_spec.rb +12 -0
  51. data/spec/models/update_comment_automation_request_spec.rb +12 -0
  52. data/spec/models/webhook_payload_comment_comment_author_instagram_profile_spec.rb +54 -0
  53. data/spec/models/webhook_payload_comment_comment_author_spec.rb +6 -0
  54. data/zernio-sdk-0.0.685.gem +0 -0
  55. metadata +26 -2
  56. data/zernio-sdk-0.0.683.gem +0 -0
@@ -25,9 +25,17 @@ module Zernio
25
25
 
26
26
  attr_accessor :comment_text
27
27
 
28
- # DM outcome
28
+ # DM outcome. '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
 
@@ -70,6 +78,9 @@ module Zernio
70
78
  :'commenter_name' => :'commenterName',
71
79
  :'comment_text' => :'commentText',
72
80
  :'status' => :'status',
81
+ :'audience_outcome' => :'audienceOutcome',
82
+ :'commenter_is_follower' => :'commenterIsFollower',
83
+ :'commenter_follower_count' => :'commenterFollowerCount',
73
84
  :'error' => :'error',
74
85
  :'comment_reply_status' => :'commentReplyStatus',
75
86
  :'comment_reply_error' => :'commentReplyError',
@@ -96,6 +107,9 @@ module Zernio
96
107
  :'commenter_name' => :'String',
97
108
  :'comment_text' => :'String',
98
109
  :'status' => :'String',
110
+ :'audience_outcome' => :'String',
111
+ :'commenter_is_follower' => :'Boolean',
112
+ :'commenter_follower_count' => :'Integer',
99
113
  :'error' => :'String',
100
114
  :'comment_reply_status' => :'String',
101
115
  :'comment_reply_error' => :'String',
@@ -149,6 +163,18 @@ module Zernio
149
163
  self.status = attributes[:'status']
150
164
  end
151
165
 
166
+ if attributes.key?(:'audience_outcome')
167
+ self.audience_outcome = attributes[:'audience_outcome']
168
+ end
169
+
170
+ if attributes.key?(:'commenter_is_follower')
171
+ self.commenter_is_follower = attributes[:'commenter_is_follower']
172
+ end
173
+
174
+ if attributes.key?(:'commenter_follower_count')
175
+ self.commenter_follower_count = attributes[:'commenter_follower_count']
176
+ end
177
+
152
178
  if attributes.key?(:'error')
153
179
  self.error = attributes[:'error']
154
180
  end
@@ -178,8 +204,10 @@ module Zernio
178
204
  # @return true if the model is valid
179
205
  def valid?
180
206
  warn '[DEPRECATED] the `valid?` method is obsolete'
181
- status_validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped"])
207
+ status_validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped", "gated"])
182
208
  return false unless status_validator.valid?(@status)
209
+ audience_outcome_validator = EnumAttributeValidator.new('String', ["passed", "blocked", "gate_sent", "gate_passed", "gate_failed"])
210
+ return false unless audience_outcome_validator.valid?(@audience_outcome)
183
211
  comment_reply_status_validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped"])
184
212
  return false unless comment_reply_status_validator.valid?(@comment_reply_status)
185
213
  true
@@ -188,13 +216,23 @@ module Zernio
188
216
  # Custom attribute writer method checking allowed values (enum).
189
217
  # @param [Object] status Object to be assigned
190
218
  def status=(status)
191
- validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped"])
219
+ validator = EnumAttributeValidator.new('String', ["sent", "failed", "skipped", "gated"])
192
220
  unless validator.valid?(status)
193
221
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
194
222
  end
195
223
  @status = status
196
224
  end
197
225
 
226
+ # Custom attribute writer method checking allowed values (enum).
227
+ # @param [Object] audience_outcome Object to be assigned
228
+ def audience_outcome=(audience_outcome)
229
+ validator = EnumAttributeValidator.new('String', ["passed", "blocked", "gate_sent", "gate_passed", "gate_failed"])
230
+ unless validator.valid?(audience_outcome)
231
+ fail ArgumentError, "invalid value for \"audience_outcome\", must be one of #{validator.allowable_values}."
232
+ end
233
+ @audience_outcome = audience_outcome
234
+ end
235
+
198
236
  # Custom attribute writer method checking allowed values (enum).
199
237
  # @param [Object] comment_reply_status Object to be assigned
200
238
  def comment_reply_status=(comment_reply_status)
@@ -216,6 +254,9 @@ module Zernio
216
254
  commenter_name == o.commenter_name &&
217
255
  comment_text == o.comment_text &&
218
256
  status == o.status &&
257
+ audience_outcome == o.audience_outcome &&
258
+ commenter_is_follower == o.commenter_is_follower &&
259
+ commenter_follower_count == o.commenter_follower_count &&
219
260
  error == o.error &&
220
261
  comment_reply_status == o.comment_reply_status &&
221
262
  comment_reply_error == o.comment_reply_error &&
@@ -231,7 +272,7 @@ module Zernio
231
272
  # Calculates hash code according to all attributes.
232
273
  # @return [Integer] Hash code
233
274
  def hash
234
- [id, comment_id, commenter_id, commenter_name, comment_text, status, error, comment_reply_status, comment_reply_error, created_at].hash
275
+ [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, created_at].hash
235
276
  end
236
277
 
237
278
  # 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
@@ -21,12 +21,15 @@ module Zernio
21
21
 
22
22
  attr_accessor :pagination
23
23
 
24
+ attr_accessor :misses
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'success' => :'success',
28
30
  :'logs' => :'logs',
29
- :'pagination' => :'pagination'
31
+ :'pagination' => :'pagination',
32
+ :'misses' => :'misses'
30
33
  }
31
34
  end
32
35
 
@@ -45,7 +48,8 @@ module Zernio
45
48
  {
46
49
  :'success' => :'Boolean',
47
50
  :'logs' => :'Array<GetCommentAutomation200ResponseLogsInner>',
48
- :'pagination' => :'ListContacts200ResponsePagination'
51
+ :'pagination' => :'ListContacts200ResponsePagination',
52
+ :'misses' => :'ListCommentAutomationLogs200ResponseMisses'
49
53
  }
50
54
  end
51
55
 
@@ -84,6 +88,10 @@ module Zernio
84
88
  if attributes.key?(:'pagination')
85
89
  self.pagination = attributes[:'pagination']
86
90
  end
91
+
92
+ if attributes.key?(:'misses')
93
+ self.misses = attributes[:'misses']
94
+ end
87
95
  end
88
96
 
89
97
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -108,7 +116,8 @@ module Zernio
108
116
  self.class == o.class &&
109
117
  success == o.success &&
110
118
  logs == o.logs &&
111
- pagination == o.pagination
119
+ pagination == o.pagination &&
120
+ misses == o.misses
112
121
  end
113
122
 
114
123
  # @see the `==` method
@@ -120,7 +129,7 @@ module Zernio
120
129
  # Calculates hash code according to all attributes.
121
130
  # @return [Integer] Hash code
122
131
  def hash
123
- [success, logs, pagination].hash
132
+ [success, logs, pagination, misses].hash
124
133
  end
125
134
 
126
135
  # Builds the object from hash
@@ -0,0 +1,171 @@
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
+ # Comments that reached this automation but matched none of its keywords. These produce no log entry, so this is the only signal that a keyword is catching nothing. Retained for a short window, then dropped.
18
+ class ListCommentAutomationLogs200ResponseMisses < ApiModelBase
19
+ # Number of non-matching comments in the retention window
20
+ attr_accessor :total
21
+
22
+ # How many days of non-matching comments the total covers
23
+ attr_accessor :retention_days
24
+
25
+ # A few of the most recent non-matching comments, for diagnosing a keyword setup.
26
+ attr_accessor :samples
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'total' => :'total',
32
+ :'retention_days' => :'retentionDays',
33
+ :'samples' => :'samples'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'total' => :'Integer',
51
+ :'retention_days' => :'Integer',
52
+ :'samples' => :'Array<ListCommentAutomationLogs200ResponseMissesSamplesInner>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListCommentAutomationLogs200ResponseMisses` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListCommentAutomationLogs200ResponseMisses`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'total')
79
+ self.total = attributes[:'total']
80
+ end
81
+
82
+ if attributes.key?(:'retention_days')
83
+ self.retention_days = attributes[:'retention_days']
84
+ end
85
+
86
+ if attributes.key?(:'samples')
87
+ if (value = attributes[:'samples']).is_a?(Array)
88
+ self.samples = value
89
+ end
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ total == o.total &&
114
+ retention_days == o.retention_days &&
115
+ samples == o.samples
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [total, retention_days, samples].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ transformed_hash = {}
137
+ openapi_types.each_pair do |key, type|
138
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = nil
140
+ elsif type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[attribute_map[key]].is_a?(Array)
144
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
145
+ end
146
+ elsif !attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
+ end
149
+ end
150
+ new(transformed_hash)
151
+ end
152
+
153
+ # Returns the object in the form of hash
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_hash
156
+ hash = {}
157
+ self.class.attribute_map.each_pair do |attr, param|
158
+ value = self.send(attr)
159
+ if value.nil?
160
+ is_nullable = self.class.openapi_nullable.include?(attr)
161
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
162
+ end
163
+
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ end
170
+
171
+ end