| @@ 58-65 (lines=8) @@ | ||
| 55 | * |
|
| 56 | * @return array |
|
| 57 | */ |
|
| 58 | public function add(array $data) |
|
| 59 | { |
|
| 60 | $data = $this->resolverFactory->createAppResolver()->resolve($data); |
|
| 61 | ||
| 62 | return $this->api->request('POST', '/apps', [ |
|
| 63 | 'Authorization' => 'Basic '.$this->api->getConfig()->getUserAuthKey(), |
|
| 64 | ], json_encode($data)); |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * Update application with provided data. |
|
| @@ 77-84 (lines=8) @@ | ||
| 74 | * |
|
| 75 | * @return array |
|
| 76 | */ |
|
| 77 | public function update($id, array $data) |
|
| 78 | { |
|
| 79 | $data = $this->resolverFactory->createAppResolver()->resolve($data); |
|
| 80 | ||
| 81 | return $this->api->request('PUT', '/apps/'.$id, [ |
|
| 82 | 'Authorization' => 'Basic '.$this->api->getConfig()->getUserAuthKey(), |
|
| 83 | ], json_encode($data)); |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * Create a new segment for application with provided data. |
|
| @@ 94-101 (lines=8) @@ | ||
| 91 | * |
|
| 92 | * @return array |
|
| 93 | */ |
|
| 94 | public function createSegment($appId, array $data) |
|
| 95 | { |
|
| 96 | $data = $this->resolverFactory->createSegmentResolver()->resolve($data); |
|
| 97 | ||
| 98 | return $this->api->request('POST', '/apps/'.$appId.'/segments', [ |
|
| 99 | 'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(), |
|
| 100 | ], json_encode($data)); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * Delete existing segment from your application. |
|
| @@ 71-78 (lines=8) @@ | ||
| 68 | * |
|
| 69 | * @return array |
|
| 70 | */ |
|
| 71 | public function add(array $data) |
|
| 72 | { |
|
| 73 | $data = $this->resolverFactory->createNotificationResolver()->resolve($data); |
|
| 74 | ||
| 75 | return $this->api->request('POST', '/notifications', [ |
|
| 76 | 'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(), |
|
| 77 | ], json_encode($data)); |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * Open notification. |
|