pushary 2.3.0__tar.gz → 2.4.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.
- {pushary-2.3.0 → pushary-2.4.0}/PKG-INFO +1 -1
- {pushary-2.3.0 → pushary-2.4.0}/pyproject.toml +1 -1
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/__init__.py +1 -1
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/reminders.py +7 -2
- {pushary-2.3.0 → pushary-2.4.0}/tests/test_reminders.py +4 -2
- {pushary-2.3.0 → pushary-2.4.0}/.gitignore +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/LICENSE +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/README.md +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/examples/agno/README.md +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/examples/dify/README.md +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/examples/llamaindex/README.md +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/examples/microsoft/README.md +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/examples/strands/README.md +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/_types.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/_util.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/adapters.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/client.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/decisions.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/errors.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/keys.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/py.typed +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/src/pushary/webhook.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/tests/test_adapters.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/tests/test_agent.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/tests/test_client.py +0 -0
- {pushary-2.3.0 → pushary-2.4.0}/tests/test_webhook.py +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from typing import Callable, Dict, Optional
|
|
3
|
+
from uuid import uuid4
|
|
3
4
|
|
|
4
5
|
RequestFn = Callable[..., Dict[str, object]]
|
|
5
6
|
|
|
@@ -12,10 +13,11 @@ class RemindersResource:
|
|
|
12
13
|
self, body: str, *, in_minutes: Optional[int] = None, at: Optional[str] = None,
|
|
13
14
|
title: Optional[str] = None, agent_name: Optional[str] = None,
|
|
14
15
|
session_id: Optional[str] = None, machine_id: Optional[str] = None,
|
|
15
|
-
env: Optional[str] = None,
|
|
16
|
+
env: Optional[str] = None, request_id: Optional[str] = None,
|
|
16
17
|
) -> Dict[str, object]:
|
|
17
18
|
values = {"body": body, "inMinutes": in_minutes, "at": at, "title": title,
|
|
18
|
-
"agentName": agent_name, "sessionId": session_id, "machineId": machine_id, "env": env
|
|
19
|
+
"agentName": agent_name, "sessionId": session_id, "machineId": machine_id, "env": env,
|
|
20
|
+
"requestId": str(uuid4()) if request_id is None else request_id}
|
|
19
21
|
return self._request("POST", "/reminders", body={key: value for key, value in values.items() if value is not None})
|
|
20
22
|
|
|
21
23
|
def list(self) -> Dict[str, object]:
|
|
@@ -23,3 +25,6 @@ class RemindersResource:
|
|
|
23
25
|
|
|
24
26
|
def cancel(self, reminder_id: str) -> Dict[str, object]:
|
|
25
27
|
return self._request("POST", "/reminders", body={"cancelReminderId": reminder_id})
|
|
28
|
+
|
|
29
|
+
def get(self, reminder_id: str) -> Dict[str, object]:
|
|
30
|
+
return self._request("POST", "/reminders", body={"reminderId": reminder_id})
|
|
@@ -7,11 +7,13 @@ class ReminderTests(unittest.TestCase):
|
|
|
7
7
|
def test_schedule_list_and_cancel_use_authenticated_reminder_resource(self):
|
|
8
8
|
with mock.patch.object(PusharyServer, '_request', return_value={'pending': []}) as request:
|
|
9
9
|
client = PusharyServer('pk_test.secret')
|
|
10
|
-
client.reminders.schedule('Check deploy', in_minutes=30)
|
|
10
|
+
client.reminders.schedule('Check deploy', in_minutes=30, request_id='stable-request')
|
|
11
11
|
client.reminders.list()
|
|
12
12
|
client.reminders.cancel('id')
|
|
13
|
+
client.reminders.get('id')
|
|
13
14
|
self.assertEqual(request.call_args_list, [
|
|
14
|
-
mock.call('POST', '/reminders', body={'body': 'Check deploy', 'inMinutes': 30}),
|
|
15
|
+
mock.call('POST', '/reminders', body={'body': 'Check deploy', 'inMinutes': 30, 'requestId': 'stable-request'}),
|
|
15
16
|
mock.call('GET', '/reminders'),
|
|
16
17
|
mock.call('POST', '/reminders', body={'cancelReminderId': 'id'}),
|
|
18
|
+
mock.call('POST', '/reminders', body={'reminderId': 'id'}),
|
|
17
19
|
])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|