| @@ 57-67 (lines=11) @@ | ||
| 54 | * |
|
| 55 | * @return \Acquia\LiftClient\Entity\Goal |
|
| 56 | */ |
|
| 57 | public function get($id) { |
|
| 58 | $url = "/goals/{$id}"; |
|
| 59 | ||
| 60 | // Now make the request. |
|
| 61 | $request = new Request('GET', $url); |
|
| 62 | $data = $this->client->getResponseJson($request); |
|
| 63 | ||
| 64 | return new Goal($data); |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * Add a goal. |
|
| 69 | * |
|
| 70 | * @see http://docs.decision-api.acquia.com/#goals_post |
|
| @@ 78-87 (lines=10) @@ | ||
| 75 | * |
|
| 76 | * @return \Acquia\LiftClient\Entity\Goal |
|
| 77 | */ |
|
| 78 | public function add(Goal $goal) { |
|
| 79 | $body = $goal->json(); |
|
| 80 | $url = '/goals'; |
|
| 81 | $request = new Request('POST', $url, [], $body); |
|
| 82 | $data = $this->client->getResponseJson($request); |
|
| 83 | ||
| 84 | return new Goal($data); |
|
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| 88 | * Deletes a goal by ID. |
|
| 89 | * |
|
| 90 | * @see http://docs.decision-api.acquia.com/#goals__goal_id__delete |
|
| @@ 66-76 (lines=11) @@ | ||
| 63 | * |
|
| 64 | * @return \Acquia\LiftClient\Entity\Slot |
|
| 65 | */ |
|
| 66 | public function get($id) { |
|
| 67 | $url = "/slots/{$id}"; |
|
| 68 | ||
| 69 | // Now make the request. |
|
| 70 | $request = new Request('GET', $url); |
|
| 71 | $data = $this->client->getResponseJson($request); |
|
| 72 | ||
| 73 | return new Slot($data); |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Add a slot. |
|
| 78 | * |
|
| 79 | * @param \Acquia\LiftClient\Entity\Slot $slot |
|
| @@ 85-94 (lines=10) @@ | ||
| 82 | * |
|
| 83 | * @return \Acquia\LiftClient\Entity\Slot |
|
| 84 | */ |
|
| 85 | public function add(Slot $slot) { |
|
| 86 | $body = $slot->json(); |
|
| 87 | $url = '/slots'; |
|
| 88 | $request = new Request('POST', $url, [], $body); |
|
| 89 | $data = $this->client->getResponseJson($request); |
|
| 90 | ||
| 91 | return new Slot($data); |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Deletes a slot by ID. |
|
| 96 | * |
|
| 97 | * @param string $id |
|