@google-cloud/contentwarehouse
Version:
Document AI Warehouse client for Node.js
851 lines (776 loc) • 4.87 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_contentwarehouse_protos || ($protobuf.roots._google_cloud_contentwarehouse_protos = {});
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.cloud = (function() {
/**
* Namespace cloud.
* @memberof google
* @namespace
*/
var cloud = {};
cloud.contentwarehouse = (function() {
/**
* Namespace contentwarehouse.
* @memberof google.cloud
* @namespace
*/
var contentwarehouse = {};
contentwarehouse.v1 = (function() {
/**
* Namespace v1.
* @memberof google.cloud.contentwarehouse
* @namespace
*/
var v1 = {};
v1.CreateDocumentMetadata = (function() {
/**
* Properties of a CreateDocumentMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @interface ICreateDocumentMetadata
*/
/**
* Constructs a new CreateDocumentMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @classdesc Represents a CreateDocumentMetadata.
* @implements ICreateDocumentMetadata
* @constructor
* @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata=} [properties] Properties to set
*/
function CreateDocumentMetadata(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]];
}
/**
* Creates a new CreateDocumentMetadata instance using the specified properties.
* @function create
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata=} [properties] Properties to set
* @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata instance
*/
CreateDocumentMetadata.create = function create(properties) {
return new CreateDocumentMetadata(properties);
};
/**
* Encodes the specified CreateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages.
* @function encode
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata} message CreateDocumentMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CreateDocumentMetadata.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified CreateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.CreateDocumentMetadata.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.ICreateDocumentMetadata} message CreateDocumentMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CreateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CreateDocumentMetadata message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CreateDocumentMetadata.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.contentwarehouse.v1.CreateDocumentMetadata();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CreateDocumentMetadata message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CreateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CreateDocumentMetadata message.
* @function verify
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CreateDocumentMetadata.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a CreateDocumentMetadata message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} CreateDocumentMetadata
*/
CreateDocumentMetadata.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata)
return object;
return new $root.google.cloud.contentwarehouse.v1.CreateDocumentMetadata();
};
/**
* Creates a plain object from a CreateDocumentMetadata message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.CreateDocumentMetadata} message CreateDocumentMetadata
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CreateDocumentMetadata.toObject = function toObject() {
return {};
};
/**
* Converts this CreateDocumentMetadata to JSON.
* @function toJSON
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @instance
* @returns {Object.<string,*>} JSON object
*/
CreateDocumentMetadata.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CreateDocumentMetadata
* @function getTypeUrl
* @memberof google.cloud.contentwarehouse.v1.CreateDocumentMetadata
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CreateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.CreateDocumentMetadata";
};
return CreateDocumentMetadata;
})();
v1.UpdateDocumentMetadata = (function() {
/**
* Properties of an UpdateDocumentMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @interface IUpdateDocumentMetadata
*/
/**
* Constructs a new UpdateDocumentMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @classdesc Represents an UpdateDocumentMetadata.
* @implements IUpdateDocumentMetadata
* @constructor
* @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata=} [properties] Properties to set
*/
function UpdateDocumentMetadata(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]];
}
/**
* Creates a new UpdateDocumentMetadata instance using the specified properties.
* @function create
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata=} [properties] Properties to set
* @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata instance
*/
UpdateDocumentMetadata.create = function create(properties) {
return new UpdateDocumentMetadata(properties);
};
/**
* Encodes the specified UpdateDocumentMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages.
* @function encode
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata} message UpdateDocumentMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UpdateDocumentMetadata.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified UpdateDocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.UpdateDocumentMetadata.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IUpdateDocumentMetadata} message UpdateDocumentMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UpdateDocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an UpdateDocumentMetadata message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UpdateDocumentMetadata.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.contentwarehouse.v1.UpdateDocumentMetadata();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an UpdateDocumentMetadata message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UpdateDocumentMetadata.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an UpdateDocumentMetadata message.
* @function verify
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UpdateDocumentMetadata.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates an UpdateDocumentMetadata message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} UpdateDocumentMetadata
*/
UpdateDocumentMetadata.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata)
return object;
return new $root.google.cloud.contentwarehouse.v1.UpdateDocumentMetadata();
};
/**
* Creates a plain object from an UpdateDocumentMetadata message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.UpdateDocumentMetadata} message UpdateDocumentMetadata
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UpdateDocumentMetadata.toObject = function toObject() {
return {};
};
/**
* Converts this UpdateDocumentMetadata to JSON.
* @function toJSON
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @instance
* @returns {Object.<string,*>} JSON object
*/
UpdateDocumentMetadata.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UpdateDocumentMetadata
* @function getTypeUrl
* @memberof google.cloud.contentwarehouse.v1.UpdateDocumentMetadata
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UpdateDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.UpdateDocumentMetadata";
};
return UpdateDocumentMetadata;
})();
v1.RequestMetadata = (function() {
/**
* Properties of a RequestMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @interface IRequestMetadata
* @property {google.cloud.contentwarehouse.v1.IUserInfo|null} [userInfo] RequestMetadata userInfo
*/
/**
* Constructs a new RequestMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @classdesc Represents a RequestMetadata.
* @implements IRequestMetadata
* @constructor
* @param {google.cloud.contentwarehouse.v1.IRequestMetadata=} [properties] Properties to set
*/
function RequestMetadata(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]];
}
/**
* RequestMetadata userInfo.
* @member {google.cloud.contentwarehouse.v1.IUserInfo|null|undefined} userInfo
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @instance
*/
RequestMetadata.prototype.userInfo = null;
/**
* Creates a new RequestMetadata instance using the specified properties.
* @function create
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IRequestMetadata=} [properties] Properties to set
* @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata instance
*/
RequestMetadata.create = function create(properties) {
return new RequestMetadata(properties);
};
/**
* Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages.
* @function encode
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IRequestMetadata} message RequestMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
RequestMetadata.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo"))
$root.google.cloud.contentwarehouse.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.RequestMetadata.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IRequestMetadata} message RequestMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
RequestMetadata.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a RequestMetadata message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
RequestMetadata.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.contentwarehouse.v1.RequestMetadata();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a RequestMetadata message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
RequestMetadata.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a RequestMetadata message.
* @function verify
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
RequestMetadata.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.userInfo != null && message.hasOwnProperty("userInfo")) {
var error = $root.google.cloud.contentwarehouse.v1.UserInfo.verify(message.userInfo);
if (error)
return "userInfo." + error;
}
return null;
};
/**
* Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.contentwarehouse.v1.RequestMetadata} RequestMetadata
*/
RequestMetadata.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.contentwarehouse.v1.RequestMetadata)
return object;
var message = new $root.google.cloud.contentwarehouse.v1.RequestMetadata();
if (object.userInfo != null) {
if (typeof object.userInfo !== "object")
throw TypeError(".google.cloud.contentwarehouse.v1.RequestMetadata.userInfo: object expected");
message.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.fromObject(object.userInfo);
}
return message;
};
/**
* Creates a plain object from a RequestMetadata message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.RequestMetadata} message RequestMetadata
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
RequestMetadata.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.userInfo = null;
if (message.userInfo != null && message.hasOwnProperty("userInfo"))
object.userInfo = $root.google.cloud.contentwarehouse.v1.UserInfo.toObject(message.userInfo, options);
return object;
};
/**
* Converts this RequestMetadata to JSON.
* @function toJSON
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @instance
* @returns {Object.<string,*>} JSON object
*/
RequestMetadata.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for RequestMetadata
* @function getTypeUrl
* @memberof google.cloud.contentwarehouse.v1.RequestMetadata
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
RequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.RequestMetadata";
};
return RequestMetadata;
})();
v1.ResponseMetadata = (function() {
/**
* Properties of a ResponseMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @interface IResponseMetadata
* @property {string|null} [requestId] ResponseMetadata requestId
*/
/**
* Constructs a new ResponseMetadata.
* @memberof google.cloud.contentwarehouse.v1
* @classdesc Represents a ResponseMetadata.
* @implements IResponseMetadata
* @constructor
* @param {google.cloud.contentwarehouse.v1.IResponseMetadata=} [properties] Properties to set
*/
function ResponseMetadata(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]];
}
/**
* ResponseMetadata requestId.
* @member {string} requestId
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @instance
*/
ResponseMetadata.prototype.requestId = "";
/**
* Creates a new ResponseMetadata instance using the specified properties.
* @function create
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IResponseMetadata=} [properties] Properties to set
* @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata instance
*/
ResponseMetadata.create = function create(properties) {
return new ResponseMetadata(properties);
};
/**
* Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages.
* @function encode
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IResponseMetadata} message ResponseMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResponseMetadata.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId);
return writer;
};
/**
* Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.contentwarehouse.v1.ResponseMetadata.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.IResponseMetadata} message ResponseMetadata message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ResponseMetadata message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResponseMetadata.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.contentwarehouse.v1.ResponseMetadata();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.requestId = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ResponseMetadata message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ResponseMetadata.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ResponseMetadata message.
* @function verify
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ResponseMetadata.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.requestId != null && message.hasOwnProperty("requestId"))
if (!$util.isString(message.requestId))
return "requestId: string expected";
return null;
};
/**
* Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.contentwarehouse.v1.ResponseMetadata} ResponseMetadata
*/
ResponseMetadata.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.contentwarehouse.v1.ResponseMetadata)
return object;
var message = new $root.google.cloud.contentwarehouse.v1.ResponseMetadata();
if (object.requestId != null)
message.requestId = String(object.requestId);
return message;
};
/**
* Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {google.cloud.contentwarehouse.v1.ResponseMetadata} message ResponseMetadata
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ResponseMetadata.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.requestId = "";
if (message.requestId != null && message.hasOwnProperty("requestId"))
object.requestId = message.requestId;
return object;
};
/**
* Converts this ResponseMetadata to JSON.
* @function toJSON
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @instance
* @returns {Object.<string,*>} JSON object
*/
ResponseMetadata.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ResponseMetadata
* @function getTypeUrl
* @memberof google.cloud.contentwarehouse.v1.ResponseMetadata
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.contentwarehouse.v1.ResponseMetadata";
};
return ResponseMetadata;
})();
v1.UserInfo = (function() {
/**
* Properties of a UserInfo.
* @memberof google.cloud.contentwarehouse.v1
* @interface IUserInfo
* @property {string|null} [id] UserInfo id
* @property {Array.<string>|null} [groupIds] UserInfo groupIds
*/
/**
* Constructs a new UserInfo.
* @memberof google.cloud.contentwarehouse.v1
* @classd