python-zendesk-sdk 0.8.0__tar.gz → 0.11.0__tar.gz

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 (60) hide show
  1. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/.gitignore +1 -0
  2. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/PKG-INFO +41 -5
  3. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/README.md +40 -4
  4. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/enriched_tickets.py +27 -0
  5. python_zendesk_sdk-0.11.0/examples/organizations.py +110 -0
  6. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/pyproject.toml +1 -1
  7. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/__init__.py +1 -1
  8. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/client.py +17 -0
  9. python_zendesk_sdk-0.11.0/src/zendesk_sdk/clients/organizations.py +353 -0
  10. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/tickets.py +93 -0
  11. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_clients.py +249 -1
  12. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_package_import.py +1 -1
  13. python_zendesk_sdk-0.8.0/src/zendesk_sdk/clients/organizations.py +0 -106
  14. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/.flake8 +0 -0
  15. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/.github/workflows/publish.yml +0 -0
  16. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/.python-version +0 -0
  17. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/LICENSE +0 -0
  18. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/context7.json +0 -0
  19. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/basic_usage.py +0 -0
  20. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/caching.py +0 -0
  21. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/error_handling.py +0 -0
  22. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/groups.py +0 -0
  23. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/help_center.py +0 -0
  24. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/pagination_example.py +0 -0
  25. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/search.py +0 -0
  26. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/examples/users.py +0 -0
  27. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/__init__.py +0 -0
  28. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/attachments.py +0 -0
  29. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/base.py +0 -0
  30. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/groups.py +0 -0
  31. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/help_center/__init__.py +0 -0
  32. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/help_center/articles.py +0 -0
  33. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/help_center/categories.py +0 -0
  34. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/help_center/sections.py +0 -0
  35. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/search.py +0 -0
  36. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/ticket_fields.py +0 -0
  37. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/clients/users.py +0 -0
  38. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/config.py +0 -0
  39. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/exceptions.py +0 -0
  40. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/http_client.py +0 -0
  41. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/__init__.py +0 -0
  42. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/base.py +0 -0
  43. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/comment.py +0 -0
  44. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/enriched_ticket.py +0 -0
  45. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/group.py +0 -0
  46. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/help_center.py +0 -0
  47. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/organization.py +0 -0
  48. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/search.py +0 -0
  49. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/ticket.py +0 -0
  50. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/models/user.py +0 -0
  51. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/src/zendesk_sdk/pagination.py +0 -0
  52. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/__init__.py +0 -0
  53. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_client.py +0 -0
  54. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_config.py +0 -0
  55. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_exceptions.py +0 -0
  56. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_help_center_client.py +0 -0
  57. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_http_client.py +0 -0
  58. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_models.py +0 -0
  59. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_pagination.py +0 -0
  60. {python_zendesk_sdk-0.8.0 → python_zendesk_sdk-0.11.0}/tests/test_search_query_config.py +0 -0
@@ -186,6 +186,7 @@ Thumbs.db
186
186
 
187
187
  # Debug files
188
188
  debug.py
189
+ debug_*.py
189
190
 
190
191
  # Local directories
191
192
  .claude/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-zendesk-sdk
3
- Version: 0.8.0
3
+ Version: 0.11.0
4
4
  Summary: Modern Python SDK for Zendesk API
5
5
  Project-URL: Homepage, https://github.com/bormog/python-zendesk-sdk
6
6
  Project-URL: Repository, https://github.com/bormog/python-zendesk-sdk
@@ -230,8 +230,32 @@ user = await client.users.merge(source_id, target_id) # Merge into target
230
230
 
231
231
  ### Organizations
232
232
  ```python
233
- org = await client.organizations.get(org_id) # Get organization by ID
233
+ # Read
234
+ org = await client.organizations.get(org_id) # Get organization by ID (cached)
234
235
  paginator = client.organizations.list() # List organizations (paginator)
236
+
237
+ # Create
238
+ org = await client.organizations.create(
239
+ name="Acme Corp",
240
+ domain_names=["acme.com"],
241
+ tags=["enterprise"],
242
+ organization_fields={"plan": "premium"},
243
+ )
244
+ org = await client.organizations.create_or_update( # Upsert by external_id
245
+ name="Acme Corp",
246
+ external_id="acme-123",
247
+ )
248
+
249
+ # Update
250
+ org = await client.organizations.update(
251
+ org_id,
252
+ name="Acme Corporation",
253
+ tags=["enterprise", "vip"],
254
+ organization_fields={"plan": "enterprise"},
255
+ )
256
+
257
+ # Delete
258
+ await client.organizations.delete(org_id)
235
259
  ```
