@google-cloud/pubsub 3.2.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +3 -2
  3. package/build/protos/google/pubsub/v1/pubsub.proto +65 -43
  4. package/build/protos/google/pubsub/v1/schema.proto +138 -16
  5. package/build/protos/protos.d.ts +2513 -373
  6. package/build/protos/protos.js +6492 -1101
  7. package/build/protos/protos.json +522 -36
  8. package/build/src/ack-metadata.d.ts +1 -1
  9. package/build/src/iam.d.ts +7 -7
  10. package/build/src/iam.js.map +1 -1
  11. package/build/src/message-queues.d.ts +1 -1
  12. package/build/src/publisher/index.d.ts +1 -1
  13. package/build/src/publisher/index.js +2 -2
  14. package/build/src/publisher/index.js.map +1 -1
  15. package/build/src/publisher/message-queues.d.ts +29 -1
  16. package/build/src/publisher/message-queues.js +32 -2
  17. package/build/src/publisher/message-queues.js.map +1 -1
  18. package/build/src/publisher/pubsub-message.d.ts +1 -1
  19. package/build/src/pubsub.d.ts +19 -19
  20. package/build/src/schema.d.ts +6 -6
  21. package/build/src/snapshot.d.ts +4 -4
  22. package/build/src/subscriber.d.ts +4 -4
  23. package/build/src/subscriber.js +1 -3
  24. package/build/src/subscriber.js.map +1 -1
  25. package/build/src/subscription.d.ts +21 -21
  26. package/build/src/temporal.d.ts +1 -1
  27. package/build/src/topic.d.ts +17 -17
  28. package/build/src/v1/index.js +1 -1
  29. package/build/src/v1/publisher_client.d.ts +20 -20
  30. package/build/src/v1/publisher_client.js +15 -13
  31. package/build/src/v1/publisher_client.js.map +1 -1
  32. package/build/src/v1/schema_service_client.d.ts +193 -20
  33. package/build/src/v1/schema_service_client.js +189 -13
  34. package/build/src/v1/schema_service_client.js.map +1 -1
  35. package/build/src/v1/schema_service_client_config.json +16 -0
  36. package/build/src/v1/subscriber_client.d.ts +54 -60
  37. package/build/src/v1/subscriber_client.js +19 -17
  38. package/build/src/v1/subscriber_client.js.map +1 -1
  39. package/build/src/v1/subscriber_client_config.json +7 -1
  40. package/package.json +4 -4
