Skip to content

Commit 721b890

Browse files
committed
Merge pull request #5 from Staffjoy/tasking
Add tasking
2 parents a7abe60 + 08e4367 commit 721b890

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
setup(name="staffjoy",
44
packages=["staffjoy"],
5-
version="0.4",
5+
version="0.5",
66
description="Staffjoy API Wrapper in Python",
77
author="Philip Thomas",
88
author_email="help@staffjoy.com",
99
license="MIT",
1010
url="https://github.com/staffjoy/client_python",
11-
download_url="https://github.com/StaffJoy/client_python/archive/0.4.tar.gz",
11+
download_url="https://github.com/StaffJoy/client_python/archive/0.5.tar.gz",
1212
keywords=["staffjoy-api", "staffjoy", "staff joy"],
1313
install_requires=["requests[security]"], )

staffjoy/client.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from .resources.cron import Cron
44
from .resources.user import User
55
from .resources.plan import Plan
6+
from .resources.chomp_task import ChompTask
7+
from .resources.mobius_task import MobiusTask
68

79

810
class Client(Resource):
@@ -35,3 +37,23 @@ def get_plans(self, **kwargs):
3537

3638
def get_plan(self, id):
3739
return Plan.get(parent=self, id=id)
40+
41+
def get_chomp_task(self, id):
42+
# id is schedule id
43+
return ChompTask.get(parent=self)
44+
45+
def get_chomp_tasks(self, **kwargs):
46+
return ChompTask.get(parent=self)
47+
48+
def claim_chomp_task(self):
49+
return ChompTask.create(parent=self)
50+
51+
def get_mobius_task(self, id):
52+
# id is schedule id
53+
return MobiusTask.get(parent=self)
54+
55+
def get_mobius_tasks(self, **kwargs):
56+
return MobiusTask.get(parent=self)
57+
58+
def claim_mobius_task(self):
59+
return MobiusTask.create(parent=self)

staffjoy/resources/chomp_task.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from ..resource import Resource
2+
3+
4+
class ChompTask(Resource):
5+
PATH = "/internal/tasking/chomp/{schedule_id}"
6+
ENVELOPE = None

staffjoy/resources/mobius_task.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from ..resource import Resource
2+
3+
4+
class MobiusTask(Resource):
5+
PATH = "/internal/tasking/mobius/{schedule_id}"
6+
ENVELOPE = None

0 commit comments

Comments
 (0)