xref: /aosp_15_r20/external/googleapis/google/cloud/dialogflow/v2beta1/document.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.dialogflow.v2beta1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/dialogflow/v2beta1/gcs.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/protobuf/timestamp.proto";
28import "google/rpc/status.proto";
29
30option cc_enable_arenas = true;
31option csharp_namespace = "Google.Cloud.Dialogflow.V2Beta1";
32option go_package = "cloud.google.com/go/dialogflow/apiv2beta1/dialogflowpb;dialogflowpb";
33option java_multiple_files = true;
34option java_outer_classname = "DocumentProto";
35option java_package = "com.google.cloud.dialogflow.v2beta1";
36option objc_class_prefix = "DF";
37
38// Service for managing knowledge
39// [Documents][google.cloud.dialogflow.v2beta1.Document].
40service Documents {
41  option (google.api.default_host) = "dialogflow.googleapis.com";
42  option (google.api.oauth_scopes) =
43      "https://www.googleapis.com/auth/cloud-platform,"
44      "https://www.googleapis.com/auth/dialogflow";
45
46  // Returns the list of all documents of the knowledge base.
47  //
48  // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
49  // only use `projects.knowledgeBases.documents`.
50  rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
51    option (google.api.http) = {
52      get: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents"
53      additional_bindings {
54        get: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents"
55      }
56      additional_bindings {
57        get: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents"
58      }
59    };
60    option (google.api.method_signature) = "parent";
61  }
62
63  // Retrieves the specified document.
64  //
65  // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
66  // only use `projects.knowledgeBases.documents`.
67  rpc GetDocument(GetDocumentRequest) returns (Document) {
68    option (google.api.http) = {
69      get: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}"
70      additional_bindings {
71        get: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}"
72      }
73      additional_bindings {
74        get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}"
75      }
76    };
77    option (google.api.method_signature) = "name";
78  }
79
80  // Creates a new document.
81  //
82  // This method is a [long-running
83  // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
84  // The returned `Operation` type has the following method-specific fields:
85  //
86  // - `metadata`:
87  // [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]
88  // - `response`: [Document][google.cloud.dialogflow.v2beta1.Document]
89  //
90  // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
91  // only use `projects.knowledgeBases.documents`.
92  rpc CreateDocument(CreateDocumentRequest)
93      returns (google.longrunning.Operation) {
94    option (google.api.http) = {
95      post: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents"
96      body: "document"
97      additional_bindings {
98        post: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents"
99        body: "document"
100      }
101      additional_bindings {
102        post: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents"
103        body: "document"
104      }
105    };
106    option (google.api.method_signature) = "parent,document";
107    option (google.longrunning.operation_info) = {
108      response_type: "Document"
109      metadata_type: "KnowledgeOperationMetadata"
110    };
111  }
112
113  // Create documents by importing data from external sources.
114  // Dialogflow supports up to 350 documents in each request. If you try to
115  // import more, Dialogflow will return an error.
116  //
117  // This method is a [long-running
118  // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
119  // The returned `Operation` type has the following method-specific fields:
120  //
121  // - `metadata`:
122  // [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]
123  // - `response`:
124  // [ImportDocumentsResponse][google.cloud.dialogflow.v2beta1.ImportDocumentsResponse]
125  rpc ImportDocuments(ImportDocumentsRequest)
126      returns (google.longrunning.Operation) {
127    option (google.api.http) = {
128      post: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents:import"
129      body: "*"
130      additional_bindings {
131        post: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import"
132        body: "*"
133      }
134    };
135    option (google.longrunning.operation_info) = {
136      response_type: "ImportDocumentsResponse"
137      metadata_type: "KnowledgeOperationMetadata"
138    };
139  }
140
141  // Deletes the specified document.
142  //
143  // This method is a [long-running
144  // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
145  // The returned `Operation` type has the following method-specific fields:
146  //
147  // - `metadata`:
148  // [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]
149  // - `response`: An [Empty
150  //   message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
151  //
152  // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
153  // only use `projects.knowledgeBases.documents`.
154  rpc DeleteDocument(DeleteDocumentRequest)
155      returns (google.longrunning.Operation) {
156    option (google.api.http) = {
157      delete: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}"
158      additional_bindings {
159        delete: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}"
160      }
161      additional_bindings {
162        delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}"
163      }
164    };
165    option (google.api.method_signature) = "name";
166    option (google.longrunning.operation_info) = {
167      response_type: "google.protobuf.Empty"
168      metadata_type: "KnowledgeOperationMetadata"
169    };
170  }
171
172  // Updates the specified document.
173  //
174  // This method is a [long-running
175  // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
176  // The returned `Operation` type has the following method-specific fields:
177  //
178  // - `metadata`:
179  // [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]
180  // - `response`: [Document][google.cloud.dialogflow.v2beta1.Document]
181  //
182  // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
183  // only use `projects.knowledgeBases.documents`.
184  rpc UpdateDocument(UpdateDocumentRequest)
185      returns (google.longrunning.Operation) {
186    option (google.api.http) = {
187      patch: "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}"
188      body: "document"
189      additional_bindings {
190        patch: "/v2beta1/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}"
191        body: "document"
192      }
193      additional_bindings {
194        patch: "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}"
195        body: "document"
196      }
197    };
198    option (google.api.method_signature) = "document,update_mask";
199    option (google.api.method_signature) = "document";
200    option (google.longrunning.operation_info) = {
201      response_type: "Document"
202      metadata_type: "KnowledgeOperationMetadata"
203    };
204  }
205
206  // Reloads the specified document from its specified source, content_uri or
207  // content. The previously loaded content of the document will be deleted.
208  // Note: Even when the content of the document has not changed, there still
209  // may be side effects because of internal implementation changes.
210  // Note: If the document source is Google Cloud Storage URI, its metadata will
211  // be replaced with the custom metadata from Google Cloud Storage if the
212  // `import_gcs_custom_metadata` field is set to true in the request.
213  //
214  // This method is a [long-running
215  // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
216  // The returned `Operation` type has the following method-specific fields:
217  //
218  // - `metadata`:
219  // [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]
220  // - `response`: [Document][google.cloud.dialogflow.v2beta1.Document]
221  //
222  // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
223  // only use `projects.knowledgeBases.documents`.
224  rpc ReloadDocument(ReloadDocumentRequest)
225      returns (google.longrunning.Operation) {
226    option (google.api.http) = {
227      post: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload"
228      body: "*"
229      additional_bindings {
230        post: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload"
231        body: "*"
232      }
233      additional_bindings {
234        post: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload"
235        body: "*"
236      }
237    };
238    option (google.api.method_signature) = "name,gcs_source";
239    option (google.longrunning.operation_info) = {
240      response_type: "Document"
241      metadata_type: "KnowledgeOperationMetadata"
242    };
243  }
244}
245
246// A knowledge document to be used by a
247// [KnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBase].
248//
249// For more information, see the [knowledge base
250// guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases).
251//
252// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
253// only use `projects.knowledgeBases.documents`.
254message Document {
255  option (google.api.resource) = {
256    type: "dialogflow.googleapis.com/Document"
257    pattern: "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}"
258    pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}"
259  };
260
261  // The knowledge type of document content.
262  enum KnowledgeType {
263    option allow_alias = true;
264
265    // The type is unspecified or arbitrary.
266    KNOWLEDGE_TYPE_UNSPECIFIED = 0;
267
268    // The document content contains question and answer pairs as either HTML or
269    // CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats
270    // may fail to be parsed.
271    //
272    // CSV must have questions in the first column and answers in the second,
273    // with no header. Because of this explicit format, they are always parsed
274    // accurately.
275    FAQ = 1;
276
277    // Documents for which unstructured text is extracted and used for
278    // question answering.
279    EXTRACTIVE_QA = 2;
280
281    // The entire document content as a whole can be used for query results.
282    // Only for Contact Center Solutions on Dialogflow.
283    ARTICLE_SUGGESTION = 3;
284
285    // The document contains agent-facing Smart Reply entries.
286    AGENT_FACING_SMART_REPLY = 4;
287
288    // The legacy enum for agent-facing smart reply feature.
289    SMART_REPLY = 4;
290  }
291
292  // The status of a reload attempt.
293  message ReloadStatus {
294    // Output only. The time of a reload attempt.
295    // This reload may have been triggered automatically or manually and may
296    // not have succeeded.
297    google.protobuf.Timestamp time = 1;
298
299    // Output only. The status of a reload attempt or the initial load.
300    google.rpc.Status status = 2;
301  }
302
303  // Possible states of the document
304  enum State {
305    // The document state is unspecified.
306    STATE_UNSPECIFIED = 0;
307
308    // The document creation is in progress.
309    CREATING = 1;
310
311    // The document is active and ready to use.
312    ACTIVE = 2;
313
314    // The document updation is in progress.
315    UPDATING = 3;
316
317    // The document is reloading.
318    RELOADING = 4;
319
320    // The document deletion is in progress.
321    DELETING = 5;
322  }
323
324  // Optional. The document resource name.
325  // The name must be empty when creating a document.
326  // Format: `projects/<Project ID>/locations/<Location
327  // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
328  string name = 1 [(google.api.field_behavior) = OPTIONAL];
329
330  // Required. The display name of the document. The name must be 1024 bytes or
331  // less; otherwise, the creation request fails.
332  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
333
334  // Required. The MIME type of this document.
335  string mime_type = 3 [(google.api.field_behavior) = REQUIRED];
336
337  // Required. The knowledge type of document content.
338  repeated KnowledgeType knowledge_types = 4
339      [(google.api.field_behavior) = REQUIRED];
340
341  // The source of this document.
342  oneof source {
343    // The URI where the file content is located.
344    //
345    // For documents stored in Google Cloud Storage, these URIs must have
346    // the form `gs://<bucket-name>/<object-name>`.
347    //
348    // NOTE: External URLs must correspond to public webpages, i.e., they must
349    // be indexed by Google Search. In particular, URLs for showing documents in
350    // Google Cloud Storage (i.e. the URL in your browser) are not supported.
351    // Instead use the `gs://` format URI described above.
352    string content_uri = 5;
353
354    // The raw content of the document. This field is only permitted for
355    // EXTRACTIVE_QA and FAQ knowledge types.
356    // Note: This field is in the process of being deprecated, please use
357    // raw_content instead.
358    string content = 6 [deprecated = true];
359
360    // The raw content of the document. This field is only permitted for
361    // EXTRACTIVE_QA and FAQ knowledge types.
362    bytes raw_content = 9;
363  }
364
365  // Optional. If true, we try to automatically reload the document every day
366  // (at a time picked by the system). If false or unspecified, we don't try
367  // to automatically reload the document.
368  //
369  // Currently you can only enable automatic reload for documents sourced from
370  // a public url, see `source` field for the source types.
371  //
372  // Reload status can be tracked in `latest_reload_status`. If a reload
373  // fails, we will keep the document unchanged.
374  //
375  // If a reload fails with internal errors, the system will try to reload the
376  // document on the next day.
377  // If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the
378  // system will not try to reload the document anymore. You need to manually
379  // reload the document successfully by calling `ReloadDocument` and clear the
380  // errors.
381  bool enable_auto_reload = 11 [(google.api.field_behavior) = OPTIONAL];
382
383  // Output only. The time and status of the latest reload.
384  // This reload may have been triggered automatically or manually
385  // and may not have succeeded.
386  ReloadStatus latest_reload_status = 12
387      [(google.api.field_behavior) = OUTPUT_ONLY];
388
389  // Optional. Metadata for the document. The metadata supports arbitrary
390  // key-value pairs. Suggested use cases include storing a document's title,
391  // an external URL distinct from the document's content_uri, etc.
392  // The max size of a `key` or a `value` of the metadata is 1024 bytes.
393  map<string, string> metadata = 7 [(google.api.field_behavior) = OPTIONAL];
394
395  // Output only. The current state of the document.
396  State state = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
397}
398
399// Request message for
400// [Documents.GetDocument][google.cloud.dialogflow.v2beta1.Documents.GetDocument].
401message GetDocumentRequest {
402  // Required. The name of the document to retrieve.
403  // Format `projects/<Project ID>/locations/<Location
404  // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
405  string name = 1 [
406    (google.api.field_behavior) = REQUIRED,
407    (google.api.resource_reference) = {
408      type: "dialogflow.googleapis.com/Document"
409    }
410  ];
411}
412
413// Request message for
414// [Documents.ListDocuments][google.cloud.dialogflow.v2beta1.Documents.ListDocuments].
415message ListDocumentsRequest {
416  // Required. The knowledge base to list all documents for.
417  // Format: `projects/<Project ID>/locations/<Location
418  // ID>/knowledgeBases/<Knowledge Base ID>`.
419  string parent = 1 [
420    (google.api.field_behavior) = REQUIRED,
421    (google.api.resource_reference) = {
422      child_type: "dialogflow.googleapis.com/Document"
423    }
424  ];
425
426  // The maximum number of items to return in a single page. By
427  // default 10 and at most 100.
428  int32 page_size = 2;
429
430  // The next_page_token value returned from a previous list request.
431  string page_token = 3;
432
433  // The filter expression used to filter documents returned by the list method.
434  // The expression has the following syntax:
435  //
436  //   <field> <operator> <value> [AND <field> <operator> <value>] ...
437  //
438  // The following fields and operators are supported:
439  //
440  // * knowledge_types with has(:) operator
441  // * display_name with has(:) operator
442  // * state with equals(=) operator
443  //
444  // Examples:
445  //
446  // * "knowledge_types:FAQ" matches documents with FAQ knowledge type.
447  // * "display_name:customer" matches documents whose display name contains
448  //   "customer".
449  // * "state=ACTIVE" matches documents with ACTIVE state.
450  // * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents.
451  //
452  // For more information about filtering, see
453  // [API Filtering](https://aip.dev/160).
454  string filter = 4;
455}
456
457// Response message for
458// [Documents.ListDocuments][google.cloud.dialogflow.v2beta1.Documents.ListDocuments].
459message ListDocumentsResponse {
460  // The list of documents.
461  repeated Document documents = 1;
462
463  // Token to retrieve the next page of results, or empty if there are no
464  // more results in the list.
465  string next_page_token = 2;
466}
467
468// Request message for
469// [Documents.CreateDocument][google.cloud.dialogflow.v2beta1.Documents.CreateDocument].
470message CreateDocumentRequest {
471  // Required. The knowledge base to create a document for.
472  // Format: `projects/<Project ID>/locations/<Location
473  // ID>/knowledgeBases/<Knowledge Base ID>`.
474  string parent = 1 [
475    (google.api.field_behavior) = REQUIRED,
476    (google.api.resource_reference) = {
477      child_type: "dialogflow.googleapis.com/Document"
478    }
479  ];
480
481  // Required. The document to create.
482  Document document = 2 [(google.api.field_behavior) = REQUIRED];
483
484  // Whether to import custom metadata from Google Cloud Storage.
485  // Only valid when the document source is Google Cloud Storage URI.
486  bool import_gcs_custom_metadata = 3;
487}
488
489// Request message for
490// [Documents.ImportDocuments][google.cloud.dialogflow.v2beta1.Documents.ImportDocuments].
491message ImportDocumentsRequest {
492  // Required. The knowledge base to import documents into.
493  // Format: `projects/<Project ID>/locations/<Location
494  // ID>/knowledgeBases/<Knowledge Base ID>`.
495  string parent = 1 [
496    (google.api.field_behavior) = REQUIRED,
497    (google.api.resource_reference) = {
498      child_type: "dialogflow.googleapis.com/Document"
499    }
500  ];
501
502  // Required. The source to use for importing documents.
503  //
504  // If the source captures multiple objects, then multiple documents will be
505  // created, one corresponding to each object, and all of these documents will
506  // be created using the same document template.
507  //
508  // Dialogflow supports up to 350 documents in each request. If you try to
509  // import more, Dialogflow will return an error.
510  oneof source {
511    // Optional. The Google Cloud Storage location for the documents.
512    // The path can include a wildcard.
513    //
514    // These URIs may have the forms
515    // `gs://<bucket-name>/<object-name>`.
516    // `gs://<bucket-name>/<object-path>/*.<extension>`.
517    GcsSources gcs_source = 2 [(google.api.field_behavior) = OPTIONAL];
518  }
519
520  // Required. Document template used for importing all the documents.
521  ImportDocumentTemplate document_template = 3
522      [(google.api.field_behavior) = REQUIRED];
523
524  // Whether to import custom metadata from Google Cloud Storage.
525  // Only valid when the document source is Google Cloud Storage URI.
526  bool import_gcs_custom_metadata = 4;
527}
528
529// The template used for importing documents.
530message ImportDocumentTemplate {
531  // Required. The MIME type of the document.
532  string mime_type = 1 [(google.api.field_behavior) = REQUIRED];
533
534  // Required. The knowledge type of document content.
535  repeated Document.KnowledgeType knowledge_types = 2
536      [(google.api.field_behavior) = REQUIRED];
537
538  // Metadata for the document. The metadata supports arbitrary
539  // key-value pairs. Suggested use cases include storing a document's title,
540  // an external URL distinct from the document's content_uri, etc.
541  // The max size of a `key` or a `value` of the metadata is 1024 bytes.
542  map<string, string> metadata = 3;
543}
544
545// Response message for
546// [Documents.ImportDocuments][google.cloud.dialogflow.v2beta1.Documents.ImportDocuments].
547message ImportDocumentsResponse {
548  // Includes details about skipped documents or any other warnings.
549  repeated google.rpc.Status warnings = 1;
550}
551
552// Request message for
553// [Documents.DeleteDocument][google.cloud.dialogflow.v2beta1.Documents.DeleteDocument].
554message DeleteDocumentRequest {
555  // Required. The name of the document to delete.
556  // Format: `projects/<Project ID>/locations/<Location
557  // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
558  string name = 1 [
559    (google.api.field_behavior) = REQUIRED,
560    (google.api.resource_reference) = {
561      type: "dialogflow.googleapis.com/Document"
562    }
563  ];
564}
565
566// Request message for
567// [Documents.UpdateDocument][google.cloud.dialogflow.v2beta1.Documents.UpdateDocument].
568message UpdateDocumentRequest {
569  // Required. The document to update.
570  Document document = 1 [(google.api.field_behavior) = REQUIRED];
571
572  // Optional. Not specified means `update all`.
573  // Currently, only `display_name` can be updated, an InvalidArgument will be
574  // returned for attempting to update other fields.
575  google.protobuf.FieldMask update_mask = 2
576      [(google.api.field_behavior) = OPTIONAL];
577}
578
579// Metadata related to the Export Data Operations (e.g. ExportDocument).
580message ExportOperationMetadata {
581  // Cloud Storage file path of the exported data.
582  GcsDestination exported_gcs_destination = 1;
583}
584
585// Metadata in google::longrunning::Operation for Knowledge operations.
586message KnowledgeOperationMetadata {
587  // States of the operation.
588  enum State {
589    // State unspecified.
590    STATE_UNSPECIFIED = 0;
591
592    // The operation has been created.
593    PENDING = 1;
594
595    // The operation is currently running.
596    RUNNING = 2;
597
598    // The operation is done, either cancelled or completed.
599    DONE = 3;
600  }
601
602  // Required. Output only. The current state of this operation.
603  State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
604
605  // The name of the knowledge base interacted with during the operation.
606  string knowledge_base = 3;
607
608  // Additional metadata for the Knowledge operation.
609  oneof operation_metadata {
610    // Metadata for the Export Data Operation such as the destination of export.
611    ExportOperationMetadata export_operation_metadata = 4;
612  }
613}
614
615// Request message for
616// [Documents.ReloadDocument][google.cloud.dialogflow.v2beta1.Documents.ReloadDocument].
617message ReloadDocumentRequest {
618  // Required. The name of the document to reload.
619  // Format: `projects/<Project ID>/locations/<Location
620  // ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`
621  string name = 1 [
622    (google.api.field_behavior) = REQUIRED,
623    (google.api.resource_reference) = {
624      type: "dialogflow.googleapis.com/Document"
625    }
626  ];
627
628  // The source for document reloading.
629  //
630  // Optional. If provided, the service will load the contents from the source
631  // and update document in the knowledge base.
632  //
633  // Reloading from a new document source is allowed for smart messaging
634  // documents only. If you want to update the source for other document types,
635  // please delete the existing document and create a new one instead.
636  oneof source {
637    // The path for a Cloud Storage source file for reloading document content.
638    // If not provided, the Document's existing source will be reloaded.
639    GcsSource gcs_source = 3;
640  }
641
642  // Whether to import custom metadata from Google Cloud Storage.
643  // Only valid when the document source is Google Cloud Storage URI.
644  bool import_gcs_custom_metadata = 4;
645}
646