kirimel-python 0.1.3__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kirimel-python
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Official KiriMel Python SDK
5
5
  Author-email: KiriMel <support@kirimel.com>
6
6
  License: MIT
@@ -13,6 +13,7 @@ from .resources import (
13
13
  Conversions,
14
14
  LandingPages,
15
15
  Workflows,
16
+ Webhooks,
16
17
  )
17
18
 
18
19
 
@@ -57,6 +58,7 @@ class KiriMel:
57
58
  self._conversions: Optional[Conversions] = None
58
59
  self._landing_pages: Optional[LandingPages] = None
59
60
  self._workflows: Optional[Workflows] = None
61
+ self._webhooks: Optional[Webhooks] = None
60
62
 
61
63
  @property
62
64
  def campaigns(self) -> Campaigns:
@@ -120,3 +122,10 @@ class KiriMel:
120
122
  if self._workflows is None:
121
123
  self._workflows = Workflows(self._http_client)
122
124
  return self._workflows
125
+
126
+ @property
127
+ def webhooks(self) -> Webhooks:
128
+ """Get webhooks resource client"""
129
+ if self._webhooks is None:
130
+ self._webhooks = Webhooks(self._http_client)
131
+ return self._webhooks
@@ -424,6 +424,46 @@ class Workflows(ResourceClient):
424
424
  return self._http_client.get(f"workflows/{workflow_id}/data")
425
425
 
426
426
 
427
+ class Webhooks(ResourceClient):
428
+ """Webhooks resource client"""
429
+
430
+ def list(self, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
431
+ """List all webhooks"""
432
+ return self._http_client.get("webhooks", params or {})
433
+
434
+ def get(self, webhook_id: int) -> Dict[str, Any]:
435
+ """Get single webhook"""
436
+ return self._http_client.get(f"webhooks/{webhook_id}")
437
+
438
+ def create(self, data: Dict[str, Any]) -> Dict[str, Any]:
439
+ """Create webhook"""
440
+ return self._http_client.post("webhooks", data)
441
+
442
+ def update(self, webhook_id: int, data: Dict[str, Any]) -> Dict[str, Any]:
443
+ """Update webhook"""
444
+ return self._http_client.post(f"webhooks/{webhook_id}", data)
445
+
446
+ def delete(self, webhook_id: int) -> Dict[str, Any]:
447
+ """Delete webhook"""
448
+ return self._http_client.delete(f"webhooks/{webhook_id}")
449
+
450
+ def test(self, webhook_id: int) -> Dict[str, Any]:
451
+ """Test webhook"""
452
+ return self._http_client.post(f"webhooks/{webhook_id}/test")
453
+
454
+ def logs(self, webhook_id: int) -> Dict[str, Any]:
455
+ """Get webhook logs"""
456
+ return self._http_client.get(f"webhooks/{webhook_id}/logs")
457
+
458
+ def events(self) -> Dict[str, Any]:
459
+ """Get supported webhook events"""
460
+ return self._http_client.get("webhooks/events")
461
+
462
+ def regenerate_secret(self, webhook_id: int) -> Dict[str, Any]:
463
+ """Regenerate webhook secret"""
464
+ return self._http_client.post(f"webhooks/{webhook_id}/secret/regenerate")
465
+
466
+
427
467
  __all__ = [
428
468
  "Campaigns",
429
469
  "Subscribers",
@@ -434,4 +474,5 @@ __all__ = [
434
474
  "Conversions",
435
475
  "LandingPages",
436
476
  "Workflows",
477
+ "Webhooks",
437
478
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kirimel-python
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Official KiriMel Python SDK
5
5
  Author-email: KiriMel <support@kirimel.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kirimel-python"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "Official KiriMel Python SDK"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
File without changes
File without changes
File without changes