@google-cloud/lustre
Version:
Google Cloud Managed Lustre API client for Node.js
825 lines (771 loc) • 1.7 MB
JavaScript
// 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_lustre_protos || ($protobuf.roots._google_cloud_lustre_protos = {});
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.cloud = (function() {
/**
* Namespace cloud.
* @memberof google
* @namespace
*/
var cloud = {};
cloud.lustre = (function() {
/**
* Namespace lustre.
* @memberof google.cloud
* @namespace
*/
var lustre = {};
lustre.v1 = (function() {
/**
* Namespace v1.
* @memberof google.cloud.lustre
* @namespace
*/
var v1 = {};
v1.Instance = (function() {
/**
* Properties of an Instance.
* @memberof google.cloud.lustre.v1
* @interface IInstance
* @property {string|null} [name] Instance name
* @property {string|null} [filesystem] Instance filesystem
* @property {number|Long|null} [capacityGib] Instance capacityGib
* @property {string|null} [network] Instance network
* @property {google.cloud.lustre.v1.Instance.State|null} [state] Instance state
* @property {string|null} [mountPoint] Instance mountPoint
* @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime
* @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime
* @property {string|null} [description] Instance description
* @property {Object.<string,string>|null} [labels] Instance labels
* @property {number|Long|null} [perUnitStorageThroughput] Instance perUnitStorageThroughput
* @property {boolean|null} [gkeSupportEnabled] Instance gkeSupportEnabled
*/
/**
* Constructs a new Instance.
* @memberof google.cloud.lustre.v1
* @classdesc Represents an Instance.
* @implements IInstance
* @constructor
* @param {google.cloud.lustre.v1.IInstance=} [properties] Properties to set
*/
function Instance(properties) {
this.labels = {};
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]];
}
/**
* Instance name.
* @member {string} name
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.name = "";
/**
* Instance filesystem.
* @member {string} filesystem
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.filesystem = "";
/**
* Instance capacityGib.
* @member {number|Long} capacityGib
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.capacityGib = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Instance network.
* @member {string} network
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.network = "";
/**
* Instance state.
* @member {google.cloud.lustre.v1.Instance.State} state
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.state = 0;
/**
* Instance mountPoint.
* @member {string} mountPoint
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.mountPoint = "";
/**
* Instance createTime.
* @member {google.protobuf.ITimestamp|null|undefined} createTime
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.createTime = null;
/**
* Instance updateTime.
* @member {google.protobuf.ITimestamp|null|undefined} updateTime
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.updateTime = null;
/**
* Instance description.
* @member {string} description
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.description = "";
/**
* Instance labels.
* @member {Object.<string,string>} labels
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.labels = $util.emptyObject;
/**
* Instance perUnitStorageThroughput.
* @member {number|Long} perUnitStorageThroughput
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.perUnitStorageThroughput = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Instance gkeSupportEnabled.
* @member {boolean} gkeSupportEnabled
* @memberof google.cloud.lustre.v1.Instance
* @instance
*/
Instance.prototype.gkeSupportEnabled = false;
/**
* Creates a new Instance instance using the specified properties.
* @function create
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {google.cloud.lustre.v1.IInstance=} [properties] Properties to set
* @returns {google.cloud.lustre.v1.Instance} Instance instance
*/
Instance.create = function create(properties) {
return new Instance(properties);
};
/**
* Encodes the specified Instance message. Does not implicitly {@link google.cloud.lustre.v1.Instance.verify|verify} messages.
* @function encode
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {google.cloud.lustre.v1.IInstance} message Instance message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Instance.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.capacityGib != null && Object.hasOwnProperty.call(message, "capacityGib"))
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.capacityGib);
if (message.network != null && Object.hasOwnProperty.call(message, "network"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.network);
if (message.state != null && Object.hasOwnProperty.call(message, "state"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state);
if (message.mountPoint != null && Object.hasOwnProperty.call(message, "mountPoint"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountPoint);
if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
$root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
$root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.description);
if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
if (message.filesystem != null && Object.hasOwnProperty.call(message, "filesystem"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.filesystem);
if (message.perUnitStorageThroughput != null && Object.hasOwnProperty.call(message, "perUnitStorageThroughput"))
writer.uint32(/* id 11, wireType 0 =*/88).int64(message.perUnitStorageThroughput);
if (message.gkeSupportEnabled != null && Object.hasOwnProperty.call(message, "gkeSupportEnabled"))
writer.uint32(/* id 12, wireType 0 =*/96).bool(message.gkeSupportEnabled);
return writer;
};
/**
* Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.lustre.v1.Instance.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {google.cloud.lustre.v1.IInstance} message Instance message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Instance.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Instance message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.lustre.v1.Instance} Instance
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Instance.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.lustre.v1.Instance(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.name = reader.string();
break;
}
case 10: {
message.filesystem = reader.string();
break;
}
case 2: {
message.capacityGib = reader.int64();
break;
}
case 3: {
message.network = reader.string();
break;
}
case 4: {
message.state = reader.int32();
break;
}
case 5: {
message.mountPoint = reader.string();
break;
}
case 6: {
message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 7: {
message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 8: {
message.description = reader.string();
break;
}
case 9: {
if (message.labels === $util.emptyObject)
message.labels = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.labels[key] = value;
break;
}
case 11: {
message.perUnitStorageThroughput = reader.int64();
break;
}
case 12: {
message.gkeSupportEnabled = reader.bool();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an Instance message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.lustre.v1.Instance} Instance
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Instance.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an Instance message.
* @function verify
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Instance.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.filesystem != null && message.hasOwnProperty("filesystem"))
if (!$util.isString(message.filesystem))
return "filesystem: string expected";
if (message.capacityGib != null && message.hasOwnProperty("capacityGib"))
if (!$util.isInteger(message.capacityGib) && !(message.capacityGib && $util.isInteger(message.capacityGib.low) && $util.isInteger(message.capacityGib.high)))
return "capacityGib: integer|Long expected";
if (message.network != null && message.hasOwnProperty("network"))
if (!$util.isString(message.network))
return "network: string expected";
if (message.state != null && message.hasOwnProperty("state"))
switch (message.state) {
default:
return "state: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
break;
}
if (message.mountPoint != null && message.hasOwnProperty("mountPoint"))
if (!$util.isString(message.mountPoint))
return "mountPoint: string expected";
if (message.createTime != null && message.hasOwnProperty("createTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.createTime);
if (error)
return "createTime." + error;
}
if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
if (error)
return "updateTime." + error;
}
if (message.description != null && message.hasOwnProperty("description"))
if (!$util.isString(message.description))
return "description: string expected";
if (message.labels != null && message.hasOwnProperty("labels")) {
if (!$util.isObject(message.labels))
return "labels: object expected";
var key = Object.keys(message.labels);
for (var i = 0; i < key.length; ++i)
if (!$util.isString(message.labels[key[i]]))
return "labels: string{k:string} expected";
}
if (message.perUnitStorageThroughput != null && message.hasOwnProperty("perUnitStorageThroughput"))
if (!$util.isInteger(message.perUnitStorageThroughput) && !(message.perUnitStorageThroughput && $util.isInteger(message.perUnitStorageThroughput.low) && $util.isInteger(message.perUnitStorageThroughput.high)))
return "perUnitStorageThroughput: integer|Long expected";
if (message.gkeSupportEnabled != null && message.hasOwnProperty("gkeSupportEnabled"))
if (typeof message.gkeSupportEnabled !== "boolean")
return "gkeSupportEnabled: boolean expected";
return null;
};
/**
* Creates an Instance message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.lustre.v1.Instance} Instance
*/
Instance.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.lustre.v1.Instance)
return object;
var message = new $root.google.cloud.lustre.v1.Instance();
if (object.name != null)
message.name = String(object.name);
if (object.filesystem != null)
message.filesystem = String(object.filesystem);
if (object.capacityGib != null)
if ($util.Long)
(message.capacityGib = $util.Long.fromValue(object.capacityGib)).unsigned = false;
else if (typeof object.capacityGib === "string")
message.capacityGib = parseInt(object.capacityGib, 10);
else if (typeof object.capacityGib === "number")
message.capacityGib = object.capacityGib;
else if (typeof object.capacityGib === "object")
message.capacityGib = new $util.LongBits(object.capacityGib.low >>> 0, object.capacityGib.high >>> 0).toNumber();
if (object.network != null)
message.network = String(object.network);
switch (object.state) {
default:
if (typeof object.state === "number") {
message.state = object.state;
break;
}
break;
case "STATE_UNSPECIFIED":
case 0:
message.state = 0;
break;
case "ACTIVE":
case 1:
message.state = 1;
break;
case "CREATING":
case 2:
message.state = 2;
break;
case "DELETING":
case 3:
message.state = 3;
break;
case "UPGRADING":
case 4:
message.state = 4;
break;
case "REPAIRING":
case 5:
message.state = 5;
break;
case "STOPPED":
case 6:
message.state = 6;
break;
case "UPDATING":
case 7:
message.state = 7;
break;
}
if (object.mountPoint != null)
message.mountPoint = String(object.mountPoint);
if (object.createTime != null) {
if (typeof object.createTime !== "object")
throw TypeError(".google.cloud.lustre.v1.Instance.createTime: object expected");
message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
}
if (object.updateTime != null) {
if (typeof object.updateTime !== "object")
throw TypeError(".google.cloud.lustre.v1.Instance.updateTime: object expected");
message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
}
if (object.description != null)
message.description = String(object.description);
if (object.labels) {
if (typeof object.labels !== "object")
throw TypeError(".google.cloud.lustre.v1.Instance.labels: object expected");
message.labels = {};
for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
message.labels[keys[i]] = String(object.labels[keys[i]]);
}
if (object.perUnitStorageThroughput != null)
if ($util.Long)
(message.perUnitStorageThroughput = $util.Long.fromValue(object.perUnitStorageThroughput)).unsigned = false;
else if (typeof object.perUnitStorageThroughput === "string")
message.perUnitStorageThroughput = parseInt(object.perUnitStorageThroughput, 10);
else if (typeof object.perUnitStorageThroughput === "number")
message.perUnitStorageThroughput = object.perUnitStorageThroughput;
else if (typeof object.perUnitStorageThroughput === "object")
message.perUnitStorageThroughput = new $util.LongBits(object.perUnitStorageThroughput.low >>> 0, object.perUnitStorageThroughput.high >>> 0).toNumber();
if (object.gkeSupportEnabled != null)
message.gkeSupportEnabled = Boolean(object.gkeSupportEnabled);
return message;
};
/**
* Creates a plain object from an Instance message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {google.cloud.lustre.v1.Instance} message Instance
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Instance.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.labels = {};
if (options.defaults) {
object.name = "";
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.capacityGib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.capacityGib = options.longs === String ? "0" : 0;
object.network = "";
object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
object.mountPoint = "";
object.createTime = null;
object.updateTime = null;
object.description = "";
object.filesystem = "";
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.perUnitStorageThroughput = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.perUnitStorageThroughput = options.longs === String ? "0" : 0;
object.gkeSupportEnabled = false;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.capacityGib != null && message.hasOwnProperty("capacityGib"))
if (typeof message.capacityGib === "number")
object.capacityGib = options.longs === String ? String(message.capacityGib) : message.capacityGib;
else
object.capacityGib = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGib) : options.longs === Number ? new $util.LongBits(message.capacityGib.low >>> 0, message.capacityGib.high >>> 0).toNumber() : message.capacityGib;
if (message.network != null && message.hasOwnProperty("network"))
object.network = message.network;
if (message.state != null && message.hasOwnProperty("state"))
object.state = options.enums === String ? $root.google.cloud.lustre.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.lustre.v1.Instance.State[message.state] : message.state;
if (message.mountPoint != null && message.hasOwnProperty("mountPoint"))
object.mountPoint = message.mountPoint;
if (message.createTime != null && message.hasOwnProperty("createTime"))
object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
if (message.updateTime != null && message.hasOwnProperty("updateTime"))
object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
if (message.description != null && message.hasOwnProperty("description"))
object.description = message.description;
var keys2;
if (message.labels && (keys2 = Object.keys(message.labels)).length) {
object.labels = {};
for (var j = 0; j < keys2.length; ++j)
object.labels[keys2[j]] = message.labels[keys2[j]];
}
if (message.filesystem != null && message.hasOwnProperty("filesystem"))
object.filesystem = message.filesystem;
if (message.perUnitStorageThroughput != null && message.hasOwnProperty("perUnitStorageThroughput"))
if (typeof message.perUnitStorageThroughput === "number")
object.perUnitStorageThroughput = options.longs === String ? String(message.perUnitStorageThroughput) : message.perUnitStorageThroughput;
else
object.perUnitStorageThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.perUnitStorageThroughput) : options.longs === Number ? new $util.LongBits(message.perUnitStorageThroughput.low >>> 0, message.perUnitStorageThroughput.high >>> 0).toNumber() : message.perUnitStorageThroughput;
if (message.gkeSupportEnabled != null && message.hasOwnProperty("gkeSupportEnabled"))
object.gkeSupportEnabled = message.gkeSupportEnabled;
return object;
};
/**
* Converts this Instance to JSON.
* @function toJSON
* @memberof google.cloud.lustre.v1.Instance
* @instance
* @returns {Object.<string,*>} JSON object
*/
Instance.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Instance
* @function getTypeUrl
* @memberof google.cloud.lustre.v1.Instance
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.lustre.v1.Instance";
};
/**
* State enum.
* @name google.cloud.lustre.v1.Instance.State
* @enum {number}
* @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
* @property {number} ACTIVE=1 ACTIVE value
* @property {number} CREATING=2 CREATING value
* @property {number} DELETING=3 DELETING value
* @property {number} UPGRADING=4 UPGRADING value
* @property {number} REPAIRING=5 REPAIRING value
* @property {number} STOPPED=6 STOPPED value
* @property {number} UPDATING=7 UPDATING value
*/
Instance.State = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
values[valuesById[1] = "ACTIVE"] = 1;
values[valuesById[2] = "CREATING"] = 2;
values[valuesById[3] = "DELETING"] = 3;
values[valuesById[4] = "UPGRADING"] = 4;
values[valuesById[5] = "REPAIRING"] = 5;
values[valuesById[6] = "STOPPED"] = 6;
values[valuesById[7] = "UPDATING"] = 7;
return values;
})();
return Instance;
})();
v1.ListInstancesRequest = (function() {
/**
* Properties of a ListInstancesRequest.
* @memberof google.cloud.lustre.v1
* @interface IListInstancesRequest
* @property {string|null} [parent] ListInstancesRequest parent
* @property {number|null} [pageSize] ListInstancesRequest pageSize
* @property {string|null} [pageToken] ListInstancesRequest pageToken
* @property {string|null} [filter] ListInstancesRequest filter
* @property {string|null} [orderBy] ListInstancesRequest orderBy
*/
/**
* Constructs a new ListInstancesRequest.
* @memberof google.cloud.lustre.v1
* @classdesc Represents a ListInstancesRequest.
* @implements IListInstancesRequest
* @constructor
* @param {google.cloud.lustre.v1.IListInstancesRequest=} [properties] Properties to set
*/
function ListInstancesRequest(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]];
}
/**
* ListInstancesRequest parent.
* @member {string} parent
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @instance
*/
ListInstancesRequest.prototype.parent = "";
/**
* ListInstancesRequest pageSize.
* @member {number} pageSize
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @instance
*/
ListInstancesRequest.prototype.pageSize = 0;
/**
* ListInstancesRequest pageToken.
* @member {string} pageToken
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @instance
*/
ListInstancesRequest.prototype.pageToken = "";
/**
* ListInstancesRequest filter.
* @member {string} filter
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @instance
*/
ListInstancesRequest.prototype.filter = "";
/**
* ListInstancesRequest orderBy.
* @member {string} orderBy
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @instance
*/
ListInstancesRequest.prototype.orderBy = "";
/**
* Creates a new ListInstancesRequest instance using the specified properties.
* @function create
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @static
* @param {google.cloud.lustre.v1.IListInstancesRequest=} [properties] Properties to set
* @returns {google.cloud.lustre.v1.ListInstancesRequest} ListInstancesRequest instance
*/
ListInstancesRequest.create = function create(properties) {
return new ListInstancesRequest(properties);
};
/**
* Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.lustre.v1.ListInstancesRequest.verify|verify} messages.
* @function encode
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @static
* @param {google.cloud.lustre.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ListInstancesRequest.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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter);
if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy);
return writer;
};
/**
* Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.lustre.v1.ListInstancesRequest.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @static
* @param {google.cloud.lustre.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ListInstancesRequest message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.lustre.v1.ListInstancesRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.lustre.v1.ListInstancesRequest} ListInstancesRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ListInstancesRequest.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.lustre.v1.ListInstancesRequest();
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.pageSize = reader.int32();
break;
}
case 3: {
message.pageToken = reader.string();