Skip to content

Commit

Permalink
Merge pull request #5 from Staffjoy/tasking
Browse files Browse the repository at this point in the history
Add tasking
  • Loading branch information
philipithomas committed Feb 23, 2016
2 parents a7abe60 + 08e4367 commit 721b890
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -2,12 +2,12 @@

setup(name="staffjoy",
packages=["staffjoy"],
version="0.4",
version="0.5",
description="Staffjoy API Wrapper in Python",
author="Philip Thomas",
author_email="help@staffjoy.com",
license="MIT",
url="https://github.com/staffjoy/client_python",
download_url="https://github.com/StaffJoy/client_python/archive/0.4.tar.gz",
download_url="https://github.com/StaffJoy/client_python/archive/0.5.tar.gz",
keywords=["staffjoy-api", "staffjoy", "staff joy"],
install_requires=["requests[security]"], )
22 changes: 22 additions & 0 deletions staffjoy/client.py
Expand Up @@ -3,6 +3,8 @@
from .resources.cron import Cron
from .resources.user import User
from .resources.plan import Plan
from .resources.chomp_task import ChompTask
from .resources.mobius_task import MobiusTask


class Client(Resource):
Expand Down Expand Up @@ -35,3 +37,23 @@ def get_plans(self, **kwargs):

def get_plan(self, id):
return Plan.get(parent=self, id=id)

def get_chomp_task(self, id):
# id is schedule id
return ChompTask.get(parent=self)

def get_chomp_tasks(self, **kwargs):
return ChompTask.get(parent=self)

def claim_chomp_task(self):
return ChompTask.create(parent=self)

def get_mobius_task(self, id):
# id is schedule id
return MobiusTask.get(parent=self)

def get_mobius_tasks(self, **kwargs):
return MobiusTask.get(parent=self)

def claim_mobius_task(self):
return MobiusTask.create(parent=self)
6 changes: 6 additions & 0 deletions staffjoy/resources/chomp_task.py
@@ -0,0 +1,6 @@
from ..resource import Resource


class ChompTask(Resource):
PATH = "/internal/tasking/chomp/{schedule_id}"
ENVELOPE = None
6 changes: 6 additions & 0 deletions staffjoy/resources/mobius_task.py
@@ -0,0 +1,6 @@
from ..resource import Resource


class MobiusTask(Resource):
PATH = "/internal/tasking/mobius/{schedule_id}"
ENVELOPE = None

0 comments on commit 721b890

Please sign in to comment.