summaryrefslogtreecommitdiffstats
path: root/vendor/gipfl/openrpc/src/Method.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:44:51 +0000
commita1ec78bf0dc93d0e05e5f066f1949dc3baecea06 (patch)
treeee596ce1bc9840661386f96f9b8d1f919a106317 /vendor/gipfl/openrpc/src/Method.php
parentInitial commit. (diff)
downloadicingaweb2-module-incubator-a1ec78bf0dc93d0e05e5f066f1949dc3baecea06.tar.xz
icingaweb2-module-incubator-a1ec78bf0dc93d0e05e5f066f1949dc3baecea06.zip
Adding upstream version 0.20.0.upstream/0.20.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gipfl/openrpc/src/Method.php')
-rw-r--r--vendor/gipfl/openrpc/src/Method.php133
1 files changed, 133 insertions, 0 deletions
diff --git a/vendor/gipfl/openrpc/src/Method.php b/vendor/gipfl/openrpc/src/Method.php
new file mode 100644
index 0000000..54226e3
--- /dev/null
+++ b/vendor/gipfl/openrpc/src/Method.php
@@ -0,0 +1,133 @@
+<?php
+
+namespace gipfl\OpenRpc;
+
+use JsonSerializable;
+
+/**
+ * Describes the interface for the given method name. The method name is used
+ * as the method field of the JSON-RPC body. It therefore MUST be unique.
+ */
+class Method implements JsonSerializable
+{
+ use SimpleJsonSerializer;
+
+ /**
+ * REQUIRED. The cannonical name for the method. The name MUST be unique
+ * within the methods array.
+ *
+ * @var string
+ */
+ public $name;
+
+ /**
+ * A list of tags for API documentation control. Tags can be used for
+ * logical grouping of methods by resources or any other qualifier.
+ *
+ * @var TagObject[]|Reference[]
+ */
+ public $tags;
+
+ /**
+ * A short summary of what the method does
+ *
+ * @var string|null
+ */
+ public $summary;
+
+ /**
+ * A verbose explanation of the method behavior. GitHub Flavored Markdown
+ * syntax MAY be used for rich text representation.
+ *
+ * @var string|null
+ */
+ public $description;
+
+ /**
+ * Additional external documentation for this method
+ *
+ * @var ExternalDocumentation
+ */
+ public $externalDocs;
+
+ /**
+ * REQUIRED. A list of parameters that are applicable for this method. The
+ * list MUST NOT include duplicated parameters and therefore require name
+ * to be unique. The list can use the Reference Object to link to parameters
+ * that are defined by the Content Descriptor Object. All optional params
+ * (content descriptor objects with “required”: false) MUST be positioned
+ * after all required params in the list.
+ *
+ * @var <ContentDescriptor|Reference>[]
+ */
+ public $params;
+
+ /**
+ * REQUIRED. The description of the result returned by the method. It MUST
+ * be a Content Descriptor.
+ *
+ * @var ContentDescriptor|Reference
+ */
+ public $result;
+
+ /**
+ * Declares this method to be deprecated. Consumers SHOULD refrain from
+ * usage of the declared method. Default value is false.
+ *
+ * @var boolean
+ */
+ public $deprecated;
+
+ /**
+ * An alternative servers array to service this method. If an alternative
+ * servers array is specified at the Root level, it will be overridden by
+ * this value.
+ *
+ * @var Server[]
+ */
+ public $servers;
+
+ /**
+ * A list of custom application defined errors that MAY be returned. The
+ * Errors MUST have unique error codes.
+ *
+ * @var <Error|Reference>[]
+ */
+ public $errors;
+
+ /**
+ * A list of possible links from this method call
+ *
+ * @var <Link|Reference>[]
+ */
+ public $links;
+
+ /**
+ * The expected format of the parameters. As per the JSON-RPC 2.0 specification,
+ * the params of a JSON-RPC request object may be an array, object, or either
+ * (represented as by-position, by-name, and either respectively). When a method
+ * has a paramStructure value of by-name, callers of the method MUST send a
+ * JSON-RPC request object whose params field is an object. Further, the key
+ * names of the params object MUST be the same as the contentDescriptor.names
+ * for the given method. Defaults to "either".
+ *
+ * @var string "by-name" | "by-position" | "either"
+ */
+ public $paramStructure;
+
+ /**
+ * Array of Example Pairing Object where each example includes a valid
+ * params-to-result Content Descriptor pairing.
+ *
+ * @var ExamplePairing []
+ */
+ public $examples;
+
+ /**
+ * @param $name
+ */
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+}