document.proto 24 KB

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