document_io.proto 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.documentai.v1beta3;
  16. import "google/protobuf/field_mask.proto";
  17. option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "DocumentIoProto";
  21. option java_package = "com.google.cloud.documentai.v1beta3";
  22. option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3";
  23. option ruby_package = "Google::Cloud::DocumentAI::V1beta3";
  24. // Payload message of raw document content (bytes).
  25. message RawDocument {
  26. // Inline document content.
  27. bytes content = 1;
  28. // An IANA MIME type (RFC6838) indicating the nature and format of the
  29. // [content][google.cloud.documentai.v1beta3.RawDocument.content].
  30. string mime_type = 2;
  31. }
  32. // Specifies a document stored on Cloud Storage.
  33. message GcsDocument {
  34. // The Cloud Storage object uri.
  35. string gcs_uri = 1;
  36. // An IANA MIME type (RFC6838) of the content.
  37. string mime_type = 2;
  38. }
  39. // Specifies a set of documents on Cloud Storage.
  40. message GcsDocuments {
  41. // The list of documents.
  42. repeated GcsDocument documents = 1;
  43. }
  44. // Specifies all documents on Cloud Storage with a common prefix.
  45. message GcsPrefix {
  46. // The URI prefix.
  47. string gcs_uri_prefix = 1;
  48. }
  49. // The common config to specify a set of documents used as input.
  50. message BatchDocumentsInputConfig {
  51. // The source.
  52. oneof source {
  53. // The set of documents that match the specified Cloud Storage `gcs_prefix`.
  54. GcsPrefix gcs_prefix = 1;
  55. // The set of documents individually specified on Cloud Storage.
  56. GcsDocuments gcs_documents = 2;
  57. }
  58. }
  59. // Config that controls the output of documents. All documents will be written
  60. // as a JSON file.
  61. message DocumentOutputConfig {
  62. // The configuration used when outputting documents.
  63. message GcsOutputConfig {
  64. // The Cloud Storage uri (a directory) of the output.
  65. string gcs_uri = 1;
  66. // Specifies which fields to include in the output documents.
  67. // Only supports top level document and pages field so it must be in the
  68. // form of `{document_field_name}` or `pages.{page_field_name}`.
  69. google.protobuf.FieldMask field_mask = 2;
  70. }
  71. // The destination of the results.
  72. oneof destination {
  73. // Output config to write the results to Cloud Storage.
  74. GcsOutputConfig gcs_output_config = 1;
  75. }
  76. }