document_io.proto 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Copyright 2021 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.v1;
  16. import "google/api/annotations.proto";
  17. option csharp_namespace = "Google.Cloud.DocumentAI.V1";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "DocumentIoProto";
  21. option java_package = "com.google.cloud.documentai.v1";
  22. option php_namespace = "Google\\Cloud\\DocumentAI\\V1";
  23. option ruby_package = "Google::Cloud::DocumentAI::V1";
  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].
  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. }
  67. // The destination of the results.
  68. oneof destination {
  69. // Output config to write the results to Cloud Storage.
  70. GcsOutputConfig gcs_output_config = 1;
  71. }
  72. }