From 796d9733def0bcd4cdb335b72a9982621200a5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortun=CC=83o?= Date: Tue, 20 Oct 2020 17:41:01 +0200 Subject: [PATCH] Add leads endpoint --- src/Resources/Leads.php | 91 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/Resources/Leads.php diff --git a/src/Resources/Leads.php b/src/Resources/Leads.php new file mode 100644 index 0000000..e07ed79 --- /dev/null +++ b/src/Resources/Leads.php @@ -0,0 +1,91 @@ +request->setResource('/'); + $result = $this->request->get('leadLabels'); + + $this->request->setResource($this->getName()); + + return $result; + } + + /** + * Add a label. + * + * @return Response + */ + public function addLabel(array $values = []) + { + $this->request->setResource('/'); + $result = $this->request->post('leadLabels', $values); + + $this->request->setResource($this->getName()); + + return $result; + } + + /** + * Delete a label. + * + * @return Response + */ + public function deleteLabel($id) + { + $this->request->setResource('/'); + $result = $this->request->delete('leadLabels/' . $id); + + $this->request->setResource($this->getName()); + + return $result; + } + + /** + * @param $id + * @param array $values + * @return Response + */ + public function update($id, array $values = []) + { + $this->request->setResource('/'); + $result = $this->request->put('leadLabels/' . $id, $values); + + $this->request->setResource($this->getName()); + + return $result; + } + + /** + * Get all sources. + * + * @return Response + */ + public function sources() + { + $this->request->setResource('/'); + $result = $this->request->get('leadSources'); + + $this->request->setResource($this->getName()); + + return $result; + } +}