diff --git a/Makefile b/Makefile index 5a3e3ce..83c7101 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ unknown-cli: cargo run -- validate -p test/spidermonkey.wasm -c test/unknown-fields.yaml install: + @echo "if this fails, be sure to install protoc via: https://grpc.io/docs/protoc-installation/" @echo "check PROTOC: `which protoc`" go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 cargo install protobuf-codegen@3.2.0 @@ -19,6 +20,7 @@ generate: install protoc --experimental_allow_proto3_optional \ --rust_out=proto/v1/src \ --go_out=proto/v1/go \ + --php_out=proto/v1/php \ proto/v1/api.proto generate-web-list-mods-response: diff --git a/proto/v1/go/modsurferpb/api.pb.go b/proto/v1/go/modsurferpb/api.pb.go index 0a54306..b28f570 100644 --- a/proto/v1/go/modsurferpb/api.pb.go +++ b/proto/v1/go/modsurferpb/api.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.32.0 -// protoc v3.12.4 +// protoc v3.15.8 // source: proto/v1/api.proto package modsurferpb import ( - timestamp "github.com/golang/protobuf/ptypes/timestamp" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -512,7 +512,7 @@ type Module struct { // arbitrary metadata provided by the operator of this module Metadata map[string]string `protobuf:"bytes,9,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // timestamp when this module was loaded and stored - InsertedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=inserted_at,json=insertedAt,proto3" json:"inserted_at,omitempty"` + InsertedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=inserted_at,json=insertedAt,proto3" json:"inserted_at,omitempty"` // the interned strings stored in the wasm binary (panic/abort messages, etc.) Strings []string `protobuf:"bytes,11,rep,name=strings,proto3" json:"strings,omitempty"` // the cyclomatic complexity @@ -612,7 +612,7 @@ func (x *Module) GetMetadata() map[string]string { return nil } -func (x *Module) GetInsertedAt() *timestamp.Timestamp { +func (x *Module) GetInsertedAt() *timestamppb.Timestamp { if x != nil { return x.InsertedAt } @@ -1279,9 +1279,9 @@ type SearchModulesRequest struct { // arbitrary metadata provided by the operator of this module Metadata map[string]string `protobuf:"bytes,10,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // timestamp when this module was loaded and stored - InsertedBefore *timestamp.Timestamp `protobuf:"bytes,11,opt,name=inserted_before,json=insertedBefore,proto3,oneof" json:"inserted_before,omitempty"` + InsertedBefore *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=inserted_before,json=insertedBefore,proto3,oneof" json:"inserted_before,omitempty"` // timestamp when this module was loaded and stored - InsertedAfter *timestamp.Timestamp `protobuf:"bytes,12,opt,name=inserted_after,json=insertedAfter,proto3,oneof" json:"inserted_after,omitempty"` + InsertedAfter *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=inserted_after,json=insertedAfter,proto3,oneof" json:"inserted_after,omitempty"` // the interned strings stored in the wasm binary (panic/abort messages, etc.) Strings []string `protobuf:"bytes,13,rep,name=strings,proto3" json:"strings,omitempty"` // match on any function name in an import or export. @@ -1387,14 +1387,14 @@ func (x *SearchModulesRequest) GetMetadata() map[string]string { return nil } -func (x *SearchModulesRequest) GetInsertedBefore() *timestamp.Timestamp { +func (x *SearchModulesRequest) GetInsertedBefore() *timestamppb.Timestamp { if x != nil { return x.InsertedBefore } return nil } -func (x *SearchModulesRequest) GetInsertedAfter() *timestamp.Timestamp { +func (x *SearchModulesRequest) GetInsertedAfter() *timestamppb.Timestamp { if x != nil { return x.InsertedAfter } @@ -2904,7 +2904,7 @@ var file_proto_v1_api_proto_goTypes = []interface{}{ nil, // 40: SearchModulesRequest.MetadataEntry nil, // 41: DeleteModulesResponse.ModuleIdHashEntry nil, // 42: AuditModulesResponse.InvalidModuleReportEntry - (*timestamp.Timestamp)(nil), // 43: google.protobuf.Timestamp + (*timestamppb.Timestamp)(nil), // 43: google.protobuf.Timestamp } var file_proto_v1_api_proto_depIdxs = []int32{ 0, // 0: Function.params:type_name -> ValType diff --git a/proto/v1/php/AuditModulesRequest.php b/proto/v1/php/AuditModulesRequest.php new file mode 100644 index 0000000..ba3adcc --- /dev/null +++ b/proto/v1/php/AuditModulesRequest.php @@ -0,0 +1,130 @@ +AuditModulesRequest + */ +class AuditModulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * the YAML checkfile (e.g. mod.yaml) bytes + * + * Generated from protobuf field bytes checkfile = 1; + */ + protected $checkfile = ''; + /** + * Generated from protobuf field .AuditOutcome outcome = 2; + */ + protected $outcome = 0; + /** + * Generated from protobuf field .Pagination pagination = 3; + */ + protected $pagination = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $checkfile + * the YAML checkfile (e.g. mod.yaml) bytes + * @type int $outcome + * @type \Pagination $pagination + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * the YAML checkfile (e.g. mod.yaml) bytes + * + * Generated from protobuf field bytes checkfile = 1; + * @return string + */ + public function getCheckfile() + { + return $this->checkfile; + } + + /** + * the YAML checkfile (e.g. mod.yaml) bytes + * + * Generated from protobuf field bytes checkfile = 1; + * @param string $var + * @return $this + */ + public function setCheckfile($var) + { + GPBUtil::checkString($var, False); + $this->checkfile = $var; + + return $this; + } + + /** + * Generated from protobuf field .AuditOutcome outcome = 2; + * @return int + */ + public function getOutcome() + { + return $this->outcome; + } + + /** + * Generated from protobuf field .AuditOutcome outcome = 2; + * @param int $var + * @return $this + */ + public function setOutcome($var) + { + GPBUtil::checkEnum($var, \AuditOutcome::class); + $this->outcome = $var; + + return $this; + } + + /** + * Generated from protobuf field .Pagination pagination = 3; + * @return \Pagination|null + */ + public function getPagination() + { + return isset($this->pagination) ? $this->pagination : null; + } + + public function hasPagination() + { + return isset($this->pagination); + } + + public function clearPagination() + { + unset($this->pagination); + } + + /** + * Generated from protobuf field .Pagination pagination = 3; + * @param \Pagination $var + * @return $this + */ + public function setPagination($var) + { + GPBUtil::checkMessage($var, \Pagination::class); + $this->pagination = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/AuditModulesResponse.php b/proto/v1/php/AuditModulesResponse.php new file mode 100644 index 0000000..51b8c87 --- /dev/null +++ b/proto/v1/php/AuditModulesResponse.php @@ -0,0 +1,181 @@ +AuditModulesResponse + */ +class AuditModulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * each record contains the ID of the invalid Module which failed the audit, as well as the failure + * report produced by the validation check (encoded in JSON) + * + * Generated from protobuf field map invalid_module_report = 1; + */ + private $invalid_module_report; + /** + * Generated from protobuf field .Pagination pagination = 2; + */ + protected $pagination = null; + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + */ + protected $total = 0; + /** + * Generated from protobuf field .Error error = 4; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $invalid_module_report + * each record contains the ID of the invalid Module which failed the audit, as well as the failure + * report produced by the validation check (encoded in JSON) + * @type \Pagination $pagination + * @type int|string $total + * the full count of results in the database (not the count of this message's + * `modules`). + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * each record contains the ID of the invalid Module which failed the audit, as well as the failure + * report produced by the validation check (encoded in JSON) + * + * Generated from protobuf field map invalid_module_report = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInvalidModuleReport() + { + return $this->invalid_module_report; + } + + /** + * each record contains the ID of the invalid Module which failed the audit, as well as the failure + * report produced by the validation check (encoded in JSON) + * + * Generated from protobuf field map invalid_module_report = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInvalidModuleReport($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT64, \Google\Protobuf\Internal\GPBType::BYTES); + $this->invalid_module_report = $arr; + + return $this; + } + + /** + * Generated from protobuf field .Pagination pagination = 2; + * @return \Pagination|null + */ + public function getPagination() + { + return isset($this->pagination) ? $this->pagination : null; + } + + public function hasPagination() + { + return isset($this->pagination); + } + + public function clearPagination() + { + unset($this->pagination); + } + + /** + * Generated from protobuf field .Pagination pagination = 2; + * @param \Pagination $var + * @return $this + */ + public function setPagination($var) + { + GPBUtil::checkMessage($var, \Pagination::class); + $this->pagination = $var; + + return $this; + } + + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + * @return int|string + */ + public function getTotal() + { + return $this->total; + } + + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + * @param int|string $var + * @return $this + */ + public function setTotal($var) + { + GPBUtil::checkUint64($var); + $this->total = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 4; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 4; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/AuditOutcome.php b/proto/v1/php/AuditOutcome.php new file mode 100644 index 0000000..3f79ffd --- /dev/null +++ b/proto/v1/php/AuditOutcome.php @@ -0,0 +1,48 @@ +AuditOutcome + */ +class AuditOutcome +{ + /** + * Generated from protobuf enum PASS = 0; + */ + const PASS = 0; + /** + * Generated from protobuf enum FAIL = 1; + */ + const FAIL = 1; + + private static $valueToName = [ + self::PASS => 'PASS', + self::FAIL => 'FAIL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/proto/v1/php/CallPluginRequest.php b/proto/v1/php/CallPluginRequest.php new file mode 100644 index 0000000..d0fd1f0 --- /dev/null +++ b/proto/v1/php/CallPluginRequest.php @@ -0,0 +1,156 @@ +CallPluginRequest + */ +class CallPluginRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string identifier = 1; + */ + protected $identifier = ''; + /** + * Generated from protobuf field string function_name = 2; + */ + protected $function_name = ''; + /** + * Generated from protobuf field bytes input = 3; + */ + protected $input = ''; + /** + * bytes config = 5; + * + * Generated from protobuf field string hash = 4; + */ + protected $hash = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $identifier + * @type string $function_name + * @type string $input + * @type string $hash + * bytes config = 5; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string identifier = 1; + * @return string + */ + public function getIdentifier() + { + return $this->identifier; + } + + /** + * Generated from protobuf field string identifier = 1; + * @param string $var + * @return $this + */ + public function setIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->identifier = $var; + + return $this; + } + + /** + * Generated from protobuf field string function_name = 2; + * @return string + */ + public function getFunctionName() + { + return $this->function_name; + } + + /** + * Generated from protobuf field string function_name = 2; + * @param string $var + * @return $this + */ + public function setFunctionName($var) + { + GPBUtil::checkString($var, True); + $this->function_name = $var; + + return $this; + } + + /** + * Generated from protobuf field bytes input = 3; + * @return string + */ + public function getInput() + { + return $this->input; + } + + /** + * Generated from protobuf field bytes input = 3; + * @param string $var + * @return $this + */ + public function setInput($var) + { + GPBUtil::checkString($var, False); + $this->input = $var; + + return $this; + } + + /** + * bytes config = 5; + * + * Generated from protobuf field string hash = 4; + * @return string + */ + public function getHash() + { + return isset($this->hash) ? $this->hash : ''; + } + + public function hasHash() + { + return isset($this->hash); + } + + public function clearHash() + { + unset($this->hash); + } + + /** + * bytes config = 5; + * + * Generated from protobuf field string hash = 4; + * @param string $var + * @return $this + */ + public function setHash($var) + { + GPBUtil::checkString($var, True); + $this->hash = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/CallPluginResponse.php b/proto/v1/php/CallPluginResponse.php new file mode 100644 index 0000000..80f68a6 --- /dev/null +++ b/proto/v1/php/CallPluginResponse.php @@ -0,0 +1,93 @@ +CallPluginResponse + */ +class CallPluginResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes output = 1; + */ + protected $output = ''; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes output = 1; + * @return string + */ + public function getOutput() + { + return $this->output; + } + + /** + * Generated from protobuf field bytes output = 1; + * @param string $var + * @return $this + */ + public function setOutput($var) + { + GPBUtil::checkString($var, False); + $this->output = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/CreateModuleRequest.php b/proto/v1/php/CreateModuleRequest.php new file mode 100644 index 0000000..aa20da0 --- /dev/null +++ b/proto/v1/php/CreateModuleRequest.php @@ -0,0 +1,130 @@ +CreateModuleRequest + */ +class CreateModuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes wasm = 1; + */ + protected $wasm = ''; + /** + * Generated from protobuf field map metadata = 2; + */ + private $metadata; + /** + * a valid URL with a scheme prefix e.g. `s3://`, `file://`, `https://` + * + * Generated from protobuf field string location = 3; + */ + protected $location = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $wasm + * @type array|\Google\Protobuf\Internal\MapField $metadata + * @type string $location + * a valid URL with a scheme prefix e.g. `s3://`, `file://`, `https://` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes wasm = 1; + * @return string + */ + public function getWasm() + { + return $this->wasm; + } + + /** + * Generated from protobuf field bytes wasm = 1; + * @param string $var + * @return $this + */ + public function setWasm($var) + { + GPBUtil::checkString($var, False); + $this->wasm = $var; + + return $this; + } + + /** + * Generated from protobuf field map metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Generated from protobuf field map metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * a valid URL with a scheme prefix e.g. `s3://`, `file://`, `https://` + * + * Generated from protobuf field string location = 3; + * @return string + */ + public function getLocation() + { + return isset($this->location) ? $this->location : ''; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * a valid URL with a scheme prefix e.g. `s3://`, `file://`, `https://` + * + * Generated from protobuf field string location = 3; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/CreateModuleResponse.php b/proto/v1/php/CreateModuleResponse.php new file mode 100644 index 0000000..8e8d735 --- /dev/null +++ b/proto/v1/php/CreateModuleResponse.php @@ -0,0 +1,122 @@ +CreateModuleResponse + */ +class CreateModuleResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int64 module_id = 1; + */ + protected $module_id = 0; + /** + * Generated from protobuf field string hash = 2; + */ + protected $hash = ''; + /** + * Generated from protobuf field .Error error = 3; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $module_id + * @type string $hash + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field int64 module_id = 1; + * @return int|string + */ + public function getModuleId() + { + return $this->module_id; + } + + /** + * Generated from protobuf field int64 module_id = 1; + * @param int|string $var + * @return $this + */ + public function setModuleId($var) + { + GPBUtil::checkInt64($var); + $this->module_id = $var; + + return $this; + } + + /** + * Generated from protobuf field string hash = 2; + * @return string + */ + public function getHash() + { + return $this->hash; + } + + /** + * Generated from protobuf field string hash = 2; + * @param string $var + * @return $this + */ + public function setHash($var) + { + GPBUtil::checkString($var, True); + $this->hash = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 3; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 3; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/DeleteModulesRequest.php b/proto/v1/php/DeleteModulesRequest.php new file mode 100644 index 0000000..13f57ed --- /dev/null +++ b/proto/v1/php/DeleteModulesRequest.php @@ -0,0 +1,59 @@ +DeleteModulesRequest + */ +class DeleteModulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated int64 module_ids = 1; + */ + private $module_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $module_ids + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated int64 module_ids = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModuleIds() + { + return $this->module_ids; + } + + /** + * Generated from protobuf field repeated int64 module_ids = 1; + * @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModuleIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->module_ids = $arr; + + return $this; + } + +} + diff --git a/proto/v1/php/DeleteModulesResponse.php b/proto/v1/php/DeleteModulesResponse.php new file mode 100644 index 0000000..b6b3023 --- /dev/null +++ b/proto/v1/php/DeleteModulesResponse.php @@ -0,0 +1,95 @@ +DeleteModulesResponse + */ +class DeleteModulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field map module_id_hash = 1; + */ + private $module_id_hash; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $module_id_hash + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field map module_id_hash = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getModuleIdHash() + { + return $this->module_id_hash; + } + + /** + * Generated from protobuf field map module_id_hash = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setModuleIdHash($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT64, \Google\Protobuf\Internal\GPBType::STRING); + $this->module_id_hash = $arr; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/DiffRequest.php b/proto/v1/php/DiffRequest.php new file mode 100644 index 0000000..bc5dd5d --- /dev/null +++ b/proto/v1/php/DiffRequest.php @@ -0,0 +1,140 @@ +DiffRequest + */ +class DiffRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int64 module1 = 1; + */ + protected $module1 = 0; + /** + * Generated from protobuf field int64 module2 = 2; + */ + protected $module2 = 0; + /** + * Generated from protobuf field bool color_terminal = 3; + */ + protected $color_terminal = false; + /** + * Generated from protobuf field bool with_context = 4; + */ + protected $with_context = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $module1 + * @type int|string $module2 + * @type bool $color_terminal + * @type bool $with_context + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field int64 module1 = 1; + * @return int|string + */ + public function getModule1() + { + return $this->module1; + } + + /** + * Generated from protobuf field int64 module1 = 1; + * @param int|string $var + * @return $this + */ + public function setModule1($var) + { + GPBUtil::checkInt64($var); + $this->module1 = $var; + + return $this; + } + + /** + * Generated from protobuf field int64 module2 = 2; + * @return int|string + */ + public function getModule2() + { + return $this->module2; + } + + /** + * Generated from protobuf field int64 module2 = 2; + * @param int|string $var + * @return $this + */ + public function setModule2($var) + { + GPBUtil::checkInt64($var); + $this->module2 = $var; + + return $this; + } + + /** + * Generated from protobuf field bool color_terminal = 3; + * @return bool + */ + public function getColorTerminal() + { + return $this->color_terminal; + } + + /** + * Generated from protobuf field bool color_terminal = 3; + * @param bool $var + * @return $this + */ + public function setColorTerminal($var) + { + GPBUtil::checkBool($var); + $this->color_terminal = $var; + + return $this; + } + + /** + * Generated from protobuf field bool with_context = 4; + * @return bool + */ + public function getWithContext() + { + return $this->with_context; + } + + /** + * Generated from protobuf field bool with_context = 4; + * @param bool $var + * @return $this + */ + public function setWithContext($var) + { + GPBUtil::checkBool($var); + $this->with_context = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/DiffResponse.php b/proto/v1/php/DiffResponse.php new file mode 100644 index 0000000..52d418b --- /dev/null +++ b/proto/v1/php/DiffResponse.php @@ -0,0 +1,96 @@ +DiffResponse + */ +class DiffResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string diff = 1; + */ + protected $diff = ''; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $diff + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string diff = 1; + * @return string + */ + public function getDiff() + { + return $this->diff; + } + + /** + * Generated from protobuf field string diff = 1; + * @param string $var + * @return $this + */ + public function setDiff($var) + { + GPBUtil::checkString($var, True); + $this->diff = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Direction.php b/proto/v1/php/Direction.php new file mode 100644 index 0000000..0744ccd --- /dev/null +++ b/proto/v1/php/Direction.php @@ -0,0 +1,46 @@ +Direction + */ +class Direction +{ + /** + * Generated from protobuf enum Desc = 0; + */ + const Desc = 0; + /** + * Generated from protobuf enum Asc = 1; + */ + const Asc = 1; + + private static $valueToName = [ + self::Desc => 'Desc', + self::Asc => 'Asc', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/proto/v1/php/Error.php b/proto/v1/php/Error.php new file mode 100644 index 0000000..4278d2f --- /dev/null +++ b/proto/v1/php/Error.php @@ -0,0 +1,85 @@ +Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int32 code = 1; + */ + protected $code = 0; + /** + * Generated from protobuf field string message = 2; + */ + protected $message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * @type string $message + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field int32 code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Generated from protobuf field int32 code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * Generated from protobuf field string message = 2; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Generated from protobuf field string message = 2; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Export.php b/proto/v1/php/Export.php new file mode 100644 index 0000000..10c1769 --- /dev/null +++ b/proto/v1/php/Export.php @@ -0,0 +1,69 @@ +Export + */ +class Export extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .Function func = 1; + */ + protected $func = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \PBFunction $func + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .Function func = 1; + * @return \PBFunction|null + */ + public function getFunc() + { + return isset($this->func) ? $this->func : null; + } + + public function hasFunc() + { + return isset($this->func); + } + + public function clearFunc() + { + unset($this->func); + } + + /** + * Generated from protobuf field .Function func = 1; + * @param \PBFunction $var + * @return $this + */ + public function setFunc($var) + { + GPBUtil::checkMessage($var, \PBFunction::class); + $this->func = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Field.php b/proto/v1/php/Field.php new file mode 100644 index 0000000..81239b8 --- /dev/null +++ b/proto/v1/php/Field.php @@ -0,0 +1,76 @@ +Field + */ +class Field +{ + /** + * Generated from protobuf enum CreatedAt = 0; + */ + const CreatedAt = 0; + /** + * Generated from protobuf enum Name = 1; + */ + const Name = 1; + /** + * Generated from protobuf enum Size = 2; + */ + const Size = 2; + /** + * Generated from protobuf enum Language = 3; + */ + const Language = 3; + /** + * Generated from protobuf enum ImportsCount = 4; + */ + const ImportsCount = 4; + /** + * Generated from protobuf enum ExportsCount = 5; + */ + const ExportsCount = 5; + /** + * Generated from protobuf enum Sha256 = 6; + */ + const Sha256 = 6; + /** + * Generated from protobuf enum Complexity = 7; + */ + const Complexity = 7; + + private static $valueToName = [ + self::CreatedAt => 'CreatedAt', + self::Name => 'Name', + self::Size => 'Size', + self::Language => 'Language', + self::ImportsCount => 'ImportsCount', + self::ExportsCount => 'ExportsCount', + self::Sha256 => 'Sha256', + self::Complexity => 'Complexity', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/proto/v1/php/GPBMetadata/Proto/V1/Api.php b/proto/v1/php/GPBMetadata/Proto/V1/Api.php new file mode 100644 index 0000000..80d1243 Binary files /dev/null and b/proto/v1/php/GPBMetadata/Proto/V1/Api.php differ diff --git a/proto/v1/php/GetModuleGraphRequest.php b/proto/v1/php/GetModuleGraphRequest.php new file mode 100644 index 0000000..d37c16a --- /dev/null +++ b/proto/v1/php/GetModuleGraphRequest.php @@ -0,0 +1,59 @@ +GetModuleGraphRequest + */ +class GetModuleGraphRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int64 module_id = 1; + */ + protected $module_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $module_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field int64 module_id = 1; + * @return int|string + */ + public function getModuleId() + { + return $this->module_id; + } + + /** + * Generated from protobuf field int64 module_id = 1; + * @param int|string $var + * @return $this + */ + public function setModuleId($var) + { + GPBUtil::checkInt64($var); + $this->module_id = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/GetModuleGraphResponse.php b/proto/v1/php/GetModuleGraphResponse.php new file mode 100644 index 0000000..0a29267 --- /dev/null +++ b/proto/v1/php/GetModuleGraphResponse.php @@ -0,0 +1,105 @@ +GetModuleGraphResponse + */ +class GetModuleGraphResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .ModuleGraph module_graph = 1; + */ + protected $module_graph = null; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \ModuleGraph $module_graph + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .ModuleGraph module_graph = 1; + * @return \ModuleGraph|null + */ + public function getModuleGraph() + { + return isset($this->module_graph) ? $this->module_graph : null; + } + + public function hasModuleGraph() + { + return isset($this->module_graph); + } + + public function clearModuleGraph() + { + unset($this->module_graph); + } + + /** + * Generated from protobuf field .ModuleGraph module_graph = 1; + * @param \ModuleGraph $var + * @return $this + */ + public function setModuleGraph($var) + { + GPBUtil::checkMessage($var, \ModuleGraph::class); + $this->module_graph = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/GetModuleRequest.php b/proto/v1/php/GetModuleRequest.php new file mode 100644 index 0000000..fadac40 --- /dev/null +++ b/proto/v1/php/GetModuleRequest.php @@ -0,0 +1,59 @@ +GetModuleRequest + */ +class GetModuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field int64 module_id = 1; + */ + protected $module_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $module_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field int64 module_id = 1; + * @return int|string + */ + public function getModuleId() + { + return $this->module_id; + } + + /** + * Generated from protobuf field int64 module_id = 1; + * @param int|string $var + * @return $this + */ + public function setModuleId($var) + { + GPBUtil::checkInt64($var); + $this->module_id = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/GetModuleResponse.php b/proto/v1/php/GetModuleResponse.php new file mode 100644 index 0000000..003523c --- /dev/null +++ b/proto/v1/php/GetModuleResponse.php @@ -0,0 +1,105 @@ +GetModuleResponse + */ +class GetModuleResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .Module module = 1; + */ + protected $module = null; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Module $module + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .Module module = 1; + * @return \Module|null + */ + public function getModule() + { + return isset($this->module) ? $this->module : null; + } + + public function hasModule() + { + return isset($this->module); + } + + public function clearModule() + { + unset($this->module); + } + + /** + * Generated from protobuf field .Module module = 1; + * @param \Module $var + * @return $this + */ + public function setModule($var) + { + GPBUtil::checkMessage($var, \Module::class); + $this->module = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Import.php b/proto/v1/php/Import.php new file mode 100644 index 0000000..76fe279 --- /dev/null +++ b/proto/v1/php/Import.php @@ -0,0 +1,96 @@ +Import + */ +class Import extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string module_name = 1; + */ + protected $module_name = ''; + /** + * Generated from protobuf field .Function func = 2; + */ + protected $func = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $module_name + * @type \PBFunction $func + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string module_name = 1; + * @return string + */ + public function getModuleName() + { + return $this->module_name; + } + + /** + * Generated from protobuf field string module_name = 1; + * @param string $var + * @return $this + */ + public function setModuleName($var) + { + GPBUtil::checkString($var, True); + $this->module_name = $var; + + return $this; + } + + /** + * Generated from protobuf field .Function func = 2; + * @return \PBFunction|null + */ + public function getFunc() + { + return isset($this->func) ? $this->func : null; + } + + public function hasFunc() + { + return isset($this->func); + } + + public function clearFunc() + { + unset($this->func); + } + + /** + * Generated from protobuf field .Function func = 2; + * @param \PBFunction $var + * @return $this + */ + public function setFunc($var) + { + GPBUtil::checkMessage($var, \PBFunction::class); + $this->func = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/InstallPluginRequest.php b/proto/v1/php/InstallPluginRequest.php new file mode 100644 index 0000000..20c1ea1 --- /dev/null +++ b/proto/v1/php/InstallPluginRequest.php @@ -0,0 +1,156 @@ +InstallPluginRequest + */ +class InstallPluginRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string identifier = 1; + */ + protected $identifier = ''; + /** + * Generated from protobuf field string name = 2; + */ + protected $name = null; + /** + * Generated from protobuf field string location = 3; + */ + protected $location = ''; + /** + * bytes config = 5; + * + * Generated from protobuf field bytes wasm = 4; + */ + protected $wasm = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $identifier + * @type string $name + * @type string $location + * @type string $wasm + * bytes config = 5; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string identifier = 1; + * @return string + */ + public function getIdentifier() + { + return $this->identifier; + } + + /** + * Generated from protobuf field string identifier = 1; + * @param string $var + * @return $this + */ + public function setIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->identifier = $var; + + return $this; + } + + /** + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field string location = 3; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Generated from protobuf field string location = 3; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * bytes config = 5; + * + * Generated from protobuf field bytes wasm = 4; + * @return string + */ + public function getWasm() + { + return $this->wasm; + } + + /** + * bytes config = 5; + * + * Generated from protobuf field bytes wasm = 4; + * @param string $var + * @return $this + */ + public function setWasm($var) + { + GPBUtil::checkString($var, False); + $this->wasm = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/InstallPluginResponse.php b/proto/v1/php/InstallPluginResponse.php new file mode 100644 index 0000000..bab7b8e --- /dev/null +++ b/proto/v1/php/InstallPluginResponse.php @@ -0,0 +1,93 @@ +InstallPluginResponse + */ +class InstallPluginResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string hash = 1; + */ + protected $hash = ''; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $hash + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string hash = 1; + * @return string + */ + public function getHash() + { + return $this->hash; + } + + /** + * Generated from protobuf field string hash = 1; + * @param string $var + * @return $this + */ + public function setHash($var) + { + GPBUtil::checkString($var, True); + $this->hash = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/ListModulesRequest.php b/proto/v1/php/ListModulesRequest.php new file mode 100644 index 0000000..6fb909a --- /dev/null +++ b/proto/v1/php/ListModulesRequest.php @@ -0,0 +1,106 @@ +ListModulesRequest + */ +class ListModulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .Pagination pagination = 1; + */ + protected $pagination = null; + /** + * Generated from protobuf field .Sort sort = 2; + */ + protected $sort = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Pagination $pagination + * @type \Sort $sort + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .Pagination pagination = 1; + * @return \Pagination|null + */ + public function getPagination() + { + return isset($this->pagination) ? $this->pagination : null; + } + + public function hasPagination() + { + return isset($this->pagination); + } + + public function clearPagination() + { + unset($this->pagination); + } + + /** + * Generated from protobuf field .Pagination pagination = 1; + * @param \Pagination $var + * @return $this + */ + public function setPagination($var) + { + GPBUtil::checkMessage($var, \Pagination::class); + $this->pagination = $var; + + return $this; + } + + /** + * Generated from protobuf field .Sort sort = 2; + * @return \Sort|null + */ + public function getSort() + { + return isset($this->sort) ? $this->sort : null; + } + + public function hasSort() + { + return isset($this->sort); + } + + public function clearSort() + { + unset($this->sort); + } + + /** + * Generated from protobuf field .Sort sort = 2; + * @param \Sort $var + * @return $this + */ + public function setSort($var) + { + GPBUtil::checkMessage($var, \Sort::class); + $this->sort = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/ListModulesResponse.php b/proto/v1/php/ListModulesResponse.php new file mode 100644 index 0000000..f3783db --- /dev/null +++ b/proto/v1/php/ListModulesResponse.php @@ -0,0 +1,207 @@ +ListModulesResponse + */ +class ListModulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .Module modules = 1; + */ + private $modules; + /** + * Generated from protobuf field .Pagination pagination = 2; + */ + protected $pagination = null; + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + */ + protected $total = 0; + /** + * Generated from protobuf field .Sort sort = 4; + */ + protected $sort = null; + /** + * Generated from protobuf field .Error error = 5; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Module[]|\Google\Protobuf\Internal\RepeatedField $modules + * @type \Pagination $pagination + * @type int|string $total + * the full count of results in the database (not the count of this message's + * `modules`). + * @type \Sort $sort + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .Module modules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModules() + { + return $this->modules; + } + + /** + * Generated from protobuf field repeated .Module modules = 1; + * @param \Module[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Module::class); + $this->modules = $arr; + + return $this; + } + + /** + * Generated from protobuf field .Pagination pagination = 2; + * @return \Pagination|null + */ + public function getPagination() + { + return isset($this->pagination) ? $this->pagination : null; + } + + public function hasPagination() + { + return isset($this->pagination); + } + + public function clearPagination() + { + unset($this->pagination); + } + + /** + * Generated from protobuf field .Pagination pagination = 2; + * @param \Pagination $var + * @return $this + */ + public function setPagination($var) + { + GPBUtil::checkMessage($var, \Pagination::class); + $this->pagination = $var; + + return $this; + } + + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + * @return int|string + */ + public function getTotal() + { + return $this->total; + } + + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + * @param int|string $var + * @return $this + */ + public function setTotal($var) + { + GPBUtil::checkUint64($var); + $this->total = $var; + + return $this; + } + + /** + * Generated from protobuf field .Sort sort = 4; + * @return \Sort|null + */ + public function getSort() + { + return isset($this->sort) ? $this->sort : null; + } + + public function hasSort() + { + return isset($this->sort); + } + + public function clearSort() + { + unset($this->sort); + } + + /** + * Generated from protobuf field .Sort sort = 4; + * @param \Sort $var + * @return $this + */ + public function setSort($var) + { + GPBUtil::checkMessage($var, \Sort::class); + $this->sort = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 5; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 5; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Module.php b/proto/v1/php/Module.php new file mode 100644 index 0000000..6ef6028 --- /dev/null +++ b/proto/v1/php/Module.php @@ -0,0 +1,516 @@ +Module + */ +class Module extends \Google\Protobuf\Internal\Message +{ + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + */ + protected $id = 0; + /** + * sha256 hash of the modules raw bytes + * + * Generated from protobuf field string hash = 3; + */ + protected $hash = ''; + /** + * function imports called by the module (see: + * + * + * Generated from protobuf field repeated .Import imports = 4; + */ + private $imports; + /** + * function exports provided by the module (see: + * + * + * Generated from protobuf field repeated .Export exports = 5; + */ + private $exports; + /** + * size in bytes of the module + * + * Generated from protobuf field uint64 size = 6; + */ + protected $size = 0; + /** + * path or locator to the module + * + * Generated from protobuf field string location = 7; + */ + protected $location = ''; + /** + * programming language used to produce this module + * + * Generated from protobuf field .SourceLanguage source_language = 8; + */ + protected $source_language = 0; + /** + * arbitrary metadata provided by the operator of this module + * + * Generated from protobuf field map metadata = 9; + */ + private $metadata; + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_at = 10; + */ + protected $inserted_at = null; + /** + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * + * Generated from protobuf field repeated string strings = 11; + */ + private $strings; + /** + * the cyclomatic complexity + * () of the instructions + * + * Generated from protobuf field uint32 complexity = 13; + */ + protected $complexity = null; + /** + * the serialized graph in json format + * + * Generated from protobuf field bytes graph = 14; + */ + protected $graph = null; + /** + * function hashes + * + * Generated from protobuf field map function_hashes = 15; + */ + private $function_hashes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $id + * ID for this module, generated by the database. + * @type string $hash + * sha256 hash of the modules raw bytes + * @type \Import[]|\Google\Protobuf\Internal\RepeatedField $imports + * function imports called by the module (see: + * + * @type \Export[]|\Google\Protobuf\Internal\RepeatedField $exports + * function exports provided by the module (see: + * + * @type int|string $size + * size in bytes of the module + * @type string $location + * path or locator to the module + * @type int $source_language + * programming language used to produce this module + * @type array|\Google\Protobuf\Internal\MapField $metadata + * arbitrary metadata provided by the operator of this module + * @type \Google\Protobuf\Timestamp $inserted_at + * timestamp when this module was loaded and stored + * @type string[]|\Google\Protobuf\Internal\RepeatedField $strings + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * @type int $complexity + * the cyclomatic complexity + * () of the instructions + * @type string $graph + * the serialized graph in json format + * @type array|\Google\Protobuf\Internal\MapField $function_hashes + * function hashes + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + * @return int|string + */ + public function getId() + { + return $this->id; + } + + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkInt64($var); + $this->id = $var; + + return $this; + } + + /** + * sha256 hash of the modules raw bytes + * + * Generated from protobuf field string hash = 3; + * @return string + */ + public function getHash() + { + return $this->hash; + } + + /** + * sha256 hash of the modules raw bytes + * + * Generated from protobuf field string hash = 3; + * @param string $var + * @return $this + */ + public function setHash($var) + { + GPBUtil::checkString($var, True); + $this->hash = $var; + + return $this; + } + + /** + * function imports called by the module (see: + * + * + * Generated from protobuf field repeated .Import imports = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImports() + { + return $this->imports; + } + + /** + * function imports called by the module (see: + * + * + * Generated from protobuf field repeated .Import imports = 4; + * @param \Import[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Import::class); + $this->imports = $arr; + + return $this; + } + + /** + * function exports provided by the module (see: + * + * + * Generated from protobuf field repeated .Export exports = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExports() + { + return $this->exports; + } + + /** + * function exports provided by the module (see: + * + * + * Generated from protobuf field repeated .Export exports = 5; + * @param \Export[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Export::class); + $this->exports = $arr; + + return $this; + } + + /** + * size in bytes of the module + * + * Generated from protobuf field uint64 size = 6; + * @return int|string + */ + public function getSize() + { + return $this->size; + } + + /** + * size in bytes of the module + * + * Generated from protobuf field uint64 size = 6; + * @param int|string $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkUint64($var); + $this->size = $var; + + return $this; + } + + /** + * path or locator to the module + * + * Generated from protobuf field string location = 7; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * path or locator to the module + * + * Generated from protobuf field string location = 7; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * programming language used to produce this module + * + * Generated from protobuf field .SourceLanguage source_language = 8; + * @return int + */ + public function getSourceLanguage() + { + return $this->source_language; + } + + /** + * programming language used to produce this module + * + * Generated from protobuf field .SourceLanguage source_language = 8; + * @param int $var + * @return $this + */ + public function setSourceLanguage($var) + { + GPBUtil::checkEnum($var, \SourceLanguage::class); + $this->source_language = $var; + + return $this; + } + + /** + * arbitrary metadata provided by the operator of this module + * + * Generated from protobuf field map metadata = 9; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * arbitrary metadata provided by the operator of this module + * + * Generated from protobuf field map metadata = 9; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_at = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getInsertedAt() + { + return isset($this->inserted_at) ? $this->inserted_at : null; + } + + public function hasInsertedAt() + { + return isset($this->inserted_at); + } + + public function clearInsertedAt() + { + unset($this->inserted_at); + } + + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_at = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setInsertedAt($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->inserted_at = $var; + + return $this; + } + + /** + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * + * Generated from protobuf field repeated string strings = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStrings() + { + return $this->strings; + } + + /** + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * + * Generated from protobuf field repeated string strings = 11; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStrings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->strings = $arr; + + return $this; + } + + /** + * the cyclomatic complexity + * () of the instructions + * + * Generated from protobuf field uint32 complexity = 13; + * @return int + */ + public function getComplexity() + { + return isset($this->complexity) ? $this->complexity : 0; + } + + public function hasComplexity() + { + return isset($this->complexity); + } + + public function clearComplexity() + { + unset($this->complexity); + } + + /** + * the cyclomatic complexity + * () of the instructions + * + * Generated from protobuf field uint32 complexity = 13; + * @param int $var + * @return $this + */ + public function setComplexity($var) + { + GPBUtil::checkUint32($var); + $this->complexity = $var; + + return $this; + } + + /** + * the serialized graph in json format + * + * Generated from protobuf field bytes graph = 14; + * @return string + */ + public function getGraph() + { + return isset($this->graph) ? $this->graph : ''; + } + + public function hasGraph() + { + return isset($this->graph); + } + + public function clearGraph() + { + unset($this->graph); + } + + /** + * the serialized graph in json format + * + * Generated from protobuf field bytes graph = 14; + * @param string $var + * @return $this + */ + public function setGraph($var) + { + GPBUtil::checkString($var, False); + $this->graph = $var; + + return $this; + } + + /** + * function hashes + * + * Generated from protobuf field map function_hashes = 15; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFunctionHashes() + { + return $this->function_hashes; + } + + /** + * function hashes + * + * Generated from protobuf field map function_hashes = 15; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFunctionHashes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->function_hashes = $arr; + + return $this; + } + +} + diff --git a/proto/v1/php/ModuleGraph.php b/proto/v1/php/ModuleGraph.php new file mode 100644 index 0000000..cd92234 --- /dev/null +++ b/proto/v1/php/ModuleGraph.php @@ -0,0 +1,99 @@ +ModuleGraph + */ +class ModuleGraph extends \Google\Protobuf\Internal\Message +{ + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + */ + protected $id = 0; + /** + * the serialized graph in json format + * + * Generated from protobuf field bytes json_bytes = 2; + */ + protected $json_bytes = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $id + * ID for this module, generated by the database. + * @type string $json_bytes + * the serialized graph in json format + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + * @return int|string + */ + public function getId() + { + return $this->id; + } + + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkInt64($var); + $this->id = $var; + + return $this; + } + + /** + * the serialized graph in json format + * + * Generated from protobuf field bytes json_bytes = 2; + * @return string + */ + public function getJsonBytes() + { + return $this->json_bytes; + } + + /** + * the serialized graph in json format + * + * Generated from protobuf field bytes json_bytes = 2; + * @param string $var + * @return $this + */ + public function setJsonBytes($var) + { + GPBUtil::checkString($var, False); + $this->json_bytes = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/PBFunction.php b/proto/v1/php/PBFunction.php new file mode 100644 index 0000000..e4fb729 --- /dev/null +++ b/proto/v1/php/PBFunction.php @@ -0,0 +1,112 @@ +Function + */ +class PBFunction extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .ValType params = 1; + */ + private $params; + /** + * Generated from protobuf field repeated .ValType results = 2; + */ + private $results; + /** + * Generated from protobuf field string name = 3; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[]|\Google\Protobuf\Internal\RepeatedField $params + * @type int[]|\Google\Protobuf\Internal\RepeatedField $results + * @type string $name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .ValType params = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParams() + { + return $this->params; + } + + /** + * Generated from protobuf field repeated .ValType params = 1; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \ValType::class); + $this->params = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .ValType results = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResults() + { + return $this->results; + } + + /** + * Generated from protobuf field repeated .ValType results = 2; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \ValType::class); + $this->results = $arr; + + return $this; + } + + /** + * Generated from protobuf field string name = 3; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 3; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Pagination.php b/proto/v1/php/Pagination.php new file mode 100644 index 0000000..386d007 --- /dev/null +++ b/proto/v1/php/Pagination.php @@ -0,0 +1,86 @@ +Pagination + */ +class Pagination extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field uint32 limit = 1; + */ + protected $limit = 0; + /** + * Generated from protobuf field uint32 offset = 2; + */ + protected $offset = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $limit + * @type int $offset + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field uint32 limit = 1; + * @return int + */ + public function getLimit() + { + return $this->limit; + } + + /** + * Generated from protobuf field uint32 limit = 1; + * @param int $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkUint32($var); + $this->limit = $var; + + return $this; + } + + /** + * Generated from protobuf field uint32 offset = 2; + * @return int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * Generated from protobuf field uint32 offset = 2; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkUint32($var); + $this->offset = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/SearchModulesRequest.php b/proto/v1/php/SearchModulesRequest.php new file mode 100644 index 0000000..97ce36c --- /dev/null +++ b/proto/v1/php/SearchModulesRequest.php @@ -0,0 +1,696 @@ +SearchModulesRequest + */ +class SearchModulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + */ + protected $id = null; + /** + * original name of the binary module file + * + * Generated from protobuf field string hash = 3; + */ + protected $hash = null; + /** + * function imports called by the module (see: + * ) + * + * Generated from protobuf field repeated .Import imports = 4; + */ + private $imports; + /** + * function exports provided by the module (see: + * ) + * + * Generated from protobuf field repeated .Export exports = 5; + */ + private $exports; + /** + * minimum size in bytes of the module + * + * Generated from protobuf field uint64 min_size = 6; + */ + protected $min_size = null; + /** + * maximum size in bytes of the module + * + * Generated from protobuf field uint64 max_size = 7; + */ + protected $max_size = null; + /** + * optional path or locator to the module (TODO: maybe this is better stored + * as metadata) + * + * Generated from protobuf field string location = 8; + */ + protected $location = null; + /** + * programming language used to produce this module + * + * Generated from protobuf field .SourceLanguage source_language = 9; + */ + protected $source_language = null; + /** + * arbitrary metadata provided by the operator of this module + * + * Generated from protobuf field map metadata = 10; + */ + private $metadata; + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_before = 11; + */ + protected $inserted_before = null; + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_after = 12; + */ + protected $inserted_after = null; + /** + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * + * Generated from protobuf field repeated string strings = 13; + */ + private $strings; + /** + * match on any function name in an import or export. + * + * Generated from protobuf field string function_name = 14; + */ + protected $function_name = null; + /** + * match on the module name e.g. `env` or `wasi_snapshot_preview1` + * + * Generated from protobuf field string module_name = 15; + */ + protected $module_name = null; + /** + * Generated from protobuf field .Pagination pagination = 16; + */ + protected $pagination = null; + /** + * Generated from protobuf field .Sort sort = 17; + */ + protected $sort = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $id + * ID for this module, generated by the database. + * @type string $hash + * original name of the binary module file + * @type \Import[]|\Google\Protobuf\Internal\RepeatedField $imports + * function imports called by the module (see: + * ) + * @type \Export[]|\Google\Protobuf\Internal\RepeatedField $exports + * function exports provided by the module (see: + * ) + * @type int|string $min_size + * minimum size in bytes of the module + * @type int|string $max_size + * maximum size in bytes of the module + * @type string $location + * optional path or locator to the module (TODO: maybe this is better stored + * as metadata) + * @type int $source_language + * programming language used to produce this module + * @type array|\Google\Protobuf\Internal\MapField $metadata + * arbitrary metadata provided by the operator of this module + * @type \Google\Protobuf\Timestamp $inserted_before + * timestamp when this module was loaded and stored + * @type \Google\Protobuf\Timestamp $inserted_after + * timestamp when this module was loaded and stored + * @type string[]|\Google\Protobuf\Internal\RepeatedField $strings + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * @type string $function_name + * match on any function name in an import or export. + * @type string $module_name + * match on the module name e.g. `env` or `wasi_snapshot_preview1` + * @type \Pagination $pagination + * @type \Sort $sort + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * ID for this module, generated by the database. + * + * Generated from protobuf field int64 id = 1; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkInt64($var); + $this->id = $var; + + return $this; + } + + /** + * original name of the binary module file + * + * Generated from protobuf field string hash = 3; + * @return string + */ + public function getHash() + { + return isset($this->hash) ? $this->hash : ''; + } + + public function hasHash() + { + return isset($this->hash); + } + + public function clearHash() + { + unset($this->hash); + } + + /** + * original name of the binary module file + * + * Generated from protobuf field string hash = 3; + * @param string $var + * @return $this + */ + public function setHash($var) + { + GPBUtil::checkString($var, True); + $this->hash = $var; + + return $this; + } + + /** + * function imports called by the module (see: + * ) + * + * Generated from protobuf field repeated .Import imports = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImports() + { + return $this->imports; + } + + /** + * function imports called by the module (see: + * ) + * + * Generated from protobuf field repeated .Import imports = 4; + * @param \Import[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Import::class); + $this->imports = $arr; + + return $this; + } + + /** + * function exports provided by the module (see: + * ) + * + * Generated from protobuf field repeated .Export exports = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExports() + { + return $this->exports; + } + + /** + * function exports provided by the module (see: + * ) + * + * Generated from protobuf field repeated .Export exports = 5; + * @param \Export[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Export::class); + $this->exports = $arr; + + return $this; + } + + /** + * minimum size in bytes of the module + * + * Generated from protobuf field uint64 min_size = 6; + * @return int|string + */ + public function getMinSize() + { + return isset($this->min_size) ? $this->min_size : 0; + } + + public function hasMinSize() + { + return isset($this->min_size); + } + + public function clearMinSize() + { + unset($this->min_size); + } + + /** + * minimum size in bytes of the module + * + * Generated from protobuf field uint64 min_size = 6; + * @param int|string $var + * @return $this + */ + public function setMinSize($var) + { + GPBUtil::checkUint64($var); + $this->min_size = $var; + + return $this; + } + + /** + * maximum size in bytes of the module + * + * Generated from protobuf field uint64 max_size = 7; + * @return int|string + */ + public function getMaxSize() + { + return isset($this->max_size) ? $this->max_size : 0; + } + + public function hasMaxSize() + { + return isset($this->max_size); + } + + public function clearMaxSize() + { + unset($this->max_size); + } + + /** + * maximum size in bytes of the module + * + * Generated from protobuf field uint64 max_size = 7; + * @param int|string $var + * @return $this + */ + public function setMaxSize($var) + { + GPBUtil::checkUint64($var); + $this->max_size = $var; + + return $this; + } + + /** + * optional path or locator to the module (TODO: maybe this is better stored + * as metadata) + * + * Generated from protobuf field string location = 8; + * @return string + */ + public function getLocation() + { + return isset($this->location) ? $this->location : ''; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * optional path or locator to the module (TODO: maybe this is better stored + * as metadata) + * + * Generated from protobuf field string location = 8; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * programming language used to produce this module + * + * Generated from protobuf field .SourceLanguage source_language = 9; + * @return int + */ + public function getSourceLanguage() + { + return isset($this->source_language) ? $this->source_language : 0; + } + + public function hasSourceLanguage() + { + return isset($this->source_language); + } + + public function clearSourceLanguage() + { + unset($this->source_language); + } + + /** + * programming language used to produce this module + * + * Generated from protobuf field .SourceLanguage source_language = 9; + * @param int $var + * @return $this + */ + public function setSourceLanguage($var) + { + GPBUtil::checkEnum($var, \SourceLanguage::class); + $this->source_language = $var; + + return $this; + } + + /** + * arbitrary metadata provided by the operator of this module + * + * Generated from protobuf field map metadata = 10; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * arbitrary metadata provided by the operator of this module + * + * Generated from protobuf field map metadata = 10; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_before = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getInsertedBefore() + { + return isset($this->inserted_before) ? $this->inserted_before : null; + } + + public function hasInsertedBefore() + { + return isset($this->inserted_before); + } + + public function clearInsertedBefore() + { + unset($this->inserted_before); + } + + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_before = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setInsertedBefore($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->inserted_before = $var; + + return $this; + } + + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_after = 12; + * @return \Google\Protobuf\Timestamp|null + */ + public function getInsertedAfter() + { + return isset($this->inserted_after) ? $this->inserted_after : null; + } + + public function hasInsertedAfter() + { + return isset($this->inserted_after); + } + + public function clearInsertedAfter() + { + unset($this->inserted_after); + } + + /** + * timestamp when this module was loaded and stored + * + * Generated from protobuf field .google.protobuf.Timestamp inserted_after = 12; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setInsertedAfter($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->inserted_after = $var; + + return $this; + } + + /** + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * + * Generated from protobuf field repeated string strings = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStrings() + { + return $this->strings; + } + + /** + * the interned strings stored in the wasm binary (panic/abort messages, etc.) + * + * Generated from protobuf field repeated string strings = 13; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStrings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->strings = $arr; + + return $this; + } + + /** + * match on any function name in an import or export. + * + * Generated from protobuf field string function_name = 14; + * @return string + */ + public function getFunctionName() + { + return isset($this->function_name) ? $this->function_name : ''; + } + + public function hasFunctionName() + { + return isset($this->function_name); + } + + public function clearFunctionName() + { + unset($this->function_name); + } + + /** + * match on any function name in an import or export. + * + * Generated from protobuf field string function_name = 14; + * @param string $var + * @return $this + */ + public function setFunctionName($var) + { + GPBUtil::checkString($var, True); + $this->function_name = $var; + + return $this; + } + + /** + * match on the module name e.g. `env` or `wasi_snapshot_preview1` + * + * Generated from protobuf field string module_name = 15; + * @return string + */ + public function getModuleName() + { + return isset($this->module_name) ? $this->module_name : ''; + } + + public function hasModuleName() + { + return isset($this->module_name); + } + + public function clearModuleName() + { + unset($this->module_name); + } + + /** + * match on the module name e.g. `env` or `wasi_snapshot_preview1` + * + * Generated from protobuf field string module_name = 15; + * @param string $var + * @return $this + */ + public function setModuleName($var) + { + GPBUtil::checkString($var, True); + $this->module_name = $var; + + return $this; + } + + /** + * Generated from protobuf field .Pagination pagination = 16; + * @return \Pagination|null + */ + public function getPagination() + { + return isset($this->pagination) ? $this->pagination : null; + } + + public function hasPagination() + { + return isset($this->pagination); + } + + public function clearPagination() + { + unset($this->pagination); + } + + /** + * Generated from protobuf field .Pagination pagination = 16; + * @param \Pagination $var + * @return $this + */ + public function setPagination($var) + { + GPBUtil::checkMessage($var, \Pagination::class); + $this->pagination = $var; + + return $this; + } + + /** + * Generated from protobuf field .Sort sort = 17; + * @return \Sort|null + */ + public function getSort() + { + return isset($this->sort) ? $this->sort : null; + } + + public function hasSort() + { + return isset($this->sort); + } + + public function clearSort() + { + unset($this->sort); + } + + /** + * Generated from protobuf field .Sort sort = 17; + * @param \Sort $var + * @return $this + */ + public function setSort($var) + { + GPBUtil::checkMessage($var, \Sort::class); + $this->sort = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/SearchModulesResponse.php b/proto/v1/php/SearchModulesResponse.php new file mode 100644 index 0000000..2a88691 --- /dev/null +++ b/proto/v1/php/SearchModulesResponse.php @@ -0,0 +1,207 @@ +SearchModulesResponse + */ +class SearchModulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .Module modules = 1; + */ + private $modules; + /** + * Generated from protobuf field .Pagination pagination = 2; + */ + protected $pagination = null; + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + */ + protected $total = 0; + /** + * Generated from protobuf field .Sort sort = 4; + */ + protected $sort = null; + /** + * Generated from protobuf field .Error error = 5; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Module[]|\Google\Protobuf\Internal\RepeatedField $modules + * @type \Pagination $pagination + * @type int|string $total + * the full count of results in the database (not the count of this message's + * `modules`). + * @type \Sort $sort + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .Module modules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModules() + { + return $this->modules; + } + + /** + * Generated from protobuf field repeated .Module modules = 1; + * @param \Module[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Module::class); + $this->modules = $arr; + + return $this; + } + + /** + * Generated from protobuf field .Pagination pagination = 2; + * @return \Pagination|null + */ + public function getPagination() + { + return isset($this->pagination) ? $this->pagination : null; + } + + public function hasPagination() + { + return isset($this->pagination); + } + + public function clearPagination() + { + unset($this->pagination); + } + + /** + * Generated from protobuf field .Pagination pagination = 2; + * @param \Pagination $var + * @return $this + */ + public function setPagination($var) + { + GPBUtil::checkMessage($var, \Pagination::class); + $this->pagination = $var; + + return $this; + } + + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + * @return int|string + */ + public function getTotal() + { + return $this->total; + } + + /** + * the full count of results in the database (not the count of this message's + * `modules`). + * + * Generated from protobuf field uint64 total = 3; + * @param int|string $var + * @return $this + */ + public function setTotal($var) + { + GPBUtil::checkUint64($var); + $this->total = $var; + + return $this; + } + + /** + * Generated from protobuf field .Sort sort = 4; + * @return \Sort|null + */ + public function getSort() + { + return isset($this->sort) ? $this->sort : null; + } + + public function hasSort() + { + return isset($this->sort); + } + + public function clearSort() + { + unset($this->sort); + } + + /** + * Generated from protobuf field .Sort sort = 4; + * @param \Sort $var + * @return $this + */ + public function setSort($var) + { + GPBUtil::checkMessage($var, \Sort::class); + $this->sort = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 5; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 5; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/Sort.php b/proto/v1/php/Sort.php new file mode 100644 index 0000000..90f9e28 --- /dev/null +++ b/proto/v1/php/Sort.php @@ -0,0 +1,85 @@ +Sort + */ +class Sort extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .Direction direction = 1; + */ + protected $direction = 0; + /** + * Generated from protobuf field .Field field = 2; + */ + protected $field = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $direction + * @type int $field + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .Direction direction = 1; + * @return int + */ + public function getDirection() + { + return $this->direction; + } + + /** + * Generated from protobuf field .Direction direction = 1; + * @param int $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkEnum($var, \Direction::class); + $this->direction = $var; + + return $this; + } + + /** + * Generated from protobuf field .Field field = 2; + * @return int + */ + public function getField() + { + return $this->field; + } + + /** + * Generated from protobuf field .Field field = 2; + * @param int $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkEnum($var, \Field::class); + $this->field = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/SourceLanguage.php b/proto/v1/php/SourceLanguage.php new file mode 100644 index 0000000..cf09ff3 --- /dev/null +++ b/proto/v1/php/SourceLanguage.php @@ -0,0 +1,86 @@ +SourceLanguage + */ +class SourceLanguage +{ + /** + * Generated from protobuf enum Unknown = 0; + */ + const Unknown = 0; + /** + * Generated from protobuf enum Rust = 1; + */ + const Rust = 1; + /** + * Generated from protobuf enum Go = 2; + */ + const Go = 2; + /** + * Generated from protobuf enum C = 3; + */ + const C = 3; + /** + * Generated from protobuf enum Cpp = 4; + */ + const Cpp = 4; + /** + * Generated from protobuf enum AssemblyScript = 5; + */ + const AssemblyScript = 5; + /** + * Generated from protobuf enum Swift = 6; + */ + const Swift = 6; + /** + * Generated from protobuf enum JavaScript = 7; + */ + const JavaScript = 7; + /** + * Generated from protobuf enum Haskell = 8; + */ + const Haskell = 8; + /** + * Generated from protobuf enum Zig = 9; + */ + const Zig = 9; + + private static $valueToName = [ + self::Unknown => 'Unknown', + self::Rust => 'Rust', + self::Go => 'Go', + self::C => 'C', + self::Cpp => 'Cpp', + self::AssemblyScript => 'AssemblyScript', + self::Swift => 'Swift', + self::JavaScript => 'JavaScript', + self::Haskell => 'Haskell', + self::Zig => 'Zig', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/proto/v1/php/UninstallPluginRequest.php b/proto/v1/php/UninstallPluginRequest.php new file mode 100644 index 0000000..bb994db --- /dev/null +++ b/proto/v1/php/UninstallPluginRequest.php @@ -0,0 +1,58 @@ +UninstallPluginRequest + */ +class UninstallPluginRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string identifier = 1; + */ + protected $identifier = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $identifier + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string identifier = 1; + * @return string + */ + public function getIdentifier() + { + return $this->identifier; + } + + /** + * Generated from protobuf field string identifier = 1; + * @param string $var + * @return $this + */ + public function setIdentifier($var) + { + GPBUtil::checkString($var, True); + $this->identifier = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/UninstallPluginResponse.php b/proto/v1/php/UninstallPluginResponse.php new file mode 100644 index 0000000..8ed3536 --- /dev/null +++ b/proto/v1/php/UninstallPluginResponse.php @@ -0,0 +1,66 @@ +UninstallPluginResponse + */ +class UninstallPluginResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .Error error = 1; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .Error error = 1; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 1; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/proto/v1/php/ValType.php b/proto/v1/php/ValType.php new file mode 100644 index 0000000..2768de4 --- /dev/null +++ b/proto/v1/php/ValType.php @@ -0,0 +1,72 @@ +ValType + */ +class ValType +{ + /** + * Generated from protobuf enum I32 = 0; + */ + const I32 = 0; + /** + * Generated from protobuf enum I64 = 1; + */ + const I64 = 1; + /** + * Generated from protobuf enum F32 = 2; + */ + const F32 = 2; + /** + * Generated from protobuf enum F64 = 3; + */ + const F64 = 3; + /** + * Generated from protobuf enum V128 = 4; + */ + const V128 = 4; + /** + * Generated from protobuf enum FuncRef = 5; + */ + const FuncRef = 5; + /** + * Generated from protobuf enum ExternRef = 6; + */ + const ExternRef = 6; + + private static $valueToName = [ + self::I32 => 'I32', + self::I64 => 'I64', + self::F32 => 'F32', + self::F64 => 'F64', + self::V128 => 'V128', + self::FuncRef => 'FuncRef', + self::ExternRef => 'ExternRef', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/proto/v1/php/ValidateModuleRequest.php b/proto/v1/php/ValidateModuleRequest.php new file mode 100644 index 0000000..ffc3624 --- /dev/null +++ b/proto/v1/php/ValidateModuleRequest.php @@ -0,0 +1,131 @@ +ValidateModuleRequest + */ +class ValidateModuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * the YAML checkfile (e.g. mod.yaml) bytes + * + * Generated from protobuf field bytes checkfile = 1; + */ + protected $checkfile = ''; + protected $module_input; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $checkfile + * the YAML checkfile (e.g. mod.yaml) bytes + * @type string $module + * @type int|string $module_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * the YAML checkfile (e.g. mod.yaml) bytes + * + * Generated from protobuf field bytes checkfile = 1; + * @return string + */ + public function getCheckfile() + { + return $this->checkfile; + } + + /** + * the YAML checkfile (e.g. mod.yaml) bytes + * + * Generated from protobuf field bytes checkfile = 1; + * @param string $var + * @return $this + */ + public function setCheckfile($var) + { + GPBUtil::checkString($var, False); + $this->checkfile = $var; + + return $this; + } + + /** + * Generated from protobuf field bytes module = 2; + * @return string + */ + public function getModule() + { + return $this->readOneof(2); + } + + public function hasModule() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field bytes module = 2; + * @param string $var + * @return $this + */ + public function setModule($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field int64 module_id = 3; + * @return int|string + */ + public function getModuleId() + { + return $this->readOneof(3); + } + + public function hasModuleId() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field int64 module_id = 3; + * @param int|string $var + * @return $this + */ + public function setModuleId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getModuleInput() + { + return $this->whichOneof("module_input"); + } + +} + diff --git a/proto/v1/php/ValidateModuleResponse.php b/proto/v1/php/ValidateModuleResponse.php new file mode 100644 index 0000000..517147d --- /dev/null +++ b/proto/v1/php/ValidateModuleResponse.php @@ -0,0 +1,95 @@ +ValidateModuleResponse + */ +class ValidateModuleResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes invalid_module_report = 1; + */ + protected $invalid_module_report = ''; + /** + * Generated from protobuf field .Error error = 2; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $invalid_module_report + * @type \Error $error + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\V1\Api::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes invalid_module_report = 1; + * @return string + */ + public function getInvalidModuleReport() + { + return $this->invalid_module_report; + } + + /** + * Generated from protobuf field bytes invalid_module_report = 1; + * @param string $var + * @return $this + */ + public function setInvalidModuleReport($var) + { + GPBUtil::checkString($var, False); + $this->invalid_module_report = $var; + + return $this; + } + + /** + * Generated from protobuf field .Error error = 2; + * @return \Error|null + */ + public function getError() + { + return isset($this->error) ? $this->error : null; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Generated from protobuf field .Error error = 2; + * @param \Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Error::class); + $this->error = $var; + + return $this; + } + +} +