falaai-api 1.21.47

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 (130) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +205 -0
  4. data/docs/AnalysisApi.md +147 -0
  5. data/docs/AudioEvent.md +26 -0
  6. data/docs/AudioInputMeta.md +26 -0
  7. data/docs/AuditoriaRiscoAnalysisV2.md +22 -0
  8. data/docs/AuditoriaRiscoAppliedActionV2.md +32 -0
  9. data/docs/AuditoriaRiscoAudioEventModelV2.md +22 -0
  10. data/docs/AuditoriaRiscoAuditDecisionsV2.md +22 -0
  11. data/docs/AuditoriaRiscoConversationScoresV2.md +38 -0
  12. data/docs/AuditoriaRiscoDetectionItemV2.md +110 -0
  13. data/docs/AuditoriaRiscoDetectionsV2.md +26 -0
  14. data/docs/AuditoriaRiscoIndexerV2.md +18 -0
  15. data/docs/AuditoriaRiscoMetaV2.md +28 -0
  16. data/docs/AuditoriaRiscoParticipantV2.md +22 -0
  17. data/docs/AuditoriaRiscoParticipantsV2.md +26 -0
  18. data/docs/AuditoriaRiscoRequest.md +38 -0
  19. data/docs/AuditoriaRiscoScoresV2.md +20 -0
  20. data/docs/AuditoriaRiscoScoringExplanationV2.md +20 -0
  21. data/docs/AuditoriaRiscoSummaryV2.md +48 -0
  22. data/docs/AuditoriaRiscoTimelineV2.md +22 -0
  23. data/docs/AuditoriaRiscoUsageV2.md +22 -0
  24. data/docs/AuditoriaRiscoV2.md +46 -0
  25. data/docs/AuditoriaRiscoV2Response.md +18 -0
  26. data/docs/AuditoriaRiscoVerdictV2.md +30 -0
  27. data/docs/CreateEmailAlertRequest.md +22 -0
  28. data/docs/CreateWebhookRequest.md +24 -0
  29. data/docs/DiagnosticAnalysisMap.md +28 -0
  30. data/docs/DiagnosticAudioEvent.md +26 -0
  31. data/docs/DiagnosticCategoricalAnalysis.md +22 -0
  32. data/docs/DiagnosticRequest.md +30 -0
  33. data/docs/DiagnosticResponse.md +28 -0
  34. data/docs/DiagnosticTextAnalysis.md +18 -0
  35. data/docs/DiagnosticUsage.md +22 -0
  36. data/docs/EmailAlertItem.md +32 -0
  37. data/docs/EmailAlertListResponse.md +22 -0
  38. data/docs/EmailAlertMessageResponse.md +18 -0
  39. data/docs/EmailAlertsApi.md +285 -0
  40. data/docs/EmailEvent.md +15 -0
  41. data/docs/HTTPValidationError.md +18 -0
  42. data/docs/HealthApi.md +137 -0
  43. data/docs/HealthResponse.md +28 -0
  44. data/docs/LocationInner.md +15 -0
  45. data/docs/MessageResponse.md +18 -0
  46. data/docs/Participant.md +22 -0
  47. data/docs/ParticipantDiagnostic.md +26 -0
  48. data/docs/SpeechApi.md +85 -0
  49. data/docs/TranscriptionResponse.md +49 -0
  50. data/docs/TranscriptionUsage.md +22 -0
  51. data/docs/UpdateEmailAlertRequest.md +24 -0
  52. data/docs/UpdateWebhookRequest.md +26 -0
  53. data/docs/UsageApi.md +151 -0
  54. data/docs/UsageByKeyItem.md +26 -0
  55. data/docs/UsageLogItem.md +28 -0
  56. data/docs/UsageLogResponse.md +22 -0
  57. data/docs/ValidationError.md +26 -0
  58. data/docs/VersionApi.md +72 -0
  59. data/docs/VersionResponse.md +22 -0
  60. data/docs/WebhookEvent.md +15 -0
  61. data/docs/WebhookItem.md +42 -0
  62. data/docs/WebhookListResponse.md +22 -0
  63. data/docs/WebhooksApi.md +293 -0
  64. data/lib/falaai-api/api/analysis_api.rb +158 -0
  65. data/lib/falaai-api/api/email_alerts_api.rb +294 -0
  66. data/lib/falaai-api/api/health_api.rb +132 -0
  67. data/lib/falaai-api/api/speech_api.rb +100 -0
  68. data/lib/falaai-api/api/usage_api.rb +156 -0
  69. data/lib/falaai-api/api/version_api.rb +77 -0
  70. data/lib/falaai-api/api/webhooks_api.rb +302 -0
  71. data/lib/falaai-api/api_client.rb +397 -0
  72. data/lib/falaai-api/api_error.rb +58 -0
  73. data/lib/falaai-api/api_model_base.rb +88 -0
  74. data/lib/falaai-api/configuration.rb +309 -0
  75. data/lib/falaai-api/models/audio_event.rb +273 -0
  76. data/lib/falaai-api/models/audio_input_meta.rb +273 -0
  77. data/lib/falaai-api/models/auditoria_risco_analysis_v2.rb +174 -0
  78. data/lib/falaai-api/models/auditoria_risco_applied_action_v2.rb +292 -0
  79. data/lib/falaai-api/models/auditoria_risco_audio_event_model_v2.rb +174 -0
  80. data/lib/falaai-api/models/auditoria_risco_audit_decisions_v2.rb +170 -0
  81. data/lib/falaai-api/models/auditoria_risco_conversation_scores_v2.rb +251 -0
  82. data/lib/falaai-api/models/auditoria_risco_detection_item_v2.rb +651 -0
  83. data/lib/falaai-api/models/auditoria_risco_detections_v2.rb +198 -0
  84. data/lib/falaai-api/models/auditoria_risco_indexer_v2.rb +150 -0
  85. data/lib/falaai-api/models/auditoria_risco_meta_v2.rb +234 -0
  86. data/lib/falaai-api/models/auditoria_risco_participant_v2.rb +168 -0
  87. data/lib/falaai-api/models/auditoria_risco_participants_v2.rb +196 -0
  88. data/lib/falaai-api/models/auditoria_risco_request.rb +451 -0
  89. data/lib/falaai-api/models/auditoria_risco_scores_v2.rb +177 -0
  90. data/lib/falaai-api/models/auditoria_risco_scoring_explanation_v2.rb +160 -0
  91. data/lib/falaai-api/models/auditoria_risco_summary_v2.rb +300 -0
  92. data/lib/falaai-api/models/auditoria_risco_timeline_v2.rb +174 -0
  93. data/lib/falaai-api/models/auditoria_risco_usage_v2.rb +219 -0
  94. data/lib/falaai-api/models/auditoria_risco_v2.rb +548 -0
  95. data/lib/falaai-api/models/auditoria_risco_v2_response.rb +165 -0
  96. data/lib/falaai-api/models/auditoria_risco_verdict_v2.rb +213 -0
  97. data/lib/falaai-api/models/create_email_alert_request.rb +221 -0
  98. data/lib/falaai-api/models/create_webhook_request.rb +233 -0
  99. data/lib/falaai-api/models/diagnostic_analysis_map.rb +285 -0
  100. data/lib/falaai-api/models/diagnostic_audio_event.rb +205 -0
  101. data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +170 -0
  102. data/lib/falaai-api/models/diagnostic_request.rb +316 -0
  103. data/lib/falaai-api/models/diagnostic_response.rb +283 -0
  104. data/lib/falaai-api/models/diagnostic_text_analysis.rb +148 -0
  105. data/lib/falaai-api/models/diagnostic_usage.rb +219 -0
  106. data/lib/falaai-api/models/email_alert_item.rb +356 -0
  107. data/lib/falaai-api/models/email_alert_list_response.rb +218 -0
  108. data/lib/falaai-api/models/email_alert_message_response.rb +165 -0
  109. data/lib/falaai-api/models/email_event.rb +47 -0
  110. data/lib/falaai-api/models/health_response.rb +300 -0
  111. data/lib/falaai-api/models/http_validation_error.rb +149 -0
  112. data/lib/falaai-api/models/location_inner.rb +103 -0
  113. data/lib/falaai-api/models/message_response.rb +165 -0
  114. data/lib/falaai-api/models/participant.rb +226 -0
  115. data/lib/falaai-api/models/participant_diagnostic.rb +222 -0
  116. data/lib/falaai-api/models/transcription_response.rb +540 -0
  117. data/lib/falaai-api/models/transcription_usage.rb +219 -0
  118. data/lib/falaai-api/models/update_email_alert_request.rb +176 -0
  119. data/lib/falaai-api/models/update_webhook_request.rb +190 -0
  120. data/lib/falaai-api/models/usage_by_key_item.rb +256 -0
  121. data/lib/falaai-api/models/usage_log_item.rb +300 -0
  122. data/lib/falaai-api/models/usage_log_response.rb +218 -0
  123. data/lib/falaai-api/models/validation_error.rb +237 -0
  124. data/lib/falaai-api/models/version_response.rb +219 -0
  125. data/lib/falaai-api/models/webhook_event.rb +48 -0
  126. data/lib/falaai-api/models/webhook_item.rb +442 -0
  127. data/lib/falaai-api/models/webhook_list_response.rb +218 -0
  128. data/lib/falaai-api/version.rb +15 -0
  129. data/lib/falaai-api.rb +100 -0
  130. metadata +229 -0
