@google-cloud/discoveryengine 0.1.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 (32) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +202 -0
  3. package/README.md +209 -0
  4. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +93 -0
  5. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +77 -0
  6. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +261 -0
  7. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +265 -0
  8. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +182 -0
  9. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +453 -0
  10. package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +122 -0
  11. package/build/protos/protos.d.ts +10120 -0
  12. package/build/protos/protos.js +26118 -0
  13. package/build/protos/protos.json +2682 -0
  14. package/build/src/index.d.ts +17 -0
  15. package/build/src/index.js +37 -0
  16. package/build/src/index.js.map +1 -0
  17. package/build/src/v1beta/document_service_client.d.ts +684 -0
  18. package/build/src/v1beta/document_service_client.js +830 -0
  19. package/build/src/v1beta/document_service_client.js.map +1 -0
  20. package/build/src/v1beta/document_service_client_config.json +77 -0
  21. package/build/src/v1beta/index.d.ts +3 -0
  22. package/build/src/v1beta/index.js +27 -0
  23. package/build/src/v1beta/index.js.map +1 -0
  24. package/build/src/v1beta/recommendation_service_client.d.ts +307 -0
  25. package/build/src/v1beta/recommendation_service_client.js +407 -0
  26. package/build/src/v1beta/recommendation_service_client.js.map +1 -0
  27. package/build/src/v1beta/recommendation_service_client_config.json +43 -0
  28. package/build/src/v1beta/user_event_service_client.d.ts +445 -0
  29. package/build/src/v1beta/user_event_service_client.js +628 -0
  30. package/build/src/v1beta/user_event_service_client.js.map +1 -0
  31. package/build/src/v1beta/user_event_service_client_config.json +62 -0
  32. package/package.json +66 -0
