UNPKG

@animeapis/hub

Version:
912 lines (829 loc) 672 kB
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ /* AMD */ if (typeof define === 'function' && define.amd) define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots._animeapis_hub_protos || ($protobuf.roots._animeapis_hub_protos = {}); $root.animeshon = (function() { /** * Namespace animeshon. * @exports animeshon * @namespace */ var animeshon = {}; animeshon.hub = (function() { /** * Namespace hub. * @memberof animeshon * @namespace */ var hub = {}; hub.v1alpha1 = (function() { /** * Namespace v1alpha1. * @memberof animeshon.hub * @namespace */ var v1alpha1 = {}; v1alpha1.Git = (function() { /** * Constructs a new Git service. * @memberof animeshon.hub.v1alpha1 * @classdesc Represents a Git * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function Git(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (Git.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Git; /** * Creates new Git service using the specified rpc implementation. * @function create * @memberof animeshon.hub.v1alpha1.Git * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {Git} RPC service. Useful where requests and/or responses are streamed. */ Git.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link animeshon.hub.v1alpha1.Git#advertiseReferences}. * @memberof animeshon.hub.v1alpha1.Git * @typedef AdvertiseReferencesCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.api.HttpBody} [response] HttpBody */ /** * Calls AdvertiseReferences. * @function advertiseReferences * @memberof animeshon.hub.v1alpha1.Git * @instance * @param {animeshon.hub.v1alpha1.IAdvertiseReferencesRequest} request AdvertiseReferencesRequest message or plain object * @param {animeshon.hub.v1alpha1.Git.AdvertiseReferencesCallback} callback Node-style callback called with the error, if any, and HttpBody * @returns {undefined} * @variation 1 */ Object.defineProperty(Git.prototype.advertiseReferences = function advertiseReferences(request, callback) { return this.rpcCall(advertiseReferences, $root.animeshon.hub.v1alpha1.AdvertiseReferencesRequest, $root.google.api.HttpBody, request, callback); }, "name", { value: "AdvertiseReferences" }); /** * Calls AdvertiseReferences. * @function advertiseReferences * @memberof animeshon.hub.v1alpha1.Git * @instance * @param {animeshon.hub.v1alpha1.IAdvertiseReferencesRequest} request AdvertiseReferencesRequest message or plain object * @returns {Promise<google.api.HttpBody>} Promise * @variation 2 */ /** * Callback as used by {@link animeshon.hub.v1alpha1.Git#receivePack}. * @memberof animeshon.hub.v1alpha1.Git * @typedef ReceivePackCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.api.HttpBody} [response] HttpBody */ /** * Calls ReceivePack. * @function receivePack * @memberof animeshon.hub.v1alpha1.Git * @instance * @param {animeshon.hub.v1alpha1.IReceivePackRequest} request ReceivePackRequest message or plain object * @param {animeshon.hub.v1alpha1.Git.ReceivePackCallback} callback Node-style callback called with the error, if any, and HttpBody * @returns {undefined} * @variation 1 */ Object.defineProperty(Git.prototype.receivePack = function receivePack(request, callback) { return this.rpcCall(receivePack, $root.animeshon.hub.v1alpha1.ReceivePackRequest, $root.google.api.HttpBody, request, callback); }, "name", { value: "ReceivePack" }); /** * Calls ReceivePack. * @function receivePack * @memberof animeshon.hub.v1alpha1.Git * @instance * @param {animeshon.hub.v1alpha1.IReceivePackRequest} request ReceivePackRequest message or plain object * @returns {Promise<google.api.HttpBody>} Promise * @variation 2 */ /** * Callback as used by {@link animeshon.hub.v1alpha1.Git#uploadPack}. * @memberof animeshon.hub.v1alpha1.Git * @typedef UploadPackCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.api.HttpBody} [response] HttpBody */ /** * Calls UploadPack. * @function uploadPack * @memberof animeshon.hub.v1alpha1.Git * @instance * @param {animeshon.hub.v1alpha1.IUploadPackRequest} request UploadPackRequest message or plain object * @param {animeshon.hub.v1alpha1.Git.UploadPackCallback} callback Node-style callback called with the error, if any, and HttpBody * @returns {undefined} * @variation 1 */ Object.defineProperty(Git.prototype.uploadPack = function uploadPack(request, callback) { return this.rpcCall(uploadPack, $root.animeshon.hub.v1alpha1.UploadPackRequest, $root.google.api.HttpBody, request, callback); }, "name", { value: "UploadPack" }); /** * Calls UploadPack. * @function uploadPack * @memberof animeshon.hub.v1alpha1.Git * @instance * @param {animeshon.hub.v1alpha1.IUploadPackRequest} request UploadPackRequest message or plain object * @returns {Promise<google.api.HttpBody>} Promise * @variation 2 */ return Git; })(); v1alpha1.Hub = (function() { /** * Constructs a new Hub service. * @memberof animeshon.hub.v1alpha1 * @classdesc Represents a Hub * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function Hub(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (Hub.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Hub; /** * Creates new Hub service using the specified rpc implementation. * @function create * @memberof animeshon.hub.v1alpha1.Hub * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {Hub} RPC service. Useful where requests and/or responses are streamed. */ Hub.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link animeshon.hub.v1alpha1.Hub#createRepository}. * @memberof animeshon.hub.v1alpha1.Hub * @typedef CreateRepositoryCallback * @type {function} * @param {Error|null} error Error, if any * @param {animeshon.hub.v1alpha1.Repository} [response] Repository */ /** * Calls CreateRepository. * @function createRepository * @memberof animeshon.hub.v1alpha1.Hub * @instance * @param {animeshon.hub.v1alpha1.ICreateRepositoryRequest} request CreateRepositoryRequest message or plain object * @param {animeshon.hub.v1alpha1.Hub.CreateRepositoryCallback} callback Node-style callback called with the error, if any, and Repository * @returns {undefined} * @variation 1 */ Object.defineProperty(Hub.prototype.createRepository = function createRepository(request, callback) { return this.rpcCall(createRepository, $root.animeshon.hub.v1alpha1.CreateRepositoryRequest, $root.animeshon.hub.v1alpha1.Repository, request, callback); }, "name", { value: "CreateRepository" }); /** * Calls CreateRepository. * @function createRepository * @memberof animeshon.hub.v1alpha1.Hub * @instance * @param {animeshon.hub.v1alpha1.ICreateRepositoryRequest} request CreateRepositoryRequest message or plain object * @returns {Promise<animeshon.hub.v1alpha1.Repository>} Promise * @variation 2 */ /** * Callback as used by {@link animeshon.hub.v1alpha1.Hub#deleteRepository}. * @memberof animeshon.hub.v1alpha1.Hub * @typedef DeleteRepositoryCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteRepository. * @function deleteRepository * @memberof animeshon.hub.v1alpha1.Hub * @instance * @param {animeshon.hub.v1alpha1.IDeleteRepositoryRequest} request DeleteRepositoryRequest message or plain object * @param {animeshon.hub.v1alpha1.Hub.DeleteRepositoryCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(Hub.prototype.deleteRepository = function deleteRepository(request, callback) { return this.rpcCall(deleteRepository, $root.animeshon.hub.v1alpha1.DeleteRepositoryRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteRepository" }); /** * Calls DeleteRepository. * @function deleteRepository * @memberof animeshon.hub.v1alpha1.Hub * @instance * @param {animeshon.hub.v1alpha1.IDeleteRepositoryRequest} request DeleteRepositoryRequest message or plain object * @returns {Promise<google.protobuf.Empty>} Promise * @variation 2 */ /** * Callback as used by {@link animeshon.hub.v1alpha1.Hub#listRepositories}. * @memberof animeshon.hub.v1alpha1.Hub * @typedef ListRepositoriesCallback * @type {function} * @param {Error|null} error Error, if any * @param {animeshon.hub.v1alpha1.ListRepositoriesResponse} [response] ListRepositoriesResponse */ /** * Calls ListRepositories. * @function listRepositories * @memberof animeshon.hub.v1alpha1.Hub * @instance * @param {animeshon.hub.v1alpha1.IListRepositoriesRequest} request ListRepositoriesRequest message or plain object * @param {animeshon.hub.v1alpha1.Hub.ListRepositoriesCallback} callback Node-style callback called with the error, if any, and ListRepositoriesResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(Hub.prototype.listRepositories = function listRepositories(request, callback) { return this.rpcCall(listRepositories, $root.animeshon.hub.v1alpha1.ListRepositoriesRequest, $root.animeshon.hub.v1alpha1.ListRepositoriesResponse, request, callback); }, "name", { value: "ListRepositories" }); /** * Calls ListRepositories. * @function listRepositories * @memberof animeshon.hub.v1alpha1.Hub * @instance * @param {animeshon.hub.v1alpha1.IListRepositoriesRequest} request ListRepositoriesRequest message or plain object * @returns {Promise<animeshon.hub.v1alpha1.ListRepositoriesResponse>} Promise * @variation 2 */ return Hub; })(); v1alpha1.Repository = (function() { /** * Properties of a Repository. * @memberof animeshon.hub.v1alpha1 * @interface IRepository * @property {string|null} [name] Repository name */ /** * Constructs a new Repository. * @memberof animeshon.hub.v1alpha1 * @classdesc Represents a Repository. * @implements IRepository * @constructor * @param {animeshon.hub.v1alpha1.IRepository=} [properties] Properties to set */ function Repository(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Repository name. * @member {string} name * @memberof animeshon.hub.v1alpha1.Repository * @instance */ Repository.prototype.name = ""; /** * Creates a new Repository instance using the specified properties. * @function create * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {animeshon.hub.v1alpha1.IRepository=} [properties] Properties to set * @returns {animeshon.hub.v1alpha1.Repository} Repository instance */ Repository.create = function create(properties) { return new Repository(properties); }; /** * Encodes the specified Repository message. Does not implicitly {@link animeshon.hub.v1alpha1.Repository.verify|verify} messages. * @function encode * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {animeshon.hub.v1alpha1.IRepository} message Repository message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Repository.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified Repository message, length delimited. Does not implicitly {@link animeshon.hub.v1alpha1.Repository.verify|verify} messages. * @function encodeDelimited * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {animeshon.hub.v1alpha1.IRepository} message Repository message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Repository.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Repository message from the specified reader or buffer. * @function decode * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {animeshon.hub.v1alpha1.Repository} Repository * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Repository.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.animeshon.hub.v1alpha1.Repository(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Repository message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {animeshon.hub.v1alpha1.Repository} Repository * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Repository.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Repository message. * @function verify * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Repository.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a Repository message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {Object.<string,*>} object Plain object * @returns {animeshon.hub.v1alpha1.Repository} Repository */ Repository.fromObject = function fromObject(object) { if (object instanceof $root.animeshon.hub.v1alpha1.Repository) return object; var message = new $root.animeshon.hub.v1alpha1.Repository(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a Repository message. Also converts values to other types if specified. * @function toObject * @memberof animeshon.hub.v1alpha1.Repository * @static * @param {animeshon.hub.v1alpha1.Repository} message Repository * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ Repository.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this Repository to JSON. * @function toJSON * @memberof animeshon.hub.v1alpha1.Repository * @instance * @returns {Object.<string,*>} JSON object */ Repository.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Repository; })(); v1alpha1.AdvertiseReferencesRequest = (function() { /** * Properties of an AdvertiseReferencesRequest. * @memberof animeshon.hub.v1alpha1 * @interface IAdvertiseReferencesRequest * @property {string|null} [name] AdvertiseReferencesRequest name * @property {string|null} [service] AdvertiseReferencesRequest service */ /** * Constructs a new AdvertiseReferencesRequest. * @memberof animeshon.hub.v1alpha1 * @classdesc Represents an AdvertiseReferencesRequest. * @implements IAdvertiseReferencesRequest * @constructor * @param {animeshon.hub.v1alpha1.IAdvertiseReferencesRequest=} [properties] Properties to set */ function AdvertiseReferencesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AdvertiseReferencesRequest name. * @member {string} name * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @instance */ AdvertiseReferencesRequest.prototype.name = ""; /** * AdvertiseReferencesRequest service. * @member {string} service * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @instance */ AdvertiseReferencesRequest.prototype.service = ""; /** * Creates a new AdvertiseReferencesRequest instance using the specified properties. * @function create * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {animeshon.hub.v1alpha1.IAdvertiseReferencesRequest=} [properties] Properties to set * @returns {animeshon.hub.v1alpha1.AdvertiseReferencesRequest} AdvertiseReferencesRequest instance */ AdvertiseReferencesRequest.create = function create(properties) { return new AdvertiseReferencesRequest(properties); }; /** * Encodes the specified AdvertiseReferencesRequest message. Does not implicitly {@link animeshon.hub.v1alpha1.AdvertiseReferencesRequest.verify|verify} messages. * @function encode * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {animeshon.hub.v1alpha1.IAdvertiseReferencesRequest} message AdvertiseReferencesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AdvertiseReferencesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.service != null && Object.hasOwnProperty.call(message, "service")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); return writer; }; /** * Encodes the specified AdvertiseReferencesRequest message, length delimited. Does not implicitly {@link animeshon.hub.v1alpha1.AdvertiseReferencesRequest.verify|verify} messages. * @function encodeDelimited * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {animeshon.hub.v1alpha1.IAdvertiseReferencesRequest} message AdvertiseReferencesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AdvertiseReferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AdvertiseReferencesRequest message from the specified reader or buffer. * @function decode * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {animeshon.hub.v1alpha1.AdvertiseReferencesRequest} AdvertiseReferencesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AdvertiseReferencesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.animeshon.hub.v1alpha1.AdvertiseReferencesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.service = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AdvertiseReferencesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {animeshon.hub.v1alpha1.AdvertiseReferencesRequest} AdvertiseReferencesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AdvertiseReferencesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AdvertiseReferencesRequest message. * @function verify * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AdvertiseReferencesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.service != null && message.hasOwnProperty("service")) if (!$util.isString(message.service)) return "service: string expected"; return null; }; /** * Creates an AdvertiseReferencesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {Object.<string,*>} object Plain object * @returns {animeshon.hub.v1alpha1.AdvertiseReferencesRequest} AdvertiseReferencesRequest */ AdvertiseReferencesRequest.fromObject = function fromObject(object) { if (object instanceof $root.animeshon.hub.v1alpha1.AdvertiseReferencesRequest) return object; var message = new $root.animeshon.hub.v1alpha1.AdvertiseReferencesRequest(); if (object.name != null) message.name = String(object.name); if (object.service != null) message.service = String(object.service); return message; }; /** * Creates a plain object from an AdvertiseReferencesRequest message. Also converts values to other types if specified. * @function toObject * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @static * @param {animeshon.hub.v1alpha1.AdvertiseReferencesRequest} message AdvertiseReferencesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ AdvertiseReferencesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.service = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; return object; }; /** * Converts this AdvertiseReferencesRequest to JSON. * @function toJSON * @memberof animeshon.hub.v1alpha1.AdvertiseReferencesRequest * @instance * @returns {Object.<string,*>} JSON object */ AdvertiseReferencesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return AdvertiseReferencesRequest; })(); v1alpha1.ReceivePackRequest = (function() { /** * Properties of a ReceivePackRequest. * @memberof animeshon.hub.v1alpha1 * @interface IReceivePackRequest * @property {string|null} [name] ReceivePackRequest name * @property {google.api.IHttpBody|null} [body] ReceivePackRequest body */ /** * Constructs a new ReceivePackRequest. * @memberof animeshon.hub.v1alpha1 * @classdesc Represents a ReceivePackRequest. * @implements IReceivePackRequest * @constructor * @param {animeshon.hub.v1alpha1.IReceivePackRequest=} [properties] Properties to set */ function ReceivePackRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ReceivePackRequest name. * @member {string} name * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @instance */ ReceivePackRequest.prototype.name = ""; /** * ReceivePackRequest body. * @member {google.api.IHttpBody|null|undefined} body * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @instance */ ReceivePackRequest.prototype.body = null; /** * Creates a new ReceivePackRequest instance using the specified properties. * @function create * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {animeshon.hub.v1alpha1.IReceivePackRequest=} [properties] Properties to set * @returns {animeshon.hub.v1alpha1.ReceivePackRequest} ReceivePackRequest instance */ ReceivePackRequest.create = function create(properties) { return new ReceivePackRequest(properties); }; /** * Encodes the specified ReceivePackRequest message. Does not implicitly {@link animeshon.hub.v1alpha1.ReceivePackRequest.verify|verify} messages. * @function encode * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {animeshon.hub.v1alpha1.IReceivePackRequest} message ReceivePackRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReceivePackRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.body != null && Object.hasOwnProperty.call(message, "body")) $root.google.api.HttpBody.encode(message.body, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified ReceivePackRequest message, length delimited. Does not implicitly {@link animeshon.hub.v1alpha1.ReceivePackRequest.verify|verify} messages. * @function encodeDelimited * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {animeshon.hub.v1alpha1.IReceivePackRequest} message ReceivePackRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReceivePackRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ReceivePackRequest message from the specified reader or buffer. * @function decode * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {animeshon.hub.v1alpha1.ReceivePackRequest} ReceivePackRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReceivePackRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.animeshon.hub.v1alpha1.ReceivePackRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.body = $root.google.api.HttpBody.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ReceivePackRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {animeshon.hub.v1alpha1.ReceivePackRequest} ReceivePackRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReceivePackRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ReceivePackRequest message. * @function verify * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ReceivePackRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.body != null && message.hasOwnProperty("body")) { var error = $root.google.api.HttpBody.verify(message.body); if (error) return "body." + error; } return null; }; /** * Creates a ReceivePackRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {Object.<string,*>} object Plain object * @returns {animeshon.hub.v1alpha1.ReceivePackRequest} ReceivePackRequest */ ReceivePackRequest.fromObject = function fromObject(object) { if (object instanceof $root.animeshon.hub.v1alpha1.ReceivePackRequest) return object; var message = new $root.animeshon.hub.v1alpha1.ReceivePackRequest(); if (object.name != null) message.name = String(object.name); if (object.body != null) { if (typeof object.body !== "object") throw TypeError(".animeshon.hub.v1alpha1.ReceivePackRequest.body: object expected"); message.body = $root.google.api.HttpBody.fromObject(object.body); } return message; }; /** * Creates a plain object from a ReceivePackRequest message. Also converts values to other types if specified. * @function toObject * @memberof animeshon.hub.v1alpha1.ReceivePackRequest * @static * @param {animeshon.hub.v1alpha1.ReceivePackRequest} message ReceivePackRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ ReceivePackRequest.toObject = function toObject(message, options) {