@@ -0,0 +1,48 @@
1
+ =begin
2
+ #FalaAI API
3
+
4
+ #Transcribe, diagnose and score calls with 3 simple endpoints. **Endpoints:** - `POST /v1/audio/transcriptions` — Audio to text - `POST /v1/analyze/diagnostic` — Conversation analysis - `POST /v1/analyze/auditoriaRisco` — Compliance audit **Complete flow (Python):** ```python import httpx API = 'https://api.fala.ai' KEY = 'fai_xxx' HD = {'Authorization': f'Bearer {KEY}'} # 1. Transcribe files = {'file': open('call.mp3', 'rb')} resp = httpx.post(f'{API}/v1/audio/transcriptions', headers=HD, files=files, data={'model': 'falaai-transcribe-1', 'language': 'pt'}) tr = resp.json() print(f'Text: {tr[\"text\"][:100]}...') # 2. Diagnose resp = httpx.post(f'{API}/v1/analyze/diagnostic', headers=HD, json={'dialog': tr['dialog'], 'language': 'pt-BR', 'duration_seconds': tr['duration_seconds']}) diag = resp.json() print(f'Sentiment: {diag[\"analysis\"][\"sentiment\"][\"list_choice\"]}') print(f'Summary: {diag[\"analysis\"][\"dialogue_summary\"][\"explanation\"][:100]}...') # 3. Audit resp = httpx.post(f'{API}/v1/analyze/auditoriaRisco', headers=HD, json={'dialogo': tr['dialog'], 'duration_seconds': tr['duration_seconds']}) audit = resp.json() print(f'Score: {audit[\"audit_score\"]} | Verdict: {audit[\"verdict\"]}') print(f'Detections: {audit[\"total_detections\"]} | Violations: {len(audit[\"violations\"])} | Positives: {len(audit[\"positives\"])}') ``` **Authentication:** All endpoints require an API Key in the `Authorization` header: `Bearer fai_xxx` Get your API Key at [falaai.action.tec.br/api](https://falaai.action.tec.br/api)
5
+
6
+ The version of the OpenAPI document: 1.21.47
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FalaAI
17
+ class WebhookEvent
18
+ SUBSCRIPTION_CREATED = "subscription.created".freeze
19
+ AVULSO_COMPLETED = "avulso.completed".freeze
20
+ SUBSCRIPTION_UPGRADED = "subscription.upgraded".freeze
21
+ SUBSCRIPTION_DOWNGRADED = "subscription.downgraded".freeze
22
+ SUBSCRIPTION_CANCELED = "subscription.canceled".freeze
23
+ CREDITS_LOW = "credits.low".freeze
24
+ CREDITS_EXHAUSTED = "credits.exhausted".freeze
25
+ SUBSCRIPTION_RENEWED = "subscription.renewed".freeze
26
+ SUBSCRIPTION_EXPIRED = "subscription.expired".freeze
27
+ PAYMENT_FAILED = "payment.failed".freeze
28
+
29
+ def self.all_vars
30
+ @all_vars ||= [SUBSCRIPTION_CREATED, AVULSO_COMPLETED, SUBSCRIPTION_UPGRADED, SUBSCRIPTION_DOWNGRADED, SUBSCRIPTION_CANCELED, CREDITS_LOW, CREDITS_EXHAUSTED, SUBSCRIPTION_RENEWED, SUBSCRIPTION_EXPIRED, PAYMENT_FAILED].freeze
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def self.build_from_hash(value)
37
+ new.build_from_hash(value)
38
+ end
39
+
40
+ # Builds the enum from string
41
+ # @param [String] The enum value in the form of the string
42
+ # @return [String] The enum value
43
+ def build_from_hash(value)
44
+ return value if WebhookEvent.all_vars.include?(value)
45
+ raise "Invalid ENUM value #{value} for class #WebhookEvent"
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,442 @@
1
+ =begin
2
+ #FalaAI API
3
+
4
+ #Transcribe, diagnose and score calls with 3 simple endpoints. **Endpoints:** - `POST /v1/audio/transcriptions` — Audio to text - `POST /v1/analyze/diagnostic` — Conversation analysis - `POST /v1/analyze/auditoriaRisco` — Compliance audit **Complete flow (Python):** ```python import httpx API = 'https://api.fala.ai' KEY = 'fai_xxx' HD = {'Authorization': f'Bearer {KEY}'} # 1. Transcribe files = {'file': open('call.mp3', 'rb')} resp = httpx.post(f'{API}/v1/audio/transcriptions', headers=HD, files=files, data={'model': 'falaai-transcribe-1', 'language': 'pt'}) tr = resp.json() print(f'Text: {tr[\"text\"][:100]}...') # 2. Diagnose resp = httpx.post(f'{API}/v1/analyze/diagnostic', headers=HD, json={'dialog': tr['dialog'], 'language': 'pt-BR', 'duration_seconds': tr['duration_seconds']}) diag = resp.json() print(f'Sentiment: {diag[\"analysis\"][\"sentiment\"][\"list_choice\"]}') print(f'Summary: {diag[\"analysis\"][\"dialogue_summary\"][\"explanation\"][:100]}...') # 3. Audit resp = httpx.post(f'{API}/v1/analyze/auditoriaRisco', headers=HD, json={'dialogo': tr['dialog'], 'duration_seconds': tr['duration_seconds']}) audit = resp.json() print(f'Score: {audit[\"audit_score\"]} | Verdict: {audit[\"verdict\"]}') print(f'Detections: {audit[\"total_detections\"]} | Violations: {len(audit[\"violations\"])} | Positives: {len(audit[\"positives\"])}') ``` **Authentication:** All endpoints require an API Key in the `Authorization` header: `Bearer fai_xxx` Get your API Key at [falaai.action.tec.br/api](https://falaai.action.tec.br/api)
5
+
6
+ The version of the OpenAPI document: 1.21.47
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FalaAI
17
+ class WebhookItem < ApiModelBase
18
+ # Webhook id
19
+ attr_accessor :id
20
+
21
+ # Owner user id
22
+ attr_accessor :user_id
23
+
24
+ # Webhook name
25
+ attr_accessor :name
26
+
27
+ # Destination URL
28
+ attr_accessor :url
29
+
30
+ # HMAC signing secret
31
+ attr_accessor :secret
32
+
33
+ # Subscribed events
34
+ attr_accessor :events
35
+
36
+ # Is active
37
+ attr_accessor :active
38
+
39
+ # Retry enabled
40
+ attr_accessor :retry_enabled
41
+
42
+ # ISO 8601 of last delivery
43
+ attr_accessor :last_delivery_at
44
+
45
+ # Last HTTP status delivered
46
+ attr_accessor :last_status
47
+
48
+ # Consecutive failures
49
+ attr_accessor :failure_count
50
+
51
+ # ISO 8601 created
52
+ attr_accessor :created_at
53
+
54
+ # ISO 8601 updated
55
+ attr_accessor :updated_at
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'id' => :'id',
61
+ :'user_id' => :'user_id',
62
+ :'name' => :'name',
63
+ :'url' => :'url',
64
+ :'secret' => :'secret',
65
+ :'events' => :'events',
66
+ :'active' => :'active',
67
+ :'retry_enabled' => :'retry_enabled',
68
+ :'last_delivery_at' => :'last_delivery_at',
69
+ :'last_status' => :'last_status',
70
+ :'failure_count' => :'failure_count',
71
+ :'created_at' => :'created_at',
72
+ :'updated_at' => :'updated_at'
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
+ :'id' => :'String',
90
+ :'user_id' => :'String',
91
+ :'name' => :'String',
92
+ :'url' => :'String',
93
+ :'secret' => :'String',
94
+ :'events' => :'Array<String>',
95
+ :'active' => :'Boolean',
96
+ :'retry_enabled' => :'Boolean',
97
+ :'last_delivery_at' => :'String',
98
+ :'last_status' => :'Integer',
99
+ :'failure_count' => :'Integer',
100
+ :'created_at' => :'String',
101
+ :'updated_at' => :'String'
102
+ }
103
+ end
104
+
105
+ # List of attributes with nullable: true
106
+ def self.openapi_nullable
107
+ Set.new([
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::WebhookItem` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ acceptable_attribute_map = self.class.acceptable_attribute_map
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!acceptable_attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::WebhookItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'id')
128
+ self.id = attributes[:'id']
129
+ else
130
+ self.id = nil
131
+ end
132
+
133
+ if attributes.key?(:'user_id')
134
+ self.user_id = attributes[:'user_id']
135
+ else
136
+ self.user_id = nil
137
+ end
138
+
139
+ if attributes.key?(:'name')
140
+ self.name = attributes[:'name']
141
+ else
142
+ self.name = nil
143
+ end
144
+
145
+ if attributes.key?(:'url')
146
+ self.url = attributes[:'url']
147
+ else
148
+ self.url = nil
149
+ end
150
+
151
+ if attributes.key?(:'secret')
152
+ self.secret = attributes[:'secret']
153
+ else
154
+ self.secret = nil
155
+ end
156
+
157
+ if attributes.key?(:'events')
158
+ if (value = attributes[:'events']).is_a?(Array)
159
+ self.events = value
160
+ end
161
+ else
162
+ self.events = nil
163
+ end
164
+
165
+ if attributes.key?(:'active')
166
+ self.active = attributes[:'active']
167
+ else
168
+ self.active = nil
169
+ end
170
+
171
+ if attributes.key?(:'retry_enabled')
172
+ self.retry_enabled = attributes[:'retry_enabled']
173
+ else
174
+ self.retry_enabled = nil
175
+ end
176
+
177
+ if attributes.key?(:'last_delivery_at')
178
+ self.last_delivery_at = attributes[:'last_delivery_at']
179
+ end
180
+
181
+ if attributes.key?(:'last_status')
182
+ self.last_status = attributes[:'last_status']
183
+ end
184
+
185
+ if attributes.key?(:'failure_count')
186
+ self.failure_count = attributes[:'failure_count']
187
+ else
188
+ self.failure_count = 0
189
+ end
190
+
191
+ if attributes.key?(:'created_at')
192
+ self.created_at = attributes[:'created_at']
193
+ else
194
+ self.created_at = nil
195
+ end
196
+
197
+ if attributes.key?(:'updated_at')
198
+ self.updated_at = attributes[:'updated_at']
199
+ else
200
+ self.updated_at = nil
201
+ end
202
+ end
203
+
204
+ # Show invalid properties with the reasons. Usually used together with valid?
205
+ # @return Array for valid properties with the reasons
206
+ def list_invalid_properties
207
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
208
+ invalid_properties = Array.new
209
+ if @id.nil?
210
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
211
+ end
212
+
213
+ if @user_id.nil?
214
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
215
+ end
216
+
217
+ if @name.nil?
218
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
219
+ end
220
+
221
+ if @url.nil?
222
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
223
+ end
224
+
225
+ if @secret.nil?
226
+ invalid_properties.push('invalid value for "secret", secret cannot be nil.')
227
+ end
228
+
229
+ if @events.nil?
230
+ invalid_properties.push('invalid value for "events", events cannot be nil.')
231
+ end
232
+
233
+ if @active.nil?
234
+ invalid_properties.push('invalid value for "active", active cannot be nil.')
235
+ end
236
+
237
+ if @retry_enabled.nil?
238
+ invalid_properties.push('invalid value for "retry_enabled", retry_enabled cannot be nil.')
239
+ end
240
+
241
+ if @created_at.nil?
242
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
243
+ end
244
+
245
+ if @updated_at.nil?
246
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
247
+ end
248
+
249
+ invalid_properties
250
+ end
251
+
252
+ # Check to see if the all the properties in the model are valid
253
+ # @return true if the model is valid
254
+ def valid?
255
+ warn '[DEPRECATED] the `valid?` method is obsolete'
256
+ return false if @id.nil?
257
+ return false if @user_id.nil?
258
+ return false if @name.nil?
259
+ return false if @url.nil?
260
+ return false if @secret.nil?
261
+ return false if @events.nil?
262
+ return false if @active.nil?
263
+ return false if @retry_enabled.nil?
264
+ return false if @created_at.nil?
265
+ return false if @updated_at.nil?
266
+ true
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] id Value to be assigned
271
+ def id=(id)
272
+ if id.nil?
273
+ fail ArgumentError, 'id cannot be nil'
274
+ end
275
+
276
+ @id = id
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] user_id Value to be assigned
281
+ def user_id=(user_id)
282
+ if user_id.nil?
283
+ fail ArgumentError, 'user_id cannot be nil'
284
+ end
285
+
286
+ @user_id = user_id
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] name Value to be assigned
291
+ def name=(name)
292
+ if name.nil?
293
+ fail ArgumentError, 'name cannot be nil'
294
+ end
295
+
296
+ @name = name
297
+ end
298
+
299
+ # Custom attribute writer method with validation
300
+ # @param [Object] url Value to be assigned
301
+ def url=(url)
302
+ if url.nil?
303
+ fail ArgumentError, 'url cannot be nil'
304
+ end
305
+
306
+ @url = url
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param [Object] secret Value to be assigned
311
+ def secret=(secret)
312
+ if secret.nil?
313
+ fail ArgumentError, 'secret cannot be nil'
314
+ end
315
+
316
+ @secret = secret
317
+ end
318
+
319
+ # Custom attribute writer method with validation
320
+ # @param [Object] events Value to be assigned
321
+ def events=(events)
322
+ if events.nil?
323
+ fail ArgumentError, 'events cannot be nil'
324
+ end
325
+
326
+ @events = events
327
+ end
328
+
329
+ # Custom attribute writer method with validation
330
+ # @param [Object] active Value to be assigned
331
+ def active=(active)
332
+ if active.nil?
333
+ fail ArgumentError, 'active cannot be nil'
334
+ end
335
+
336
+ @active = active
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] retry_enabled Value to be assigned
341
+ def retry_enabled=(retry_enabled)
342
+ if retry_enabled.nil?
343
+ fail ArgumentError, 'retry_enabled cannot be nil'
344
+ end
345
+
346
+ @retry_enabled = retry_enabled
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] created_at Value to be assigned
351
+ def created_at=(created_at)
352
+ if created_at.nil?
353
+ fail ArgumentError, 'created_at cannot be nil'
354
+ end
355
+
356
+ @created_at = created_at
357
+ end
358
+
359
+ # Custom attribute writer method with validation
360
+ # @param [Object] updated_at Value to be assigned
361
+ def updated_at=(updated_at)
362
+ if updated_at.nil?
363
+ fail ArgumentError, 'updated_at cannot be nil'
364
+ end
365
+
366
+ @updated_at = updated_at
367
+ end
368
+
369
+ # Checks equality by comparing each attribute.
370
+ # @param [Object] Object to be compared
371
+ def ==(o)
372
+ return true if self.equal?(o)
373
+ self.class == o.class &&
374
+ id == o.id &&
375
+ user_id == o.user_id &&
376
+ name == o.name &&
377
+ url == o.url &&
378
+ secret == o.secret &&
379
+ events == o.events &&
380
+ active == o.active &&
381
+ retry_enabled == o.retry_enabled &&
382
+ last_delivery_at == o.last_delivery_at &&
383
+ last_status == o.last_status &&
384
+ failure_count == o.failure_count &&
385
+ created_at == o.created_at &&
386
+ updated_at == o.updated_at
387
+ end
388
+
389
+ # @see the `==` method
390
+ # @param [Object] Object to be compared
391
+ def eql?(o)
392
+ self == o
393
+ end
394
+
395
+ # Calculates hash code according to all attributes.
396
+ # @return [Integer] Hash code
397
+ def hash
398
+ [id, user_id, name, url, secret, events, active, retry_enabled, last_delivery_at, last_status, failure_count, created_at, updated_at].hash
399
+ end
400
+
401
+ # Builds the object from hash
402
+ # @param [Hash] attributes Model attributes in the form of hash
403
+ # @return [Object] Returns the model itself
404
+ def self.build_from_hash(attributes)
405
+ return nil unless attributes.is_a?(Hash)
406
+ attributes = attributes.transform_keys(&:to_sym)
407
+ transformed_hash = {}
408
+ openapi_types.each_pair do |key, type|
409
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
410
+ transformed_hash["#{key}"] = nil
411
+ elsif type =~ /\AArray<(.*)>/i
412
+ # check to ensure the input is an array given that the attribute
413
+ # is documented as an array but the input is not
414
+ if attributes[attribute_map[key]].is_a?(Array)
415
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
416
+ end
417
+ elsif !attributes[attribute_map[key]].nil?
418
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
419
+ end
420
+ end
421
+ new(transformed_hash)
422
+ end
423
+
424
+ # Returns the object in the form of hash
425
+ # @return [Hash] Returns the object in the form of hash
426
+ def to_hash
427
+ hash = {}
428
+ self.class.attribute_map.each_pair do |attr, param|
429
+ value = self.send(attr)
430
+ if value.nil?
431
+ is_nullable = self.class.openapi_nullable.include?(attr)
432
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
433
+ end
434
+
435
+ hash[param] = _to_hash(value)
436
+ end
437
+ hash
438
+ end
439
+
440
+ end
441
+
442
+ end