Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pipedrive/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pipedrive.pipelines import Pipelines
from pipedrive.products import Products
from pipedrive.recents import Recents
from pipedrive.stages import Stages
from pipedrive.users import Users
from pipedrive.webhooks import Webhooks

Expand All @@ -34,6 +35,7 @@ def __init__(self, client_id=None, client_secret=None, domain=None):
self.pipelines = Pipelines(self)
self.products = Products(self)
self.recents = Recents(self)
self.stages = Stages(self)
self.users = Users(self)
self.webhooks = Webhooks(self)

Expand Down
27 changes: 27 additions & 0 deletions pipedrive/stages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Stages(object):
def __init__(self, client):
self._client = client

def get_stage(self, stage_id, **kwargs):
url = 'stages/{}'.format(stage_id)
return self._client._get(self._client.BASE_URL + url, **kwargs)

def get_all_stages(self, **kwargs):
url = 'stages'
return self._client._get(self._client.BASE_URL + url, **kwargs)

def get_stage_deals(self, stage_id, **kwargs):
url = 'stages/{}/deals'.format(stage_id)
return self._client._get(self._client.BASE_URL + url, **kwargs)

def create_stage(self, data, **kwargs):
url = 'stages'
return self._client._post(self._client.BASE_URL + url, data, **kwargs)

def update_stage(self, stage_id, data, **kwargs):
url = 'stages/{}'.format(stage_id)
return self._client._put(self._client.BASE_URL + url, data, **kwargs)

def delete_stage(self, stage_id, **kwargs):
url = 'stages/{}'.format(stage_id)
return self._client._delete(self._client.BASE_URL + url, **kwargs)