| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,70 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+namespace Telnyx; |
|
| 4 |
+ |
|
| 5 |
+/** |
|
| 6 |
+ * Class Portout |
|
| 7 |
+ * |
|
| 8 |
+ * @package Telnyx |
|
| 9 |
+ */ |
|
| 10 |
+class Portout extends ApiResource |
|
| 11 |
+{
|
|
| 12 |
+ |
|
| 13 |
+ const OBJECT_NAME = "portout"; |
|
| 14 |
+ |
|
| 15 |
+ use ApiOperations\All; |
|
| 16 |
+ use ApiOperations\Retrieve; |
|
| 17 |
+ |
|
| 18 |
+ /** |
|
| 19 |
+ * Authorize or reject portout request |
|
| 20 |
+ * |
|
| 21 |
+ * @param array|null $params |
|
| 22 |
+ * @param array|string|null $options |
|
| 23 |
+ * |
|
| 24 |
+ * @return |
|
| 25 |
+ */ |
|
| 26 |
+ public function update_status($status) |
|
| 27 |
+ {
|
|
| 28 |
+ $url = $this->instanceUrl() . '/' . $status; |
|
| 29 |
+ list($response, $opts) = $this->_request('patch', $url, null, null);
|
|
| 30 |
+ $this->refreshFrom($response, $opts); |
|
| 31 |
+ return $this; |
|
| 32 |
+ } |
|
| 33 |
+ |
|
| 34 |
+ /** |
|
| 35 |
+ * List all comments for a portout request |
|
| 36 |
+ * |
|
| 37 |
+ * @param array|null $params |
|
| 38 |
+ * @param array|string|null $options |
|
| 39 |
+ * |
|
| 40 |
+ * @return |
|
| 41 |
+ */ |
|
| 42 |
+ public function list_comments() |
|
| 43 |
+ {
|
|
| 44 |
+ $url = $this->instanceUrl() . '/comments'; |
|
| 45 |
+ list($response, $opts) = $this->_request('get', $url, null, null);
|
|
| 46 |
+ |
|
| 47 |
+ // This is needed for nextPage() and previousPage() |
|
| 48 |
+ $response['url'] = $url; |
|
| 49 |
+ |
|
| 50 |
+ $obj = Util\Util::convertToTelnyxObject($response, $opts); |
|
| 51 |
+ return $obj; |
|
| 52 |
+ } |
|
| 53 |
+ |
|
| 54 |
+ /** |
|
| 55 |
+ * Create a comment on a portout request |
|
| 56 |
+ * |
|
| 57 |
+ * @param array|null $params |
|
| 58 |
+ * @param array|string|null $options |
|
| 59 |
+ * |
|
| 60 |
+ * @return |
|
| 61 |
+ */ |
|
| 62 |
+ public function create_comment($params = null, $options = null) |
|
| 63 |
+ {
|
|
| 64 |
+ $url = $this->instanceUrl() . '/comments'; |
|
| 65 |
+ list($response, $opts) = $this->_request('post', $url, $params, $options);
|
|
| 66 |
+ $this->refreshFrom($response, $opts); |
|
| 67 |
+ return $this; |
|
| 68 |
+ } |
|
| 69 |
+ |
|
| 70 |
+} |