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,38 @@
1
+<?php
2
+
3
+namespace Telnyx;
4
+
5
+/**
6
+ * Class SingletonApiResource
7
+ *
8
+ * @package Telnyx
9
+ */
10
+abstract class SingletonApiResource extends ApiResource
11
+{
12
+    protected static function _singletonRetrieve($options = null)
13
+    {
14
+        $opts = Util\RequestOptions::parse($options);
15
+        $instance = new static(null, $opts);
16
+        $instance->refresh();
17
+        return $instance;
18
+    }
19
+
20
+    /**
21
+     * @return string The endpoint associated with this singleton class.
22
+     */
23
+    public static function classUrl()
24
+    {
25
+        // Replace dots with slashes for namespaced resources, e.g. if the object's name is
26
+        // "foo.bar", then its URL will be "/v2/foo/bar".
27
+        $base = str_replace('.', '/', static::OBJECT_NAME);
28
+        return "/v2/${base}";
29
+    }
30
+
31
+    /**
32
+     * @return string The endpoint associated with this singleton API resource.
33
+     */
34
+    public function instanceUrl()
35
+    {
36
+        return static::classUrl();
37
+    }
38
+}