Browse code

Added README.md appinfo/info.xml appinfo/signature.json lib/Controller/AuthorApiController.php and the providers directory

DoubleBastionAdmin authored on 20/08/2022 16:33:00
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,75 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * Class PhoneNumber
7
+ *
8
+ * @package Telnyx
9
+ */
10
+class PhoneNumber extends ApiResource
11
+{
12
+    const OBJECT_NAME = "phone_number";
13
+
14
+    use ApiOperations\All;
15
+    use ApiOperations\Delete;
16
+    use ApiOperations\Retrieve;
17
+    use ApiOperations\Update;
18
+
19
+    /**
20
+     * Retrieve the voice settings for a phone number
21
+     * @return 
22
+     */
23
+    public function voice()
24
+    {
25
+        $url = $this->instanceUrl() . '/voice';
26
+        list($response, $opts) = $this->_request('get', $url, null, null);
27
+        $this->refreshFrom($response, $opts);
28
+        return $this;
29
+    }
30
+
31
+    /**
32
+     * Update the voice settings for a phone number
33
+     *
34
+     * @param array|null $params
35
+     * @param array|string|null $options
36
+     *
37
+     * @return
38
+     */
39
+    public function update_voice($params = null, $options = null)
40
+    {
41
+        $url = $this->instanceUrl() . '/voice';
42
+        list($response, $opts) = $this->_request('patch', $url, $params, $options);
43
+        $this->refreshFrom($response, $opts);
44
+        return $this;
45
+    }
46
+
47
+    /**
48
+     * Retrieve the messaging settings for a phone number
49
+     *
50
+     * @return
51
+     */
52
+    public function messaging()
53
+    {
54
+        $url = $this->instanceUrl() . '/messaging';
55
+        list($response, $opts) = $this->_request('get', $url, null, null);
56
+        $this->refreshFrom($response, $opts);
57
+        return $this;
58
+    }
59
+
60
+    /**
61
+     * Update the messaging settings for a phone number
62
+     *
63
+     * @param array|null $params
64
+     * @param array|string|null $options
65
+     *
66
+     * @return
67
+     */
68
+    public function update_messaging($params = null, $options = null)
69
+    {
70
+        $url = $this->instanceUrl() . '/messaging';
71
+        list($response, $opts) = $this->_request('patch', $url, $params, $options);
72
+        $this->refreshFrom($response, $opts);
73
+        return $this;
74
+    }
75
+}