|
10 | 10 | StringType, |
11 | 11 | ) |
12 | 12 |
|
| 13 | +# define languages for translated articles content, add here to include |
| 14 | +languages = [ |
| 15 | + "bg", |
| 16 | + "cs", |
| 17 | + "de", |
| 18 | + "en", |
| 19 | + "es", |
| 20 | + "fr", |
| 21 | + "hu", |
| 22 | + "it", |
| 23 | + "nb", |
| 24 | + "nl", |
| 25 | + "pl", |
| 26 | + "pt", |
| 27 | + "pt-BR", |
| 28 | + "sk", |
| 29 | + "sv", |
| 30 | +] |
| 31 | + |
| 32 | +# define translated content articles schema to avoid repetition |
| 33 | +translated_content = [ |
| 34 | + Property( |
| 35 | + lang, |
| 36 | + ObjectType( |
| 37 | + Property("title", StringType), |
| 38 | + Property("description", StringType), |
| 39 | + Property("author_id", IntegerType), |
| 40 | + Property("state", StringType), |
| 41 | + Property("created_at", IntegerType), |
| 42 | + Property("updated_at", IntegerType), |
| 43 | + ), |
| 44 | + ) for lang in languages |
| 45 | +] |
| 46 | + |
13 | 47 | conversations_schema = PropertiesList( |
14 | | - Property("type", StringType), |
15 | 48 | Property("id", StringType), |
16 | 49 | Property("title", StringType), |
17 | 50 | Property("created_at", IntegerType), |
|
27 | 60 | Property( |
28 | 61 | "tags", |
29 | 62 | ObjectType( |
30 | | - Property("type", StringType), |
31 | 63 | Property( |
32 | 64 | "tags", |
33 | 65 | ArrayType( |
34 | 66 | ObjectType( |
35 | | - Property("type", StringType), |
36 | 67 | Property("id", StringType), |
37 | 68 | Property("name", StringType), |
38 | 69 | Property("applied_at", IntegerType), |
|
57 | 88 | Property( |
58 | 89 | "contact", |
59 | 90 | ObjectType( |
60 | | - Property("type", StringType), |
61 | 91 | Property("id", StringType), |
62 | | - Property("external_id", StringType), |
63 | 92 | ), |
64 | 93 | ), |
65 | 94 | Property( |
66 | 95 | "teammate", |
67 | 96 | ObjectType( |
68 | | - Property("type", StringType), |
69 | 97 | Property("id", StringType), |
70 | 98 | ), |
71 | 99 | ), |
|
109 | 137 | Property( |
110 | 138 | "contacts", |
111 | 139 | ObjectType( |
112 | | - Property("type", StringType), |
113 | 140 | Property( |
114 | 141 | "contacts", |
115 | 142 | ArrayType( |
|
125 | 152 | Property( |
126 | 153 | "teammates", |
127 | 154 | ObjectType( |
128 | | - Property("type", StringType), |
129 | 155 | Property( |
130 | 156 | "teammates", |
131 | 157 | ArrayType( |
132 | 158 | ObjectType( |
133 | | - Property("type", StringType), |
134 | 159 | Property("id", StringType), |
135 | 160 | ) |
136 | 161 | ), |
|
148 | 173 | Property( |
149 | 174 | "sla_applied", |
150 | 175 | ObjectType( |
151 | | - Property("type", StringType), |
152 | 176 | Property("sla_name", StringType), |
153 | 177 | Property("sla_status", StringType), |
154 | 178 | ), |
155 | 179 | ), |
156 | 180 | Property( |
157 | 181 | "statistics", |
158 | 182 | ObjectType( |
159 | | - Property("type", StringType), |
160 | 183 | Property("time_to_assignment", IntegerType), |
161 | 184 | Property("time_to_admin_reply", IntegerType), |
162 | 185 | Property("time_to_first_close", IntegerType), |
|
180 | 203 | Property( |
181 | 204 | "linked_objects", |
182 | 205 | ObjectType( |
183 | | - Property("type", StringType), |
184 | 206 | Property("total_count", IntegerType), |
185 | | - Property("has_more", BooleanType), |
186 | 207 | Property( |
187 | 208 | "data", |
188 | 209 | ArrayType( |
189 | 210 | ObjectType( |
190 | | - Property("type", StringType), |
191 | 211 | Property("id", StringType), |
192 | 212 | Property("category", StringType), |
193 | 213 | ) |
|
201 | 221 | Property( |
202 | 222 | "active_draft", |
203 | 223 | ObjectType( |
204 | | - Property("type", StringType), |
205 | 224 | Property( |
206 | 225 | "instances", |
207 | 226 | ArrayType( |
|
216 | 235 | Property("has_errors", BooleanType), |
217 | 236 | ), |
218 | 237 | ), |
219 | | - Property("type", StringType), |
220 | 238 | ), |
221 | 239 | ), |
222 | 240 | ), |
|
231 | 249 | Property( |
232 | 250 | "latest_bought_listings", |
233 | 251 | ObjectType( |
234 | | - Property("type", StringType), |
235 | 252 | Property( |
236 | 253 | "instances", |
237 | 254 | ArrayType( |
|
246 | 263 | Property("sellerId", StringType), |
247 | 264 | ), |
248 | 265 | ), |
249 | | - Property("type", StringType), |
250 | 266 | ), |
251 | 267 | ), |
252 | 268 | ), |
|
255 | 271 | Property( |
256 | 272 | "selected_bought_listing", |
257 | 273 | ObjectType( |
258 | | - Property("type", StringType), |
259 | 274 | Property( |
260 | 275 | "instances", |
261 | 276 | ArrayType( |
|
270 | 285 | Property("sellerId", StringType), |
271 | 286 | ), |
272 | 287 | ), |
273 | | - Property("type", StringType), |
274 | 288 | ), |
275 | 289 | ), |
276 | 290 | ), |
|
279 | 293 | Property( |
280 | 294 | "last_payout", |
281 | 295 | ObjectType( |
282 | | - Property("type", StringType), |
283 | 296 | Property( |
284 | 297 | "instances", |
285 | 298 | ArrayType( |
|
308 | 321 | ).to_dict() |
309 | 322 |
|
310 | 323 | conversation_parts_schema = PropertiesList( |
311 | | - Property("type", StringType), |
312 | 324 | Property("id", StringType), |
313 | 325 | Property("conversation_id", StringType), |
314 | 326 | Property("part_type", StringType), |
|
348 | 360 | ), |
349 | 361 | Property("external_id", StringType), |
350 | 362 | Property("redacted", BooleanType), |
| 363 | + Property( |
| 364 | + "conversation_part_has_body", |
| 365 | + BooleanType, |
| 366 | + description = ( |
| 367 | + "Indicates whether this conversation part contains a non-empty body. " |
| 368 | + "True if the body field is present and not empty, false otherwise." |
| 369 | + ), |
| 370 | + ), |
351 | 371 | ).to_dict() |
352 | 372 |
|
353 | 373 | admins_schema = PropertiesList( |
354 | | - Property("type", StringType), |
355 | 374 | Property("id", StringType), |
356 | 375 | Property("name", StringType), |
357 | | - Property("email", StringType), |
358 | | - Property("job_title", StringType), |
359 | 376 | Property("away_mode_enabled", BooleanType), |
360 | 377 | Property("away_mode_reassign", BooleanType), |
361 | 378 | Property("has_inbox_seat", BooleanType), |
362 | 379 | Property("team_ids", ArrayType(IntegerType)), |
363 | | - Property("avatar", StringType), |
364 | 380 | Property( |
365 | 381 | "team_priority_level", |
366 | 382 | ObjectType( |
|
371 | 387 | ).to_dict() |
372 | 388 |
|
373 | 389 | tags_schema = PropertiesList( |
374 | | - Property("type", StringType), |
375 | 390 | Property("id", StringType), |
376 | 391 | Property("name", StringType), |
377 | | - Property("applied_at", IntegerType), |
378 | | - Property("applied_by", ObjectType(Property("type", StringType), Property("id", StringType))), |
379 | 392 | ).to_dict() |
380 | 393 |
|
381 | 394 | teams_schema = PropertiesList( |
|
395 | 408 | contacts_schema = PropertiesList( |
396 | 409 | Property("type", StringType), |
397 | 410 | Property("id", StringType, description="The unique identifier for the contact"), |
398 | | - Property("workspace_id", StringType, description="The ID of the workspace the contact belongs to"), |
399 | 411 | Property( |
400 | 412 | "external_id", |
401 | 413 | StringType, |
402 | 414 | description="An external identifier for the contact, set by the integrating application", |
403 | 415 | ), |
404 | | - Property("role", StringType, description="The role of the contact, either user or lead"), |
405 | | - Property("email", StringType, description="The email address of the contact"), |
406 | | - Property("phone", StringType, description="The phone number of the contact"), |
407 | | - Property("name", StringType, description="The name of the contact"), |
408 | | - Property( |
409 | | - "avatar", |
410 | | - ObjectType( |
411 | | - Property("type", StringType, description="The type of object"), |
412 | | - Property("image_url", StringType, description="URL of the contact's avatar image"), |
413 | | - ), |
414 | | - ), |
415 | | - Property("owner_id", IntegerType, description="The ID of the teammate who owns this contact"), |
416 | | - Property( |
417 | | - "social_profiles", |
418 | | - ObjectType( |
419 | | - Property( |
420 | | - "data", |
421 | | - ArrayType( |
422 | | - ObjectType( |
423 | | - Property("type", StringType), |
424 | | - Property("name", StringType), |
425 | | - Property("url", StringType), |
426 | | - ), |
427 | | - ), |
428 | | - ), |
429 | | - ), |
430 | | - description="A list of social profiles associated with the contact", |
431 | | - ), |
432 | 416 | Property( |
433 | 417 | "has_hard_bounced", |
434 | 418 | BooleanType, |
|
479 | 463 | ), |
480 | 464 | description="An object containing location meta data about a Intercom contact.", |
481 | 465 | ), |
482 | | - Property("ip", StringType, description="The IP address of the contact"), |
483 | 466 | Property("utm_source", StringType, description="The UTM source parameter from the contact's signup URL"), |
484 | 467 | Property("utm_medium", StringType, description="The UTM medium parameter from the contact's signup URL"), |
485 | 468 | Property("utm_campaign", StringType, description="The UTM campaign parameter from the contact's signup URL"), |
|
494 | 477 | ObjectType( |
495 | 478 | Property("type", StringType), |
496 | 479 | Property("id", StringType), |
497 | | - Property("url", StringType), |
498 | 480 | ), |
499 | 481 | ), |
500 | 482 | ), |
501 | | - Property("url", StringType), |
502 | 483 | Property("total_count", IntegerType), |
503 | | - Property("has_more", BooleanType), |
504 | 484 | ), |
505 | 485 | description="Tags associated with the contact", |
506 | 486 | ), |
|
513 | 493 | ObjectType( |
514 | 494 | Property("type", StringType), |
515 | 495 | Property("id", StringType), |
516 | | - Property("url", StringType), |
517 | 496 | ), |
518 | 497 | ), |
519 | 498 | ), |
520 | | - Property("url", StringType), |
521 | 499 | Property("total_count", IntegerType), |
522 | | - Property("has_more", BooleanType), |
523 | 500 | ), |
524 | 501 | description="Notes associated with the contact", |
525 | 502 | ), |
| 503 | + Property("custom_attributes", ObjectType(), description="Custom attributes associated with the contact"), |
| 504 | +).to_dict() |
| 505 | + |
| 506 | +articles_schema = PropertiesList( |
| 507 | + Property("id", StringType), |
| 508 | + Property("parent_type", StringType), |
| 509 | + Property("parent_ids", ArrayType(IntegerType)), |
| 510 | + Property( |
| 511 | + "translated_content", |
| 512 | + ObjectType(*translated_content), |
| 513 | + ), |
| 514 | + Property("languages", ArrayType(StringType)), |
526 | 515 | Property( |
527 | | - "companies", |
| 516 | + "tags", |
528 | 517 | ObjectType( |
529 | | - Property("url", StringType), |
530 | | - Property("total_count", IntegerType), |
531 | | - Property("has_more", BooleanType), |
| 518 | + Property( |
| 519 | + "tags", |
| 520 | + ArrayType( |
| 521 | + ObjectType( |
| 522 | + Property("id", StringType), |
| 523 | + Property("name", StringType), |
| 524 | + Property("applied_at", IntegerType), |
| 525 | + Property( |
| 526 | + "applied_by", |
| 527 | + ObjectType( |
| 528 | + Property("type", StringType), |
| 529 | + Property("id", StringType), |
| 530 | + ), |
| 531 | + ), |
| 532 | + ), |
| 533 | + ), |
| 534 | + ), |
532 | 535 | ), |
533 | | - description="Notes associated with the contact", |
534 | 536 | ), |
535 | | - Property("custom_attributes", ObjectType(), description="Custom attributes associated with the contact"), |
| 537 | + Property("title", StringType), |
| 538 | + Property("description", StringType), |
| 539 | + Property("body", StringType), |
| 540 | + Property("author_id", IntegerType), |
| 541 | + Property("state", StringType), |
| 542 | + Property("created_at", IntegerType), |
| 543 | + Property("updated_at", IntegerType), |
536 | 544 | ).to_dict() |
0 commit comments