falaai-api 1.21.49 → 1.21.54
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.
- checksums.yaml +4 -4
- data/README.md +37 -38
- data/docs/AnalysisApi.md +2 -2
- data/docs/DiagnosticParticipant.md +1 -1
- data/docs/DiagnosticRequest.md +2 -2
- data/docs/DiagnosticResponse.md +3 -1
- data/docs/Participant.md +1 -1
- data/docs/ParticipantDiagnostic.md +1 -1
- data/docs/RiskAuditRequest.md +4 -6
- data/docs/SpeechApi.md +3 -3
- data/docs/WhatsappApi.md +95 -0
- data/docs/WhatsappConversation.md +32 -0
- data/docs/WhatsappConversationsResponse.md +28 -0
- data/docs/WhatsappMeta.md +50 -0
- data/docs/WhatsappSpeaker.md +20 -0
- data/docs/WhatsappUsage.md +34 -0
- data/docs/index.html +55 -51
- data/docs/llms.txt +18 -0
- data/docs/robots.txt +4 -0
- data/docs/sitemap.xml +8 -0
- data/lib/falaai-api/api/analysis_api.rb +1 -1
- data/lib/falaai-api/api/email_alerts_api.rb +1 -1
- data/lib/falaai-api/api/health_api.rb +1 -1
- data/lib/falaai-api/api/speech_api.rb +5 -5
- data/lib/falaai-api/api/usage_api.rb +1 -1
- data/lib/falaai-api/api/version_api.rb +1 -1
- data/lib/falaai-api/api/webhooks_api.rb +1 -1
- data/lib/falaai-api/api/whatsapp_api.rb +132 -0
- data/lib/falaai-api/api_client.rb +1 -1
- data/lib/falaai-api/api_error.rb +1 -1
- data/lib/falaai-api/api_model_base.rb +1 -1
- data/lib/falaai-api/configuration.rb +1 -1
- data/lib/falaai-api/models/audio_event.rb +1 -1
- data/lib/falaai-api/models/audio_input_meta.rb +1 -1
- data/lib/falaai-api/models/create_email_alert_request.rb +1 -1
- data/lib/falaai-api/models/create_webhook_request.rb +1 -1
- data/lib/falaai-api/models/diagnostic_analysis_map.rb +1 -1
- data/lib/falaai-api/models/diagnostic_audio_event.rb +1 -1
- data/lib/falaai-api/models/diagnostic_categorical_analysis.rb +1 -1
- data/lib/falaai-api/models/diagnostic_participant.rb +2 -9
- data/lib/falaai-api/models/diagnostic_request.rb +5 -12
- data/lib/falaai-api/models/diagnostic_response.rb +15 -5
- data/lib/falaai-api/models/diagnostic_text_analysis.rb +1 -1
- data/lib/falaai-api/models/diagnostic_usage.rb +1 -1
- data/lib/falaai-api/models/email_alert_item.rb +1 -1
- data/lib/falaai-api/models/email_alert_list_response.rb +1 -1
- data/lib/falaai-api/models/email_alert_message_response.rb +1 -1
- data/lib/falaai-api/models/email_event.rb +1 -1
- data/lib/falaai-api/models/health_response.rb +1 -1
- data/lib/falaai-api/models/http_validation_error.rb +1 -1
- data/lib/falaai-api/models/location_inner.rb +1 -1
- data/lib/falaai-api/models/message_response.rb +1 -1
- data/lib/falaai-api/models/participant.rb +2 -2
- data/lib/falaai-api/models/participant_diagnostic.rb +2 -19
- data/lib/falaai-api/models/risk_audit_analysis_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_applied_action_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_audio_event_model_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_audit_decisions_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_conversation_scores_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_detection_item_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_detections_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_indexer_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_meta_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_participant_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_participants_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_request.rb +19 -54
- data/lib/falaai-api/models/risk_audit_scores_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_scoring_explanation_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_summary_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_timeline_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_usage_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_v2.rb +1 -1
- data/lib/falaai-api/models/risk_audit_v2_response.rb +1 -1
- data/lib/falaai-api/models/risk_audit_verdict_v2.rb +1 -1
- data/lib/falaai-api/models/transcription_response.rb +1 -1
- data/lib/falaai-api/models/transcription_usage.rb +1 -1
- data/lib/falaai-api/models/update_email_alert_request.rb +1 -1
- data/lib/falaai-api/models/update_webhook_request.rb +1 -1
- data/lib/falaai-api/models/usage_by_key_item.rb +1 -1
- data/lib/falaai-api/models/usage_log_item.rb +1 -1
- data/lib/falaai-api/models/usage_log_response.rb +1 -1
- data/lib/falaai-api/models/validation_error.rb +1 -1
- data/lib/falaai-api/models/version_response.rb +1 -1
- data/lib/falaai-api/models/webhook_event.rb +1 -1
- data/lib/falaai-api/models/webhook_item.rb +1 -1
- data/lib/falaai-api/models/webhook_list_response.rb +1 -1
- data/lib/falaai-api/models/whatsapp_conversation.rb +356 -0
- data/lib/falaai-api/models/whatsapp_conversations_response.rb +285 -0
- data/lib/falaai-api/models/whatsapp_meta.rb +597 -0
- data/lib/falaai-api/models/whatsapp_speaker.rb +192 -0
- data/lib/falaai-api/models/whatsapp_usage.rb +381 -0
- data/lib/falaai-api/version.rb +2 -2
- data/lib/falaai-api.rb +7 -1
- metadata +17 -2
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FalaAI API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.21.54
|
|
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 WhatsappConversation < ApiModelBase
|
|
18
|
+
# Conversation identifier in the batch
|
|
19
|
+
attr_accessor :conversation_id
|
|
20
|
+
|
|
21
|
+
# Real start (wall-clock, ISO)
|
|
22
|
+
attr_accessor :first_at
|
|
23
|
+
|
|
24
|
+
# Real end (wall-clock, ISO)
|
|
25
|
+
attr_accessor :last_at
|
|
26
|
+
|
|
27
|
+
# (last - first) + last turn duration
|
|
28
|
+
attr_accessor :duration_seconds
|
|
29
|
+
|
|
30
|
+
# Speakers of THIS conversation (dynamic)
|
|
31
|
+
attr_accessor :speakers
|
|
32
|
+
|
|
33
|
+
# Lines 'Speaker N: [HH:MM:SS.mmm - HH:MM:SS.mmm] text' (real offset)
|
|
34
|
+
attr_accessor :dialog
|
|
35
|
+
|
|
36
|
+
# Number of messages
|
|
37
|
+
attr_accessor :message_count
|
|
38
|
+
|
|
39
|
+
# Total characters of the conversation
|
|
40
|
+
attr_accessor :characters
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'conversation_id' => :'conversation_id',
|
|
46
|
+
:'first_at' => :'first_at',
|
|
47
|
+
:'last_at' => :'last_at',
|
|
48
|
+
:'duration_seconds' => :'duration_seconds',
|
|
49
|
+
:'speakers' => :'speakers',
|
|
50
|
+
:'dialog' => :'dialog',
|
|
51
|
+
:'message_count' => :'message_count',
|
|
52
|
+
:'characters' => :'characters'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Returns attribute mapping this model knows about
|
|
57
|
+
def self.acceptable_attribute_map
|
|
58
|
+
attribute_map
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns all the JSON keys this model knows about
|
|
62
|
+
def self.acceptable_attributes
|
|
63
|
+
acceptable_attribute_map.values
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute type mapping.
|
|
67
|
+
def self.openapi_types
|
|
68
|
+
{
|
|
69
|
+
:'conversation_id' => :'String',
|
|
70
|
+
:'first_at' => :'String',
|
|
71
|
+
:'last_at' => :'String',
|
|
72
|
+
:'duration_seconds' => :'Float',
|
|
73
|
+
:'speakers' => :'Array<WhatsappSpeaker>',
|
|
74
|
+
:'dialog' => :'String',
|
|
75
|
+
:'message_count' => :'Integer',
|
|
76
|
+
:'characters' => :'Integer'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::WhatsappConversation` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::WhatsappConversation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'conversation_id')
|
|
103
|
+
self.conversation_id = attributes[:'conversation_id']
|
|
104
|
+
else
|
|
105
|
+
self.conversation_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'first_at')
|
|
109
|
+
self.first_at = attributes[:'first_at']
|
|
110
|
+
else
|
|
111
|
+
self.first_at = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'last_at')
|
|
115
|
+
self.last_at = attributes[:'last_at']
|
|
116
|
+
else
|
|
117
|
+
self.last_at = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'duration_seconds')
|
|
121
|
+
self.duration_seconds = attributes[:'duration_seconds']
|
|
122
|
+
else
|
|
123
|
+
self.duration_seconds = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'speakers')
|
|
127
|
+
if (value = attributes[:'speakers']).is_a?(Array)
|
|
128
|
+
self.speakers = value
|
|
129
|
+
end
|
|
130
|
+
else
|
|
131
|
+
self.speakers = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'dialog')
|
|
135
|
+
self.dialog = attributes[:'dialog']
|
|
136
|
+
else
|
|
137
|
+
self.dialog = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'message_count')
|
|
141
|
+
self.message_count = attributes[:'message_count']
|
|
142
|
+
else
|
|
143
|
+
self.message_count = nil
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'characters')
|
|
147
|
+
self.characters = attributes[:'characters']
|
|
148
|
+
else
|
|
149
|
+
self.characters = nil
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
154
|
+
# @return Array for valid properties with the reasons
|
|
155
|
+
def list_invalid_properties
|
|
156
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
157
|
+
invalid_properties = Array.new
|
|
158
|
+
if @conversation_id.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "conversation_id", conversation_id cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if @first_at.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "first_at", first_at cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if @last_at.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "last_at", last_at cannot be nil.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @duration_seconds.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "duration_seconds", duration_seconds cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @speakers.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "speakers", speakers cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if @dialog.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "dialog", dialog cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @message_count.nil?
|
|
183
|
+
invalid_properties.push('invalid value for "message_count", message_count cannot be nil.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if @characters.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "characters", characters cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
invalid_properties
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Check to see if the all the properties in the model are valid
|
|
194
|
+
# @return true if the model is valid
|
|
195
|
+
def valid?
|
|
196
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
197
|
+
return false if @conversation_id.nil?
|
|
198
|
+
return false if @first_at.nil?
|
|
199
|
+
return false if @last_at.nil?
|
|
200
|
+
return false if @duration_seconds.nil?
|
|
201
|
+
return false if @speakers.nil?
|
|
202
|
+
return false if @dialog.nil?
|
|
203
|
+
return false if @message_count.nil?
|
|
204
|
+
return false if @characters.nil?
|
|
205
|
+
true
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Custom attribute writer method with validation
|
|
209
|
+
# @param [Object] conversation_id Value to be assigned
|
|
210
|
+
def conversation_id=(conversation_id)
|
|
211
|
+
if conversation_id.nil?
|
|
212
|
+
fail ArgumentError, 'conversation_id cannot be nil'
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
@conversation_id = conversation_id
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] first_at Value to be assigned
|
|
220
|
+
def first_at=(first_at)
|
|
221
|
+
if first_at.nil?
|
|
222
|
+
fail ArgumentError, 'first_at cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@first_at = first_at
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] last_at Value to be assigned
|
|
230
|
+
def last_at=(last_at)
|
|
231
|
+
if last_at.nil?
|
|
232
|
+
fail ArgumentError, 'last_at cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@last_at = last_at
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] duration_seconds Value to be assigned
|
|
240
|
+
def duration_seconds=(duration_seconds)
|
|
241
|
+
if duration_seconds.nil?
|
|
242
|
+
fail ArgumentError, 'duration_seconds cannot be nil'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@duration_seconds = duration_seconds
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] speakers Value to be assigned
|
|
250
|
+
def speakers=(speakers)
|
|
251
|
+
if speakers.nil?
|
|
252
|
+
fail ArgumentError, 'speakers cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@speakers = speakers
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] dialog Value to be assigned
|
|
260
|
+
def dialog=(dialog)
|
|
261
|
+
if dialog.nil?
|
|
262
|
+
fail ArgumentError, 'dialog cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@dialog = dialog
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method with validation
|
|
269
|
+
# @param [Object] message_count Value to be assigned
|
|
270
|
+
def message_count=(message_count)
|
|
271
|
+
if message_count.nil?
|
|
272
|
+
fail ArgumentError, 'message_count cannot be nil'
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
@message_count = message_count
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Custom attribute writer method with validation
|
|
279
|
+
# @param [Object] characters Value to be assigned
|
|
280
|
+
def characters=(characters)
|
|
281
|
+
if characters.nil?
|
|
282
|
+
fail ArgumentError, 'characters cannot be nil'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
@characters = characters
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Checks equality by comparing each attribute.
|
|
289
|
+
# @param [Object] Object to be compared
|
|
290
|
+
def ==(o)
|
|
291
|
+
return true if self.equal?(o)
|
|
292
|
+
self.class == o.class &&
|
|
293
|
+
conversation_id == o.conversation_id &&
|
|
294
|
+
first_at == o.first_at &&
|
|
295
|
+
last_at == o.last_at &&
|
|
296
|
+
duration_seconds == o.duration_seconds &&
|
|
297
|
+
speakers == o.speakers &&
|
|
298
|
+
dialog == o.dialog &&
|
|
299
|
+
message_count == o.message_count &&
|
|
300
|
+
characters == o.characters
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# @see the `==` method
|
|
304
|
+
# @param [Object] Object to be compared
|
|
305
|
+
def eql?(o)
|
|
306
|
+
self == o
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Calculates hash code according to all attributes.
|
|
310
|
+
# @return [Integer] Hash code
|
|
311
|
+
def hash
|
|
312
|
+
[conversation_id, first_at, last_at, duration_seconds, speakers, dialog, message_count, characters].hash
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Builds the object from hash
|
|
316
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
317
|
+
# @return [Object] Returns the model itself
|
|
318
|
+
def self.build_from_hash(attributes)
|
|
319
|
+
return nil unless attributes.is_a?(Hash)
|
|
320
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
321
|
+
transformed_hash = {}
|
|
322
|
+
openapi_types.each_pair do |key, type|
|
|
323
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
324
|
+
transformed_hash["#{key}"] = nil
|
|
325
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
326
|
+
# check to ensure the input is an array given that the attribute
|
|
327
|
+
# is documented as an array but the input is not
|
|
328
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
329
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
330
|
+
end
|
|
331
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
332
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
333
|
+
end
|
|
334
|
+
end
|
|
335
|
+
new(transformed_hash)
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Returns the object in the form of hash
|
|
339
|
+
# @return [Hash] Returns the object in the form of hash
|
|
340
|
+
def to_hash
|
|
341
|
+
hash = {}
|
|
342
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
343
|
+
value = self.send(attr)
|
|
344
|
+
if value.nil?
|
|
345
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
346
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
hash[param] = _to_hash(value)
|
|
350
|
+
end
|
|
351
|
+
hash
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
end
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FalaAI API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.21.54
|
|
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 WhatsappConversationsResponse < ApiModelBase
|
|
18
|
+
# Unique identifier. Prefix 'wc-' + UUID
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Object type. Always 'conversations'
|
|
22
|
+
attr_accessor :object
|
|
23
|
+
|
|
24
|
+
# Usage and processing information
|
|
25
|
+
attr_accessor :usage
|
|
26
|
+
|
|
27
|
+
# Segmented conversations
|
|
28
|
+
attr_accessor :conversations
|
|
29
|
+
|
|
30
|
+
# Client-supplied ID echoed verbatim (if provided)
|
|
31
|
+
attr_accessor :client_reference_id
|
|
32
|
+
|
|
33
|
+
# Segmentation parameters and counts
|
|
34
|
+
attr_accessor :meta
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'id' => :'id',
|
|
40
|
+
:'object' => :'object',
|
|
41
|
+
:'usage' => :'usage',
|
|
42
|
+
:'conversations' => :'conversations',
|
|
43
|
+
:'client_reference_id' => :'client_reference_id',
|
|
44
|
+
:'meta' => :'meta'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'id' => :'String',
|
|
62
|
+
:'object' => :'String',
|
|
63
|
+
:'usage' => :'WhatsappUsage',
|
|
64
|
+
:'conversations' => :'Array<WhatsappConversation>',
|
|
65
|
+
:'client_reference_id' => :'String',
|
|
66
|
+
:'meta' => :'WhatsappMeta'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FalaAI::WhatsappConversationsResponse` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FalaAI::WhatsappConversationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'id')
|
|
93
|
+
self.id = attributes[:'id']
|
|
94
|
+
else
|
|
95
|
+
self.id = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'object')
|
|
99
|
+
self.object = attributes[:'object']
|
|
100
|
+
else
|
|
101
|
+
self.object = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'usage')
|
|
105
|
+
self.usage = attributes[:'usage']
|
|
106
|
+
else
|
|
107
|
+
self.usage = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'conversations')
|
|
111
|
+
if (value = attributes[:'conversations']).is_a?(Array)
|
|
112
|
+
self.conversations = value
|
|
113
|
+
end
|
|
114
|
+
else
|
|
115
|
+
self.conversations = nil
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'client_reference_id')
|
|
119
|
+
self.client_reference_id = attributes[:'client_reference_id']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'meta')
|
|
123
|
+
self.meta = attributes[:'meta']
|
|
124
|
+
else
|
|
125
|
+
self.meta = nil
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
130
|
+
# @return Array for valid properties with the reasons
|
|
131
|
+
def list_invalid_properties
|
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
133
|
+
invalid_properties = Array.new
|
|
134
|
+
if @id.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @object.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "object", object cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @usage.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "usage", usage cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @conversations.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "conversations", conversations cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @meta.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "meta", meta cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
invalid_properties
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Check to see if the all the properties in the model are valid
|
|
158
|
+
# @return true if the model is valid
|
|
159
|
+
def valid?
|
|
160
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
161
|
+
return false if @id.nil?
|
|
162
|
+
return false if @object.nil?
|
|
163
|
+
return false if @usage.nil?
|
|
164
|
+
return false if @conversations.nil?
|
|
165
|
+
return false if @meta.nil?
|
|
166
|
+
true
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] id Value to be assigned
|
|
171
|
+
def id=(id)
|
|
172
|
+
if id.nil?
|
|
173
|
+
fail ArgumentError, 'id cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@id = id
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] object Value to be assigned
|
|
181
|
+
def object=(object)
|
|
182
|
+
if object.nil?
|
|
183
|
+
fail ArgumentError, 'object cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@object = object
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] usage Value to be assigned
|
|
191
|
+
def usage=(usage)
|
|
192
|
+
if usage.nil?
|
|
193
|
+
fail ArgumentError, 'usage cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@usage = usage
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Custom attribute writer method with validation
|
|
200
|
+
# @param [Object] conversations Value to be assigned
|
|
201
|
+
def conversations=(conversations)
|
|
202
|
+
if conversations.nil?
|
|
203
|
+
fail ArgumentError, 'conversations cannot be nil'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
@conversations = conversations
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Custom attribute writer method with validation
|
|
210
|
+
# @param [Object] meta Value to be assigned
|
|
211
|
+
def meta=(meta)
|
|
212
|
+
if meta.nil?
|
|
213
|
+
fail ArgumentError, 'meta cannot be nil'
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
@meta = meta
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Checks equality by comparing each attribute.
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def ==(o)
|
|
222
|
+
return true if self.equal?(o)
|
|
223
|
+
self.class == o.class &&
|
|
224
|
+
id == o.id &&
|
|
225
|
+
object == o.object &&
|
|
226
|
+
usage == o.usage &&
|
|
227
|
+
conversations == o.conversations &&
|
|
228
|
+
client_reference_id == o.client_reference_id &&
|
|
229
|
+
meta == o.meta
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# @see the `==` method
|
|
233
|
+
# @param [Object] Object to be compared
|
|
234
|
+
def eql?(o)
|
|
235
|
+
self == o
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Calculates hash code according to all attributes.
|
|
239
|
+
# @return [Integer] Hash code
|
|
240
|
+
def hash
|
|
241
|
+
[id, object, usage, conversations, client_reference_id, meta].hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Builds the object from hash
|
|
245
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
246
|
+
# @return [Object] Returns the model itself
|
|
247
|
+
def self.build_from_hash(attributes)
|
|
248
|
+
return nil unless attributes.is_a?(Hash)
|
|
249
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
250
|
+
transformed_hash = {}
|
|
251
|
+
openapi_types.each_pair do |key, type|
|
|
252
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
253
|
+
transformed_hash["#{key}"] = nil
|
|
254
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
255
|
+
# check to ensure the input is an array given that the attribute
|
|
256
|
+
# is documented as an array but the input is not
|
|
257
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
258
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
259
|
+
end
|
|
260
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
261
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
new(transformed_hash)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the object in the form of hash
|
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
|
269
|
+
def to_hash
|
|
270
|
+
hash = {}
|
|
271
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
272
|
+
value = self.send(attr)
|
|
273
|
+
if value.nil?
|
|
274
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
275
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
hash[param] = _to_hash(value)
|
|
279
|
+
end
|
|
280
|
+
hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|