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,37 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * Class Balance
7
+ *
8
+ * @package Telnyx
9
+ */
10
+class Balance extends ApiResource
11
+{
12
+    const OBJECT_NAME = "balance";
13
+
14
+    use ApiOperations\Retrieve;
15
+    
16
+    /**
17
+     * @return string The endpoint URL for the given class.
18
+     */
19
+    public static function classUrl()
20
+    {
21
+        // NOTE: This function override compensates for the lack of an S at the end of this endpoint.
22
+        // Original function inside ApiResource.php
23
+        return "/v2/balance";
24
+    }
25
+
26
+    /**
27
+     * @param string|null $id
28
+     *
29
+     * @return Retrieve user balance details
30
+     */
31
+    public static function retrieve()
32
+    {
33
+        list($response, $opts) = static::_staticRequest('get', static::classUrl(), null, null);
34
+        $obj = \Telnyx\Util\Util::convertToTelnyxObject($response->json, $opts);
35
+        return $obj;
36
+    }
37
+}