@@ -0,0 +1,684 @@
1
+ /// <reference types="node" />
2
+ import type * as gax from 'google-gax';
3
+ import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax';
4
+ import { Transform } from 'stream';
5
+ import * as protos from '../../protos/protos';
6
+ /**
7
+ * Service for ingesting
8
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document} information of the
9
+ * customer's website.
10
+ * @class
11
+ * @memberof v1beta
12
+ */
13
+ export declare class DocumentServiceClient {
14
+ private _terminated;
15
+ private _opts;
16
+ private _providedCustomServicePath;
17
+ private _gaxModule;
18
+ private _gaxGrpc;
19
+ private _protos;
20
+ private _defaults;
21
+ auth: gax.GoogleAuth;
22
+ descriptors: Descriptors;
23
+ warn: (code: string, message: string, warnType?: string) => void;
24
+ innerApiCalls: {
25
+ [name: string]: Function;
26
+ };
27
+ pathTemplates: {
28
+ [name: string]: gax.PathTemplate;
29
+ };
30
+ operationsClient: gax.OperationsClient;
31
+ documentServiceStub?: Promise<{
32
+ [name: string]: Function;
33
+ }>;
34
+ /**
35
+ * Construct an instance of DocumentServiceClient.
36
+ *
37
+ * @param {object} [options] - The configuration object.
38
+ * The options accepted by the constructor are described in detail
39
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
40
+ * The common options are:
41
+ * @param {object} [options.credentials] - Credentials object.
42
+ * @param {string} [options.credentials.client_email]
43
+ * @param {string} [options.credentials.private_key]
44
+ * @param {string} [options.email] - Account email address. Required when
45
+ * using a .pem or .p12 keyFilename.
46
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
47
+ * .p12 key downloaded from the Google Developers Console. If you provide
48
+ * a path to a JSON file, the projectId option below is not necessary.
49
+ * NOTE: .pem and .p12 require you to specify options.email as well.
50
+ * @param {number} [options.port] - The port on which to connect to
51
+ * the remote host.
52
+ * @param {string} [options.projectId] - The project ID from the Google
53
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
54
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
55
+ * app is running in an environment which supports
56
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
57
+ * your project ID will be detected automatically.
58
+ * @param {string} [options.apiEndpoint] - The domain name of the
59
+ * API remote host.
60
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
61
+ * Follows the structure of {@link gapicConfig}.
62
+ * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
63
+ * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
64
+ * For more information, please check the
65
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
66
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
67
+ * need to avoid loading the default gRPC version and want to use the fallback
68
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
69
+ * ```
70
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
71
+ * const client = new DocumentServiceClient({fallback: 'rest'}, gax);
72
+ * ```
73
+ */
74
+ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
75
+ /**
76
+ * Initialize the client.
77
+ * Performs asynchronous operations (such as authentication) and prepares the client.
78
+ * This function will be called automatically when any class method is called for the
79
+ * first time, but if you need to initialize it before calling an actual method,
80
+ * feel free to call initialize() directly.
81
+ *
82
+ * You can await on this method if you want to make sure the client is initialized.
83
+ *
84
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
85
+ */
86
+ initialize(): Promise<{
87
+ [name: string]: Function;
88
+ }>;
89
+ /**
90
+ * The DNS address for this API service.
91
+ * @returns {string} The DNS address for this service.
92
+ */
93
+ static get servicePath(): string;
94
+ /**
95
+ * The DNS address for this API service - same as servicePath(),
96
+ * exists for compatibility reasons.
97
+ * @returns {string} The DNS address for this service.
98
+ */
99
+ static get apiEndpoint(): string;
100
+ /**
101
+ * The port for this API service.
102
+ * @returns {number} The default port for this service.
103
+ */
104
+ static get port(): number;
105
+ /**
106
+ * The scopes needed to make gRPC calls for every method defined
107
+ * in this service.
108
+ * @returns {string[]} List of default scopes.
109
+ */
110
+ static get scopes(): string[];
111
+ getProjectId(): Promise<string>;
112
+ getProjectId(callback: Callback<string, undefined, undefined>): void;
113
+ /**
114
+ * Gets a {@link google.cloud.discoveryengine.v1beta.Document|Document}.
115
+ *
116
+ * @param {Object} request
117
+ * The request object that will be sent.
118
+ * @param {string} request.name
119
+ * Required. Full resource name of
120
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, such as
121
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
122
+ *
123
+ * If the caller does not have permission to access the
124
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, regardless of
125
+ * whether or not it exists, a PERMISSION_DENIED error is returned.
126
+ *
127
+ * If the requested {@link google.cloud.discoveryengine.v1beta.Document|Document}
128
+ * does not exist, a NOT_FOUND error is returned.
129
+ * @param {object} [options]
130
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
131
+ * @returns {Promise} - The promise which resolves to an array.
132
+ * The first element of the array is an object representing [Document]{@link google.cloud.discoveryengine.v1beta.Document}.
133
+ * Please see the
134
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
135
+ * for more details and examples.
136
+ * @example <caption>include:samples/generated/v1beta/document_service.get_document.js</caption>
137
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_GetDocument_async
138
+ */
139
+ getDocument(request?: protos.google.cloud.discoveryengine.v1beta.IGetDocumentRequest, options?: CallOptions): Promise<[
140
+ protos.google.cloud.discoveryengine.v1beta.IDocument,
141
+ (protos.google.cloud.discoveryengine.v1beta.IGetDocumentRequest | undefined),
142
+ {} | undefined
143
+ ]>;
144
+ getDocument(request: protos.google.cloud.discoveryengine.v1beta.IGetDocumentRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IDocument, protos.google.cloud.discoveryengine.v1beta.IGetDocumentRequest | null | undefined, {} | null | undefined>): void;
145
+ getDocument(request: protos.google.cloud.discoveryengine.v1beta.IGetDocumentRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IDocument, protos.google.cloud.discoveryengine.v1beta.IGetDocumentRequest | null | undefined, {} | null | undefined>): void;
146
+ /**
147
+ * Creates a {@link google.cloud.discoveryengine.v1beta.Document|Document}.
148
+ *
149
+ * @param {Object} request
150
+ * The request object that will be sent.
151
+ * @param {string} request.parent
152
+ * Required. The parent resource name, such as
153
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
154
+ * @param {google.cloud.discoveryengine.v1beta.Document} request.document
155
+ * Required. The {@link google.cloud.discoveryengine.v1beta.Document|Document} to
156
+ * create.
157
+ * @param {string} request.documentId
158
+ * Required. The ID to use for the
159
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, which will become
160
+ * the final component of the
161
+ * {@link google.cloud.discoveryengine.v1beta.Document.name|Document.name}.
162
+ *
163
+ * If the caller does not have permission to create the
164
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, regardless of
165
+ * whether or not it exists, a PERMISSION_DENIED error is returned.
166
+ *
167
+ * This field must be unique among all
168
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}s with the same
169
+ * {@link google.cloud.discoveryengine.v1beta.CreateDocumentRequest.parent|parent}.
170
+ * Otherwise, an ALREADY_EXISTS error is returned.
171
+ *
172
+ * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
173
+ * standard with a length limit of 63 characters. Otherwise, an
174
+ * INVALID_ARGUMENT error is returned.
175
+ * @param {object} [options]
176
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
177
+ * @returns {Promise} - The promise which resolves to an array.
178
+ * The first element of the array is an object representing [Document]{@link google.cloud.discoveryengine.v1beta.Document}.
179
+ * Please see the
180
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
181
+ * for more details and examples.
182
+ * @example <caption>include:samples/generated/v1beta/document_service.create_document.js</caption>
183
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_CreateDocument_async
184
+ */
185
+ createDocument(request?: protos.google.cloud.discoveryengine.v1beta.ICreateDocumentRequest, options?: CallOptions): Promise<[
186
+ protos.google.cloud.discoveryengine.v1beta.IDocument,
187
+ (protos.google.cloud.discoveryengine.v1beta.ICreateDocumentRequest | undefined),
188
+ {} | undefined
189
+ ]>;
190
+ createDocument(request: protos.google.cloud.discoveryengine.v1beta.ICreateDocumentRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IDocument, protos.google.cloud.discoveryengine.v1beta.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void;
191
+ createDocument(request: protos.google.cloud.discoveryengine.v1beta.ICreateDocumentRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IDocument, protos.google.cloud.discoveryengine.v1beta.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void;
192
+ /**
193
+ * Updates a {@link google.cloud.discoveryengine.v1beta.Document|Document}.
194
+ *
195
+ * @param {Object} request
196
+ * The request object that will be sent.
197
+ * @param {google.cloud.discoveryengine.v1beta.Document} request.document
198
+ * Required. The document to update/create.
199
+ *
200
+ * If the caller does not have permission to update the
201
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, regardless of
202
+ * whether or not it exists, a PERMISSION_DENIED error is returned.
203
+ *
204
+ * If the {@link google.cloud.discoveryengine.v1beta.Document|Document} to update
205
+ * does not exist and
206
+ * {@link google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing|allow_missing}
207
+ * is not set, a NOT_FOUND error is returned.
208
+ * @param {boolean} request.allowMissing
209
+ * If set to true, and the
210
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document} is not found, a
211
+ * new {@link google.cloud.discoveryengine.v1beta.Document|Document} will be
212
+ * created.
213
+ * @param {object} [options]
214
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
215
+ * @returns {Promise} - The promise which resolves to an array.
216
+ * The first element of the array is an object representing [Document]{@link google.cloud.discoveryengine.v1beta.Document}.
217
+ * Please see the
218
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
219
+ * for more details and examples.
220
+ * @example <caption>include:samples/generated/v1beta/document_service.update_document.js</caption>
221
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_UpdateDocument_async
222
+ */
223
+ updateDocument(request?: protos.google.cloud.discoveryengine.v1beta.IUpdateDocumentRequest, options?: CallOptions): Promise<[
224
+ protos.google.cloud.discoveryengine.v1beta.IDocument,
225
+ (protos.google.cloud.discoveryengine.v1beta.IUpdateDocumentRequest | undefined),
226
+ {} | undefined
227
+ ]>;
228
+ updateDocument(request: protos.google.cloud.discoveryengine.v1beta.IUpdateDocumentRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IDocument, protos.google.cloud.discoveryengine.v1beta.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void;
229
+ updateDocument(request: protos.google.cloud.discoveryengine.v1beta.IUpdateDocumentRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IDocument, protos.google.cloud.discoveryengine.v1beta.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void;
230
+ /**
231
+ * Deletes a {@link google.cloud.discoveryengine.v1beta.Document|Document}.
232
+ *
233
+ * @param {Object} request
234
+ * The request object that will be sent.
235
+ * @param {string} request.name
236
+ * Required. Full resource name of
237
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, such as
238
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
239
+ *
240
+ * If the caller does not have permission to delete the
241
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}, regardless of
242
+ * whether or not it exists, a PERMISSION_DENIED error is returned.
243
+ *
244
+ * If the {@link google.cloud.discoveryengine.v1beta.Document|Document} to delete
245
+ * does not exist, a NOT_FOUND error is returned.
246
+ * @param {object} [options]
247
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
248
+ * @returns {Promise} - The promise which resolves to an array.
249
+ * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
250
+ * Please see the
251
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
252
+ * for more details and examples.
253
+ * @example <caption>include:samples/generated/v1beta/document_service.delete_document.js</caption>
254
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_DeleteDocument_async
255
+ */
256
+ deleteDocument(request?: protos.google.cloud.discoveryengine.v1beta.IDeleteDocumentRequest, options?: CallOptions): Promise<[
257
+ protos.google.protobuf.IEmpty,
258
+ (protos.google.cloud.discoveryengine.v1beta.IDeleteDocumentRequest | undefined),
259
+ {} | undefined
260
+ ]>;
261
+ deleteDocument(request: protos.google.cloud.discoveryengine.v1beta.IDeleteDocumentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.discoveryengine.v1beta.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void;
262
+ deleteDocument(request: protos.google.cloud.discoveryengine.v1beta.IDeleteDocumentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.discoveryengine.v1beta.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void;
263
+ /**
264
+ * Bulk import of multiple
265
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}s. Request
266
+ * processing may be synchronous. Non-existing items will be created.
267
+ *
268
+ * Note: It is possible for a subset of the
269
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}s to be
270
+ * successfully updated.
271
+ *
272
+ * @param {Object} request
273
+ * The request object that will be sent.
274
+ * @param {google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.InlineSource} request.inlineSource
275
+ * The Inline source for the input content for documents.
276
+ * @param {google.cloud.discoveryengine.v1beta.GcsSource} request.gcsSource
277
+ * Google Cloud Storage location for the input content.
278
+ * @param {google.cloud.discoveryengine.v1beta.BigQuerySource} request.bigquerySource
279
+ * BigQuery input source.
280
+ * @param {string} request.parent
281
+ * Required. The parent branch resource name, such as
282
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
283
+ * Requires create/update permission.
284
+ * @param {google.cloud.discoveryengine.v1beta.ImportErrorConfig} request.errorConfig
285
+ * The desired location of errors incurred during the Import.
286
+ * @param {google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode} request.reconciliationMode
287
+ * The mode of reconciliation between existing documents and the documents to
288
+ * be imported. Defaults to
289
+ * {@link google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL|ReconciliationMode.INCREMENTAL}.
290
+ * @param {object} [options]
291
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
292
+ * @returns {Promise} - The promise which resolves to an array.
293
+ * The first element of the array is an object representing
294
+ * a long running operation. Its `promise()` method returns a promise
295
+ * you can `await` for.
296
+ * Please see the
297
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
298
+ * for more details and examples.
299
+ * @example <caption>include:samples/generated/v1beta/document_service.import_documents.js</caption>
300
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_ImportDocuments_async
301
+ */
302
+ importDocuments(request?: protos.google.cloud.discoveryengine.v1beta.IImportDocumentsRequest, options?: CallOptions): Promise<[
303
+ LROperation<protos.google.cloud.discoveryengine.v1beta.IImportDocumentsResponse, protos.google.cloud.discoveryengine.v1beta.IImportDocumentsMetadata>,
304
+ protos.google.longrunning.IOperation | undefined,
305
+ {} | undefined
306
+ ]>;
307
+ importDocuments(request: protos.google.cloud.discoveryengine.v1beta.IImportDocumentsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.discoveryengine.v1beta.IImportDocumentsResponse, protos.google.cloud.discoveryengine.v1beta.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
308
+ importDocuments(request: protos.google.cloud.discoveryengine.v1beta.IImportDocumentsRequest, callback: Callback<LROperation<protos.google.cloud.discoveryengine.v1beta.IImportDocumentsResponse, protos.google.cloud.discoveryengine.v1beta.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
309
+ /**
310
+ * Check the status of the long running operation returned by `importDocuments()`.
311
+ * @param {String} name
312
+ * The operation name that will be passed.
313
+ * @returns {Promise} - The promise which resolves to an object.
314
+ * The decoded operation object has result and metadata field to get information from.
315
+ * Please see the
316
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
317
+ * for more details and examples.
318
+ * @example <caption>include:samples/generated/v1beta/document_service.import_documents.js</caption>
319
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_ImportDocuments_async
320
+ */
321
+ checkImportDocumentsProgress(name: string): Promise<LROperation<protos.google.cloud.discoveryengine.v1beta.ImportDocumentsResponse, protos.google.cloud.discoveryengine.v1beta.ImportDocumentsMetadata>>;
322
+ /**
323
+ * Gets a list of {@link google.cloud.discoveryengine.v1beta.Document|Document}s.
324
+ *
325
+ * @param {Object} request
326
+ * The request object that will be sent.
327
+ * @param {string} request.parent
328
+ * Required. The parent branch resource name, such as
329
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
330
+ * Use `default_branch` as the branch ID, to list documents under the default
331
+ * branch.
332
+ *
333
+ * If the caller does not have permission to list {@link |Documents}s under this
334
+ * branch, regardless of whether or not this branch exists, a
335
+ * PERMISSION_DENIED error is returned.
336
+ * @param {number} request.pageSize
337
+ * Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
338
+ * to return. If unspecified, defaults to 100. The maximum allowed value is
339
+ * 1000. Values above 1000 will be coerced to 1000.
340
+ *
341
+ * If this field is negative, an INVALID_ARGUMENT error is returned.
342
+ * @param {string} request.pageToken
343
+ * A page token
344
+ * {@link google.cloud.discoveryengine.v1beta.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token},
345
+ * received from a previous
346
+ * {@link google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments|DocumentService.ListDocuments}
347
+ * call. Provide this to retrieve the subsequent page.
348
+ *
349
+ * When paginating, all other parameters provided to
350
+ * {@link google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments|DocumentService.ListDocuments}
351
+ * must match the call that provided the page token. Otherwise, an
352
+ * INVALID_ARGUMENT error is returned.
353
+ * @param {object} [options]
354
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
355
+ * @returns {Promise} - The promise which resolves to an array.
356
+ * The first element of the array is Array of [Document]{@link google.cloud.discoveryengine.v1beta.Document}.
357
+ * The client library will perform auto-pagination by default: it will call the API as many
358
+ * times as needed and will merge results from all the pages into this array.
359
+ * Note that it can affect your quota.
360
+ * We recommend using `listDocumentsAsync()`
361
+ * method described below for async iteration which you can stop as needed.
362
+ * Please see the
363
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
364
+ * for more details and examples.
365
+ */
366
+ listDocuments(request?: protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, options?: CallOptions): Promise<[
367
+ protos.google.cloud.discoveryengine.v1beta.IDocument[],
368
+ protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest | null,
369
+ protos.google.cloud.discoveryengine.v1beta.IListDocumentsResponse
370
+ ]>;
371
+ listDocuments(request: protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, protos.google.cloud.discoveryengine.v1beta.IListDocumentsResponse | null | undefined, protos.google.cloud.discoveryengine.v1beta.IDocument>): void;
372
+ listDocuments(request: protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, callback: PaginationCallback<protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, protos.google.cloud.discoveryengine.v1beta.IListDocumentsResponse | null | undefined, protos.google.cloud.discoveryengine.v1beta.IDocument>): void;
373
+ /**
374
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
375
+ * @param {Object} request
376
+ * The request object that will be sent.
377
+ * @param {string} request.parent
378
+ * Required. The parent branch resource name, such as
379
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
380
+ * Use `default_branch` as the branch ID, to list documents under the default
381
+ * branch.
382
+ *
383
+ * If the caller does not have permission to list {@link |Documents}s under this
384
+ * branch, regardless of whether or not this branch exists, a
385
+ * PERMISSION_DENIED error is returned.
386
+ * @param {number} request.pageSize
387
+ * Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
388
+ * to return. If unspecified, defaults to 100. The maximum allowed value is
389
+ * 1000. Values above 1000 will be coerced to 1000.
390
+ *
391
+ * If this field is negative, an INVALID_ARGUMENT error is returned.
392
+ * @param {string} request.pageToken
393
+ * A page token
394
+ * {@link google.cloud.discoveryengine.v1beta.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token},
395
+ * received from a previous
396
+ * {@link google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments|DocumentService.ListDocuments}
397
+ * call. Provide this to retrieve the subsequent page.
398
+ *
399
+ * When paginating, all other parameters provided to
400
+ * {@link google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments|DocumentService.ListDocuments}
401
+ * must match the call that provided the page token. Otherwise, an
402
+ * INVALID_ARGUMENT error is returned.
403
+ * @param {object} [options]
404
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
405
+ * @returns {Stream}
406
+ * An object stream which emits an object representing [Document]{@link google.cloud.discoveryengine.v1beta.Document} on 'data' event.
407
+ * The client library will perform auto-pagination by default: it will call the API as many
408
+ * times as needed. Note that it can affect your quota.
409
+ * We recommend using `listDocumentsAsync()`
410
+ * method described below for async iteration which you can stop as needed.
411
+ * Please see the
412
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
413
+ * for more details and examples.
414
+ */
415
+ listDocumentsStream(request?: protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, options?: CallOptions): Transform;
416
+ /**
417
+ * Equivalent to `listDocuments`, but returns an iterable object.
418
+ *
419
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
420
+ * @param {Object} request
421
+ * The request object that will be sent.
422
+ * @param {string} request.parent
423
+ * Required. The parent branch resource name, such as
424
+ * `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
425
+ * Use `default_branch` as the branch ID, to list documents under the default
426
+ * branch.
427
+ *
428
+ * If the caller does not have permission to list {@link |Documents}s under this
429
+ * branch, regardless of whether or not this branch exists, a
430
+ * PERMISSION_DENIED error is returned.
431
+ * @param {number} request.pageSize
432
+ * Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
433
+ * to return. If unspecified, defaults to 100. The maximum allowed value is
434
+ * 1000. Values above 1000 will be coerced to 1000.
435
+ *
436
+ * If this field is negative, an INVALID_ARGUMENT error is returned.
437
+ * @param {string} request.pageToken
438
+ * A page token
439
+ * {@link google.cloud.discoveryengine.v1beta.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token},
440
+ * received from a previous
441
+ * {@link google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments|DocumentService.ListDocuments}
442
+ * call. Provide this to retrieve the subsequent page.
443
+ *
444
+ * When paginating, all other parameters provided to
445
+ * {@link google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments|DocumentService.ListDocuments}
446
+ * must match the call that provided the page token. Otherwise, an
447
+ * INVALID_ARGUMENT error is returned.
448
+ * @param {object} [options]
449
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
450
+ * @returns {Object}
451
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
452
+ * When you iterate the returned iterable, each element will be an object representing
453
+ * [Document]{@link google.cloud.discoveryengine.v1beta.Document}. The API will be called under the hood as needed, once per the page,
454
+ * so you can stop the iteration when you don't need more results.
455
+ * Please see the
456
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
457
+ * for more details and examples.
458
+ * @example <caption>include:samples/generated/v1beta/document_service.list_documents.js</caption>
459
+ * region_tag:discoveryengine_v1beta_generated_DocumentService_ListDocuments_async
460
+ */
461
+ listDocumentsAsync(request?: protos.google.cloud.discoveryengine.v1beta.IListDocumentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1beta.IDocument>;
462
+ /**
463
+ * Gets the latest state of a long-running operation. Clients can use this
464
+ * method to poll the operation result at intervals as recommended by the API
465
+ * service.
466
+ *
467
+ * @param {Object} request - The request object that will be sent.
468
+ * @param {string} request.name - The name of the operation resource.
469
+ * @param {Object=} options
470
+ * Optional parameters. You can override the default settings for this call,
471
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
472
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
473
+ * details.
474
+ * @param {function(?Error, ?Object)=} callback
475
+ * The function which will be called with the result of the API call.
476
+ *
477
+ * The second parameter to the callback is an object representing
478
+ * [google.longrunning.Operation]{@link
479
+ * external:"google.longrunning.Operation"}.
480
+ * @return {Promise} - The promise which resolves to an array.
481
+ * The first element of the array is an object representing
482
+ * [google.longrunning.Operation]{@link
483
+ * external:"google.longrunning.Operation"}. The promise has a method named
484
+ * "cancel" which cancels the ongoing API call.
485
+ *
486
+ * @example
487
+ * ```
488
+ * const client = longrunning.operationsClient();
489
+ * const name = '';
490
+ * const [response] = await client.getOperation({name});
491
+ * // doThingsWith(response)
492
+ * ```
493
+ */
494
+ getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
495
+ /**
496
+ * Lists operations that match the specified filter in the request. If the
497
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
498
+ *
499
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
500
+ *
501
+ * @param {Object} request - The request object that will be sent.
502
+ * @param {string} request.name - The name of the operation collection.
503
+ * @param {string} request.filter - The standard list filter.
504
+ * @param {number=} request.pageSize -
505
+ * The maximum number of resources contained in the underlying API
506
+ * response. If page streaming is performed per-resource, this
507
+ * parameter does not affect the return value. If page streaming is
508
+ * performed per-page, this determines the maximum number of
509
+ * resources in a page.
510
+ * @param {Object=} options
511
+ * Optional parameters. You can override the default settings for this call,
512
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
513
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
514
+ * details.
515
+ * @returns {Object}
516
+ * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
517
+ *
518
+ * @example
519
+ * ```
520
+ * const client = longrunning.operationsClient();
521
+ * for await (const response of client.listOperationsAsync(request));
522
+ * // doThingsWith(response)
523
+ * ```
524
+ */
525
+ listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
526
+ /**
527
+ * Starts asynchronous cancellation on a long-running operation. The server
528
+ * makes a best effort to cancel the operation, but success is not
529
+ * guaranteed. If the server doesn't support this method, it returns
530
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
531
+ * {@link Operations.GetOperation} or
532
+ * other methods to check whether the cancellation succeeded or whether the
533
+ * operation completed despite cancellation. On successful cancellation,
534
+ * the operation is not deleted; instead, it becomes an operation with
535
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
536
+ * 1, corresponding to `Code.CANCELLED`.
537
+ *
538
+ * @param {Object} request - The request object that will be sent.
539
+ * @param {string} request.name - The name of the operation resource to be cancelled.
540
+ * @param {Object=} options
541
+ * Optional parameters. You can override the default settings for this call,
542
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
543
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
544
+ * details.
545
+ * @param {function(?Error)=} callback
546
+ * The function which will be called with the result of the API call.
547
+ * @return {Promise} - The promise which resolves when API call finishes.
548
+ * The promise has a method named "cancel" which cancels the ongoing API
549
+ * call.
550
+ *
551
+ * @example
552
+ * ```
553
+ * const client = longrunning.operationsClient();
554
+ * await client.cancelOperation({name: ''});
555
+ * ```
556
+ */
557
+ cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
558
+ /**
559
+ * Deletes a long-running operation. This method indicates that the client is
560
+ * no longer interested in the operation result. It does not cancel the
561
+ * operation. If the server doesn't support this method, it returns
562
+ * `google.rpc.Code.UNIMPLEMENTED`.
563
+ *
564
+ * @param {Object} request - The request object that will be sent.
565
+ * @param {string} request.name - The name of the operation resource to be deleted.
566
+ * @param {Object=} options
567
+ * Optional parameters. You can override the default settings for this call,
568
+ * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
569
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
570
+ * details.
571
+ * @param {function(?Error)=} callback
572
+ * The function which will be called with the result of the API call.
573
+ * @return {Promise} - The promise which resolves when API call finishes.
574
+ * The promise has a method named "cancel" which cancels the ongoing API
575
+ * call.
576
+ *
577
+ * @example
578
+ * ```
579
+ * const client = longrunning.operationsClient();
580
+ * await client.deleteOperation({name: ''});
581
+ * ```
582
+ */
583
+ deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
584
+ /**
585
+ * Return a fully-qualified branch resource name string.
586
+ *
587
+ * @param {string} project
588
+ * @param {string} location
589
+ * @param {string} data_store
590
+ * @param {string} branch
591
+ * @returns {string} Resource name string.
592
+ */
593
+ branchPath(project: string, location: string, dataStore: string, branch: string): string;
594
+ /**
595
+ * Parse the project from Branch resource.
596
+ *
597
+ * @param {string} branchName
598
+ * A fully-qualified path representing Branch resource.
599
+ * @returns {string} A string representing the project.
600
+ */
601
+ matchProjectFromBranchName(branchName: string): string | number;
602
+ /**
603
+ * Parse the location from Branch resource.
604
+ *
605
+ * @param {string} branchName
606
+ * A fully-qualified path representing Branch resource.
607
+ * @returns {string} A string representing the location.
608
+ */
609
+ matchLocationFromBranchName(branchName: string): string | number;
610
+ /**
611
+ * Parse the data_store from Branch resource.
612
+ *
613
+ * @param {string} branchName
614
+ * A fully-qualified path representing Branch resource.
615
+ * @returns {string} A string representing the data_store.
616
+ */
617
+ matchDataStoreFromBranchName(branchName: string): string | number;
618
+ /**
619
+ * Parse the branch from Branch resource.
620
+ *
621
+ * @param {string} branchName
622
+ * A fully-qualified path representing Branch resource.
623
+ * @returns {string} A string representing the branch.
624
+ */
625
+ matchBranchFromBranchName(branchName: string): string | number;
626
+ /**
627
+ * Return a fully-qualified document resource name string.
628
+ *
629
+ * @param {string} project
630
+ * @param {string} location
631
+ * @param {string} data_store
632
+ * @param {string} branch
633
+ * @param {string} document
634
+ * @returns {string} Resource name string.
635
+ */
636
+ documentPath(project: string, location: string, dataStore: string, branch: string, document: string): string;
637
+ /**
638
+ * Parse the project from Document resource.
639
+ *
640
+ * @param {string} documentName
641
+ * A fully-qualified path representing Document resource.
642
+ * @returns {string} A string representing the project.
643
+ */
644
+ matchProjectFromDocumentName(documentName: string): string | number;
645
+ /**
646
+ * Parse the location from Document resource.
647
+ *
648
+ * @param {string} documentName
649
+ * A fully-qualified path representing Document resource.
650
+ * @returns {string} A string representing the location.
651
+ */
652
+ matchLocationFromDocumentName(documentName: string): string | number;
653
+ /**
654
+ * Parse the data_store from Document resource.
655
+ *
656
+ * @param {string} documentName
657
+ * A fully-qualified path representing Document resource.
658
+ * @returns {string} A string representing the data_store.
659
+ */
660
+ matchDataStoreFromDocumentName(documentName: string): string | number;
661
+ /**
662
+ * Parse the branch from Document resource.
663
+ *
664
+ * @param {string} documentName
665
+ * A fully-qualified path representing Document resource.
666
+ * @returns {string} A string representing the branch.
667
+ */
668
+ matchBranchFromDocumentName(documentName: string): string | number;
669
+ /**
670
+ * Parse the document from Document resource.
671
+ *
672
+ * @param {string} documentName
673
+ * A fully-qualified path representing Document resource.
674
+ * @returns {string} A string representing the document.
675
+ */
676
+ matchDocumentFromDocumentName(documentName: string): string | number;
677
+ /**
678
+ * Terminate the gRPC channel and close the client.
679
+ *
680
+ * The client will no longer be usable and all future behavior is undefined.
681
+ * @returns {Promise} A promise that resolves when the client is closed.
682
+ */
683
+ close(): Promise<void>;
684
+ }