| @@ 27-33 (lines=7) @@ | ||
| 24 | * | |
| 25 | * @param string $id ID of your application | |
| 26 | */ | |
| 27 | public function getOne(string $id): array | |
| 28 |     { | |
| 29 |         $request = $this->createRequest('GET', "/apps/$id"); | |
| 30 |         $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); | |
| 31 | ||
| 32 | return $this->client->sendRequest($request); | |
| 33 | } | |
| 34 | ||
| 35 | /** | |
| 36 | * Get information about all your created applications. | |
| @@ 40-46 (lines=7) @@ | ||
| 37 | * | |
| 38 | * User authentication key must be set. | |
| 39 | */ | |
| 40 | public function getAll(): array | |
| 41 |     { | |
| 42 |         $request = $this->createRequest('GET', '/apps'); | |
| 43 |         $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); | |
| 44 | ||
| 45 | return $this->client->sendRequest($request); | |
| 46 | } | |
| 47 | ||
| 48 | /** | |
| 49 | * Create a new application with provided data. | |
| @@ 113-119 (lines=7) @@ | ||
| 110 | * @param string $appId Application ID | |
| 111 | * @param string $segmentId Segment ID | |
| 112 | */ | |
| 113 | public function deleteSegment(string $appId, string $segmentId): array | |
| 114 |     { | |
| 115 |         $request = $this->createRequest('DELETE', "/apps/$appId/segments/$segmentId"); | |
| 116 |         $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); | |
| 117 | ||
| 118 | return $this->client->sendRequest($request); | |
| 119 | } | |
| 120 | } | |
| 121 | ||
| @@ 29-35 (lines=7) @@ | ||
| 26 | * | |
| 27 | * @param string $id Notification ID | |
| 28 | */ | |
| 29 | public function getOne(string $id): array | |
| 30 |     { | |
| 31 |         $request = $this->createRequest('GET', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); | |
| 32 |         $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); | |
| 33 | ||
| 34 | return $this->client->sendRequest($request); | |
| 35 | } | |
| 36 | ||
| 37 | /** | |
| 38 | * Get information about all notifications. | |
| @@ 122-128 (lines=7) @@ | ||
| 119 | * | |
| 120 | * @param string $id Notification ID | |
| 121 | */ | |
| 122 | public function cancel(string $id): array | |
| 123 |     { | |
| 124 |         $request = $this->createRequest('DELETE', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); | |
| 125 |         $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); | |
| 126 | ||
| 127 | return $this->client->sendRequest($request); | |
| 128 | } | |
| 129 | ||
| 130 | /** | |
| 131 | * View the devices sent a notification. | |