@@ -131,7 +131,7 @@ export declare class SchemaServiceClient {
131
131
  * @param {object} [options]
132
132
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
133
133
  * @returns {Promise} - The promise which resolves to an array.
134
- * The first element of the array is an object representing [Schema]{@link google.pubsub.v1.Schema}.
134
+ * The first element of the array is an object representing {@link google.pubsub.v1.Schema | Schema}.
135
135
  * Please see the
136
136
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
137
137
  * for more details and examples.
@@ -153,12 +153,11 @@ export declare class SchemaServiceClient {
153
153
  * Format is `projects/{project}/schemas/{schema}`.
154
154
  * @param {google.pubsub.v1.SchemaView} request.view
155
155
  * The set of fields to return in the response. If not set, returns a Schema
156
- * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
157
- * fields.
156
+ * with all fields filled out. Set to `BASIC` to omit the `definition`.
158
157
  * @param {object} [options]
159
158
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
160
159
  * @returns {Promise} - The promise which resolves to an array.
161
- * The first element of the array is an object representing [Schema]{@link google.pubsub.v1.Schema}.
160
+ * The first element of the array is an object representing {@link google.pubsub.v1.Schema | Schema}.
162
161
  * Please see the
163
162
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
164
163
  * for more details and examples.
@@ -170,6 +169,87 @@ export declare class SchemaServiceClient {
170
169
  ]>;
171
170
  getSchema(request: protos.google.pubsub.v1.IGetSchemaRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, {} | null | undefined>): void;
172
171
  getSchema(request: protos.google.pubsub.v1.IGetSchemaRequest, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, {} | null | undefined>): void;
172
+ /**
173
+ * Commits a new schema revision to an existing schema.
174
+ *
175
+ * @param {Object} request
176
+ * The request object that will be sent.
177
+ * @param {string} request.name
178
+ * Required. The name of the schema we are revising.
179
+ * Format is `projects/{project}/schemas/{schema}`.
180
+ * @param {google.pubsub.v1.Schema} request.schema
181
+ * Required. The schema revision to commit.
182
+ * @param {object} [options]
183
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
184
+ * @returns {Promise} - The promise which resolves to an array.
185
+ * The first element of the array is an object representing {@link google.pubsub.v1.Schema | Schema}.
186
+ * Please see the
187
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
188
+ * for more details and examples.
189
+ */
190
+ commitSchema(request?: protos.google.pubsub.v1.ICommitSchemaRequest, options?: CallOptions): Promise<[
191
+ protos.google.pubsub.v1.ISchema,
192
+ protos.google.pubsub.v1.ICommitSchemaRequest | undefined,
193
+ {} | undefined
194
+ ]>;
195
+ commitSchema(request: protos.google.pubsub.v1.ICommitSchemaRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, {} | null | undefined>): void;
196
+ commitSchema(request: protos.google.pubsub.v1.ICommitSchemaRequest, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, {} | null | undefined>): void;
197
+ /**
198
+ * Creates a new schema revision that is a copy of the provided revision_id.
199
+ *
200
+ * @param {Object} request
201
+ * The request object that will be sent.
202
+ * @param {string} request.name
203
+ * Required. The schema being rolled back with revision id.
204
+ * @param {string} request.revisionId
205
+ * Required. The revision ID to roll back to.
206
+ * It must be a revision of the same schema.
207
+ *
208
+ * Example: c7cfa2a8
209
+ * @param {object} [options]
210
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
211
+ * @returns {Promise} - The promise which resolves to an array.
212
+ * The first element of the array is an object representing {@link google.pubsub.v1.Schema | Schema}.
213
+ * Please see the
214
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
215
+ * for more details and examples.
216
+ */
217
+ rollbackSchema(request?: protos.google.pubsub.v1.IRollbackSchemaRequest, options?: CallOptions): Promise<[
218
+ protos.google.pubsub.v1.ISchema,
219
+ protos.google.pubsub.v1.IRollbackSchemaRequest | undefined,
220
+ {} | undefined
221
+ ]>;
222
+ rollbackSchema(request: protos.google.pubsub.v1.IRollbackSchemaRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, {} | null | undefined>): void;
223
+ rollbackSchema(request: protos.google.pubsub.v1.IRollbackSchemaRequest, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, {} | null | undefined>): void;
224
+ /**
225
+ * Deletes a specific schema revision.
226
+ *
227
+ * @param {Object} request
228
+ * The request object that will be sent.
229
+ * @param {string} request.name
230
+ * Required. The name of the schema revision to be deleted, with a revision ID
231
+ * explicitly included.
232
+ *
233
+ * Example: `projects/123/schemas/my-schema@c7cfa2a8`
234
+ * @param {string} [request.revisionId]
235
+ * Optional. This field is deprecated and should not be used for specifying
236
+ * the revision ID. The revision ID should be specified via the `name`
237
+ * parameter.
238
+ * @param {object} [options]
239
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
240
+ * @returns {Promise} - The promise which resolves to an array.
241
+ * The first element of the array is an object representing {@link google.pubsub.v1.Schema | Schema}.
242
+ * Please see the
243
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
244
+ * for more details and examples.
245
+ */
246
+ deleteSchemaRevision(request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, options?: CallOptions): Promise<[
247
+ protos.google.pubsub.v1.ISchema,
248
+ protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | undefined,
249
+ {} | undefined
250
+ ]>;
251
+ deleteSchemaRevision(request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | null | undefined, {} | null | undefined>): void;
252
+ deleteSchemaRevision(request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, callback: Callback<protos.google.pubsub.v1.ISchema, protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | null | undefined, {} | null | undefined>): void;
173
253
  /**
174
254
  * Deletes a schema.
175
255
  *
@@ -181,7 +261,7 @@ export declare class SchemaServiceClient {
181
261
  * @param {object} [options]
182
262
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
183
263
  * @returns {Promise} - The promise which resolves to an array.
184
- * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
264
+ * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}.
185
265
  * Please see the
186
266
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
187
267
  * for more details and examples.
@@ -206,7 +286,7 @@ export declare class SchemaServiceClient {
206
286
  * @param {object} [options]
207
287
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
208
288
  * @returns {Promise} - The promise which resolves to an array.
209
- * The first element of the array is an object representing [ValidateSchemaResponse]{@link google.pubsub.v1.ValidateSchemaResponse}.
289
+ * The first element of the array is an object representing {@link google.pubsub.v1.ValidateSchemaResponse | ValidateSchemaResponse}.
210
290
  * Please see the
211
291
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
212
292
  * for more details and examples.
@@ -239,7 +319,7 @@ export declare class SchemaServiceClient {
239
319
  * @param {object} [options]
240
320
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
241
321
  * @returns {Promise} - The promise which resolves to an array.
242
- * The first element of the array is an object representing [ValidateMessageResponse]{@link google.pubsub.v1.ValidateMessageResponse}.
322
+ * The first element of the array is an object representing {@link google.pubsub.v1.ValidateMessageResponse | ValidateMessageResponse}.
243
323
  * Please see the
244
324
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
245
325
  * for more details and examples.
@@ -272,7 +352,7 @@ export declare class SchemaServiceClient {
272
352
  * @param {object} [options]
273
353
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
274
354
  * @returns {Promise} - The promise which resolves to an array.
275
- * The first element of the array is Array of [Schema]{@link google.pubsub.v1.Schema}.
355
+ * The first element of the array is Array of {@link google.pubsub.v1.Schema | Schema}.
276
356
  * The client library will perform auto-pagination by default: it will call the API as many
277
357
  * times as needed and will merge results from all the pages into this array.
278
358
  * Note that it can affect your quota.
@@ -309,7 +389,7 @@ export declare class SchemaServiceClient {
309
389
  * @param {object} [options]
310
390
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
311
391
  * @returns {Stream}
312
- * An object stream which emits an object representing [Schema]{@link google.pubsub.v1.Schema} on 'data' event.
392
+ * An object stream which emits an object representing {@link google.pubsub.v1.Schema | Schema} on 'data' event.
313
393
  * The client library will perform auto-pagination by default: it will call the API as many
314
394
  * times as needed. Note that it can affect your quota.
315
395
  * We recommend using `listSchemasAsync()`
@@ -343,13 +423,106 @@ export declare class SchemaServiceClient {
343
423
  * @returns {Object}
344
424
  * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
345
425
  * When you iterate the returned iterable, each element will be an object representing
346
- * [Schema]{@link google.pubsub.v1.Schema}. The API will be called under the hood as needed, once per the page,
426
+ * {@link google.pubsub.v1.Schema | Schema}. The API will be called under the hood as needed, once per the page,
347
427
  * so you can stop the iteration when you don't need more results.
348
428
  * Please see the
349
429
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
350
430
  * for more details and examples.
351
431
  */
352
432
  listSchemasAsync(request?: protos.google.pubsub.v1.IListSchemasRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISchema>;
433
+ /**
434
+ * Lists all schema revisions for the named schema.
435
+ *
436
+ * @param {Object} request
437
+ * The request object that will be sent.
438
+ * @param {string} request.name
439
+ * Required. The name of the schema to list revisions for.
440
+ * @param {google.pubsub.v1.SchemaView} request.view
441
+ * The set of Schema fields to return in the response. If not set, returns
442
+ * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
443
+ * retrieve all fields.
444
+ * @param {number} request.pageSize
445
+ * The maximum number of revisions to return per page.
446
+ * @param {string} request.pageToken
447
+ * The page token, received from a previous ListSchemaRevisions call.
448
+ * Provide this to retrieve the subsequent page.
449
+ * @param {object} [options]
450
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
451
+ * @returns {Promise} - The promise which resolves to an array.
452
+ * The first element of the array is Array of {@link google.pubsub.v1.Schema | Schema}.
453
+ * The client library will perform auto-pagination by default: it will call the API as many
454
+ * times as needed and will merge results from all the pages into this array.
455
+ * Note that it can affect your quota.
456
+ * We recommend using `listSchemaRevisionsAsync()`
457
+ * method described below for async iteration which you can stop as needed.
458
+ * Please see the
459
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
460
+ * for more details and examples.
461
+ */
462
+ listSchemaRevisions(request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, options?: CallOptions): Promise<[
463
+ protos.google.pubsub.v1.ISchema[],
464
+ protos.google.pubsub.v1.IListSchemaRevisionsRequest | null,
465
+ protos.google.pubsub.v1.IListSchemaRevisionsResponse
466
+ ]>;
467
+ listSchemaRevisions(request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSchemaRevisionsRequest, protos.google.pubsub.v1.IListSchemaRevisionsResponse | null | undefined, protos.google.pubsub.v1.ISchema>): void;
468
+ listSchemaRevisions(request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSchemaRevisionsRequest, protos.google.pubsub.v1.IListSchemaRevisionsResponse | null | undefined, protos.google.pubsub.v1.ISchema>): void;
469
+ /**
470
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
471
+ * @param {Object} request
472
+ * The request object that will be sent.
473
+ * @param {string} request.name
474
+ * Required. The name of the schema to list revisions for.
475
+ * @param {google.pubsub.v1.SchemaView} request.view
476
+ * The set of Schema fields to return in the response. If not set, returns
477
+ * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
478
+ * retrieve all fields.
479
+ * @param {number} request.pageSize
480
+ * The maximum number of revisions to return per page.
481
+ * @param {string} request.pageToken
482
+ * The page token, received from a previous ListSchemaRevisions call.
483
+ * Provide this to retrieve the subsequent page.
484
+ * @param {object} [options]
485
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
486
+ * @returns {Stream}
487
+ * An object stream which emits an object representing {@link google.pubsub.v1.Schema | Schema} on 'data' event.
488
+ * The client library will perform auto-pagination by default: it will call the API as many
489
+ * times as needed. Note that it can affect your quota.
490
+ * We recommend using `listSchemaRevisionsAsync()`
491
+ * method described below for async iteration which you can stop as needed.
492
+ * Please see the
493
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
494
+ * for more details and examples.
495
+ */
496
+ listSchemaRevisionsStream(request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, options?: CallOptions): Transform;
497
+ /**
498
+ * Equivalent to `listSchemaRevisions`, but returns an iterable object.
499
+ *
500
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
501
+ * @param {Object} request
502
+ * The request object that will be sent.
503
+ * @param {string} request.name
504
+ * Required. The name of the schema to list revisions for.
505
+ * @param {google.pubsub.v1.SchemaView} request.view
506
+ * The set of Schema fields to return in the response. If not set, returns
507
+ * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
508
+ * retrieve all fields.
509
+ * @param {number} request.pageSize
510
+ * The maximum number of revisions to return per page.
511
+ * @param {string} request.pageToken
512
+ * The page token, received from a previous ListSchemaRevisions call.
513
+ * Provide this to retrieve the subsequent page.
514
+ * @param {object} [options]
515
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
516
+ * @returns {Object}
517
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
518
+ * When you iterate the returned iterable, each element will be an object representing
519
+ * {@link google.pubsub.v1.Schema | Schema}. The API will be called under the hood as needed, once per the page,
520
+ * so you can stop the iteration when you don't need more results.
521
+ * Please see the
522
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
523
+ * for more details and examples.
524
+ */
525
+ listSchemaRevisionsAsync(request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISchema>;
353
526
  /**
354
527
  * Gets the access control policy for a resource. Returns an empty policy
355
528
  * if the resource exists and does not have a policy set.
@@ -363,16 +536,16 @@ export declare class SchemaServiceClient {
363
536
  * OPTIONAL: A `GetPolicyOptions` object for specifying options to
364
537
  * `GetIamPolicy`. This field is only used by Cloud IAM.
365
538
  *
366
- * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions}
539
+ * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}.
367
540
  * @param {Object} [options]
368
541
  * Optional parameters. You can override the default settings for this call, e.g, timeout,
369
- * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
542
+ * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
370
543
  * @param {function(?Error, ?Object)} [callback]
371
544
  * The function which will be called with the result of the API call.
372
545
  *
373
- * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}.
546
+ * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}.
374
547
  * @returns {Promise} - The promise which resolves to an array.
375
- * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
548
+ * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}.
376
549
  * The promise has a method named "cancel" which cancels the ongoing API call.
377
550
  */
378
551
  getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.Policy>;
@@ -397,13 +570,13 @@ export declare class SchemaServiceClient {
397
570
  * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
398
571
  * @param {Object} [options]
399
572
  * Optional parameters. You can override the default settings for this call, e.g, timeout,
400
- * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
573
+ * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
401
574
  * @param {function(?Error, ?Object)} [callback]
402
575
  * The function which will be called with the result of the API call.
403
576
  *
404
- * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
577
+ * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
405
578
  * @returns {Promise} - The promise which resolves to an array.
406
- * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
579
+ * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
407
580
  * The promise has a method named "cancel" which cancels the ongoing API call.
408
581
  */
409
582
  setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.Policy>;
@@ -428,13 +601,13 @@ export declare class SchemaServiceClient {
428
601
  * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
429
602
  * @param {Object} [options]
430
603
  * Optional parameters. You can override the default settings for this call, e.g, timeout,
431
- * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
604
+ * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
432
605
  * @param {function(?Error, ?Object)} [callback]
433
606
  * The function which will be called with the result of the API call.
434
607
  *
435
- * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
608
+ * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
436
609
  * @returns {Promise} - The promise which resolves to an array.
437
- * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
610
+ * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
438
611
  * The promise has a method named "cancel" which cancels the ongoing API call.
439
612
  *
440
613
  */
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2022 Google LLC
2
+ // Copyright 2023 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -89,6 +89,8 @@ class SchemaServiceClient {
89
89
  const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
90
90
  const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
91
91
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
92
+ // Request numeric enum values if REST transport is used.
93
+ opts.numericEnums = true;
92
94
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
93
95
  if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
94
96
  opts['scopes'] = staticMembers.scopes;
@@ -148,6 +150,7 @@ class SchemaServiceClient {
148
150
  // pages). Denote the keys used for pagination and results.
149
151
  this.descriptors.page = {
150
152
  listSchemas: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas'),
153
+ listSchemaRevisions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas'),
151
154
  };
152
155
  // Put together the default options sent with requests.
153
156
  this._defaults = this._gaxGrpc.constructSettings('google.pubsub.v1.SchemaService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -186,6 +189,10 @@ class SchemaServiceClient {
186
189
  'createSchema',
187
190
  'getSchema',
188
191
  'listSchemas',
192
+ 'listSchemaRevisions',
193
+ 'commitSchema',
194
+ 'rollbackSchema',
195
+ 'deleteSchemaRevision',
189
196
  'deleteSchema',
190
197
  'validateSchema',
191
198
  'validateMessage',
@@ -292,6 +299,69 @@ class SchemaServiceClient {
292
299
  this.initialize();
293
300
  return this.innerApiCalls.getSchema(request, options, callback);
294
301
  }
302
+ commitSchema(request, optionsOrCallback, callback) {
303
+ var _a;
304
+ request = request || {};
305
+ let options;
306
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
307
+ callback = optionsOrCallback;
308
+ options = {};
309
+ }
310
+ else {
311
+ options = optionsOrCallback;
312
+ }
313
+ options = options || {};
314
+ options.otherArgs = options.otherArgs || {};
315
+ options.otherArgs.headers = options.otherArgs.headers || {};
316
+ options.otherArgs.headers['x-goog-request-params'] =
317
+ this._gaxModule.routingHeader.fromParams({
318
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
319
+ });
320
+ this.initialize();
321
+ return this.innerApiCalls.commitSchema(request, options, callback);
322
+ }
323
+ rollbackSchema(request, optionsOrCallback, callback) {
324
+ var _a;
325
+ request = request || {};
326
+ let options;
327
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
328
+ callback = optionsOrCallback;
329
+ options = {};
330
+ }
331
+ else {
332
+ options = optionsOrCallback;
333
+ }
334
+ options = options || {};
335
+ options.otherArgs = options.otherArgs || {};
336
+ options.otherArgs.headers = options.otherArgs.headers || {};
337
+ options.otherArgs.headers['x-goog-request-params'] =
338
+ this._gaxModule.routingHeader.fromParams({
339
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
340
+ });
341
+ this.initialize();
342
+ return this.innerApiCalls.rollbackSchema(request, options, callback);
343
+ }
344
+ deleteSchemaRevision(request, optionsOrCallback, callback) {
345
+ var _a;
346
+ request = request || {};
347
+ let options;
348
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
349
+ callback = optionsOrCallback;
350
+ options = {};
351
+ }
352
+ else {
353
+ options = optionsOrCallback;
354
+ }
355
+ options = options || {};
356
+ options.otherArgs = options.otherArgs || {};
357
+ options.otherArgs.headers = options.otherArgs.headers || {};
358
+ options.otherArgs.headers['x-goog-request-params'] =
359
+ this._gaxModule.routingHeader.fromParams({
360
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
361
+ });
362
+ this.initialize();
363
+ return this.innerApiCalls.deleteSchemaRevision(request, options, callback);
364
+ }
295
365
  deleteSchema(request, optionsOrCallback, callback) {
296
366
  var _a;
297
367
  request = request || {};
@@ -396,7 +466,7 @@ class SchemaServiceClient {
396
466
  * @param {object} [options]
397
467
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
398
468
  * @returns {Stream}
399
- * An object stream which emits an object representing [Schema]{@link google.pubsub.v1.Schema} on 'data' event.
469
+ * An object stream which emits an object representing {@link google.pubsub.v1.Schema | Schema} on 'data' event.
400
470
  * The client library will perform auto-pagination by default: it will call the API as many
401
471
  * times as needed. Note that it can affect your quota.
402
472
  * We recommend using `listSchemasAsync()`
@@ -444,7 +514,7 @@ class SchemaServiceClient {
444
514
  * @returns {Object}
445
515
  * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
446
516
  * When you iterate the returned iterable, each element will be an object representing
447
- * [Schema]{@link google.pubsub.v1.Schema}. The API will be called under the hood as needed, once per the page,
517
+ * {@link google.pubsub.v1.Schema | Schema}. The API will be called under the hood as needed, once per the page,
448
518
  * so you can stop the iteration when you don't need more results.
449
519
  * Please see the
450
520
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
@@ -465,6 +535,112 @@ class SchemaServiceClient {
465
535
  this.initialize();
466
536
  return this.descriptors.page.listSchemas.asyncIterate(this.innerApiCalls['listSchemas'], request, callSettings);
467
537
  }
538
+ listSchemaRevisions(request, optionsOrCallback, callback) {
539
+ var _a;
540
+ request = request || {};
541
+ let options;
542
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
543
+ callback = optionsOrCallback;
544
+ options = {};
545
+ }
546
+ else {
547
+ options = optionsOrCallback;
548
+ }
549
+ options = options || {};
550
+ options.otherArgs = options.otherArgs || {};
551
+ options.otherArgs.headers = options.otherArgs.headers || {};
552
+ options.otherArgs.headers['x-goog-request-params'] =
553
+ this._gaxModule.routingHeader.fromParams({
554
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
555
+ });
556
+ this.initialize();
557
+ return this.innerApiCalls.listSchemaRevisions(request, options, callback);
558
+ }
559
+ /**
560
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
561
+ * @param {Object} request
562
+ * The request object that will be sent.
563
+ * @param {string} request.name
564
+ * Required. The name of the schema to list revisions for.
565
+ * @param {google.pubsub.v1.SchemaView} request.view
566
+ * The set of Schema fields to return in the response. If not set, returns
567
+ * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
568
+ * retrieve all fields.
569
+ * @param {number} request.pageSize
570
+ * The maximum number of revisions to return per page.
571
+ * @param {string} request.pageToken
572
+ * The page token, received from a previous ListSchemaRevisions call.
573
+ * Provide this to retrieve the subsequent page.
574
+ * @param {object} [options]
575
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
576
+ * @returns {Stream}
577
+ * An object stream which emits an object representing {@link google.pubsub.v1.Schema | Schema} on 'data' event.
578
+ * The client library will perform auto-pagination by default: it will call the API as many
579
+ * times as needed. Note that it can affect your quota.
580
+ * We recommend using `listSchemaRevisionsAsync()`
581
+ * method described below for async iteration which you can stop as needed.
582
+ * Please see the
583
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
584
+ * for more details and examples.
585
+ */
586
+ listSchemaRevisionsStream(request, options) {
587
+ var _a;
588
+ request = request || {};
589
+ options = options || {};
590
+ options.otherArgs = options.otherArgs || {};
591
+ options.otherArgs.headers = options.otherArgs.headers || {};
592
+ options.otherArgs.headers['x-goog-request-params'] =
593
+ this._gaxModule.routingHeader.fromParams({
594
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
595
+ });
596
+ const defaultCallSettings = this._defaults['listSchemaRevisions'];
597
+ const callSettings = defaultCallSettings.merge(options);
598
+ this.initialize();
599
+ return this.descriptors.page.listSchemaRevisions.createStream(this.innerApiCalls.listSchemaRevisions, request, callSettings);
600
+ }
601
+ /**
602
+ * Equivalent to `listSchemaRevisions`, but returns an iterable object.
603
+ *
604
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
605
+ * @param {Object} request
606
+ * The request object that will be sent.
607
+ * @param {string} request.name
608
+ * Required. The name of the schema to list revisions for.
609
+ * @param {google.pubsub.v1.SchemaView} request.view
610
+ * The set of Schema fields to return in the response. If not set, returns
611
+ * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
612
+ * retrieve all fields.
613
+ * @param {number} request.pageSize
614
+ * The maximum number of revisions to return per page.
615
+ * @param {string} request.pageToken
616
+ * The page token, received from a previous ListSchemaRevisions call.
617
+ * Provide this to retrieve the subsequent page.
618
+ * @param {object} [options]
619
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
620
+ * @returns {Object}
621
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
622
+ * When you iterate the returned iterable, each element will be an object representing
623
+ * {@link google.pubsub.v1.Schema | Schema}. The API will be called under the hood as needed, once per the page,
624
+ * so you can stop the iteration when you don't need more results.
625
+ * Please see the
626
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
627
+ * for more details and examples.
628
+ */
629
+ listSchemaRevisionsAsync(request, options) {
630
+ var _a;
631
+ request = request || {};
632
+ options = options || {};
633
+ options.otherArgs = options.otherArgs || {};
634
+ options.otherArgs.headers = options.otherArgs.headers || {};
635
+ options.otherArgs.headers['x-goog-request-params'] =
636
+ this._gaxModule.routingHeader.fromParams({
637
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
638
+ });
639
+ const defaultCallSettings = this._defaults['listSchemaRevisions'];
640
+ const callSettings = defaultCallSettings.merge(options);
641
+ this.initialize();
642
+ return this.descriptors.page.listSchemaRevisions.asyncIterate(this.innerApiCalls['listSchemaRevisions'], request, callSettings);
643
+ }
468
644
  /**
469
645
  * Gets the access control policy for a resource. Returns an empty policy
470
646
  * if the resource exists and does not have a policy set.
@@ -478,16 +654,16 @@ class SchemaServiceClient {
478
654
  * OPTIONAL: A `GetPolicyOptions` object for specifying options to
479
655
  * `GetIamPolicy`. This field is only used by Cloud IAM.
480
656
  *
481
- * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions}
657
+ * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}.
482
658
  * @param {Object} [options]
483
659
  * Optional parameters. You can override the default settings for this call, e.g, timeout,
484
- * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
660
+ * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
485
661
  * @param {function(?Error, ?Object)} [callback]
486
662
  * The function which will be called with the result of the API call.
487
663
  *
488
- * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}.
664
+ * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}.
489
665
  * @returns {Promise} - The promise which resolves to an array.
490
- * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
666
+ * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}.
491
667
  * The promise has a method named "cancel" which cancels the ongoing API call.
492
668
  */
493
669
  getIamPolicy(request, options, callback) {
@@ -514,13 +690,13 @@ class SchemaServiceClient {
514
690
  * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
515
691
  * @param {Object} [options]
516
692
  * Optional parameters. You can override the default settings for this call, e.g, timeout,
517
- * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
693
+ * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
518
694
  * @param {function(?Error, ?Object)} [callback]
519
695
  * The function which will be called with the result of the API call.
520
696
  *
521
- * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
697
+ * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
522
698
  * @returns {Promise} - The promise which resolves to an array.
523
- * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
699
+ * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
524
700
  * The promise has a method named "cancel" which cancels the ongoing API call.
525
701
  */
526
702
  setIamPolicy(request, options, callback) {
@@ -547,13 +723,13 @@ class SchemaServiceClient {
547
723
  * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
548
724
  * @param {Object} [options]
549
725
  * Optional parameters. You can override the default settings for this call, e.g, timeout,
550
- * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
726
+ * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details.
551
727
  * @param {function(?Error, ?Object)} [callback]
552
728
  * The function which will be called with the result of the API call.
553
729
  *
554
- * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
730
+ * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
555
731
  * @returns {Promise} - The promise which resolves to an array.
556
- * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
732
+ * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}.
557
733
  * The promise has a method named "cancel" which cancels the ongoing API call.
558
734
  *
559
735
  */