UNPKG

@google-cloud/batch

Version:
887 lines (806 loc) 3.44 MB
// Copyright 2025 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/build/src/protobuf").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._google_cloud_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.cloud = (function() { /** * Namespace cloud. * @memberof google * @namespace */ var cloud = {}; cloud.batch = (function() { /** * Namespace batch. * @memberof google.cloud * @namespace */ var batch = {}; batch.v1 = (function() { /** * Namespace v1. * @memberof google.cloud.batch * @namespace */ var v1 = {}; v1.BatchService = (function() { /** * Constructs a new BatchService service. * @memberof google.cloud.batch.v1 * @classdesc Represents a BatchService * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; /** * Creates new BatchService service using the specified rpc implementation. * @function create * @memberof google.cloud.batch.v1.BatchService * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. */ BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. * @memberof google.cloud.batch.v1.BatchService * @typedef CreateJobCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.batch.v1.Job} [response] Job */ /** * Calls CreateJob. * @function createJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object * @param {google.cloud.batch.v1.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { return this.rpcCall(createJob, $root.google.cloud.batch.v1.CreateJobRequest, $root.google.cloud.batch.v1.Job, request, callback); }, "name", { value: "CreateJob" }); /** * Calls CreateJob. * @function createJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object * @returns {Promise<google.cloud.batch.v1.Job>} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. * @memberof google.cloud.batch.v1.BatchService * @typedef GetJobCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.batch.v1.Job} [response] Job */ /** * Calls GetJob. * @function getJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object * @param {google.cloud.batch.v1.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { return this.rpcCall(getJob, $root.google.cloud.batch.v1.GetJobRequest, $root.google.cloud.batch.v1.Job, request, callback); }, "name", { value: "GetJob" }); /** * Calls GetJob. * @function getJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object * @returns {Promise<google.cloud.batch.v1.Job>} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. * @memberof google.cloud.batch.v1.BatchService * @typedef DeleteJobCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.Operation} [response] Operation */ /** * Calls DeleteJob. * @function deleteJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object * @param {google.cloud.batch.v1.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { return this.rpcCall(deleteJob, $root.google.cloud.batch.v1.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "DeleteJob" }); /** * Calls DeleteJob. * @function deleteJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object * @returns {Promise<google.longrunning.Operation>} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.batch.v1.BatchService|cancelJob}. * @memberof google.cloud.batch.v1.BatchService * @typedef CancelJobCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.Operation} [response] Operation */ /** * Calls CancelJob. * @function cancelJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.ICancelJobRequest} request CancelJobRequest message or plain object * @param {google.cloud.batch.v1.BatchService.CancelJobCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.cancelJob = function cancelJob(request, callback) { return this.rpcCall(cancelJob, $root.google.cloud.batch.v1.CancelJobRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CancelJob" }); /** * Calls CancelJob. * @function cancelJob * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.ICancelJobRequest} request CancelJobRequest message or plain object * @returns {Promise<google.longrunning.Operation>} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. * @memberof google.cloud.batch.v1.BatchService * @typedef ListJobsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.batch.v1.ListJobsResponse} [response] ListJobsResponse */ /** * Calls ListJobs. * @function listJobs * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object * @param {google.cloud.batch.v1.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { return this.rpcCall(listJobs, $root.google.cloud.batch.v1.ListJobsRequest, $root.google.cloud.batch.v1.ListJobsResponse, request, callback); }, "name", { value: "ListJobs" }); /** * Calls ListJobs. * @function listJobs * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object * @returns {Promise<google.cloud.batch.v1.ListJobsResponse>} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. * @memberof google.cloud.batch.v1.BatchService * @typedef GetTaskCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.batch.v1.Task} [response] Task */ /** * Calls GetTask. * @function getTask * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object * @param {google.cloud.batch.v1.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { return this.rpcCall(getTask, $root.google.cloud.batch.v1.GetTaskRequest, $root.google.cloud.batch.v1.Task, request, callback); }, "name", { value: "GetTask" }); /** * Calls GetTask. * @function getTask * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object * @returns {Promise<google.cloud.batch.v1.Task>} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. * @memberof google.cloud.batch.v1.BatchService * @typedef ListTasksCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.batch.v1.ListTasksResponse} [response] ListTasksResponse */ /** * Calls ListTasks. * @function listTasks * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object * @param {google.cloud.batch.v1.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { return this.rpcCall(listTasks, $root.google.cloud.batch.v1.ListTasksRequest, $root.google.cloud.batch.v1.ListTasksResponse, request, callback); }, "name", { value: "ListTasks" }); /** * Calls ListTasks. * @function listTasks * @memberof google.cloud.batch.v1.BatchService * @instance * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object * @returns {Promise<google.cloud.batch.v1.ListTasksResponse>} Promise * @variation 2 */ return BatchService; })(); v1.CreateJobRequest = (function() { /** * Properties of a CreateJobRequest. * @memberof google.cloud.batch.v1 * @interface ICreateJobRequest * @property {string|null} [parent] CreateJobRequest parent * @property {string|null} [jobId] CreateJobRequest jobId * @property {google.cloud.batch.v1.IJob|null} [job] CreateJobRequest job * @property {string|null} [requestId] CreateJobRequest requestId */ /** * Constructs a new CreateJobRequest. * @memberof google.cloud.batch.v1 * @classdesc Represents a CreateJobRequest. * @implements ICreateJobRequest * @constructor * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set */ function CreateJobRequest(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]]; } /** * CreateJobRequest parent. * @member {string} parent * @memberof google.cloud.batch.v1.CreateJobRequest * @instance */ CreateJobRequest.prototype.parent = ""; /** * CreateJobRequest jobId. * @member {string} jobId * @memberof google.cloud.batch.v1.CreateJobRequest * @instance */ CreateJobRequest.prototype.jobId = ""; /** * CreateJobRequest job. * @member {google.cloud.batch.v1.IJob|null|undefined} job * @memberof google.cloud.batch.v1.CreateJobRequest * @instance */ CreateJobRequest.prototype.job = null; /** * CreateJobRequest requestId. * @member {string} requestId * @memberof google.cloud.batch.v1.CreateJobRequest * @instance */ CreateJobRequest.prototype.requestId = ""; /** * Creates a new CreateJobRequest instance using the specified properties. * @function create * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest instance */ CreateJobRequest.create = function create(properties) { return new CreateJobRequest(properties); }; /** * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. * @function encode * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); if (message.job != null && Object.hasOwnProperty.call(message, "job")) $root.google.cloud.batch.v1.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CreateJobRequest message from the specified reader or buffer. * @function decode * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateJobRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CreateJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.parent = reader.string(); break; } case 2: { message.jobId = reader.string(); break; } case 3: { message.job = $root.google.cloud.batch.v1.Job.decode(reader, reader.uint32()); break; } case 4: { message.requestId = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CreateJobRequest message. * @function verify * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CreateJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.jobId != null && message.hasOwnProperty("jobId")) if (!$util.isString(message.jobId)) return "jobId: string expected"; if (message.job != null && message.hasOwnProperty("job")) { var error = $root.google.cloud.batch.v1.Job.verify(message.job); if (error) return "job." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; }; /** * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {Object.<string,*>} object Plain object * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest */ CreateJobRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.batch.v1.CreateJobRequest) return object; var message = new $root.google.cloud.batch.v1.CreateJobRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.jobId != null) message.jobId = String(object.jobId); if (object.job != null) { if (typeof object.job !== "object") throw TypeError(".google.cloud.batch.v1.CreateJobRequest.job: object expected"); message.job = $root.google.cloud.batch.v1.Job.fromObject(object.job); } if (object.requestId != null) message.requestId = String(object.requestId); return message; }; /** * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {google.cloud.batch.v1.CreateJobRequest} message CreateJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CreateJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.jobId = ""; object.job = null; object.requestId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.jobId != null && message.hasOwnProperty("jobId")) object.jobId = message.jobId; if (message.job != null && message.hasOwnProperty("job")) object.job = $root.google.cloud.batch.v1.Job.toObject(message.job, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; /** * Converts this CreateJobRequest to JSON. * @function toJSON * @memberof google.cloud.batch.v1.CreateJobRequest * @instance * @returns {Object.<string,*>} JSON object */ CreateJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CreateJobRequest * @function getTypeUrl * @memberof google.cloud.batch.v1.CreateJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/google.cloud.batch.v1.CreateJobRequest"; }; return CreateJobRequest; })(); v1.GetJobRequest = (function() { /** * Properties of a GetJobRequest. * @memberof google.cloud.batch.v1 * @interface IGetJobRequest * @property {string|null} [name] GetJobRequest name */ /** * Constructs a new GetJobRequest. * @memberof google.cloud.batch.v1 * @classdesc Represents a GetJobRequest. * @implements IGetJobRequest * @constructor * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set */ function GetJobRequest(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]]; } /** * GetJobRequest name. * @member {string} name * @memberof google.cloud.batch.v1.GetJobRequest * @instance */ GetJobRequest.prototype.name = ""; /** * Creates a new GetJobRequest instance using the specified properties. * @function create * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest instance */ GetJobRequest.create = function create(properties) { return new GetJobRequest(properties); }; /** * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. * @function encode * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetJobRequest.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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetJobRequest message from the specified reader or buffer. * @function decode * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetJobRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.name = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetJobRequest message. * @function verify * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetJobRequest.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 GetJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {Object.<string,*>} object Plain object * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest */ GetJobRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.batch.v1.GetJobRequest) return object; var message = new $root.google.cloud.batch.v1.GetJobRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {google.cloud.batch.v1.GetJobRequest} message GetJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ GetJobRequest.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 GetJobRequest to JSON. * @function toJSON * @memberof google.cloud.batch.v1.GetJobRequest * @instance * @returns {Object.<string,*>} JSON object */ GetJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for GetJobRequest * @function getTypeUrl * @memberof google.cloud.batch.v1.GetJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/google.cloud.batch.v1.GetJobRequest"; }; return GetJobRequest; })(); v1.DeleteJobRequest = (function() { /** * Properties of a DeleteJobRequest. * @memberof google.cloud.batch.v1 * @interface IDeleteJobRequest * @property {string|null} [name] DeleteJobRequest name * @property {string|null} [reason] DeleteJobRequest reason * @property {string|null} [requestId] DeleteJobRequest requestId */ /** * Constructs a new DeleteJobRequest. * @memberof google.cloud.batch.v1 * @classdesc Represents a DeleteJobRequest. * @implements IDeleteJobRequest * @constructor * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set */ function DeleteJobRequest(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]]; } /** * DeleteJobRequest name. * @member {string} name * @memberof google.cloud.batch.v1.DeleteJobRequest * @instance */ DeleteJobRequest.prototype.name = ""; /** * DeleteJobRequest reason. * @member {string} reason * @memberof google.cloud.batch.v1.DeleteJobRequest * @instance */ DeleteJobRequest.prototype.reason = ""; /** * DeleteJobRequest requestId. * @member {string} requestId * @memberof google.cloud.batch.v1.DeleteJobRequest * @instance */ DeleteJobRequest.prototype.requestId = ""; /** * Creates a new DeleteJobRequest instance using the specified properties. * @function create * @memberof google.cloud.batch.v1.DeleteJobRequest * @static * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest instance */ DeleteJobRequest.create = function create(properties) { return new DeleteJobRequest(properties); }; /** * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. * @function encode * @memberof google.cloud.batch.v1.DeleteJobRequest * @static * @param {google.cloud.batch.v1.IDeleteJobR