From bdaae9ec3b9edc64376e9d2e5b6cebc1bac602db Mon Sep 17 00:00:00 2001 From: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com> Date: Tue, 26 Apr 2022 11:18:25 -0500 Subject: [PATCH] [INT-552] Adding new endpoints (#37) Added new endpoints since there are two additional endpoints in the official documentation --- README.es.md | 4 ++-- README.md | 4 ++-- README.zh-tw.md | 4 ++-- onfleet/onfleet.py | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.es.md b/README.es.md index c5a8fba..6171168 100644 --- a/README.es.md +++ b/README.es.md @@ -92,9 +92,9 @@ Estas son las operaciones disponibles para cada endpoint: | [Organization](https://docs.onfleet.com/reference#organizations) | get()
get(id) | x | insertTask(id, body={}) | x | | [Recipients](https://docs.onfleet.com/reference#recipients) | get(id)
get(name='')
get(phone='') | create(body={})
matchMetadata(body={}) | update(id, body={}) | x | | [Tasks](https://docs.onfleet.com/reference#tasks) | get(queryParams={})
get(id)
get(shortId=id) | create(body={})
clone(id)
forceComplete(id)
batch(body={})
autoAssign(body={})
matchMetadata(body={}) | update(id, body={}) | deleteOne(id) | -| [Teams](https://docs.onfleet.com/reference#teams) | get()
get(id)
getWorkerEta(id, queryParams={}) | create(body={})
autoDispatch(id, body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | +| [Teams](https://docs.onfleet.com/reference#teams) | get()
get(id)
getWorkerEta(id, queryParams={})
getTasks(id, queryParams={}) | create(body={})
autoDispatch(id, body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | | [Webhooks](https://docs.onfleet.com/reference#webhooks) | get() | create(body={}) | x | deleteOne(id) | -| [Workers](https://docs.onfleet.com/reference#workers) | get()
get(id)
get(queryParams={})
getByLocation(queryParams={})
getSchedule(id) | create(body={})
setSchedule(id, body={})
matchMetadata(body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | +| [Workers](https://docs.onfleet.com/reference#workers) | get()
get(id)
get(queryParams={})
getByLocation(queryParams={})
getSchedule(id)
getTasks(id, queryParams={}) | create(body={})
setSchedule(id, body={})
matchMetadata(body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | #### Peticiones GET Para obtener todos los elementos disponibles en un recurso: diff --git a/README.md b/README.md index 78bc0f2..b4bae02 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,9 @@ Here are the operations available for each entity: | [Organization](https://docs.onfleet.com/reference#organizations) | get()
get(id) | x | insertTask(id, body={}) | x | | [Recipients](https://docs.onfleet.com/reference#recipients) | get(id)
get(name='')
get(phone='') | create(body={})
matchMetadata(body={}) | update(id, body={}) | x | | [Tasks](https://docs.onfleet.com/reference#tasks) | get(queryParams={})
get(id)
get(shortId=id) | create(body={})
clone(id)
forceComplete(id)
batch(body={})
autoAssign(body={})
matchMetadata(body={}) | update(id, body={}) | deleteOne(id) | -| [Teams](https://docs.onfleet.com/reference#teams) | get()
get(id)
getWorkerEta(id, queryParams={}) | create(body={})
autoDispatch(id, body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | +| [Teams](https://docs.onfleet.com/reference#teams) | get()
get(id)
getWorkerEta(id, queryParams={})
getTasks(id, queryParams={}) | create(body={})
autoDispatch(id, body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | | [Webhooks](https://docs.onfleet.com/reference#webhooks) | get() | create(body={}) | x | deleteOne(id) | -| [Workers](https://docs.onfleet.com/reference#workers) | get()
get(id)
get(queryParams={})
getByLocation(queryParams={})
getSchedule(id) | create(body={})
setSchedule(id, body={})
matchMetadata(body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | +| [Workers](https://docs.onfleet.com/reference#workers) | get()
get(id)
get(queryParams={})
getByLocation(queryParams={})
getSchedule(id)
getTasks(id, queryParams={}) | create(body={})
setSchedule(id, body={})
matchMetadata(body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | #### GET Requests To get all the documents within an endpoint: diff --git a/README.zh-tw.md b/README.zh-tw.md index 3429e72..40e775a 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -88,9 +88,9 @@ onfleet_api = Onfleet(api_key="") # Without the .auth.json file | [Organization](https://docs.onfleet.com/reference#organizations) | get()
get(id) | x | insertTask(id, body={}) | x | | [Recipients](https://docs.onfleet.com/reference#recipients) | get(id)
get(name='')
get(phone='') | create(body={})
matchMetadata(body={}) | update(id, body={}) | x | | [Tasks](https://docs.onfleet.com/reference#tasks) | get(queryParams={})
get(id)
get(shortId=id) | create(body={})
clone(id)
forceComplete(id)
batch(body={})
autoAssign(body={})
matchMetadata(body={}) | update(id, body={}) | deleteOne(id) | -| [Teams](https://docs.onfleet.com/reference#teams) | get()
get(id)
getWorkerEta(id, queryParams={}) | create(body={})
autoDispatch(id, body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | +| [Teams](https://docs.onfleet.com/reference#teams) | get()
get(id)
getWorkerEta(id, queryParams={})
getTasks(id, queryParams={}) | create(body={})
autoDispatch(id, body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | | [Webhooks](https://docs.onfleet.com/reference#webhooks) | get() | create(body={}) | x | deleteOne(id) | -| [Workers](https://docs.onfleet.com/reference#workers) | get()
get(id)
get(queryParams={})
getByLocation(queryParams={})
getSchedule(id) | create(body={})
setSchedule(id, body={})
matchMetadata(body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | +| [Workers](https://docs.onfleet.com/reference#workers) | get()
get(id)
get(queryParams={})
getByLocation(queryParams={})
getSchedule(id)
getTasks(id, queryParams={}) | create(body={})
setSchedule(id, body={})
matchMetadata(body={}) | update(id, body={})
insertTask(id, body={}) | deleteOne(id) | #### GET 請求 展示所有資源的指令如下: diff --git a/onfleet/onfleet.py b/onfleet/onfleet.py index 73df461..1195fd9 100644 --- a/onfleet/onfleet.py +++ b/onfleet/onfleet.py @@ -50,6 +50,7 @@ class Onfleet(object): teams = Endpoint('teams', ('POST', 'PUT', 'DELETE'), _session) teams.get = Request('GET', ['/teams', '/teams/:orgId'], _session) teams.getWorkerEta = Request('GET', '/teams/:teamId/estimate', _session) + teams.getTasks = Request('GET', '/teams/:teamId/tasks', _session) teams.autoDispatch = Request('POST', '/teams/:teamId/dispatch', _session) teams.insertTask = Request('PUT', '/containers/teams/:taskId', _session) @@ -57,6 +58,7 @@ class Onfleet(object): workers.get = Request('GET', ['/workers', '/workers/:workerId'], _session) workers.getSchedule = Request('GET', '/workers/:workerId/schedule', _session) workers.getByLocation = Request('GET', '/workers/location', _session) + workers.getTasks = Request('GET', '/workers/:workerId/tasks', _session) workers.setSchedule = Request('POST', '/workers/:workerId/schedule', _session) workers.matchMetadata = Request('POST', '/workers/metadata', _session) workers.insertTask = Request('PUT', '/containers/workers/:taskId', _session)