Skip to content

Commit

Permalink
fix: make request optional in all cases (#901)
Browse files Browse the repository at this point in the history
... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0

Committer: @miraleung
PiperOrigin-RevId: 380641501

Source-Link: googleapis/googleapis@076f7e9

Source-Link: googleapis/googleapis-gen@27e4c88
  • Loading branch information
gcf-owl-bot[bot] committed Jun 22, 2021
1 parent a66a386 commit 0591d53
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 157 deletions.
6 changes: 3 additions & 3 deletions protos/google/bigtable/admin/v2/bigtable_table_admin.proto
Expand Up @@ -270,7 +270,7 @@ service BigtableTableAdmin {
}

// Create a new table by restoring from a completed backup. The new table
// must be in the same instance as the instance containing the backup. The
// must be in the same project as the instance containing the backup. The
// returned table [long-running operation][google.longrunning.Operation] can
// be used to track the progress of the operation, and to cancel it. The
// [metadata][google.longrunning.Operation.metadata] field type is
Expand Down Expand Up @@ -335,8 +335,8 @@ service BigtableTableAdmin {
// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
message RestoreTableRequest {
// Required. The name of the instance in which to create the restored
// table. This instance must be the parent of the source backup. Values are
// of the form `projects/<project>/instances/<instance>`.
// table. This instance must be in the same project as the source backup.
// Values are of the form `projects/<project>/instances/<instance>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down
33 changes: 10 additions & 23 deletions src/v2/bigtable_client.ts
Expand Up @@ -19,9 +19,9 @@
/* global window */
import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import * as path from 'path';

import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
* Client JSON configuration object, loaded from
* `src/v2/bigtable_client_config.json`.
Expand Down Expand Up @@ -131,27 +131,14 @@ export class BigtableClient {
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else if (opts.fallback === 'rest') {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Load the applicable protos.
// For Node.js, pass the path to JSON proto file.
// For browsers, pass the JSON content.

const nodejsProtoPath = path.join(
__dirname,
'..',
'..',
'protos',
'protos.json'
);
this._protos = this._gaxGrpc.loadProto(
opts.fallback
? // eslint-disable-next-line @typescript-eslint/no-var-requires
require('../../protos/protos.json')
: nodejsProtoPath
);
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);

// This API contains "path templates"; forward-slash-separated
// identifiers to uniquely identify resources within the API.
Expand Down Expand Up @@ -318,7 +305,7 @@ export class BigtableClient {
// -- Service calls --
// -------------------
mutateRow(
request: protos.google.bigtable.v2.IMutateRowRequest,
request?: protos.google.bigtable.v2.IMutateRowRequest,
options?: CallOptions
): Promise<
[
Expand Down Expand Up @@ -374,7 +361,7 @@ export class BigtableClient {
* const [response] = await client.mutateRow(request);
*/
mutateRow(
request: protos.google.bigtable.v2.IMutateRowRequest,
request?: protos.google.bigtable.v2.IMutateRowRequest,
optionsOrCallback?:
| CallOptions
| Callback<
Expand Down Expand Up @@ -413,7 +400,7 @@ export class BigtableClient {
return this.innerApiCalls.mutateRow(request, options, callback);
}
checkAndMutateRow(
request: protos.google.bigtable.v2.ICheckAndMutateRowRequest,
request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest,
options?: CallOptions
): Promise<
[
Expand Down Expand Up @@ -482,7 +469,7 @@ export class BigtableClient {
* const [response] = await client.checkAndMutateRow(request);
*/
checkAndMutateRow(
request: protos.google.bigtable.v2.ICheckAndMutateRowRequest,
request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest,
optionsOrCallback?:
| CallOptions
| Callback<
Expand Down Expand Up @@ -523,7 +510,7 @@ export class BigtableClient {
return this.innerApiCalls.checkAndMutateRow(request, options, callback);
}
readModifyWriteRow(
request: protos.google.bigtable.v2.IReadModifyWriteRowRequest,
request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest,
options?: CallOptions
): Promise<
[
Expand Down Expand Up @@ -583,7 +570,7 @@ export class BigtableClient {
* const [response] = await client.readModifyWriteRow(request);
*/
readModifyWriteRow(
request: protos.google.bigtable.v2.IReadModifyWriteRowRequest,
request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest,
optionsOrCallback?:
| CallOptions
| Callback<
Expand Down

0 comments on commit 0591d53

Please sign in to comment.