236
260
 
237
261
  ### Groups
@@ -265,6 +289,7 @@ await client.groups.delete(group_id)
265
289
  ```python
266
290
  # Read
267
291
  ticket = await client.tickets.get(ticket_id) # Get ticket by ID
292
+ tickets = await client.tickets.get_many([id1, id2]) # Get multiple tickets (batch)
268
293
  paginator = client.tickets.list() # List tickets (paginator)
269
294
  paginator = client.tickets.for_user(user_id) # User's tickets (paginator)
270
295
  paginator = client.tickets.for_organization(org_id) # Org's tickets (paginator)
@@ -294,9 +319,16 @@ await client.tickets.delete(ticket_id)
294
319
  ### Comments (nested under tickets)
295
320
  ```python
296
321
  paginator = client.tickets.comments.list(ticket_id) # List comments (paginator)
322
+ result = await client.tickets.comments.get_last(ticket_id) # Last comment + author
297
323
  ticket = await client.tickets.comments.add(ticket_id, body, public=False)
298
324
  await client.tickets.comments.make_private(ticket_id, comment_id)
299
325
  comment = await client.tickets.comments.redact(ticket_id, comment_id, text)
326
+
327
+ # Get last comment with author (single API call)
328
+ result = await client.tickets.comments.get_last(ticket_id)
329
+ if result:
330
+ comment, author = result
331
+ print(f"{author.name}: {comment.body}")
300
332
  ```
301
333
 
302
334
  ### Tags (nested under tickets)
@@ -327,9 +359,12 @@ Load tickets with all related data (comments, users, field definitions) in minim
327
359
  ```python
328
360
  from zendesk_sdk import SearchQueryConfig
329
361
 
330
- # Get ticket with all related data
362
+ # Get single ticket with all related data
331
363
  enriched = await client.tickets.get_enriched(12345)
332
364
 
365
+ # Batch: get multiple enriched tickets (much faster than calling get_enriched in a loop)
366
+ enriched_list = await client.tickets.get_many_enriched([12345, 12346, 12347])
367
+
333
368
  print(f"Ticket: {enriched.ticket.subject}")
334
369
  print(f"Requester: {enriched.requester.name}")
335
370
  print(f"Assignee: {enriched.assignee.name if enriched.assignee else 'Unassigned'}")
@@ -489,7 +524,7 @@ Access Help Center (Guide) via `client.help_center` namespace:
489
524
  ```python
490
525
  cat = await client.help_center.categories.get(category_id)
491
526
  paginator = client.help_center.categories.list() # Paginator
492
- cat = await client.help_center.categories.create(name, description)
527
+ cat = await client.help_center.categories.create(name, description=description)
493
528
  cat = await client.help_center.categories.update(category_id, name=new_name)
494
529
  await client.help_center.categories.delete(category_id, force=True)
495
530
  ```
@@ -499,7 +534,7 @@ await client.help_center.categories.delete(category_id, force=True)
499
534
  sec = await client.help_center.sections.get(section_id)
500
535
  paginator = client.help_center.sections.list() # Paginator
501
536
  paginator = client.help_center.sections.for_category(category_id)
502
- sec = await client.help_center.sections.create(category_id, name, description)
537
+ sec = await client.help_center.sections.create(category_id, name, description=description)
503
538
  sec = await client.help_center.sections.update(section_id, name=new_name)
504
539
  await client.help_center.sections.delete(section_id, force=True)
505
540
  ```
@@ -675,6 +710,7 @@ client.users.get.cache_invalidate(user_id)
675
710
  See the `examples/` directory for complete usage examples:
676
711
  - `basic_usage.py` - Basic configuration and API operations
677
712
  - `users.py` - Users CRUD (create, update, delete, suspend, passwords)
713
+ - `organizations.py` - Organizations CRUD (create, update, delete, upsert)
678
714
  - `groups.py` - Groups CRUD (create, update, delete, list)
679
715
  - `search.py` - Type-safe search with SearchQueryConfig
680
716
  - `pagination_example.py` - Working with paginated results
@@ -192,8 +192,32 @@ user = await client.users.merge(source_id, target_id) # Merge into target
192
192
 
193
193
  ### Organizations
194
194
  ```python
