From 22a49bb845fee93f1bde2da28bb5a4c919b82a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:04:44 +0100 Subject: [PATCH 1/9] fix: Fixed filtering --- Readme.md | 2 +- mailerlite/sdk/automations.py | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 5093db4..d78d976 100644 --- a/Readme.md +++ b/Readme.md @@ -438,7 +438,7 @@ client = MailerLite.Client({ 'api_key': 'your-api-key' }) -response = client.automations.list(limit=10, page=1, filter={'status': true, 'name': 'some name', 'group': 123456}) +response = client.automations.list(limit=10, page=1, filter={'enabled': True, 'name': 'some name', 'group': 123456}) ``` ### Get an automation diff --git a/mailerlite/sdk/automations.py b/mailerlite/sdk/automations.py index 7817520..aad5b59 100644 --- a/mailerlite/sdk/automations.py +++ b/mailerlite/sdk/automations.py @@ -23,7 +23,22 @@ def list(self, **kwargs): :rtype: dict """ - return self.api_client.request("GET", self.base_api_url).json() + available_params = ["filter", "page", "limit"] + + params = locals() + query_params = {} + for key, val in params["kwargs"].items(): + if key not in available_params: + raise TypeError("Got an unknown argument '%s'" % key) + + if key == "filter": + for filter_key, filter_value in val.items(): + query_params[f"filter[{filter_key}]"] = filter_value + else: + query_params[key] = val + + print(query_params) + return self.api_client.request("GET", self.base_api_url, query_params).json() def get(self, automation_id): """ From b2198a811460bf73e51cae566b804eed5a8819f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:13:24 +0100 Subject: [PATCH 2/9] fix: Fixed filtering --- mailerlite/sdk/automations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailerlite/sdk/automations.py b/mailerlite/sdk/automations.py index aad5b59..6404727 100644 --- a/mailerlite/sdk/automations.py +++ b/mailerlite/sdk/automations.py @@ -74,7 +74,7 @@ def activity(self, automation_id, **kwargs): if key == "filter": for filter_key, filter_value in val.items(): - query_params[filter_key] = filter_value + query_params[f"filter[{filter_key}]"] = filter_value else: query_params[key] = val From e050c381af9b77b80e455c6aceeb7b8a58a6f908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:16:53 +0100 Subject: [PATCH 3/9] fix: Fixed filtering --- mailerlite/sdk/campaigns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailerlite/sdk/campaigns.py b/mailerlite/sdk/campaigns.py index 286f616..d4c4841 100644 --- a/mailerlite/sdk/campaigns.py +++ b/mailerlite/sdk/campaigns.py @@ -85,7 +85,7 @@ def list(self, **kwargs): if key == "filter": for filter_key, filter_value in val.items(): - query_params[filter_key] = filter_value + query_params[f"filter[{filter_key}]"] = filter_value else: query_params[key] = val From 58ae3ca4b34e947154bcefe9f5b86241884286ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:18:23 +0100 Subject: [PATCH 4/9] fix: Fixed filtering --- mailerlite/sdk/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailerlite/sdk/fields.py b/mailerlite/sdk/fields.py index cd606fe..322cebd 100644 --- a/mailerlite/sdk/fields.py +++ b/mailerlite/sdk/fields.py @@ -59,7 +59,7 @@ def list(self, **kwargs): raise TypeError("Got an unknown argument '%s'" % key) if key == "filter": for filter_key, filter_value in val.items(): - query_params[filter_key] = filter_value + query_params[f"filter[{filter_key}]"] = filter_value else: query_params[key] = val From c74ad23cd09e51733dc8c5c02f207542c9d6122f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:19:23 +0100 Subject: [PATCH 5/9] fix: Fixed filtering --- mailerlite/sdk/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailerlite/sdk/forms.py b/mailerlite/sdk/forms.py index a59a5dc..6f5698c 100644 --- a/mailerlite/sdk/forms.py +++ b/mailerlite/sdk/forms.py @@ -29,7 +29,7 @@ def list(self, type, **kwargs): if key == "filter": for filter_key, filter_value in val.items(): - query_params[filter_key] = filter_value + query_params[f"filter[{filter_key}]"] = filter_value else: query_params[key] = val From 089a565b9b2a6717544c7e11e333d891669629fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:23:33 +0100 Subject: [PATCH 6/9] fix: Fixed filtering --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 775e080..dbfb498 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ authors = ["MailerLite "] description = "The official MailerLite Python SDK" name = "mailerlite" -version = "0.1.5" +version = "0.1.6" [tool.poetry.dependencies] python = "^3.7" diff --git a/setup.py b/setup.py index 337e96b..2bb1a00 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -__version__ = "0.1.5" +__version__ = "0.1.6" def _read_long_description(): From 070905eaab404bff9202253ae21fa670249c2104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:32:38 +0100 Subject: [PATCH 7/9] fix: Update Automation tests --- tests/automations_test.py | 5 +-- tests/vcr_cassettes/automations-activity.yml | 16 +++---- tests/vcr_cassettes/automations-get.yml | 41 ++++++++++------- tests/vcr_cassettes/automations-list.yml | 46 ++++++++++++-------- 4 files changed, 62 insertions(+), 46 deletions(-) diff --git a/tests/automations_test.py b/tests/automations_test.py index 2450192..ec29fd8 100644 --- a/tests/automations_test.py +++ b/tests/automations_test.py @@ -1,7 +1,6 @@ import os import mailerlite as MailerLite -import pytest import vcr from dotenv import load_dotenv from pytest import fixture @@ -25,7 +24,7 @@ def automation_keys(): class TestAutomations: # Automationd ID used in tests - automation_id = 75040845299975641 + automation_id = 112078014094771336 @classmethod def setup_class(self): @@ -66,7 +65,7 @@ def test_automation_activity_information_should_be_returned_when_valid_automatio self, ): response = self.client.automations.activity( - self.automation_id, filter={"filter[status]": "active"} + self.automation_id, filter={"status": "active"} ) assert isinstance(response, dict) diff --git a/tests/vcr_cassettes/automations-activity.yml b/tests/vcr_cassettes/automations-activity.yml index 4ed6cc9..84138d0 100644 --- a/tests/vcr_cassettes/automations-activity.yml +++ b/tests/vcr_cassettes/automations-activity.yml @@ -13,22 +13,22 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: GET - uri: https://connect.mailerlite.com/api/automations/75040845299975641/activity?filter%5Bstatus%5D=active + uri: https://connect.mailerlite.com/api/automations/112078014094771336/activity?filter%5Bstatus%5D=active response: body: string: !!binary | - H4sIAAAAAAAAA7SRwU7DMAyGX2XyYadoaVHLaBDiDRD3ZUKmuCwiTUriVENV3x11W1UQV3azZP/+ - P/8e4A0ZQe32AqxxHxHUAI0JkUHBgbmLSksta+8c1bxp0VgK1jBtat9qiZ3REhP7Ftl4F7XcllmR - 3RXlTVVV2/K2yLXEmk1v+Ouxw3d6yEGAxevu7wL1oFyyVoCjI5/rUUBL07ED1CkEcvwyKUDlAprg - 21kx0S2dSyq7AVKwy8grWVCwtviZ/P3qOVBvfIog4ERDoBq0kUZxkV0zyzNK/sObQ1qsfxM/0ZFX - 63DC/kO7F9AhH/4fd/oJhTnUTAD7GYw9owWVjeM3AAAA//8DAMXKwiCMAgAA + H4sIAAAAAAAAA7SRwU7DMBBEf6XaQ09WHdNCwAjxB4h7XaElbFoLxw72OiqK8u8obaqAOPe20u5o + 3s708IGMoLc7Ac76zwS6h9rGxKDhwNwmbaSRVfCeKl41aB1FZ5lWVWiMxNYaiZlDg2yDT0YqdVOU + 94XaFA+bslTr9Z2RWLHtLH8/t7inJwUCHF7ZoI3UgfbZOQGejnyeBwENje/2UOUYyfPbqACtBNQx + NBfFiDdvply2PeTo5pN3cqBh6fArh8fFa6TOhpxAwImGQNfoEg1ikl01zTOL+mXOMc/ef5Ff6MiL + ZTxx/8PdCWiRD1fgHVuhOMV6WwjgcCHjwOhAF8PwAwAA//8DAHDbHFqQAgAA headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d158d2d9e6789f-VIE + - 84f37bdc2bf22788-PRG Cache-Control: - no-cache, private Connection: @@ -38,7 +38,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 14:35:54 GMT + - Fri, 02 Feb 2024 15:31:55 GMT Server: - cloudflare Strict-Transport-Security: diff --git a/tests/vcr_cassettes/automations-get.yml b/tests/vcr_cassettes/automations-get.yml index 2b6d27c..2474f59 100644 --- a/tests/vcr_cassettes/automations-get.yml +++ b/tests/vcr_cassettes/automations-get.yml @@ -13,30 +13,39 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: GET - uri: https://connect.mailerlite.com/api/automations/75040845299975641 + uri: https://connect.mailerlite.com/api/automations/112078014094771336 response: body: string: !!binary | - H4sIAAAAAAAAA4xU70/bMBD9V6qT9i0bSZo0JNI0bWNjoMGnsRbWyXKdazF17OAfQIv6v09O0hIE - Wvlk+d3du+d3Jz9CSS2F4hF4CQVkaZiEh0ka53mepaMkggAkrRAK+IXGDj47qypquZIQAEo6E1hC - YbXDAKzmiwVqsiW0mrIlQaaqCjVDKOZUGAxAY43U+tIddEcF73g2ARiLtYHizzNNWTJMwvgwSw8z - CMCuaq+Jsk5KTTVKS3y+dEIEwFRVC7S4FTfTaoly15BppBZLQi0UEIdx/D6K38fhIMqLOC+iBAJw - dfmflKF3pm1POjFtAWHOWFWROUdRQgDN2QiDdHvd2Z0+2fuV2xUEsMQVFMDaS0ds8cHCJoCGXtWo - 2wF0L72jwvmsn/SmZnwBAZRomOZ1mwQXjaxBK2vQ9B9YNZhuC6YAm7+76b3wfZSORnGcDcMseVJk - 3My3mKEmN4pLQxZauRoCaE6yLY+iJMm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Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d158d0ee0dc27d-VIE + - 84f37bd96aad4114-PRG Cache-Control: - no-cache, private Connection: @@ -46,7 +55,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 14:35:54 GMT + - Fri, 02 Feb 2024 15:31:54 GMT Server: - cloudflare Strict-Transport-Security: diff --git a/tests/vcr_cassettes/automations-list.yml b/tests/vcr_cassettes/automations-list.yml index 1a5e862..42e0f69 100644 --- a/tests/vcr_cassettes/automations-list.yml +++ b/tests/vcr_cassettes/automations-list.yml @@ -17,30 +17,38 @@ interactions: response: body: string: !!binary | - H4sIAAAAAAAAA6RWbU/bSBD+K9FI7Se32I6dYJ+qqnfc9UAF3YdSKA1abdaTZMl61+xLIIny30/r - l2AOVFDvU+zZmWeefWY8ky0U1FLIf2yBF5DDOA2T8DBJ4yzLxukoiSAASUuEHL6isYNPzqqSWq4k - BICSTgUWkFvtMACr+XyOmjSIW7CasiVBpsoSNUPIZ1QYDEBjhdT60L1pRQVvcXYBGIuV+S+ncTJM - wvhwnB6OIQC7rjwnyloqFdUoLfH+0gkRAFNlJdBiR26q1RLlPiHTSC0WhFrIIQ7j+F0Uv4vDQZTl - cZZHCQTgquInLkOvTJOetGSaAMKcsaokM46igADq35oYpN2rV2dvaeX9g9s1BLDENeTAmpcW2OK9 - hV0ANbyqUDcFaG+6osJ5ry/0pmJ8DgEUaJjmVeME5zWtQUNrUOcfWDWYdAETgN31vnpPdB+lo1Ec - j4fhOHlgZNzUp5iiJjeKS0PmWrkKAqh/SRceRUmSDcdhkqTDYdod72//nEerxul68LmFdFpADgtr - K5NPDiYHBTWLqaK6eF9SLlALbvE9U+Xk4IGV+aidQPPhIrLj4zK7u7o8WRSfs/XxjeL0Ip19v0jT - Y37Hv8eZu/osQnqROX92NTxZFZe/b+qzyxPJ1seji/WJZGUWsb9P+Ze/DD/bnN+dfv0zPDtabs42 - n8Kzo/PN6eacX36Lsstv4Zvhka8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clfspYLjmSDNOqSBTb7RbnEakLlJYRusuZn2JYw2m0eLdFhPKTkZKlJSQ2AcTHcv5 + qNWoz29ylsFrnAoF+2YIzHd1h1RUU/y99skMypE6cbpopHBHOVoVrUBYWt+Kq4N9XpWzaoko2Bgw + 7b4U7MapH733mF2VM0XrYvl8M46v/dWDEfdr6CithQ34cr7f69QZ3FrvpS48e+DQJXaQdvpVHiGt + oDfUBD7BxifEL8tE8YtlmYas0o5XhAmUr9frvwEAAP//AwBozF32IxEAAA== headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d158ceaa96c27d-VIE + - 84f37bd6fe62b38f-PRG Cache-Control: - no-cache, private Connection: @@ -50,7 +58,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 14:35:54 GMT + - Fri, 02 Feb 2024 15:31:54 GMT Server: - cloudflare Strict-Transport-Security: From 4e88b72c6e000e5718ae600b8558467cc1276f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:33:17 +0100 Subject: [PATCH 8/9] feat: Update gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e61331b..0569159 100644 --- a/.gitignore +++ b/.gitignore @@ -91,4 +91,5 @@ ENV/ # Rope project settings .ropeproject -.vscode \ No newline at end of file +.vscode +toolset.py From ed3f0b6122b933e6f04da2c4c0d376c426e568a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Hr=C4=8Dek?= Date: Fri, 2 Feb 2024 16:48:23 +0100 Subject: [PATCH 9/9] fix: Update Campaigns tests --- tests/campaigns_test.py | 16 +++-- tests/vcr_cassettes/campaign-activity.yml | 28 ++++----- tests/vcr_cassettes/campaign-cancel.yml | 42 +++---------- tests/vcr_cassettes/campaign-create.yml | 27 ++++---- tests/vcr_cassettes/campaign-delete.yml | 18 +++--- tests/vcr_cassettes/campaign-get.yml | 55 ++++++++-------- tests/vcr_cassettes/campaign-languages.yml | 38 +++++------ tests/vcr_cassettes/campaign-list.yml | 73 ++++++++++++++-------- tests/vcr_cassettes/campaign-schedule.yml | 42 +++---------- tests/vcr_cassettes/campaign-update.yml | 50 +++------------ 10 files changed, 158 insertions(+), 231 deletions(-) diff --git a/tests/campaigns_test.py b/tests/campaigns_test.py index 85b284d..2324715 100644 --- a/tests/campaigns_test.py +++ b/tests/campaigns_test.py @@ -79,7 +79,6 @@ def test_given_proper_parameters_when_user_calls_create_then_new_campaign_is_cre "subject": "This is a test campaign", "from_name": "Test Man", "from": "testuser@mailerlite.com", - "content": "Hi there, this is a test campaign!", } ], } @@ -108,13 +107,12 @@ def test_given_correct_parameters_when_user_calls_update_then_existing_campaign_ ): params = { "name": "New Campaign Name", - "language_id": 2, + "language_id": 1, "emails": [ { - "subject": "This is a new test campaign", + "subject": "This is a new test campaign subject", "from_name": "Test Man", "from": "testuser@mailerlite.com", - "content": "Hi there, this is a new test campaign!", } ], } @@ -150,7 +148,7 @@ def test_given_correct_campaign_id_when_calling_get_then_campaign_is_returned( ) def test_list_of_all_campaigns_should_be_returned(self, campaign_keys): response = self.client.campaigns.list( - limit=10, page=1, filter={"filter[status]": "draft"} + limit=10, page=1, filter={"status": "draft"} ) assert isinstance(response, dict) @@ -172,7 +170,7 @@ def test_given_correct_campaign_id_and_schedule_parameters_when_calling_schedule ): params = { "delivery": "scheduled", - "schedule": {"date": "2022-12-31", "hours": "22", "minutes": "00"}, + "schedule": {"date": "2024-03-31", "hours": "22", "minutes": "00"}, } response = self.client.campaigns.schedule(int(pytest.entity_id), params) @@ -214,11 +212,11 @@ def test_given_correct_campaign_id_when_calling_delete_then_campaign_is_removed( ): response = self.client.campaigns.delete(int(pytest.entity_id)) - assert response == True + assert response is True response = self.client.campaigns.delete(121212) - assert response == False + assert response is False def test_given_incorrect_campaign_id_when_calling_activity_then_type_error_is_returned( self, @@ -232,7 +230,7 @@ def test_given_incorrect_campaign_id_when_calling_activity_then_type_error_is_re def test_given_correct_campaign_id_when_calling_activity_then_campaign_activity_information_is_returned( self, campaign_activity_keys ): - response = self.client.campaigns.activity(75037917434611569) + response = self.client.campaigns.activity(106527960165516964) assert isinstance(response, dict) assert isinstance(response["data"], list) diff --git a/tests/vcr_cassettes/campaign-activity.yml b/tests/vcr_cassettes/campaign-activity.yml index 01ce900..e64ac64 100644 --- a/tests/vcr_cassettes/campaign-activity.yml +++ b/tests/vcr_cassettes/campaign-activity.yml @@ -15,29 +15,25 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: POST - uri: https://connect.mailerlite.com/api/campaigns/75037917434611569/reports/subscriber-activity + uri: https://connect.mailerlite.com/api/campaigns/106527960165516964/reports/subscriber-activity response: body: string: !!binary | - H4sIAAAAAAAAA7xVS2/bMAz+KwEPPbmJJL81DOthtwHDgB3rwVBspdEiS54efSzIfx/kOE6adlt7 - yY0kSPnjx4/0FlrmGNDbLYgWKOQpigsU4zQheVLiFEEEuufK1o32ygHFETRSNJspgCKwfmkbI5bc - AD28E5cxJnme5ElZlEVOIALeMSGBgm03N8HkRgrH543uIALrmPMWKLDGiXseItqbhgOFjinPZIjw - 8EFyhoi8gigk1IY5DhQjNCaMARSB6GvWtoZbC1R5KU9aaGvmgAJBhFxjco2KGY5pTGgSmPDqLG9f - 3BjO3H8q+/ZlCkEzXNAkpSiGCFaCy9YGBhXrQt/fP3+BCCSzrt5Hxq/prmfq6eh65czRFW6y+7VW - U1kgeHJ+16Lu984usBWgCXXSku6dULU45OyiM31kCCUEFXEJb5jGa/pIUYyyOMsSXGJcJPGJPsSd - Njdr0/DN3Nh/S+OBL1fadJM28BvU+g5tQFHOCc7mJJ/jJIe/yyRMMqNJRmP8TpmcVb4qEzxDeZDJ - sI3nMtm/fWmVvMSfEDiVzRl1u92PCKRQmwH5ShgbHlk711taLapFo5XijZs/vwvVgvWiWjSs65m4 - U7ZaBN3kJc6TOMkwTrOyWhjea+NstTjK7HpQinBPn3p2xz/icY0u+8Xe8PsDk4o/uonIjoeLu4XG - G8OVq0PFINWV0d1gDNOcwiNtt1vwRh4HvuRhWa4k++X1h9k3w++F9mFfxjWhKyYtD5s7lF2W7D04 - fILGGX8E87yHr/zRza7M0MgL/D8i6JlbX6KBMDRuRuJTFIHTw0Fz2jG5P21hjQYJMymnXxFvB9Or - g3O4KqN9eg+GwEqbB2ba0Vsz0y61V83oW71yp/5PrzZA0W63+wMAAP//AwAdxcVyrgcAAA== + H4sIAAAAAAAAA7xTTY/bIBD9K6s57ImuTeqPmqrqP6h6X68igrFDg8EdhnQrK/+9gqTNbnPPiZmH + HvPmDbPCIEmCeF7BDCCA803Zdrxtq5qXVbOpWmDgF+3CVvnoCETJQFmjDlfgxG7I1aeu6sru4/9k + fkt+YWCNOwQQK4wGA4GAPdESRF/0hfLOaUVPszRWozWkn5Sf+0Iupi+UnBdpJhf6gpdNvWm7puRN + XfOma6q+QL14pNAXIe6CQrPT+EEqMkdDv78uctJfODCw8u4lF9RHEC5ay8DpVzrHJwazTrNYQUVE + 7WibGNm0Ef2cg6T2Cl+Me14hov37opU7bUHAo5U/o//88B310fgYgEGWokGM0gadxpZpd7b7rI6/ + kUMYr2reN/FNv9LDI+ZObhp4YbBI2t+lgzQ2jRfr65IBeRCbdJC0OZLThHqSZLzLn1naM54WQA95 + XtG9SfIipLhMF/9KnoHR4y+JwyXbSxx2Pjp1yYMf6X2ujLRb40hjEuxdhn9Ed0grdjr9AQAA//8D + AL2U32HnAwAA headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1b73aab87c23d-VIE + - 84f38f4bbc1bb33f-PRG Cache-Control: - no-cache, private Connection: @@ -47,7 +43,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:40:21 GMT + - Fri, 02 Feb 2024 15:45:11 GMT Server: - cloudflare Strict-Transport-Security: @@ -59,7 +55,7 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '117' + - '109' status: code: 200 message: OK diff --git a/tests/vcr_cassettes/campaign-cancel.yml b/tests/vcr_cassettes/campaign-cancel.yml index e58f106..d6929b1 100644 --- a/tests/vcr_cassettes/campaign-cancel.yml +++ b/tests/vcr_cassettes/campaign-cancel.yml @@ -15,53 +15,25 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: POST - uri: https://connect.mailerlite.com/api/campaigns/75117069411026195/cancel + uri: https://connect.mailerlite.com/api/campaigns/112080931966158193/cancel response: body: - string: !!binary | - H4sIAAAAAAAAA8xXbW/bNhD+KwzRAhsg25ITJ4uWBQXaDcXWN3QBhmEqBJo8y0woUiVPUWTD/32g - JFuym5cNK4Z+Mvnw+Nzju/PxvKaCIaPxmkpBY3o2i6Kz8PT8JIrC6Wl0PqMBZZybUmPaGExn02gW - 0YBqlgON6TuoyEuWF0xmmrzzWECxLvyRhaxUzNKAOmRYOhpTYdkCaUBz6ZzUWdr6/utTQB0gSp25 - dreQCsEO1+nC2HRZ5kx3JgKUvAVbp44vQZTKe9wuBQ2oYjorWQadbBpQboEhiJShB8LpdBRNR9OI - RLP4JIyjcxrQshAPmkzjY8+y8+EVDayOIzKdxmEYhyEN6OcSyo5Hl0o1IbC4hyyklm55YGSK4nH3 - AhasVJhCzqRK93N2fDY9CWfnZzSgzbGP1GFeBzb357W5yeYK0gcLojfpMs27AnB98uelVAJsusRc - 0YAurMlpTBEclg7sC88AVkmEMTd5Z5B2NXUFDslbpndV1kWnnF8D96G5WkpHpCOMaKiIJyVbCT7P - RiNob3dx9Or9y6s/P/xMvIzLRF90n4RcLIGJZkXIxdFotH7mgRRNsRmNLgfI3CCa3IOdMUpUcHmR - TNpFQ5ZMdnQXcyPqPWIPbIlfS4JLsBAQfPg7HHW3HdYKiA/oTwlFuMNkwp1LaMc+ztUvxiBYUqxz - ZjOp43DzIgchGTFa1cRxC6AJ04J8l7O7USUFLuPTk7C4+349ztXLNlBXPpXr9jAKw+dHMi+MRabx - x1zq0fZgD+/cDa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J - 74vrRo//VdzjwbPAZSFBo0smc+Yk78V+3B19U3r9qzQU2e2/FYG7P387ib/3yH8S+SmgFbO6/0+q - 4Q5Th1B83chKl/LSWtCo6l0TMiVum8HmbwAAAP//AwD+AKCXog8AAA== + string: "{\n \"message\": \"\"\n}" headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1ba6bef2cc318-VIE + - 84f38f42ba81b324-PRG Cache-Control: - no-cache, private Connection: - keep-alive - Content-Encoding: - - gzip Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:42:32 GMT + - Fri, 02 Feb 2024 15:45:09 GMT Server: - cloudflare Strict-Transport-Security: @@ -73,8 +45,8 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '116' + - '112' status: - code: 200 - message: OK + code: 400 + message: Bad Request version: 1 diff --git a/tests/vcr_cassettes/campaign-create.yml b/tests/vcr_cassettes/campaign-create.yml index ada17f2..c299fba 100644 --- a/tests/vcr_cassettes/campaign-create.yml +++ b/tests/vcr_cassettes/campaign-create.yml @@ -1,8 +1,7 @@ interactions: - request: body: '{"name": "Test Campaign", "language_id": 1, "type": "regular", "emails": - [{"subject": "This is a test campaign", "from_name": "Test Man", "from": "testuser@mailerlite.com", - "content": "Hi there, this is a test campaign!"}]}' + [{"subject": "This is a test campaign", "from_name": "Test Man", "from": "testuser@mailerlite.com"}]}' headers: Accept: - application/json @@ -11,7 +10,7 @@ interactions: Connection: - keep-alive Content-Length: - - '223' + - '174' Content-Type: - application/json User-Agent: @@ -20,22 +19,22 @@ interactions: uri: https://connect.mailerlite.com/api/campaigns response: body: - string: '{"data":{"id":"75117069411026195","account_id":"252151","name":"Test - Campaign","type":"regular","status":"draft","missing_data":[],"settings":[],"filter":[],"filter_for_humans":[],"delivery_schedule":null,"language_id":"1","language":{"id":"1","shortcode":"lt","iso639":"lt-LT","name":"Lietuvi\u0161kai","direction":"ltr"},"created_at":"2022-12-21 - 15:40:19","updated_at":"2022-12-21 15:40:19","scheduled_for":null,"queued_at":null,"started_at":null,"finished_at":null,"stopped_at":null,"default_email_id":"75117069437240597","emails":[{"id":"75117069437240597","account_id":"252151","emailable_id":"75117069411026195","emailable_type":"campaigns","type":"builder_html","from":"testuser@mailerlite.com","from_name":"Test - Man","name":null,"subject":"This is a test campaign","plain_text":"Sveiki,\n\nJ\u016bs - gavote {$account} naujienlai\u0161k\u012f. Ta\u010diau J\u016bs\u0173 el. - pa\u0161to programa programa nepalaiko HTML formato.\n\nNaujienlai\u0161k\u012f - galite rasti \u010dia:\n\n{$url}\n\nPagarbiai,\n{$account}\n\n\n\nJeigu ateityje - nebenorite gauti {$account} naujien\u0173, spauskite \u010dia:\n{$unsubscribe}\n","screenshot_url":null,"preview_url":"https:\/\/preview.mailerlite.io\/preview\/252151\/emails\/75117069437240597","created_at":"2022-12-21 - 15:40:19","updated_at":"2022-12-21 15:40:21","is_designed":true,"language_id":1,"language":{"id":"1","shortcode":"lt","iso639":"lt-LT","name":"Lietuvi\u0161kai","direction":"ltr"},"is_winner":false,"stats":{"sent":0,"opens_count":0,"unique_opens_count":0,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"},"forwards_count":0},"send_after":null,"track_opens":true,"uses_quiz":false}],"used_in_automations":false,"type_for_humans":"Regular","is_stopped":false,"has_winner":null,"winner_version_for_human":null,"winner_sending_time_for_humans":null,"winner_selected_manually_at":null,"can":{"update":true,"delete":true,"send":true,"copy":true,"resend":false},"uses_ecommerce":false,"uses_survey":false,"can_be_scheduled":true,"breadcrumbs":[{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/75117069411026195\/edit","text":"Details","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/emails\/75117069437240597\/edit","text":"Content","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/75117069411026195\/recipients\/basic","text":"Recipients","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/75117069411026195\/review","text":"Review","active":false,"disabled":false,"upcoming":false,"state":null},{"url":"https:\/\/dashboard.mailerlite.com\/campaigns\/75117069411026195\/schedule","text":"Schedule","active":false,"disabled":false,"upcoming":false,"state":null}],"warnings":[],"recipients_count":2,"next_step":"https:\/\/dashboard.mailerlite.com\/campaigns\/75117069411026195\/review","is_currently_sending_out":false}}' + string: '{"data":{"id":"112080931966158193","account_id":"83510","name":"Test + Campaign","type":"regular","status":"draft","missing_data":["content"],"settings":[],"filter":[],"filter_for_humans":[],"delivery_schedule":null,"language_id":"1","language":{"id":"1","shortcode":"lt","iso639":"lt-LT","name":"Lietuvi\u0161kai","direction":"ltr"},"created_at":"2024-02-02 + 15:45:06","updated_at":"2024-02-02 15:45:06","scheduled_for":null,"queued_at":null,"started_at":null,"finished_at":null,"stopped_at":null,"default_email_id":"112080932039558517","emails":[{"id":"112080932039558517","account_id":"83510","emailable_id":"112080931966158193","emailable_type":"campaigns","type":null,"from":"testuser@mailerlite.com","from_name":"Test + Man","reply_to":"igor@mailerlite.com","name":null,"subject":"This is a test + campaign","plain_text":"Sveiki,\n\nJ\u016bs gavote {$account} naujienlai\u0161k\u012f. + Ta\u010diau J\u016bs\u0173 el. pa\u0161to programa programa nepalaiko HTML + formato.\n\nNaujienlai\u0161k\u012f galite rasti \u010dia:\n\n{$url}\n\nPagarbiai,\n{$account}\n\n\n\nJeigu + ateityje nebenorite gauti {$account} naujien\u0173, spauskite \u010dia:\n{$unsubscribe}\n","screenshot_url":null,"preview_url":"https:\/\/preview.mailerlite.io\/preview\/83510\/emails\/112080932039558517","created_at":"2024-02-02 + 15:45:06","updated_at":"2024-02-02 15:45:06","is_designed":false,"language_id":1,"language":{"id":"1","shortcode":"lt","iso639":"lt-LT","name":"Lietuvi\u0161kai","direction":"ltr"},"is_winner":false,"stats":{"sent":0,"opens_count":0,"unique_opens_count":0,"open_rate":{"float":0,"string":"0%"},"clicks_count":0,"unique_clicks_count":0,"click_rate":{"float":0,"string":"0%"},"unsubscribes_count":0,"unsubscribe_rate":{"float":0,"string":"0%"},"spam_count":0,"spam_rate":{"float":0,"string":"0%"},"hard_bounces_count":0,"hard_bounce_rate":{"float":0,"string":"0%"},"soft_bounces_count":0,"soft_bounce_rate":{"float":0,"string":"0%"},"forwards_count":0,"forward_rate":{"float":0,"string":"0%"},"social_interactions_count":0,"social_interaction_rate":{"float":0,"string":"0%"},"click_to_open_rate":{"float":0,"string":"0%"}},"send_after":null,"track_opens":true,"uses_survey":false,"uses_quiz":false,"preheader":null}],"used_in_automations":false,"type_for_humans":"Regular","is_stopped":false,"has_winner":null,"winner_version_for_human":null,"winner_sending_time_for_humans":null,"winner_selected_manually_at":null,"can":{"update":true,"delete":true,"send":true,"copy":true,"resend":false},"uses_ecommerce":false,"ecommerce_stats":{"total_orders":0,"total_price":"0","multi_currency":false},"uses_survey":false,"can_be_scheduled":false,"is_smart_sending_index_option_finished":false,"is_applied_for_smart_sending_index_option":false,"warnings":[],"recipients_count":2,"next_step":null,"is_currently_sending_out":false,"can_be_copied":true,"has_basic_filter":true,"basic_filter_for_humans":{"included_groups":[],"excluded_groups":[],"included_segments":[],"excluded_segments":[],"all_active_subscribers":true}}}' headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1b72f3d7ec2c5-VIE + - 84f38f2c3a12b345-PRG Cache-Control: - no-cache, private Connection: @@ -43,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:40:21 GMT + - Fri, 02 Feb 2024 15:45:06 GMT Server: - cloudflare Strict-Transport-Security: diff --git a/tests/vcr_cassettes/campaign-delete.yml b/tests/vcr_cassettes/campaign-delete.yml index be5e703..9ff3fbd 100644 --- a/tests/vcr_cassettes/campaign-delete.yml +++ b/tests/vcr_cassettes/campaign-delete.yml @@ -15,7 +15,7 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: DELETE - uri: https://connect.mailerlite.com/api/campaigns/75117069411026195 + uri: https://connect.mailerlite.com/api/campaigns/112080931966158193 response: body: string: '' @@ -25,13 +25,13 @@ interactions: CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1ba6ddea7c223-VIE + - 84f38f445a62b373-PRG Cache-Control: - no-cache, private Connection: - keep-alive Date: - - Wed, 21 Dec 2022 15:42:32 GMT + - Fri, 02 Feb 2024 15:45:10 GMT Server: - cloudflare Strict-Transport-Security: @@ -41,7 +41,7 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '115' + - '111' status: code: 204 message: No Content @@ -65,15 +65,15 @@ interactions: response: body: string: !!binary | - H4sIAAAAAAAAA6rmUlBQUFDKTS0uTkxPVbJSUPLLVygsTS2qVChKLS7NKSlWSMsvUsjNT0nNUYh2 - LCiIifEFsYtjYpwTcwsSM9PzEKxYBUMjEFTiqgUAAAD//wMAY8lVEVgAAAA= + H4sIAAAAAAAAA6pWyk0tLk5MT1WyUgpKLc4vLUpOVcjLL1FIyy/NS9FTqgUAAAD//wMAZiyhmiEA + AAA= headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1ba6fbc1f77e9-VIE + - 84f38f470ea2412c-PRG Cache-Control: - no-cache, private Connection: @@ -83,7 +83,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:42:33 GMT + - Fri, 02 Feb 2024 15:45:10 GMT Server: - cloudflare Strict-Transport-Security: @@ -93,7 +93,7 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '114' + - '110' status: code: 404 message: Not Found diff --git a/tests/vcr_cassettes/campaign-get.yml b/tests/vcr_cassettes/campaign-get.yml index dfc5c71..6d661b4 100644 --- a/tests/vcr_cassettes/campaign-get.yml +++ b/tests/vcr_cassettes/campaign-get.yml @@ -13,43 +13,38 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: GET - uri: https://connect.mailerlite.com/api/campaigns/75117069411026195 + uri: https://connect.mailerlite.com/api/campaigns/112080931966158193 response: body: string: !!binary | - H4sIAAAAAAAAA8xXbW/bNhD+KwzRAhsgvzZOFi0LCnQbiq1v6AIMw1QINHmWmVCkSh6jyIb/+0BJ - luQ0aTasG/rJ5MPjw4d3p+N5SwVDRuMtlYLG9HQxm51OT86OZ7Pp/GR2tqARZZwbrzGtDeaL+Wwx - oxHVLAca0zdQkhcsL5jMNHkTsIhiVYQlC5lXzNKIOmToHY2psGyFNKK5dE7qLG3O/vNDRB0gSp25 - ZraSCsEOx+nK2HTtc6ZbEwFK3oCtUsfXILwCGmuvVEQV05lnGbR6aY90twygWxuL3IigtFA0otKZ - k2dn9Wz07lV/w3dGuWtJIyqkBY7SaBpThZbuIsotMASRMgys0/l8NJuP5jMyW8TH03h2RiPqC/Gg - yTx+Ng1S2huIcMn9NT568O22BnDILB4gK6mlW98xMkVxgAhYMa8whZxJlR4G+dnp/Hi6ODulEa2X - g2vvJsLA5v5EqHeypYL0wQzqTdrU4G3GuD5bll4qATZdYx6isbImpzFFcOgd2OeBAaySCGNu8tYg - bUN0CQ7Ja6a7oLXO8Msr4MHvl2vpiHSEEQ0lCaRkL4FGlBuNoIPd+dGPb19c/vHuJxJkXCT6vP0l - 5HwNTNQjQs6PRqPtkwCkaIrdaHQxQJYG0eQBbI1RooKL82TSDGqyZNLRnS+NqA6IA7AnfikJrsFC - RPDhOxy1ux1WCkhw6A8JRbjFZMKdS2jLPs7Vz8YgWFJsc2YzqePp7nkOQjJitKqI4xZAE6YF+SZn - t6NSClzHJ8fT4vbb7ThXLxpHXYZQbpvF2XT69EjmhbHINH6fSz3aLxzg7XEDaKUMw1gbDT246w95 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vamvyOBnHod4Ld9hAbrI9t2+qbREn2p5i5afRL4CH5HYLeQCz6O4Ld9LJx/QV8e2/fQe+Jr + RqPYCnlslXGaxvnqO7dXiVPvUUPKgGypcNH+zbujLB71qhMXFOIj5RADBRWiX9NmkGmLPUf+a0Aa + T0vCcu9p99SSSsVWYRRXY1vfQE//kpNXA/wxvEw4qP7/ONCXeDgpXaLdTK3Jh9SawdXZeqowPWqE + 69N4ZyxDOl0hNdqIxmyOfsw6+dz2l8y+JyUZOsxSkP1Yu2azH3vqVtoidn3XSLu6Jq9pKG5A1HD6 + xQka5XxJPrQ71wGN52QH6XdeRyOsdPSerN6cBTnbLo1WzWl4jB36mlpdo5ehT2xLelWuafW2f7gc + 07FpDHdPoB+YDhYv6O3h5ehJc8NkZRD6JAdLr6KCULPvOIe+LDGbwbuLcl6Odg3T0PgkkTkG1mr/ + Pu3wY+xEAVtgq00sqVSVd7Hpc6TXC+DADFTVKf8z7imMxqh0ZNekhnvQ9+dpt9v9DQAA//8DAB3x + kj3fCwAA headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1ba66c967c2f7-VIE + - 84f38f37ad4db33f-PRG Cache-Control: - no-cache, private Connection: @@ -59,7 +54,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:42:31 GMT + - Fri, 02 Feb 2024 15:45:07 GMT Server: - cloudflare Strict-Transport-Security: @@ -71,7 +66,7 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '118' + - '115' status: code: 200 message: OK diff --git a/tests/vcr_cassettes/campaign-languages.yml b/tests/vcr_cassettes/campaign-languages.yml index 660fe18..46576a1 100644 --- a/tests/vcr_cassettes/campaign-languages.yml +++ b/tests/vcr_cassettes/campaign-languages.yml @@ -17,29 +17,29 @@ interactions: response: body: string: !!binary | - H4sIAAAAAAAAA5SXbU/bMBDHvwrKK5Cw1MQpJbzjGUZhrIVp2tgLJ3FbL8bpbKfjQXz3KVd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Fi1NnFwrNj + tBXaAm03wzmU0QKlcV+sfOXFip19DJTztCvFHK+/OV+g5WiH+H5n8Ru+++Y4uvO9e0mQ9+ea3d4Q + /bJXe1UYoc3RCrTV73lBu5QJGrNp2ewxdCLbbZP3MqEY2iIquXc6g5RbwyYvRhHVtA8xX/7eFlNa + s20wfNuaPZ4SNd6zXzXRjsY0xHnpefHL/y///PgfAAD//wMA3VL/zpYNAAA= headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1b73c6b1577f7-VIE + - 84f38f4d8f7f4126-PRG Cache-Control: - no-cache, private Connection: @@ -49,7 +49,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:40:21 GMT + - Fri, 02 Feb 2024 15:45:11 GMT Server: - cloudflare Strict-Transport-Security: @@ -61,7 +61,7 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '116' + - '108' status: code: 200 message: OK diff --git a/tests/vcr_cassettes/campaign-list.yml b/tests/vcr_cassettes/campaign-list.yml index 7e7bc39..24a4dd0 100644 --- a/tests/vcr_cassettes/campaign-list.yml +++ b/tests/vcr_cassettes/campaign-list.yml @@ -17,35 +17,58 @@ interactions: response: body: string: !!binary | - H4sIAAAAAAAAA7RX247bNhD9FYFIkxdlfdmLsyqKFEgKBGgTFEn7UMQLYkyOJXYpUksO7XUN/3tB - 3e3dYIsmeROHw5kzF86h9kwCAcs+75mSLGOLi+vZ4nJ+db24Oj+fv7p8xVIGQthgiNcK88v57HLG - UmagRJYxQk9cQFmByg1LGe2qKHaYBw2OpcwTUPAsY9LBmljKSuW9MjlvHTNhDaGJOw6FqhQa8uwm - ZR6JlMk9yz7fpGytNKFjmQladyu+to4XoQTTKknUaoNux70oUAaNnb4GkwfIsYnhgqVMOARCyYFi - UNP5/OVs/nJ2ncym2cWr7CJGGCr5lErnR0YonbO7gKE91gg8gaMjyVoZ5YsTJVtVRxKJawiaOJag - NB+XZzGdLhbX09n5NUtZ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nCFIOagvLF0MoHfvk+xbZkiNe01nlRwngtpVUxU0RqDjJFJIvn + YIoPPxeju6z8fTbQ4j+hRTPDndEiMlhaTQ0VLXTI3+sKWoAWoAVoAVqAFn3T4nqczKbz+2IPvk5X + D+tnl8fbxXye3a5fPe+trl6ny+nV621z926ZTrK35Y8kH7EBWV2n6yM/L5uxthvbjJPvWc6Zp6Q6 + gZ+XxdWT6taTyh2u/i23R+LTU7LzI7Kz9CbLm4aLWfrjcfFm9DHvDRaPD0WfnB/WbeSrjx11/Mrv + op2NF+fpyG3LnW3LU+/47sbfZ7/Wo4tVcaT2vud6nCzT9bcWX5QnI1vV56+Yhuq/63SWBFLjJJ1M + Vtmknt6f8twngfS4Qm5Rs8rSL7/LK1DR1tBms/kDAAD//wMAlRoujMd8AAA= headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1bd7b88ae77f2-VIE + - 84f38f397a9fb354-PRG Cache-Control: - no-cache, private Connection: @@ -55,7 +78,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:44:37 GMT + - Fri, 02 Feb 2024 15:45:08 GMT Server: - cloudflare Strict-Transport-Security: @@ -67,7 +90,7 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '119' + - '114' status: code: 200 message: OK diff --git a/tests/vcr_cassettes/campaign-schedule.yml b/tests/vcr_cassettes/campaign-schedule.yml index f78e6ed..85e8cfe 100644 --- a/tests/vcr_cassettes/campaign-schedule.yml +++ b/tests/vcr_cassettes/campaign-schedule.yml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"delivery": "scheduled", "schedule": {"date": "2022-12-31", "hours": "22", + body: '{"delivery": "scheduled", "schedule": {"date": "2024-03-31", "hours": "22", "minutes": "00"}}' headers: Accept: @@ -16,51 +16,25 @@ interactions: User-Agent: - MailerLite-Python-SDK-Client method: POST - uri: https://connect.mailerlite.com/api/campaigns/75117069411026195/schedule + uri: https://connect.mailerlite.com/api/campaigns/112080931966158193/schedule response: body: - string: !!binary | - H4sIAAAAAAAAA6xWbW/jNgz+K6pwB2yAk9hp06xeVxxw23DY7g1DgWGYD4ZiMbZaWfJJVF0nyH8f - ZDuxk2vXfdgnSw+phxRJU9xSzpDReEsFpzFdLqJoGV5eXURROL+MrhY0oCzLtFOYtgrzxTxaRDSg - ipVAY/oRavKWlRUTuSIfPRZQbCovMpA7yQwNqEWGzrYQ4w0NaCmsFSpPO9t/fwmoBUShctvt1kIi - mPE6XWuTFq5kqlfhIMUDmCa1WQHcSW9xv+Q0oJKp3LEcerdpQDMDDIGnDD0QzueTaD6ZRyRaxBdh - HF3RgLqKP6syj889y8GG92ikdR6R+TwOwzgMaUC/OnA9j3JStiEweISshRK2OFHSVXWEcFgzJzGF - kgmZHqfofDm/CBdXSxrQVuwDc5rGkc7TaWxPspWE9Nn8Dyp9YrM+33bI9coJycGkBZaSBnRtdElj - imDRWTBvPAMYKRCmmS57hbQvoVuwSD4wdSiqPhhudQeZT8RtISwRljCioCaelOxd8GnVCkF5veuz - nz+9vf3r8y/Eu3GTqOv+S8h1AYy3K0KuzyaT7SsPpKir3WRyM0JWGlGXHuyVUaCEm+tk1i1asmR2 - oLtead4cEXtgT/xOECzAQEDw+Tuc9actNhKID+hPCUV4xGSWWZvQnn1ayl+1RjCk2pbM5ELF4e5N - CVwwopVsiM0MgCJMcfJdyR4nteBYxJcXYfX4/XZayrddoG59KredMArD12eirLRBpvDHUqjJXnCE - 9+ZG0FpqhrHSCgZwNxj55BDMtmKcC5VPuqAend+LJKwxjhbV4xMyI/LiWSHqaky42/VRTGZtHG9G - yTjO6XUy63Pm8+gLhAa0kkyo1AedxvRPgaw8S1SiPqHZNCVLXBhdzMF/FiufQCsBfSY0J9tX/Y+1 - m5KPAiwCNuS21neMVGYDufSnwgVn5p4RJYDUTcdTC0DJyFqbkqEj724/vJ+S36W4V+KOVFoJr7bM - 4C4g/WrVkFwTzbNNg61P4TL2Xm5fOSN3fvWMxwhq5HXQskPNOlpSN/dsc3Jiw4RCMGB1zbzTo1sm - 6jfoHZKCZEUGdkM2BjZNrnTd+0U2RLeeNP48G1lnAanhjrcMjChGLBqt/Da6Itat7L1pquxOEEHq - phJ2Q6zopHF7U+V1MiNWsEtU24991dtCY+qMpDEtECsbJzNfCNqwHKa51rkEVgnru08yG7rRZDht - J5XRPJkNSDLr2moy+6adJrNo/sPF4/L8clqp3NePgQcB9Tcu9Ph01ACFPsDJrOvD/2Lpf3m3fKMX - NuVgRa6A0xiNg5Mncj7sD9NA+94V2mCmue/UlWyJ9OX5VbubfH4/TAKftbT3ggaUCwMZCq1oTCUa - umuN10Ip/6SvmbTQjQTWG7Jt7w4DqitQNm2LrN07Jb46SE9hv08Nw9bLtgu1sEUjVE5jGr72BjMp - svsn2L7BW+BlvlHZHbMe4Jc5bMXK0dl2++Khghn/KDmVHRkewf/BsF7jExwj+GWOtTY1M3w473lB - 8ZSt20mte7PRsOy+S9m+yJwFm351YtOnfvelxXgqVMoc6pL5UrGHwvDv39GwR/84zJHCpv2IdFAv - 2FBanQ/dLn0AY4VWA9WJ3DvvR1AU5bG9Ey0Jmf+zSqYck7IZzWaZ59z2/97+uhwkDDtvZL/OdNXs - 1wY6SReRPkiQ6bIEk8Hhci1snXmA5oBlTKUrSIdRdy+omVHDBC1smjljQKFsDnfVDvc2d/8AAAD/ - /wMAPUO5d/kLAAA= + string: "{\n \"message\": \"Campaign cannot be scheduled\"\n}" headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1ba699f15c26a-VIE + - 84f38f3facaf2790-PRG Cache-Control: - no-cache, private Connection: - keep-alive - Content-Encoding: - - gzip Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:42:32 GMT + - Fri, 02 Feb 2024 15:45:09 GMT Server: - cloudflare Strict-Transport-Security: @@ -72,8 +46,8 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '117' + - '113' status: - code: 200 - message: OK + code: 422 + message: Unprocessable Entity version: 1 diff --git a/tests/vcr_cassettes/campaign-update.yml b/tests/vcr_cassettes/campaign-update.yml index 07b737e..fda3b24 100644 --- a/tests/vcr_cassettes/campaign-update.yml +++ b/tests/vcr_cassettes/campaign-update.yml @@ -1,8 +1,7 @@ interactions: - request: - body: '{"name": "New Campaign Name", "language_id": 2, "emails": [{"subject": - "This is a new test campaign", "from_name": "Test Man", "from": "testuser@mailerlite.com", - "content": "Hi there, this is a new test campaign!"}]}' + body: '{"name": "New Campaign Name", "language_id": 1, "emails": [{"subject": + "This is a new test campaign subject", "from_name": "Test Man", "from": "testuser@mailerlite.com"}]}' headers: Accept: - application/json @@ -11,60 +10,31 @@ interactions: Connection: - keep-alive Content-Length: - - '216' + - '171' Content-Type: - application/json User-Agent: - MailerLite-Python-SDK-Client method: PUT - uri: https://connect.mailerlite.com/api/campaigns/75117069411026195 + uri: https://connect.mailerlite.com/api/campaigns/112080931966158193 response: body: - string: !!binary | - H4sIAAAAAAAAA8xWbW/bNhD+KwzRAhsgv8iJk0XLggLthmLrG4oAwzAVwlk8S0woUiVPcWTD/32g - JFtymjQbsLdPIh8eHz68Ox1vwwUQ8GjDpeARP5uH4dn09PwkDKez0/B8zgMOaWoqTUljMJvPwnnI - A66hQB7xd7hiL6EoQWaavfNYwKku/ZLFrFJgecAdAVWOR1xYWBIPeCGdkzpL2rN//xRwh0RSZ66d - LaUitMNxsjQ2yasCdGciUMlbtHXi0hxFpZBHulIq4Ap0VkGGnV7eI/tbetDlxlJqhFdaKh5w6czp - 8XkzG31409/wg1HuRvKAC2kxJWk0j7giy7cBTy0CoUiAPOt0NhuFs9EsZOE8OplG4TkPeFWKR01m - 0fHUS+luIPwld9f4XGHVbWsBR2DpAFlKLV1+z8iU5QEicAmVogQLkCo5DPLx2exkOj8/4wFvlr1r - 7yfCwObhRGh2wkJh8mgG9SZdaqRdxrg+WxaVVAJtklPho7G0puARJ3RUObQvPANaJQnHqSk6g6QL - 0RU6Ym9B74PWOaNa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D - n1qthnaW3KJ10uie6t66F++bWJLF4Xn3rBSm/s8qQFegVD3ozVLPuen+vd11BSrsZ/6Q3Tg1Zb0b - W2xXWo90TsLUFAXaFPeXa2BX2Vus91gKOlngvm/e0y8sgkhtVSzaPvB+JRLg8oUBK8aHzVg82bdz - g/Kza//iCQrpe/7uaXyF1HSavp0kedtLFdL5vqIPTFWmpmgyaPDHd83dNvgr+r5ShQ/Fdb3Hvyru - 686zmMpSoiYXTxbgZNqL/bhf+l/p9c/SUGQ3/w8E/gEAAP//wupAeHcR7sRghAhFjozVUSpPLMpD - 9GIRcQcr84x0lPJSK0rii0tSC6gb3JnF8cmlRUWpeSU5lfCSKb+0BFZC1AIAAAD//wMAlBEyeukP - AAA= + string: "{\n \"message\": \"Server Error\"\n}" headers: Access-Control-Allow-Origin: - '*' CF-Cache-Status: - DYNAMIC CF-RAY: - - 77d1ba5d0ecdc24f-VIE + - 84f38f315fe0b37d-PRG Cache-Control: - no-cache, private Connection: - keep-alive - Content-Encoding: - - gzip Content-Type: - application/json Date: - - Wed, 21 Dec 2022 15:42:31 GMT + - Fri, 02 Feb 2024 15:45:07 GMT Server: - cloudflare Strict-Transport-Security: @@ -76,8 +46,8 @@ interactions: X-RateLimit-Limit: - '120' X-RateLimit-Remaining: - - '119' + - '116' status: - code: 200 - message: OK + code: 500 + message: Internal Server Error version: 1