Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed May 16, 2024
1 parent 4ea88a7 commit 94abd8d
Show file tree
Hide file tree
Showing 156 changed files with 277 additions and 205,959 deletions.
14 changes: 1 addition & 13 deletions dev/protos/admin_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3336,19 +3336,7 @@
"extensions": [
[
1000,
1000
],
[
1001,
1001
],
[
1002,
1002
],
[
9990,
9990
9994
],
[
9995,
Expand Down
23 changes: 18 additions & 5 deletions dev/protos/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,24 @@ message FeatureSet {

reserved 999;

extensions 1000; // for Protobuf C++
extensions 1001; // for Protobuf Java
extensions 1002; // for Protobuf Go

extensions 9990; // for deprecated Java Proto1
extensions 1000 to 9994 [
declaration = {
number: 1000,
full_name: ".pb.cpp",
type: ".pb.CppFeatures"
},
declaration = {
number: 1001,
full_name: ".pb.java",
type: ".pb.JavaFeatures"
},
declaration = { number: 1002, full_name: ".pb.go", type: ".pb.GoFeatures" },
declaration = {
number: 9990,
full_name: ".pb.proto1",
type: ".pb.Proto1Features"
}
];

extensions 9995 to 9999; // For internal testing
extensions 10000; // for https://github.com/bufbuild/protobuf-es
Expand Down
14 changes: 1 addition & 13 deletions dev/protos/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1206,19 +1206,7 @@
"extensions": [
[
1000,
1000
],
[
1001,
1001
],
[
1002,
1002
],
[
9990,
9990
9994
],
[
9995,
Expand Down
14 changes: 1 addition & 13 deletions dev/protos/v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1206,19 +1206,7 @@
"extensions": [
[
1000,
1000
],
[
1001,
1001
],
[
1002,
1002
],
[
9990,
9990
9994
],
[
9995,
Expand Down
10 changes: 5 additions & 5 deletions dev/src/v1/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,27 +235,27 @@ export class FirestoreClient {
batchGetDocuments: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
runQuery: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
runAggregationQuery: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
write: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
listen: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
};

Expand Down
8 changes: 4 additions & 4 deletions dev/src/v1beta1/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,22 @@ export class FirestoreClient {
batchGetDocuments: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
runQuery: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
write: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
listen: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
!!opts.fallback,
/* gaxStreamingRetries: */ false
!!opts.gaxServerStreamingRetries
),
};

Expand Down
148 changes: 148 additions & 0 deletions dev/test/gapic_firestore_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,49 @@ describe('v1.FirestoreClient', () => {
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
});

it('invokes batchGetDocuments without error and gaxServerStreamingRetries enabled', async () => {
const client = new firestoreModule.FirestoreClient({
gaxServerStreamingRetries: true,
});
client.initialize();
const request = generateSampleMessage(
new protos.google.firestore.v1.BatchGetDocumentsRequest()
);
const defaultValue1 = getTypeDefaultValue(
'.google.firestore.v1.BatchGetDocumentsRequest',
['database']
);
request.database = defaultValue1;
const expectedHeaderRequestParams = `database=${defaultValue1}`;
const expectedResponse = generateSampleMessage(
new protos.google.firestore.v1.BatchGetDocumentsResponse()
);
client.innerApiCalls.batchGetDocuments =
stubServerStreamingCall(expectedResponse);
const stream = client.batchGetDocuments(request);
const promise = new Promise((resolve, reject) => {
stream.on(
'data',
(response: protos.google.firestore.v1.BatchGetDocumentsResponse) => {
resolve(response);
}
);
stream.on('error', (err: Error) => {
reject(err);
});
});
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
const actualRequest = (
client.innerApiCalls.batchGetDocuments as SinonStub
).getCall(0).args[0];
assert.deepStrictEqual(actualRequest, request);
const actualHeaderRequestParams = (
client.innerApiCalls.batchGetDocuments as SinonStub
).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
});

it('invokes batchGetDocuments with error', async () => {
const client = new firestoreModule.FirestoreClient({
credentials: {client_email: 'bogus', private_key: 'bogus'},
Expand Down Expand Up @@ -1514,6 +1557,12 @@ describe('v1.FirestoreClient', () => {
});
await assert.rejects(promise, expectedError);
});
it('should create a client with gaxServerStreamingRetries enabled', () => {
const client = new firestoreModule.FirestoreClient({
gaxServerStreamingRetries: true,
});
assert(client);
});
});

describe('runQuery', () => {
Expand Down Expand Up @@ -1560,6 +1609,48 @@ describe('v1.FirestoreClient', () => {
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
});

it('invokes runQuery without error and gaxServerStreamingRetries enabled', async () => {
const client = new firestoreModule.FirestoreClient({
gaxServerStreamingRetries: true,
});
client.initialize();
const request = generateSampleMessage(
new protos.google.firestore.v1.RunQueryRequest()
);
const defaultValue1 = getTypeDefaultValue(
'.google.firestore.v1.RunQueryRequest',
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedResponse = generateSampleMessage(
new protos.google.firestore.v1.RunQueryResponse()
);
client.innerApiCalls.runQuery = stubServerStreamingCall(expectedResponse);
const stream = client.runQuery(request);
const promise = new Promise((resolve, reject) => {
stream.on(
'data',
(response: protos.google.firestore.v1.RunQueryResponse) => {
resolve(response);
}
);
stream.on('error', (err: Error) => {
reject(err);
});
});
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
const actualRequest = (
client.innerApiCalls.runQuery as SinonStub
).getCall(0).args[0];
assert.deepStrictEqual(actualRequest, request);
const actualHeaderRequestParams = (
client.innerApiCalls.runQuery as SinonStub
).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
});

it('invokes runQuery with error', async () => {
const client = new firestoreModule.FirestoreClient({
credentials: {client_email: 'bogus', private_key: 'bogus'},
Expand Down Expand Up @@ -1635,6 +1726,12 @@ describe('v1.FirestoreClient', () => {
});
await assert.rejects(promise, expectedError);
});
it('should create a client with gaxServerStreamingRetries enabled', () => {
const client = new firestoreModule.FirestoreClient({
gaxServerStreamingRetries: true,
});
assert(client);
});
});

describe('runAggregationQuery', () => {
Expand Down Expand Up @@ -1684,6 +1781,51 @@ describe('v1.FirestoreClient', () => {
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
});

it('invokes runAggregationQuery without error and gaxServerStreamingRetries enabled', async () => {
const client = new firestoreModule.FirestoreClient({
gaxServerStreamingRetries: true,
});
client.initialize();
const request = generateSampleMessage(
new protos.google.firestore.v1.RunAggregationQueryRequest()
);
const defaultValue1 = getTypeDefaultValue(
'.google.firestore.v1.RunAggregationQueryRequest',
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedResponse = generateSampleMessage(
new protos.google.firestore.v1.RunAggregationQueryResponse()
);
client.innerApiCalls.runAggregationQuery =
stubServerStreamingCall(expectedResponse);
const stream = client.runAggregationQuery(request);
const promise = new Promise((resolve, reject) => {
stream.on(
'data',
(
response: protos.google.firestore.v1.RunAggregationQueryResponse
) => {
resolve(response);
}
);
stream.on('error', (err: Error) => {
reject(err);
});
});
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
const actualRequest = (
client.innerApiCalls.runAggregationQuery as SinonStub
).getCall(0).args[0];
assert.deepStrictEqual(actualRequest, request);
const actualHeaderRequestParams = (
client.innerApiCalls.runAggregationQuery as SinonStub
).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
});

it('invokes runAggregationQuery with error', async () => {
const client = new firestoreModule.FirestoreClient({
credentials: {client_email: 'bogus', private_key: 'bogus'},
Expand Down Expand Up @@ -1763,6 +1905,12 @@ describe('v1.FirestoreClient', () => {
});
await assert.rejects(promise, expectedError);
});
it('should create a client with gaxServerStreamingRetries enabled', () => {
const client = new firestoreModule.FirestoreClient({
gaxServerStreamingRetries: true,
});
assert(client);
});
});

describe('write', () => {
Expand Down
Loading

0 comments on commit 94abd8d

Please sign in to comment.