195
- org = await client.organizations.get(org_id) # Get organization by ID
195
+ # Read
196
+ org = await client.organizations.get(org_id) # Get organization by ID (cached)
196
197
  paginator = client.organizations.list() # List organizations (paginator)
198
+
199
+ # Create
200
+ org = await client.organizations.create(
201
+ name="Acme Corp",
202
+ domain_names=["acme.com"],
203
+ tags=["enterprise"],
204
+ organization_fields={"plan": "premium"},
205
+ )
206
+ org = await client.organizations.create_or_update( # Upsert by external_id
207
+ name="Acme Corp",
208
+ external_id="acme-123",
209
+ )
210
+
211
+ # Update
212
+ org = await client.organizations.update(
213
+ org_id,
214
+ name="Acme Corporation",
215
+ tags=["enterprise", "vip"],
216
+ organization_fields={"plan": "enterprise"},
217
+ )
218
+
219
+ # Delete
220
+ await client.organizations.delete(org_id)
197
221
  ```
198
222
 
199
223
  ### Groups
@@ -227,6 +251,7 @@ await client.groups.delete(group_id)
227
251
  ```python
228
252
  # Read
229
253
  ticket = await client.tickets.get(ticket_id) # Get ticket by ID
254
+ tickets = await client.tickets.get_many([id1, id2]) # Get multiple tickets (batch)
230
255
  paginator = client.tickets.list() # List tickets (paginator)
231
256
  paginator = client.tickets.for_user(user_id) # User's tickets (paginator)
232
257
  paginator = client.tickets.for_organization(org_id) # Org's tickets (paginator)
@@ -256,9 +281,16 @@ await client.tickets.delete(ticket_id)
256
281
  ### Comments (nested under tickets)
257
282
  ```python
258
283
  paginator = client.tickets.comments.list(ticket_id) # List comments (paginator)
284
+ result = await client.tickets.comments.get_last(ticket_id) # Last comment + author
259
285
  ticket = await client.tickets.comments.add(ticket_id, body, public=False)
260
286
  await client.tickets.comments.make_private(ticket_id, comment_id)
261
287
  comment = await client.tickets.comments.redact(ticket_id, comment_id, text)
288
+
289
+ # Get last comment with author (single API call)
290
+ result = await client.tickets.comments.get_last(ticket_id)
291
+ if result:
292
+ comment, author = result
293
+ print(f"{author.name}: {comment.body}")
262
294
  ```
263
295
 
264
296
  ### Tags (nested under tickets)
@@ -289,9 +321,12 @@ Load tickets with all related data (comments, users, field definitions) in minim
289
321
  ```python
290
322
  from zendesk_sdk import SearchQueryConfig
291
323
 
292
- # Get ticket with all related data
324
+ # Get single ticket with all related data
293
325
  enriched = await client.tickets.get_enriched(12345)
294
326
 
327
+ # Batch: get multiple enriched tickets (much faster than calling get_enriched in a loop)
328
+ enriched_list = await client.tickets.get_many_enriched([12345, 12346, 12347])
329
+
295
330
  print(f"Ticket: {enriched.ticket.subject}")
296
331
  print(f"Requester: {enriched.requester.name}")
297
332
  print(f"Assignee: {enriched.assignee.name if enriched.assignee else 'Unassigned'}")
@@ -451,7 +486,7 @@ Access Help Center (Guide) via `client.help_center` namespace:
451
486
  ```python
452
487
  cat = await client.help_center.categories.get(category_id)
453
488
  paginator = client.help_center.categories.list() # Paginator
454
- cat = await client.help_center.categories.create(name, description)
489
+ cat = await client.help_center.categories.create(name, description=description)
455
490
  cat = await client.help_center.categories.update(category_id, name=new_name)
456
491
  await client.help_center.categories.delete(category_id, force=True)
