Class v1.ConnectionServiceClient (2.0.2)

Manages external data source connections and credentials. v1

Package

@google-cloud/bigquery-connection

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of ConnectionServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new ConnectionServiceClient({fallback: 'rest'}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

connectionServiceStub

connectionServiceStub?: Promise<{
        [name: string]: Function;
    }>;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

connectionPath(project, location, connection)

connectionPath(project: string, location: string, connection: string): string;

Return a fully-qualified connection resource name string.

Parameters
NameDescription
project string
location string
connection string
Returns
TypeDescription
string

{string} Resource name string.

createConnection(request, options)

createConnection(request?: protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.connection.v1.IConnection,
        (protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest | undefined),
        {} | undefined
    ]>;

Creates a new connection.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.connection.v1.IConnection, (protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Connection]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  Must be in the format `projects/{project_id}/locations/{location_id}`
   */
  // const parent = 'abc123'
  /**
   *  Optional. Connection id that should be assigned to the created connection.
   */
  // const connectionId = 'abc123'
  /**
   *  Required. Connection to create.
   */
  // const connection = {}

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callCreateConnection() {
    // Construct request
    const request = {
      parent,
      connection,
    };

    // Run request
    const response = await connectionClient.createConnection(request);
    console.log(response);
  }

  callCreateConnection();

createConnection(request, options, callback)

createConnection(request: protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest
options CallOptions
callback Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createConnection(request, callback)

createConnection(request: protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest, callback: Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest
callback Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConnection(request, options)

deleteConnection(request?: protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest | undefined),
        {} | undefined
    ]>;

Deletes connection and associated credential.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the deleted connection, for example:
   *  `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
   */
  // const name = 'abc123'

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callDeleteConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await connectionClient.deleteConnection(request);
    console.log(response);
  }

  callDeleteConnection();

deleteConnection(request, options, callback)

deleteConnection(request: protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConnection(request, callback)

deleteConnection(request: protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConnection(request, options)

getConnection(request?: protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.connection.v1.IConnection,
        (protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest | undefined),
        {} | undefined
    ]>;

Returns specified connection.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.connection.v1.IConnection, (protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Connection]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the requested connection, for example:
   *  `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
   */
  // const name = 'abc123'

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callGetConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await connectionClient.getConnection(request);
    console.log(response);
  }

  callGetConnection();

getConnection(request, options, callback)

getConnection(request: protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest
options CallOptions
callback Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConnection(request, callback)

getConnection(request: protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest, callback: Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest
callback Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options)

getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.IGetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  OPTIONAL: A `GetPolicyOptions` object for specifying options to
   *  `GetIamPolicy`.
   */
  // const options = {}

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callGetIamPolicy() {
    // Construct request
    const request = {
      resource,
    };

    // Run request
    const response = await connectionClient.getIamPolicy(request);
    console.log(response);
  }

  callGetIamPolicy();

getIamPolicy(request, options, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listConnections(request, options)

listConnections(request?: protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.connection.v1.IConnection[],
        protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest | null,
        protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse
    ]>;

Returns a list of connections in the given project.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.connection.v1.IConnection[], protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest | null, protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Connection]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listConnectionsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listConnections(request, options, callback)

listConnections(request: protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.bigquery.connection.v1.IConnection>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.bigquery.connection.v1.IConnection>
Returns
TypeDescription
void

listConnections(request, callback)

listConnections(request: protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.bigquery.connection.v1.IConnection>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest
callback PaginationCallback<protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.bigquery.connection.v1.IConnection>
Returns
TypeDescription
void

listConnectionsAsync(request, options)

listConnectionsAsync(request?: protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.connection.v1.IConnection>;

Equivalent to listConnections, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.bigquery.connection.v1.IConnection>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Connection]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   *  Must be in the form: `projects/{project_id}/locations/{location_id}`
   */
  // const parent = 'abc123'
  /**
   *  Required. Page size.
   */
  // const pageSize = 1234
  /**
   *  Page token.
   */
  // const pageToken = 'abc123'

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callListConnections() {
    // Construct request
    const request = {
      parent,
      pageSize,
    };

    // Run request
    const iterable = await connectionClient.listConnectionsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListConnections();

listConnectionsStream(request, options)

listConnectionsStream(request?: protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Connection] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listConnectionsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchConnectionFromConnectionName(connectionName)

matchConnectionFromConnectionName(connectionName: string): string | number;

Parse the connection from Connection resource.

Parameter
NameDescription
connectionName string

A fully-qualified path representing Connection resource.

Returns
TypeDescription
string | number

{string} A string representing the connection.

matchLocationFromConnectionName(connectionName)

matchLocationFromConnectionName(connectionName: string): string | number;

Parse the location from Connection resource.

Parameter
NameDescription
connectionName string

A fully-qualified path representing Connection resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromConnectionName(connectionName)

matchProjectFromConnectionName(connectionName: string): string | number;

Parse the project from Connection resource.

Parameter
NameDescription
connectionName string

A fully-qualified path representing Connection resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

setIamPolicy(request, options)

setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.ISetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Sets the access control policy on the specified resource. Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being specified.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  REQUIRED: The complete policy to be applied to the `resource`. The size of
   *  the policy is limited to a few 10s of KB. An empty policy is a
   *  valid policy but certain Cloud Platform services (such as Projects)
   *  might reject them.
   */
  // const policy = {}
  /**
   *  OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
   *  the fields in the mask will be modified. If no mask is provided, the
   *  following default mask is used:
   *  `paths: "bindings, etag"`
   */
  // const updateMask = {}

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callSetIamPolicy() {
    // Construct request
    const request = {
      resource,
      policy,
    };

    // Run request
    const response = await connectionClient.setIamPolicy(request);
    console.log(response);
  }

  callSetIamPolicy();

setIamPolicy(request, options, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options)

testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.ITestIamPermissionsResponse,
        protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
        {} | undefined
    ]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestIamPermissionsResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy detail is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  The set of permissions to check for the `resource`. Permissions with
   *  wildcards (such as '*' or 'storage.*') are not allowed. For more
   *  information see
   *  IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
   */
  // const permissions = 'abc123'

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callTestIamPermissions() {
    // Construct request
    const request = {
      resource,
      permissions,
    };

    // Run request
    const response = await connectionClient.testIamPermissions(request);
    console.log(response);
  }

  callTestIamPermissions();

testIamPermissions(request, options, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
options CallOptions
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConnection(request, options)

updateConnection(request?: protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.connection.v1.IConnection,
        (protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest | undefined),
        {} | undefined
    ]>;

Updates the specified connection. For security reasons, also resets credential if connection properties are in the update field mask.

Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.connection.v1.IConnection, (protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Connection]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the connection to update, for example:
   *  `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
   */
  // const name = 'abc123'
  /**
   *  Required. Connection containing the updated fields.
   */
  // const connection = {}
  /**
   *  Required. Update mask for the connection fields to be updated.
   */
  // const updateMask = {}

  // Imports the Connection library
  const {ConnectionServiceClient} = require('@google-cloud/bigquery-connection').v1;

  // Instantiates a client
  const connectionClient = new ConnectionServiceClient();

  async function callUpdateConnection() {
    // Construct request
    const request = {
      name,
      connection,
      updateMask,
    };

    // Run request
    const response = await connectionClient.updateConnection(request);
    console.log(response);
  }

  callUpdateConnection();

updateConnection(request, options, callback)

updateConnection(request: protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest
options CallOptions
callback Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConnection(request, callback)

updateConnection(request: protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest, callback: Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest
callback Callback<protos.google.cloud.bigquery.connection.v1.IConnection, protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void