@google-cloud/bigquery-connection
Version:
BigQuery Connection client for Node.js
766 lines (693 loc) • 1.89 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_bigquery_connection_protos || ($protobuf.roots._google_cloud_bigquery_connection_protos = {});
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.cloud = (function() {
/**
* Namespace cloud.
* @memberof google
* @namespace
*/
var cloud = {};
cloud.bigquery = (function() {
/**
* Namespace bigquery.
* @memberof google.cloud
* @namespace
*/
var bigquery = {};
bigquery.connection = (function() {
/**
* Namespace connection.
* @memberof google.cloud.bigquery
* @namespace
*/
var connection = {};
connection.v1 = (function() {
/**
* Namespace v1.
* @memberof google.cloud.bigquery.connection
* @namespace
*/
var v1 = {};
v1.ConnectionService = (function() {
/**
* Constructs a new ConnectionService service.
* @memberof google.cloud.bigquery.connection.v1
* @classdesc Represents a ConnectionService
* @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 ConnectionService(rpcImpl, requestDelimited, responseDelimited) {
$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
}
(ConnectionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConnectionService;
/**
* Creates new ConnectionService service using the specified rpc implementation.
* @function create
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @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 {ConnectionService} RPC service. Useful where requests and/or responses are streamed.
*/
ConnectionService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
return new this(rpcImpl, requestDelimited, responseDelimited);
};
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|createConnection}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef CreateConnectionCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.cloud.bigquery.connection.v1.Connection} [response] Connection
*/
/**
* Calls CreateConnection.
* @function createConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.ICreateConnectionRequest} request CreateConnectionRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.CreateConnectionCallback} callback Node-style callback called with the error, if any, and Connection
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.createConnection = function createConnection(request, callback) {
return this.rpcCall(createConnection, $root.google.cloud.bigquery.connection.v1.CreateConnectionRequest, $root.google.cloud.bigquery.connection.v1.Connection, request, callback);
}, "name", { value: "CreateConnection" });
/**
* Calls CreateConnection.
* @function createConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.ICreateConnectionRequest} request CreateConnectionRequest message or plain object
* @returns {Promise<google.cloud.bigquery.connection.v1.Connection>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|getConnection}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef GetConnectionCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.cloud.bigquery.connection.v1.Connection} [response] Connection
*/
/**
* Calls GetConnection.
* @function getConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IGetConnectionRequest} request GetConnectionRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.GetConnectionCallback} callback Node-style callback called with the error, if any, and Connection
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.getConnection = function getConnection(request, callback) {
return this.rpcCall(getConnection, $root.google.cloud.bigquery.connection.v1.GetConnectionRequest, $root.google.cloud.bigquery.connection.v1.Connection, request, callback);
}, "name", { value: "GetConnection" });
/**
* Calls GetConnection.
* @function getConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IGetConnectionRequest} request GetConnectionRequest message or plain object
* @returns {Promise<google.cloud.bigquery.connection.v1.Connection>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|listConnections}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef ListConnectionsCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.cloud.bigquery.connection.v1.ListConnectionsResponse} [response] ListConnectionsResponse
*/
/**
* Calls ListConnections.
* @function listConnections
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IListConnectionsRequest} request ListConnectionsRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.ListConnectionsCallback} callback Node-style callback called with the error, if any, and ListConnectionsResponse
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.listConnections = function listConnections(request, callback) {
return this.rpcCall(listConnections, $root.google.cloud.bigquery.connection.v1.ListConnectionsRequest, $root.google.cloud.bigquery.connection.v1.ListConnectionsResponse, request, callback);
}, "name", { value: "ListConnections" });
/**
* Calls ListConnections.
* @function listConnections
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IListConnectionsRequest} request ListConnectionsRequest message or plain object
* @returns {Promise<google.cloud.bigquery.connection.v1.ListConnectionsResponse>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|updateConnection}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef UpdateConnectionCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.cloud.bigquery.connection.v1.Connection} [response] Connection
*/
/**
* Calls UpdateConnection.
* @function updateConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IUpdateConnectionRequest} request UpdateConnectionRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnectionCallback} callback Node-style callback called with the error, if any, and Connection
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.updateConnection = function updateConnection(request, callback) {
return this.rpcCall(updateConnection, $root.google.cloud.bigquery.connection.v1.UpdateConnectionRequest, $root.google.cloud.bigquery.connection.v1.Connection, request, callback);
}, "name", { value: "UpdateConnection" });
/**
* Calls UpdateConnection.
* @function updateConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IUpdateConnectionRequest} request UpdateConnectionRequest message or plain object
* @returns {Promise<google.cloud.bigquery.connection.v1.Connection>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|deleteConnection}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef DeleteConnectionCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.protobuf.Empty} [response] Empty
*/
/**
* Calls DeleteConnection.
* @function deleteConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IDeleteConnectionRequest} request DeleteConnectionRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.DeleteConnectionCallback} callback Node-style callback called with the error, if any, and Empty
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.deleteConnection = function deleteConnection(request, callback) {
return this.rpcCall(deleteConnection, $root.google.cloud.bigquery.connection.v1.DeleteConnectionRequest, $root.google.protobuf.Empty, request, callback);
}, "name", { value: "DeleteConnection" });
/**
* Calls DeleteConnection.
* @function deleteConnection
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.cloud.bigquery.connection.v1.IDeleteConnectionRequest} request DeleteConnectionRequest message or plain object
* @returns {Promise<google.protobuf.Empty>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|getIamPolicy}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef GetIamPolicyCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.iam.v1.Policy} [response] Policy
*/
/**
* Calls GetIamPolicy.
* @function getIamPolicy
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.getIamPolicy = function getIamPolicy(request, callback) {
return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);
}, "name", { value: "GetIamPolicy" });
/**
* Calls GetIamPolicy.
* @function getIamPolicy
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object
* @returns {Promise<google.iam.v1.Policy>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|setIamPolicy}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef SetIamPolicyCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.iam.v1.Policy} [response] Policy
*/
/**
* Calls SetIamPolicy.
* @function setIamPolicy
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.setIamPolicy = function setIamPolicy(request, callback) {
return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback);
}, "name", { value: "SetIamPolicy" });
/**
* Calls SetIamPolicy.
* @function setIamPolicy
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object
* @returns {Promise<google.iam.v1.Policy>} Promise
* @variation 2
*/
/**
* Callback as used by {@link google.cloud.bigquery.connection.v1.ConnectionService|testIamPermissions}.
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @typedef TestIamPermissionsCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse
*/
/**
* Calls TestIamPermissions.
* @function testIamPermissions
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object
* @param {google.cloud.bigquery.connection.v1.ConnectionService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConnectionService.prototype.testIamPermissions = function testIamPermissions(request, callback) {
return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback);
}, "name", { value: "TestIamPermissions" });
/**
* Calls TestIamPermissions.
* @function testIamPermissions
* @memberof google.cloud.bigquery.connection.v1.ConnectionService
* @instance
* @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object
* @returns {Promise<google.iam.v1.TestIamPermissionsResponse>} Promise
* @variation 2
*/
return ConnectionService;
})();
v1.CreateConnectionRequest = (function() {
/**
* Properties of a CreateConnectionRequest.
* @memberof google.cloud.bigquery.connection.v1
* @interface ICreateConnectionRequest
* @property {string|null} [parent] CreateConnectionRequest parent
* @property {string|null} [connectionId] CreateConnectionRequest connectionId
* @property {google.cloud.bigquery.connection.v1.IConnection|null} [connection] CreateConnectionRequest connection
*/
/**
* Constructs a new CreateConnectionRequest.
* @memberof google.cloud.bigquery.connection.v1
* @classdesc Represents a CreateConnectionRequest.
* @implements ICreateConnectionRequest
* @constructor
* @param {google.cloud.bigquery.connection.v1.ICreateConnectionRequest=} [properties] Properties to set
*/
function CreateConnectionRequest(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]];
}
/**
* CreateConnectionRequest parent.
* @member {string} parent
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @instance
*/
CreateConnectionRequest.prototype.parent = "";
/**
* CreateConnectionRequest connectionId.
* @member {string} connectionId
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @instance
*/
CreateConnectionRequest.prototype.connectionId = "";
/**
* CreateConnectionRequest connection.
* @member {google.cloud.bigquery.connection.v1.IConnection|null|undefined} connection
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @instance
*/
CreateConnectionRequest.prototype.connection = null;
/**
* Creates a new CreateConnectionRequest instance using the specified properties.
* @function create
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.ICreateConnectionRequest=} [properties] Properties to set
* @returns {google.cloud.bigquery.connection.v1.CreateConnectionRequest} CreateConnectionRequest instance
*/
CreateConnectionRequest.create = function create(properties) {
return new CreateConnectionRequest(properties);
};
/**
* Encodes the specified CreateConnectionRequest message. Does not implicitly {@link google.cloud.bigquery.connection.v1.CreateConnectionRequest.verify|verify} messages.
* @function encode
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.ICreateConnectionRequest} message CreateConnectionRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CreateConnectionRequest.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.connectionId != null && Object.hasOwnProperty.call(message, "connectionId"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionId);
if (message.connection != null && Object.hasOwnProperty.call(message, "connection"))
$root.google.cloud.bigquery.connection.v1.Connection.encode(message.connection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CreateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.connection.v1.CreateConnectionRequest.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.ICreateConnectionRequest} message CreateConnectionRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CreateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CreateConnectionRequest message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.bigquery.connection.v1.CreateConnectionRequest} CreateConnectionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CreateConnectionRequest.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.bigquery.connection.v1.CreateConnectionRequest();
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.connectionId = reader.string();
break;
}
case 3: {
message.connection = $root.google.cloud.bigquery.connection.v1.Connection.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CreateConnectionRequest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.bigquery.connection.v1.CreateConnectionRequest} CreateConnectionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CreateConnectionRequest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CreateConnectionRequest message.
* @function verify
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CreateConnectionRequest.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.connectionId != null && message.hasOwnProperty("connectionId"))
if (!$util.isString(message.connectionId))
return "connectionId: string expected";
if (message.connection != null && message.hasOwnProperty("connection")) {
var error = $root.google.cloud.bigquery.connection.v1.Connection.verify(message.connection);
if (error)
return "connection." + error;
}
return null;
};
/**
* Creates a CreateConnectionRequest message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.bigquery.connection.v1.CreateConnectionRequest} CreateConnectionRequest
*/
CreateConnectionRequest.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.bigquery.connection.v1.CreateConnectionRequest)
return object;
var message = new $root.google.cloud.bigquery.connection.v1.CreateConnectionRequest();
if (object.parent != null)
message.parent = String(object.parent);
if (object.connectionId != null)
message.connectionId = String(object.connectionId);
if (object.connection != null) {
if (typeof object.connection !== "object")
throw TypeError(".google.cloud.bigquery.connection.v1.CreateConnectionRequest.connection: object expected");
message.connection = $root.google.cloud.bigquery.connection.v1.Connection.fromObject(object.connection);
}
return message;
};
/**
* Creates a plain object from a CreateConnectionRequest message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.CreateConnectionRequest} message CreateConnectionRequest
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CreateConnectionRequest.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.parent = "";
object.connectionId = "";
object.connection = null;
}
if (message.parent != null && message.hasOwnProperty("parent"))
object.parent = message.parent;
if (message.connectionId != null && message.hasOwnProperty("connectionId"))
object.connectionId = message.connectionId;
if (message.connection != null && message.hasOwnProperty("connection"))
object.connection = $root.google.cloud.bigquery.connection.v1.Connection.toObject(message.connection, options);
return object;
};
/**
* Converts this CreateConnectionRequest to JSON.
* @function toJSON
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @instance
* @returns {Object.<string,*>} JSON object
*/
CreateConnectionRequest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CreateConnectionRequest
* @function getTypeUrl
* @memberof google.cloud.bigquery.connection.v1.CreateConnectionRequest
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CreateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.bigquery.connection.v1.CreateConnectionRequest";
};
return CreateConnectionRequest;
})();
v1.GetConnectionRequest = (function() {
/**
* Properties of a GetConnectionRequest.
* @memberof google.cloud.bigquery.connection.v1
* @interface IGetConnectionRequest
* @property {string|null} [name] GetConnectionRequest name
*/
/**
* Constructs a new GetConnectionRequest.
* @memberof google.cloud.bigquery.connection.v1
* @classdesc Represents a GetConnectionRequest.
* @implements IGetConnectionRequest
* @constructor
* @param {google.cloud.bigquery.connection.v1.IGetConnectionRequest=} [properties] Properties to set
*/
function GetConnectionRequest(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]];
}
/**
* GetConnectionRequest name.
* @member {string} name
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @instance
*/
GetConnectionRequest.prototype.name = "";
/**
* Creates a new GetConnectionRequest instance using the specified properties.
* @function create
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.IGetConnectionRequest=} [properties] Properties to set
* @returns {google.cloud.bigquery.connection.v1.GetConnectionRequest} GetConnectionRequest instance
*/
GetConnectionRequest.create = function create(properties) {
return new GetConnectionRequest(properties);
};
/**
* Encodes the specified GetConnectionRequest message. Does not implicitly {@link google.cloud.bigquery.connection.v1.GetConnectionRequest.verify|verify} messages.
* @function encode
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.IGetConnectionRequest} message GetConnectionRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GetConnectionRequest.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 GetConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.connection.v1.GetConnectionRequest.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @static
* @param {google.cloud.bigquery.connection.v1.IGetConnectionRequest} message GetConnectionRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GetConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a GetConnectionRequest message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.bigquery.connection.v1.GetConnectionRequest} GetConnectionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GetConnectionRequest.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.bigquery.connection.v1.GetConnectionRequest();
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 GetConnectionRequest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.bigquery.connection.v1.GetConnectionRequest} GetConnectionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GetConnectionRequest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a GetConnectionRequest message.
* @function verify
* @memberof google.cloud.bigquery.connection.v1.GetConnectionRequest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
GetConnectionRequest.verify = function verify(message) {
if (typeof message !== "object" || message === null)