Skip to content

Commit 7ca7f7a

Browse files
authored
Merge pull request #57 from mailerlite/bugfix/issue-31/subscribers-pagination
Bugfix/issue 31/subscribers pagination
2 parents ceb93b7 + e62fd67 commit 7ca7f7a

15 files changed

+149
-148
lines changed

Diff for: mailerlite/sdk/subscribers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ def list(self, **kwargs):
1717
Returns a list of all subscribers.
1818
Ref: https://developers.mailerlite.com/docs/subscribers.html#list-all-subscribers
1919
20-
:param **kwargs: dict You can pass additional arguments - page, limit or filter by status
20+
:param **kwargs: dict You can pass additional arguments - cursor, limit or filter by status
2121
:raises: :class: `TypeError` : Got an unknown argument
2222
:return: JSON array
2323
:rtype: dict
2424
"""
2525

26-
available_params = ["filter", "limit", "page"]
26+
available_params = ["filter", "limit", "cursor"]
2727

2828
params = locals()
2929
query_params = {}

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
authors = ["MailerLite <[email protected]>"]
33
description = "The official MailerLite Python SDK"
44
name = "mailerlite"
5-
version = "0.1.8"
5+
version = "0.1.9"
66

77
[tool.poetry.dependencies]
88
python = "^3.7"

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import find_packages, setup
22

3-
__version__ = "0.1.8"
3+
__version__ = "0.1.9"
44

55

66
def _read_long_description():

Diff for: tests/subscribers_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_api_url_is_properly_set(self):
9595
"tests/vcr_cassettes/subscribers-list.yml", filter_headers=["Authorization"]
9696
)
9797
def test_list_of_all_subscribers_should_be_returned(self, subscriber_keys):
98-
response = self.client.subscribers.list(limit=10, page=1)
98+
response = self.client.subscribers.list(limit=10)
9999

100100
assert isinstance(response, dict)
101101
assert isinstance(response["data"], list)

Diff for: tests/vcr_cassettes/subscribers-assign-subscriber-to-group.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ interactions:
2020
response:
2121
body:
2222
string: !!binary |
23-
H4sIAAAAAAAAA4SR3WoDIRCFX6XMtQnuT3aJV73oVV+hFDFqm6G7KjoW2pB3L5OfTSiU4o3f8Tjj
24-
HA/gDBlQB0AHCppuO25lP2w2cujHsRskCPCzwQkUvOdYE/lCjydlbeMMAgoZqgUUGEv46VmJNVvP
25-
SkJGHwiUFBCTD0XbWC9sJ7Qf9wIbdDbkb8c3xKSNc9kX7tWsT4ur112xGXfeaUOgoJVtv2ralewf
26-
mlY1g2oGEFDDL1+o0yTAZm/on5vJ/WVpRyU7EPCGfnKFMwxm5rmf4z6AgMkU0hfpKXIyNs7JhK+l
27-
PU+eb4i07NM+Bn8FjniBb406neEozn9SQL28cnz8UAx3A8ZEGDRe/ccfAAAA//8DANQT7bvvAQAA
23+
H4sIAAAAAAAAA4SR3WoDIRCFX6XMtQn7v8SrXvSqr1CKGLXN0F0VHQttyLuXyc9uKIXijd/xOOMc
24+
j2A1aZBHQAsS6nY37qpu6Ptq6MaxHSoQ4GaNE0h4T6FEcpkez8rWhBkEZNJUMkjQhvDTsRJKMo6V
25+
iIzOE8hKQIjOZ2VCubKZ0HzcC2xQSZNbj1fEqLS1yWXuVW/Pi6uXfTYJ984qTSChqZpuUzebqnuo
26+
G1kPsh5AQPG/fL5MkwCTnKZ/bkb7t6WX7SjbEQS8oZts5gy9nnnu53DwIGDSmdRVegqcjAlz1P5r
27+
ac+TpxWRln08BO9uwBEv8K1QxQucxOVPMsiXV46PH4r+bsAQCb3Cm//0AwAA//8DAOk5ezHvAQAA
2828
headers:
2929
CF-Cache-Status:
3030
- DYNAMIC
3131
CF-RAY:
32-
- 8ecbc9d16b6db30f-BEG
32+
- 8ecce0fafe40e291-BEG
3333
Cache-Control:
3434
- no-cache, private
3535
Connection:
@@ -39,7 +39,7 @@ interactions:
3939
Content-Type:
4040
- application/json
4141
Date:
42-
- Wed, 04 Dec 2024 12:27:03 GMT
42+
- Wed, 04 Dec 2024 15:37:37 GMT
4343
Server:
4444
- cloudflare
4545
Transfer-Encoding:
@@ -55,12 +55,12 @@ interactions:
5555
x-ratelimit-limit:
5656
- '120'
5757
x-ratelimit-remaining:
58-
- '113'
58+
- '91'
5959
status:
6060
code: 200
6161
message: OK
6262
- request:
63-
body: '{"name": "UTQHTNKzcA"}'
63+
body: '{"name": "QQLKGrQXgy"}'
6464
headers:
6565
Accept:
6666
- application/json
@@ -78,21 +78,21 @@ interactions:
7878
uri: https://connect.mailerlite.com/api/groups
7979
response:
8080
body:
81-
string: '{"data":{"id":"139791144002258679","name":"UTQHTNKzcA","active_count":0,"sent_count":0,"opens_count":0,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribed_count":0,"unconfirmed_count":0,"bounced_count":0,"junk_count":0,"created_at":"2024-12-04
82-
12:27:03"}}'
81+
string: '{"data":{"id":"139803133867984396","name":"QQLKGrQXgy","active_count":0,"sent_count":0,"opens_count":0,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribed_count":0,"unconfirmed_count":0,"bounced_count":0,"junk_count":0,"created_at":"2024-12-04
82+
15:37:38"}}'
8383
headers:
8484
CF-Cache-Status:
8585
- DYNAMIC
8686
CF-RAY:
87-
- 8ecbc9d34e9ee295-BEG
87+
- 8ecce0fc9ca9e290-BEG
8888
Cache-Control:
8989
- no-cache, private
9090
Connection:
9191
- keep-alive
9292
Content-Type:
9393
- application/json
9494
Date:
95-
- Wed, 04 Dec 2024 12:27:03 GMT
95+
- Wed, 04 Dec 2024 15:37:38 GMT
9696
Server:
9797
- cloudflare
9898
Transfer-Encoding:
@@ -108,7 +108,7 @@ interactions:
108108
x-ratelimit-limit:
109109
- '120'
110110
x-ratelimit-remaining:
111-
- '112'
111+
- '90'
112112
status:
113113
code: 201
114114
message: Created
@@ -128,19 +128,19 @@ interactions:
128128
User-Agent:
129129
- MailerLite-Python-SDK-Client
130130
method: POST
131-
uri: https://connect.mailerlite.com/api/subscribers/139790465506477360/groups/139791144002258679
131+
uri: https://connect.mailerlite.com/api/subscribers/139790465506477360/groups/139803133867984396
132132
response:
133133
body:
134134
string: !!binary |
135-
H4sIAAAAAAAAA4SNsQrCMBgGX0U+cGshidXabG6CIAg6lzSNEtv+kTRxsPTdRXGoLo53cNyAWgUF
136-
OcDWkOCLIi84zzLGhFiuV3mBBKQ6A4nT8bA97ncPvUECpYO9m1K7SAGSJegNhQm6m6H+h0uvgnmt
137-
zq1Tnyp4SxdIsDnGBLq1uplmb/G/i9THqtfeVqae1JG0o7P13ZetXCT9Za6RmunUGxVMXb5eEExk
138-
KRcpy2ZcSJFLtsA4PgEAAP//AwCfq/pfNwEAAA==
135+
H4sIAAAAAAAAA4SNsQ6CMBgGX8V8iRsmhaJAX8BBFzY3UkohFf1rSmtiCO9uMA7g4niXXG5EI72E
136+
GGEaCMS8yBmPOc8PWZGnvDggAsm7hkBZnk9HV166FyJI5c1TV8oG8hAswqDJL9A+NA0/XDnp9bxq
137+
b1Z+K+8MdRBgW0wR1M2ofpl9xP8u0BDqQTlT62ZRB1KWWuPuK1vbQGplroH65dRp6XVTzS8kLEl3
138+
cbJj6SbeC54JnmOa3gAAAP//AwDxeR8fNwEAAA==
139139
headers:
140140
CF-Cache-Status:
141141
- DYNAMIC
142142
CF-RAY:
143-
- 8ecbc9d47d59e28f-BEG
143+
- 8ecce0fd9c46e292-BEG
144144
Cache-Control:
145145
- no-cache, private
146146
Connection:
@@ -150,7 +150,7 @@ interactions:
150150
Content-Type:
151151
- application/json
152152
Date:
153-
- Wed, 04 Dec 2024 12:27:03 GMT
153+
- Wed, 04 Dec 2024 15:37:38 GMT
154154
Server:
155155
- cloudflare
156156
Transfer-Encoding:
@@ -166,7 +166,7 @@ interactions:
166166
x-ratelimit-limit:
167167
- '120'
168168
x-ratelimit-remaining:
169-
- '111'
169+
- '89'
170170
status:
171171
code: 200
172172
message: OK
@@ -194,13 +194,13 @@ interactions:
194194
CF-Cache-Status:
195195
- DYNAMIC
196196
CF-RAY:
197-
- 8ecbc9d5dc4ce291-BEG
197+
- 8ecce0feed8ce298-BEG
198198
Cache-Control:
199199
- no-cache, private
200200
Connection:
201201
- keep-alive
202202
Date:
203-
- Wed, 04 Dec 2024 12:27:04 GMT
203+
- Wed, 04 Dec 2024 15:37:38 GMT
204204
Server:
205205
- cloudflare
206206
access-control-allow-origin:
@@ -214,7 +214,7 @@ interactions:
214214
x-ratelimit-limit:
215215
- '120'
216216
x-ratelimit-remaining:
217-
- '110'
217+
- '88'
218218
status:
219219
code: 204
220220
message: No Content
@@ -234,21 +234,21 @@ interactions:
234234
User-Agent:
235235
- MailerLite-Python-SDK-Client
236236
method: DELETE
237-
uri: https://connect.mailerlite.com/api/groups/139791144002258679
237+
uri: https://connect.mailerlite.com/api/groups/139803133867984396
238238
response:
239239
body:
240240
string: ''
241241
headers:
242242
CF-Cache-Status:
243243
- DYNAMIC
244244
CF-RAY:
245-
- 8ecbc9d70ee9e28f-BEG
245+
- 8ecce1004a3ab311-BEG
246246
Cache-Control:
247247
- no-cache, private
248248
Connection:
249249
- keep-alive
250250
Date:
251-
- Wed, 04 Dec 2024 12:27:04 GMT
251+
- Wed, 04 Dec 2024 15:37:38 GMT
252252
Server:
253253
- cloudflare
254254
access-control-allow-origin:
@@ -262,7 +262,7 @@ interactions:
262262
x-ratelimit-limit:
263263
- '120'
264264
x-ratelimit-remaining:
265-
- '109'
265+
- '87'
266266
status:
267267
code: 204
268268
message: No Content

Diff for: tests/vcr_cassettes/subscribers-count.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ interactions:
1717
response:
1818
body:
1919
string: !!binary |
20-
H4sIAAAAAAAAA6pWKskvScxRsjKuBQAAAP//AwCxSv0nCwAAAA==
20+
H4sIAAAAAAAAA6pWKskvScxRsjI0MDCuBQAAAP//AwCdOk0fDgAAAA==
2121
headers:
2222
CF-Cache-Status:
2323
- DYNAMIC
2424
CF-RAY:
25-
- 8ecbc9e46b87e292-BEG
25+
- 8ecce10d0f83b01e-BEG
2626
Cache-Control:
2727
- no-cache, private
2828
Connection:
@@ -32,7 +32,7 @@ interactions:
3232
Content-Type:
3333
- application/json
3434
Date:
35-
- Wed, 04 Dec 2024 12:27:06 GMT
35+
- Wed, 04 Dec 2024 15:37:40 GMT
3636
Server:
3737
- cloudflare
3838
Transfer-Encoding:
@@ -48,7 +48,7 @@ interactions:
4848
x-ratelimit-limit:
4949
- '120'
5050
x-ratelimit-remaining:
51-
- '100'
51+
- '78'
5252
status:
5353
code: 200
5454
message: OK

Diff for: tests/vcr_cassettes/subscribers-create.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ interactions:
2020
response:
2121
body:
2222
string: !!binary |
23-
H4sIAAAAAAAAA4SRwU4DIRCGX8XMmW1gy7aWkwdPvoIxhAJtibtAYDDRpu9uprbbxsQYLnzDzwAf
24-
R3AGDagjBAcKxHKz3nC5knIYHrmUmx4Y+MmEERSgrzg8nWlh0wQMKhpsFRQYi+HDUyW1Yj1VciD0
25-
EUFxBin7WLVN7cJ2DPb9vkABXQz62/INQ9bGueIrnSUW50Hd27baErbeaYOgoOe97ETfcfkgeiVW
26-
SgzAoMVfudjGkYEt3uA/O7P7K9KvFSc3u1T2HufE0HHR8eU5IdWSmuyCH10lw9FMZOYlHSIwGE1F
27-
fSk9J3Jn05RN/JwvSG7KDQPO83xI0V+BPmGGLx10/oETg31JLVdQr28kmJ4S4p2ClDFEHa750zcA
28-
AAD//wMA1rlfGg0CAAA=
23+
H4sIAAAAAAAAA4SRzU4DIRRGX8XcNdPADNNaVi5c+QrGEApYiTNA4GKiTd/d3NpOG2NiZsP5OMPP
24+
xwGcQQPqAMGBAjFsN1su11KO4z2XctsDAz+bMIEC9BXHhxOtbJqBQUWDrYICYzF8eEpSK9ZTkgOh
25+
jwiKM0jZx6ptame2U7DvtwEJuhj01+krhqyNc8VX2kusTh+t3nbVlrDzThsEBT3vZSf6jss70Sux
26+
VmIEBi3+8mKbJga2eIP//Jnd38qoho0a1sDgNZW9x8UYOy46PpyNfkNG8JOr1HA0MzXzlN4iMJhM
27+
RX2OHhN1Z9OcTfxcDkjdlCsGXMb5LUV/AXqEBb500PkHjgz2JbVcQT2/UMF0lRBvKkgZQ9Th4h+/
28+
AQAA//8DAFbFuXINAgAA
2929
headers:
3030
CF-Cache-Status:
3131
- DYNAMIC
3232
CF-RAY:
33-
- 8ecbc9ca0c9fe291-BEG
33+
- 8ecce0f39e5ee290-BEG
3434
Cache-Control:
3535
- no-cache, private
3636
Connection:
@@ -40,7 +40,7 @@ interactions:
4040
Content-Type:
4141
- application/json
4242
Date:
43-
- Wed, 04 Dec 2024 12:27:02 GMT
43+
- Wed, 04 Dec 2024 15:37:36 GMT
4444
Server:
4545
- cloudflare
4646
Transfer-Encoding:
@@ -56,7 +56,7 @@ interactions:
5656
x-ratelimit-limit:
5757
- '120'
5858
x-ratelimit-remaining:
59-
- '118'
59+
- '96'
6060
status:
6161
code: 200
6262
message: OK

Diff for: tests/vcr_cassettes/subscribers-delete.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ interactions:
2323
CF-Cache-Status:
2424
- DYNAMIC
2525
CF-RAY:
26-
- 8ecbc9e1cc5771a3-BEG
26+
- 8ecce10a7c1fe290-BEG
2727
Cache-Control:
2828
- no-cache, private
2929
Connection:
3030
- keep-alive
3131
Date:
32-
- Wed, 04 Dec 2024 12:27:06 GMT
32+
- Wed, 04 Dec 2024 15:37:40 GMT
3333
Server:
3434
- cloudflare
3535
access-control-allow-origin:
@@ -43,7 +43,7 @@ interactions:
4343
x-ratelimit-limit:
4444
- '120'
4545
x-ratelimit-remaining:
46-
- '102'
46+
- '80'
4747
status:
4848
code: 204
4949
message: No Content
@@ -73,7 +73,7 @@ interactions:
7373
CF-Cache-Status:
7474
- DYNAMIC
7575
CF-RAY:
76-
- 8ecbc9e368dde297-BEG
76+
- 8ecce10bcd72e293-BEG
7777
Cache-Control:
7878
- no-cache, private
7979
Connection:
@@ -83,7 +83,7 @@ interactions:
8383
Content-Type:
8484
- application/json
8585
Date:
86-
- Wed, 04 Dec 2024 12:27:06 GMT
86+
- Wed, 04 Dec 2024 15:37:40 GMT
8787
Server:
8888
- cloudflare
8989
Transfer-Encoding:
@@ -97,7 +97,7 @@ interactions:
9797
x-ratelimit-limit:
9898
- '120'
9999
x-ratelimit-remaining:
100-
- '101'
100+
- '79'
101101
status:
102102
code: 404
103103
message: Not Found

0 commit comments

Comments
 (0)