457
492
  ```
@@ -461,7 +496,7 @@ await client.help_center.categories.delete(category_id, force=True)
461
496
  sec = await client.help_center.sections.get(section_id)
462
497
  paginator = client.help_center.sections.list() # Paginator
463
498
  paginator = client.help_center.sections.for_category(category_id)
464
- sec = await client.help_center.sections.create(category_id, name, description)
499
+ sec = await client.help_center.sections.create(category_id, name, description=description)
465
500
  sec = await client.help_center.sections.update(section_id, name=new_name)
466
501
  await client.help_center.sections.delete(section_id, force=True)
467
502
  ```
@@ -637,6 +672,7 @@ client.users.get.cache_invalidate(user_id)
637
672
  See the `examples/` directory for complete usage examples:
638
673
  - `basic_usage.py` - Basic configuration and API operations
639
674
  - `users.py` - Users CRUD (create, update, delete, suspend, passwords)
675
+ - `organizations.py` - Organizations CRUD (create, update, delete, upsert)
640
676
  - `groups.py` - Groups CRUD (create, update, delete, list)
641
677
  - `search.py` - Type-safe search with SearchQueryConfig
642
678
  - `pagination_example.py` - Working with paginated results
@@ -2,6 +2,7 @@
2
2
 
3
3
  This example demonstrates:
4
4
  - Loading tickets with all related data (comments, users, field definitions)
5
+ - Batch loading multiple enriched tickets with get_many_enriched()
5
6
  - Using EnrichedTicket for efficient data access
6
7
  - Accessing custom field values with human-readable names
7
8
  - Minimizing API requests with batch loading
@@ -60,6 +61,15 @@ async def main() -> None:
60
61
  if field:
61
62
  print(f"Field type: {field.type}, Required: {field.required}")
62
63
 
64
+ # ==================== Last comment shortcut ====================
65
+
66
+ # Get just the last comment with its author (single API call)
67
+ result = await client.tickets.comments.get_last(12345)
68
+ if result:
69
+ comment, author = result
70
+ author_name = author.name if author else "Unknown"
71
+ print(f"\nLast comment by {author_name}: {comment.body[:80]}")
72
+
63
73
  # ==================== Comments with authors ====================
64
74
 
65
75
  # Process comments with author information
@@ -72,6 +82,23 @@ async def main() -> None:
72
82
  else:
73
83
  print(f" - Unknown: {body_preview}")
74
84
 
85
+ # ==================== Batch enriched tickets ====================
86
+
87
+ # Load multiple tickets with all related data at once
88
+ # Much more efficient than calling get_enriched() in a loop:
89
+ # - 1 API call for all tickets (show_many)
90
+ # - 1 API call for all users (show_many)
91
+ # - 1 API call for field definitions
92
+ # - N parallel API calls for comments (one per ticket)
93
+ ticket_ids = [12345, 12346, 12347]
94
+ enriched_list = await client.tickets.get_many_enriched(ticket_ids)
95
+
96
+ print(f"\n--- Batch loaded {len(enriched_list)} enriched tickets ---")
97
+ for item in enriched_list:
98
+ print(f" #{item.ticket.id}: {item.ticket.subject}")
99
+ print(f" Requester: {item.requester.name if item.requester else 'N/A'}")
100
+ print(f" Comments: {len(item.comments)}")
101
+
75
102
  # ==================== Search with enrichment ====================
76
103
 
77
104
  # Search for tickets and load all related data
