kirimel-python 0.1.6__tar.gz → 0.1.7__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.6
3
+ Version: 0.1.7
4
4
  Summary: Official KiriMel Python SDK
5
5
  Author-email: KiriMel <support@kirimel.com>
6
6
  License: MIT
@@ -129,11 +129,14 @@ stats = client.campaigns.stats(id)
129
129
  # List subscribers for a list
130
130
  subscribers = client.subscribers.list(list_id, limit=50)
131
131
 
132
+ # List all subscribers
133
+ all_subscribers = client.subscribers.list_all(limit=50)
134
+
132
135
  # Get single subscriber
133
136
  subscriber = client.subscribers.get(id)
134
137
 
135
- # Add subscriber to a list
136
- subscriber = client.subscribers.create(list_id, {
138
+ # Add subscriber
139
+ subscriber = client.subscribers.create({
137
140
  'email': 'user@example.com',
138
141
  'first_name': 'John',
139
142
  'last_name': 'Doe'
@@ -99,11 +99,14 @@ stats = client.campaigns.stats(id)
99
99
  # List subscribers for a list
100
100
  subscribers = client.subscribers.list(list_id, limit=50)
101
101
 
102
+ # List all subscribers
103
+ all_subscribers = client.subscribers.list_all(limit=50)
104
+
102
105
  # Get single subscriber
103
106
  subscriber = client.subscribers.get(id)
104
107
 
105
- # Add subscriber to a list
106
- subscriber = client.subscribers.create(list_id, {
108
+ # Add subscriber
109
+ subscriber = client.subscribers.create({
107
110
  'email': 'user@example.com',
108
111
  'first_name': 'John',
109
112
  'last_name': 'Doe'
@@ -67,13 +67,17 @@ class Subscribers(ResourceClient):
67
67
  """List subscribers for a list"""
68
68
  return self._http_client.get(f"lists/{list_id}/subscribers", params or {})
69
69
 
70
+ def list_all(self, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
71
+ """List all subscribers"""
72
+ return self._http_client.get("subscribers", params or {})
73
+
70
74
  def get(self, subscriber_id: int) -> Dict[str, Any]:
71
75
  """Get single subscriber"""
72
76
  return self._http_client.get(f"subscribers/{subscriber_id}")
73
77
 
74
- def create(self, list_id: int, data: Dict[str, Any]) -> Dict[str, Any]:
75
- """Add subscriber to a list"""
76
- return self._http_client.post(f"lists/{list_id}/subscribers", data)
78
+ def create(self, data: Dict[str, Any]) -> Dict[str, Any]:
79
+ """Add subscriber"""
80
+ return self._http_client.post("subscribers", data)
77
81
 
78
82
  def update(self, subscriber_id: int, data: Dict[str, Any]) -> Dict[str, Any]:
79
83
  """Update subscriber"""
@@ -81,7 +85,7 @@ class Subscribers(ResourceClient):
81
85
 
82
86
  def delete(self, subscriber_id: int) -> Dict[str, Any]:
83
87
  """Delete subscriber"""
84
- return self._http_client.post(f"subscribers/{subscriber_id}/delete")
88
+ return self._http_client.delete(f"subscribers/{subscriber_id}")
85
89
 
86
90
  def unsubscribe(self, subscriber_id: int) -> Dict[str, Any]:
87
91
  """Unsubscribe subscriber"""
@@ -145,7 +149,7 @@ class Lists(ResourceClient):
145
149
 
146
150
  def delete(self, list_id: int) -> Dict[str, Any]:
147
151
  """Delete list"""
148
- return self._http_client.post(f"lists/{list_id}/delete")
152
+ return self._http_client.delete(f"lists/{list_id}")
149
153
 
150
154
  def stats(self, list_id: int) -> Dict[str, Any]:
151
155
  """Get list statistics"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kirimel-python
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Official KiriMel Python SDK
5
5
  Author-email: KiriMel <support@kirimel.com>
6
6
  License: MIT
@@ -129,11 +129,14 @@ stats = client.campaigns.stats(id)
129
129
  # List subscribers for a list
130
130
  subscribers = client.subscribers.list(list_id, limit=50)
131
131
 
132
+ # List all subscribers
133
+ all_subscribers = client.subscribers.list_all(limit=50)
134
+
132
135
  # Get single subscriber
133
136
  subscriber = client.subscribers.get(id)
134
137
 
135
- # Add subscriber to a list
136
- subscriber = client.subscribers.create(list_id, {
138
+ # Add subscriber
139
+ subscriber = client.subscribers.create({
137
140
  'email': 'user@example.com',
138
141
  'first_name': 'John',
139
142
  'last_name': 'Doe'
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kirimel-python"
3
- version = "0.1.6"
3
+ version = "0.1.7"
4
4
  description = "Official KiriMel Python SDK"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
File without changes
File without changes