@@ -0,0 +1,110 @@
1
+ """Organizations API example for Zendesk SDK.
2
+
3
+ This example demonstrates:
4
+ - Reading organizations (get, list)
5
+ - Creating organizations
6
+ - Updating organizations
7
+ - Upserting organizations (create_or_update)
8
+ - Deleting organizations
9
+ """
10
+
11
+ import asyncio
12
+
13
+ from zendesk_sdk import ZendeskClient, ZendeskConfig
14
+
15
+
16
+ async def main() -> None:
17
+ config = ZendeskConfig(
18
+ subdomain="your-subdomain",
19
+ email="your-email@example.com",
20
+ token="your-api-token",
21
+ )
22
+
23
+ async with ZendeskClient(config) as client:
24
+ # ==================== Read Operations ====================
25
+
26
+ print("=== Read Operations ===")
27
+
28
+ # Get organization by ID (cached)
29
+ org = await client.organizations.get(12345)
30
+ print(f"Organization: {org.name}")
31
+ print(f" Domains: {org.domain_names}")
32
+ print(f" Tags: {org.tags}")
33
+
34
+ # List all organizations with pagination
35
+ print("\nAll organizations:")
36
+ async for org in client.organizations.list(limit=10):
37
+ print(f" {org.id}: {org.name}")
38
+
39
+ # Collect organizations to list
40
+ orgs = await client.organizations.list(limit=50).collect()
41
+ print(f"\nCollected {len(orgs)} organizations")
42
+
43
+ # ==================== Create Operations ====================
44
+
45
+ print("\n=== Create Operations ===")
46
+
47
+ # Create minimal organization
48
+ new_org = await client.organizations.create(name="Acme Corp")
49
+ print(f"Created organization: {new_org.id} - {new_org.name}")
50
+
51
+ # Create organization with all options
52
+ detailed_org = await client.organizations.create(
53
+ name="Enterprise Client",
54
+ domain_names=["enterprise.com", "enterprise.io"],
55
+ details="123 Business Ave, Suite 100",
56
+ notes="VIP customer, priority support",
57
+ tags=["enterprise", "vip"],
58
+ group_id=12345,
59
+ shared_tickets=True,
60
+ shared_comments=True,
61
+ organization_fields={"plan": "premium", "industry": "tech"},
62
+ )
63
+ print(f"Created detailed org: {detailed_org.id} - {detailed_org.name}")
64
+
65
+ # ==================== Update Operations ====================
66
+
67
+ print("\n=== Update Operations ===")
68
+
69
+ # Update tags only
70
+ updated = await client.organizations.update(
71
+ new_org.id,
72
+ tags=["enterprise", "partner"],
73
+ )
74
+ print(f"Updated tags: {updated.tags}")
75
+
76
+ # Update multiple fields
77
+ updated = await client.organizations.update(
78
+ new_org.id,
79
+ name="Acme Corporation",
80
+ domain_names=["acme.com", "acme.io"],
81
+ organization_fields={"plan": "enterprise"},
82
+ )
83
+ print(f"Updated org: {updated.name} (domains={updated.domain_names})")
84
+
85
+ # ==================== Upsert Operations ====================
86
+
87
+ print("\n=== Upsert Operations ===")
88
+
89
+ # Create or update by external_id
90
+ upserted = await client.organizations.create_or_update(
91
+ name="Synced Organization",
92
+ external_id="CRM-12345",
93
+ tags=["synced"],
94
+ organization_fields={"source": "crm"},
95
+ )
96
+ print(f"Upserted org: {upserted.id} - {upserted.name}")
97
+
98
+ # ==================== Delete Operations ====================
99
+
100
+ print("\n=== Delete Operations ===")
101
+
102
+ await client.organizations.delete(new_org.id)
103
+ print(f"Deleted organization: {new_org.id}")
104
+
105
+ await client.organizations.delete(detailed_org.id)
106
+ print(f"Deleted organization: {detailed_org.id}")
107
+
108
+
109
+ if __name__ == "__main__":
110
+ asyncio.run(main())
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-zendesk-sdk"
3
- version = "0.8.0"
3
+ version = "0.11.0"
4
4
  description = "Modern Python SDK for Zendesk API"
5
5
  authors = [
6
6
  {name = "bormog"}
@@ -5,7 +5,7 @@ This package provides a clean, async-first interface to the Zendesk API
5
5
  with full type safety and comprehensive error handling.
6
6
  """
7
7
 
8
- __version__ = "0.8.0"
8
+ __version__ = "0.11.0"
9
9
 
10
10
  from .client import ZendeskClient
11
11
  from .clients import (
@@ -95,6 +95,23 @@ class ZendeskClient:
95
95
  Example:
96
96
  org = await client.organizations.get(12345)
97
97
  paginator = await client.organizations.list()
98
+
99
+ # Create an organization
100
+ org = await client.organizations.create(
101
+ name="Acme Corp", domain_names=["acme.com"]
102
+ )
103
+
104
+ # Update an organization
105
+ org = await client.organizations.update(12345, tags=["vip"])
106
+
107
+ # Upsert by external_id
108
+ org = await client.organizations.create_or_update(
109
+ name="Acme Corp", external_id="acme-123"
110
+ )
111
+
112
+ # Delete an organization
113
+ await client.organizations.delete(12345)
114
+
98
115
  # For search use client.search.organizations()
99
116
  """
100
117
  from .clients import OrganizationsClient