google-api-client 0.40.2 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +66 -0
  3. data/generated/google/apis/androidmanagement_v1.rb +1 -1
  4. data/generated/google/apis/androidmanagement_v1/classes.rb +117 -0
  5. data/generated/google/apis/androidmanagement_v1/representations.rb +39 -0
  6. data/generated/google/apis/androidpublisher_v3.rb +1 -1
  7. data/generated/google/apis/appsmarket_v2.rb +1 -1
  8. data/generated/google/apis/artifactregistry_v1beta1.rb +1 -1
  9. data/generated/google/apis/artifactregistry_v1beta1/classes.rb +9 -0
  10. data/generated/google/apis/artifactregistry_v1beta1/representations.rb +1 -0
  11. data/generated/google/apis/bigquerydatatransfer_v1.rb +1 -1
  12. data/generated/google/apis/bigquerydatatransfer_v1/classes.rb +4 -4
  13. data/generated/google/apis/bigtableadmin_v1.rb +1 -1
  14. data/generated/google/apis/bigtableadmin_v1/classes.rb +5 -10
  15. data/generated/google/apis/bigtableadmin_v2.rb +1 -1
  16. data/generated/google/apis/bigtableadmin_v2/classes.rb +39 -31
  17. data/generated/google/apis/bigtableadmin_v2/service.rb +1 -5
  18. data/generated/google/apis/books_v1.rb +1 -1
  19. data/generated/google/apis/calendar_v3.rb +1 -1
  20. data/generated/google/apis/chat_v1.rb +1 -1
  21. data/generated/google/apis/chat_v1/classes.rb +2 -0
  22. data/generated/google/apis/cloudasset_v1.rb +1 -1
  23. data/generated/google/apis/cloudasset_v1/classes.rb +12 -3
  24. data/generated/google/apis/cloudasset_v1beta1.rb +1 -1
  25. data/generated/google/apis/cloudasset_v1beta1/classes.rb +948 -36
  26. data/generated/google/apis/cloudasset_v1beta1/representations.rb +241 -0
  27. data/generated/google/apis/cloudasset_v1beta1/service.rb +4 -4
  28. data/generated/google/apis/cloudasset_v1p4beta1.rb +1 -1
  29. data/generated/google/apis/cloudasset_v1p4beta1/classes.rb +18 -19
  30. data/generated/google/apis/cloudasset_v1p4beta1/service.rb +10 -6
  31. data/generated/google/apis/clouderrorreporting_v1beta1.rb +1 -1
  32. data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +1 -1
  33. data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +5 -6
  34. data/generated/google/apis/cloudidentity_v1.rb +1 -1
  35. data/generated/google/apis/cloudidentity_v1beta1.rb +1 -1
  36. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  37. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +14 -9
  38. data/generated/google/apis/cloudresourcemanager_v1/service.rb +15 -6
  39. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  40. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +4 -2
  41. data/generated/google/apis/cloudresourcemanager_v2.rb +1 -1
  42. data/generated/google/apis/cloudresourcemanager_v2beta1.rb +1 -1
  43. data/generated/google/apis/compute_alpha.rb +1 -1
  44. data/generated/google/apis/compute_alpha/classes.rb +535 -43
  45. data/generated/google/apis/compute_alpha/representations.rb +167 -0
  46. data/generated/google/apis/compute_alpha/service.rb +922 -172
  47. data/generated/google/apis/compute_beta.rb +1 -1
  48. data/generated/google/apis/compute_beta/classes.rb +107 -42
  49. data/generated/google/apis/compute_beta/representations.rb +20 -0
  50. data/generated/google/apis/compute_v1.rb +1 -1
  51. data/generated/google/apis/compute_v1/classes.rb +22 -10
  52. data/generated/google/apis/compute_v1/representations.rb +1 -0
  53. data/generated/google/apis/container_v1beta1.rb +1 -1
  54. data/generated/google/apis/container_v1beta1/classes.rb +21 -7
  55. data/generated/google/apis/content_v2.rb +1 -1
  56. data/generated/google/apis/content_v2/classes.rb +7 -1
  57. data/generated/google/apis/content_v2/representations.rb +1 -0
  58. data/generated/google/apis/content_v2/service.rb +10 -5
  59. data/generated/google/apis/content_v2_1.rb +1 -1
  60. data/generated/google/apis/content_v2_1/classes.rb +93 -7
  61. data/generated/google/apis/content_v2_1/representations.rb +37 -0
  62. data/generated/google/apis/content_v2_1/service.rb +10 -5
  63. data/generated/google/apis/dataproc_v1.rb +1 -1
  64. data/generated/google/apis/dataproc_v1/classes.rb +46 -0
  65. data/generated/google/apis/dataproc_v1/representations.rb +17 -0
  66. data/generated/google/apis/dataproc_v1beta2.rb +1 -1
  67. data/generated/google/apis/dataproc_v1beta2/classes.rb +12 -0
  68. data/generated/google/apis/dataproc_v1beta2/representations.rb +1 -0
  69. data/generated/google/apis/dialogflow_v2.rb +1 -1
  70. data/generated/google/apis/dialogflow_v2/service.rb +14 -2
  71. data/generated/google/apis/dialogflow_v2beta1.rb +1 -1
  72. data/generated/google/apis/dialogflow_v2beta1/service.rb +28 -4
  73. data/generated/google/apis/documentai_v1beta2.rb +36 -0
  74. data/generated/google/apis/documentai_v1beta2/classes.rb +3284 -0
  75. data/generated/google/apis/documentai_v1beta2/representations.rb +1344 -0
  76. data/generated/google/apis/documentai_v1beta2/service.rb +269 -0
  77. data/generated/google/apis/drive_v2.rb +1 -1
  78. data/generated/google/apis/drive_v2/service.rb +26 -78
  79. data/generated/google/apis/drive_v3.rb +1 -1
  80. data/generated/google/apis/drive_v3/service.rb +18 -54
  81. data/generated/google/apis/fcm_v1.rb +1 -1
  82. data/generated/google/apis/fcm_v1/classes.rb +6 -0
  83. data/generated/google/apis/firebase_v1beta1.rb +1 -1
  84. data/generated/google/apis/firebase_v1beta1/classes.rb +7 -6
  85. data/generated/google/apis/firebase_v1beta1/service.rb +53 -49
  86. data/generated/google/apis/healthcare_v1.rb +1 -1
  87. data/generated/google/apis/healthcare_v1/service.rb +2 -0
  88. data/generated/google/apis/healthcare_v1beta1.rb +1 -1
  89. data/generated/google/apis/healthcare_v1beta1/classes.rb +910 -43
  90. data/generated/google/apis/healthcare_v1beta1/representations.rb +404 -0
  91. data/generated/google/apis/healthcare_v1beta1/service.rb +517 -0
  92. data/generated/google/apis/iam_v1.rb +1 -1
  93. data/generated/google/apis/iam_v1/classes.rb +5 -0
  94. data/generated/google/apis/iam_v1/service.rb +4 -0
  95. data/generated/google/apis/iamcredentials_v1.rb +2 -2
  96. data/generated/google/apis/iamcredentials_v1/service.rb +1 -1
  97. data/generated/google/apis/lifesciences_v2beta.rb +1 -1
  98. data/generated/google/apis/lifesciences_v2beta/classes.rb +10 -0
  99. data/generated/google/apis/lifesciences_v2beta/representations.rb +1 -0
  100. data/generated/google/apis/monitoring_v3.rb +1 -1
  101. data/generated/google/apis/monitoring_v3/classes.rb +56 -17
  102. data/generated/google/apis/people_v1.rb +1 -1
  103. data/generated/google/apis/people_v1/classes.rb +4 -4
  104. data/generated/google/apis/people_v1/service.rb +6 -5
  105. data/generated/google/apis/run_v1.rb +1 -1
  106. data/generated/google/apis/run_v1/classes.rb +6 -6
  107. data/generated/google/apis/run_v1alpha1.rb +1 -1
  108. data/generated/google/apis/run_v1alpha1/classes.rb +6 -6
  109. data/generated/google/apis/run_v1beta1.rb +1 -1
  110. data/generated/google/apis/secretmanager_v1.rb +1 -1
  111. data/generated/google/apis/secretmanager_v1beta1.rb +1 -1
  112. data/generated/google/apis/securitycenter_v1.rb +1 -1
  113. data/generated/google/apis/securitycenter_v1/classes.rb +10 -10
  114. data/generated/google/apis/securitycenter_v1/service.rb +10 -10
  115. data/generated/google/apis/securitycenter_v1p1beta1.rb +1 -1
  116. data/generated/google/apis/securitycenter_v1p1beta1/classes.rb +10 -10
  117. data/generated/google/apis/securitycenter_v1p1beta1/service.rb +10 -10
  118. data/generated/google/apis/serviceconsumermanagement_v1.rb +1 -1
  119. data/generated/google/apis/serviceconsumermanagement_v1/classes.rb +21 -2
  120. data/generated/google/apis/serviceconsumermanagement_v1/representations.rb +1 -0
  121. data/generated/google/apis/serviceconsumermanagement_v1beta1.rb +1 -1
  122. data/generated/google/apis/serviceconsumermanagement_v1beta1/classes.rb +21 -2
  123. data/generated/google/apis/serviceconsumermanagement_v1beta1/representations.rb +1 -0
  124. data/generated/google/apis/servicemanagement_v1.rb +1 -1
  125. data/generated/google/apis/servicemanagement_v1/classes.rb +117 -37
  126. data/generated/google/apis/servicenetworking_v1.rb +1 -1
  127. data/generated/google/apis/servicenetworking_v1/classes.rb +13 -2
  128. data/generated/google/apis/servicenetworking_v1beta.rb +1 -1
  129. data/generated/google/apis/servicenetworking_v1beta/classes.rb +13 -2
  130. data/generated/google/apis/serviceusage_v1.rb +1 -1
  131. data/generated/google/apis/serviceusage_v1/classes.rb +27 -2
  132. data/generated/google/apis/serviceusage_v1/representations.rb +2 -0
  133. data/generated/google/apis/serviceusage_v1beta1.rb +1 -1
  134. data/generated/google/apis/serviceusage_v1beta1/classes.rb +72 -2
  135. data/generated/google/apis/serviceusage_v1beta1/representations.rb +30 -0
  136. data/generated/google/apis/serviceusage_v1beta1/service.rb +37 -0
  137. data/generated/google/apis/slides_v1.rb +1 -1
  138. data/generated/google/apis/slides_v1/classes.rb +4 -0
  139. data/generated/google/apis/vision_v1.rb +1 -1
  140. data/generated/google/apis/vision_v1/classes.rb +18 -0
  141. data/generated/google/apis/vision_v1p1beta1.rb +1 -1
  142. data/generated/google/apis/vision_v1p1beta1/classes.rb +18 -0
  143. data/generated/google/apis/vision_v1p2beta1.rb +1 -1
  144. data/generated/google/apis/vision_v1p2beta1/classes.rb +18 -0
  145. data/generated/google/apis/youtube_v3.rb +1 -1
  146. data/generated/google/apis/youtube_v3/classes.rb +38 -0
  147. data/generated/google/apis/youtube_v3/representations.rb +27 -0
  148. data/generated/google/apis/youtube_v3/service.rb +32 -0
  149. data/lib/google/apis/version.rb +1 -1
  150. metadata +7 -7
  151. data/generated/google/apis/customsearch_v1.rb +0 -31
  152. data/generated/google/apis/customsearch_v1/classes.rb +0 -1606
  153. data/generated/google/apis/customsearch_v1/representations.rb +0 -372
  154. data/generated/google/apis/customsearch_v1/service.rb +0 -608
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://cloud.google.com/dataproc/
26
26
  module DataprocV1
27
27
  VERSION = 'V1'
28
- REVISION = '20200528'
28
+ REVISION = '20200611'
29
29
 
30
30
  # View and manage your data across Google Cloud Platform services
31
31
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -416,6 +416,11 @@ module Google
416
416
  # @return [Google::Apis::DataprocV1::EncryptionConfig]
417
417
  attr_accessor :encryption_config
418
418
 
419
+ # Endpoint config for this cluster
420
+ # Corresponds to the JSON property `endpointConfig`
421
+ # @return [Google::Apis::DataprocV1::EndpointConfig]
422
+ attr_accessor :endpoint_config
423
+
419
424
  # Common config settings for resources of Compute Engine cluster instances,
420
425
  # applicable to all instances in the cluster.
421
426
  # Corresponds to the JSON property `gceClusterConfig`
@@ -464,6 +469,17 @@ module Google
464
469
  # @return [Google::Apis::DataprocV1::SoftwareConfig]
465
470
  attr_accessor :software_config
466
471
 
472
+ # Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
473
+ # such as Spark and MapReduce history files. If you do not specify a temp
474
+ # bucket, Cloud Dataproc will determine a Cloud Storage location (US, ASIA, or
475
+ # EU) for your cluster's temp bucket according to the Compute Engine zone where
476
+ # your cluster is deployed, and then create and manage this project-level, per-
477
+ # location bucket. The default bucket has a TTL of 90 days, but you can use any
478
+ # TTL (or none) if you specify a bucket.
479
+ # Corresponds to the JSON property `tempBucket`
480
+ # @return [String]
481
+ attr_accessor :temp_bucket
482
+
467
483
  # The config settings for Compute Engine resources in an instance group, such as
468
484
  # a master or worker group.
469
485
  # Corresponds to the JSON property `workerConfig`
@@ -479,6 +495,7 @@ module Google
479
495
  @autoscaling_config = args[:autoscaling_config] if args.key?(:autoscaling_config)
480
496
  @config_bucket = args[:config_bucket] if args.key?(:config_bucket)
481
497
  @encryption_config = args[:encryption_config] if args.key?(:encryption_config)
498
+ @endpoint_config = args[:endpoint_config] if args.key?(:endpoint_config)
482
499
  @gce_cluster_config = args[:gce_cluster_config] if args.key?(:gce_cluster_config)
483
500
  @initialization_actions = args[:initialization_actions] if args.key?(:initialization_actions)
484
501
  @lifecycle_config = args[:lifecycle_config] if args.key?(:lifecycle_config)
@@ -486,6 +503,7 @@ module Google
486
503
  @secondary_worker_config = args[:secondary_worker_config] if args.key?(:secondary_worker_config)
487
504
  @security_config = args[:security_config] if args.key?(:security_config)
488
505
  @software_config = args[:software_config] if args.key?(:software_config)
506
+ @temp_bucket = args[:temp_bucket] if args.key?(:temp_bucket)
489
507
  @worker_config = args[:worker_config] if args.key?(:worker_config)
490
508
  end
491
509
  end
@@ -822,6 +840,34 @@ module Google
822
840
  end
823
841
  end
824
842
 
843
+ # Endpoint config for this cluster
844
+ class EndpointConfig
845
+ include Google::Apis::Core::Hashable
846
+
847
+ # Optional. If true, enable http access to specific ports on the cluster from
848
+ # external sources. Defaults to false.
849
+ # Corresponds to the JSON property `enableHttpPortAccess`
850
+ # @return [Boolean]
851
+ attr_accessor :enable_http_port_access
852
+ alias_method :enable_http_port_access?, :enable_http_port_access
853
+
854
+ # Output only. The map of port descriptions to URLs. Will only be populated if
855
+ # enable_http_port_access is true.
856
+ # Corresponds to the JSON property `httpPorts`
857
+ # @return [Hash<String,String>]
858
+ attr_accessor :http_ports
859
+
860
+ def initialize(**args)
861
+ update!(**args)
862
+ end
863
+
864
+ # Update properties of this object
865
+ def update!(**args)
866
+ @enable_http_port_access = args[:enable_http_port_access] if args.key?(:enable_http_port_access)
867
+ @http_ports = args[:http_ports] if args.key?(:http_ports)
868
+ end
869
+ end
870
+
825
871
  # Represents a textual expression in the Common Expression Language (CEL) syntax.
826
872
  # CEL is a C-like expression language. The syntax and semantics of CEL are
827
873
  # documented at https://github.com/google/cel-spec.Example (Comparison):
@@ -142,6 +142,12 @@ module Google
142
142
  include Google::Apis::Core::JsonObjectSupport
143
143
  end
144
144
 
145
+ class EndpointConfig
146
+ class Representation < Google::Apis::Core::JsonRepresentation; end
147
+
148
+ include Google::Apis::Core::JsonObjectSupport
149
+ end
150
+
145
151
  class Expr
146
152
  class Representation < Google::Apis::Core::JsonRepresentation; end
147
153
 
@@ -557,6 +563,8 @@ module Google
557
563
  property :config_bucket, as: 'configBucket'
558
564
  property :encryption_config, as: 'encryptionConfig', class: Google::Apis::DataprocV1::EncryptionConfig, decorator: Google::Apis::DataprocV1::EncryptionConfig::Representation
559
565
 
566
+ property :endpoint_config, as: 'endpointConfig', class: Google::Apis::DataprocV1::EndpointConfig, decorator: Google::Apis::DataprocV1::EndpointConfig::Representation
567
+
560
568
  property :gce_cluster_config, as: 'gceClusterConfig', class: Google::Apis::DataprocV1::GceClusterConfig, decorator: Google::Apis::DataprocV1::GceClusterConfig::Representation
561
569
 
562
570
  collection :initialization_actions, as: 'initializationActions', class: Google::Apis::DataprocV1::NodeInitializationAction, decorator: Google::Apis::DataprocV1::NodeInitializationAction::Representation
@@ -571,6 +579,7 @@ module Google
571
579
 
572
580
  property :software_config, as: 'softwareConfig', class: Google::Apis::DataprocV1::SoftwareConfig, decorator: Google::Apis::DataprocV1::SoftwareConfig::Representation
573
581
 
582
+ property :temp_bucket, as: 'tempBucket'
574
583
  property :worker_config, as: 'workerConfig', class: Google::Apis::DataprocV1::InstanceGroupConfig, decorator: Google::Apis::DataprocV1::InstanceGroupConfig::Representation
575
584
 
576
585
  end
@@ -672,6 +681,14 @@ module Google
672
681
  end
673
682
  end
674
683
 
684
+ class EndpointConfig
685
+ # @private
686
+ class Representation < Google::Apis::Core::JsonRepresentation
687
+ property :enable_http_port_access, as: 'enableHttpPortAccess'
688
+ hash :http_ports, as: 'httpPorts'
689
+ end
690
+ end
691
+
675
692
  class Expr
676
693
  # @private
677
694
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://cloud.google.com/dataproc/
26
26
  module DataprocV1beta2
27
27
  VERSION = 'V1beta2'
28
- REVISION = '20200528'
28
+ REVISION = '20200611'
29
29
 
30
30
  # View and manage your data across Google Cloud Platform services
31
31
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -474,6 +474,17 @@ module Google
474
474
  # @return [Google::Apis::DataprocV1beta2::SoftwareConfig]
475
475
  attr_accessor :software_config
476
476
 
477
+ # Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
478
+ # such as Spark and MapReduce history files. If you do not specify a temp
479
+ # bucket, Cloud Dataproc will determine a Cloud Storage location (US, ASIA, or
480
+ # EU) for your cluster's temp bucket according to the Compute Engine zone where
481
+ # your cluster is deployed, and then create and manage this project-level, per-
482
+ # location bucket. The default bucket has a TTL of 90 days, but you can use any
483
+ # TTL (or none) if you specify a bucket.
484
+ # Corresponds to the JSON property `tempBucket`
485
+ # @return [String]
486
+ attr_accessor :temp_bucket
487
+
477
488
  # The config settings for Compute Engine resources in an instance group, such as
478
489
  # a master or worker group.
479
490
  # Corresponds to the JSON property `workerConfig`
@@ -498,6 +509,7 @@ module Google
498
509
  @secondary_worker_config = args[:secondary_worker_config] if args.key?(:secondary_worker_config)
499
510
  @security_config = args[:security_config] if args.key?(:security_config)
500
511
  @software_config = args[:software_config] if args.key?(:software_config)
512
+ @temp_bucket = args[:temp_bucket] if args.key?(:temp_bucket)
501
513
  @worker_config = args[:worker_config] if args.key?(:worker_config)
502
514
  end
503
515
  end
@@ -605,6 +605,7 @@ module Google
605
605
 
606
606
  property :software_config, as: 'softwareConfig', class: Google::Apis::DataprocV1beta2::SoftwareConfig, decorator: Google::Apis::DataprocV1beta2::SoftwareConfig::Representation
607
607
 
608
+ property :temp_bucket, as: 'tempBucket'
608
609
  property :worker_config, as: 'workerConfig', class: Google::Apis::DataprocV1beta2::InstanceGroupConfig, decorator: Google::Apis::DataprocV1beta2::InstanceGroupConfig::Representation
609
610
 
610
611
  end
@@ -26,7 +26,7 @@ module Google
26
26
  # @see https://cloud.google.com/dialogflow/
27
27
  module DialogflowV2
28
28
  VERSION = 'V2'
29
- REVISION = '20200601'
29
+ REVISION = '20200615'
30
30
 
31
31
  # View and manage your data across Google Cloud Platform services
32
32
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -255,8 +255,14 @@ module Google
255
255
  # Imports the specified agent from a ZIP file.
256
256
  # Uploads new intents and entity types without deleting the existing ones.
257
257
  # Intents and entity types with the same name are replaced with the new
258
- # versions from ImportAgentRequest.
258
+ # versions from ImportAgentRequest. After the import, the imported draft
259
+ # agent will be trained automatically (unless disabled in agent settings).
260
+ # However, once the import is done, training may not be completed yet. Please
261
+ # call TrainAgent and wait for the operation it returns in order to train
262
+ # explicitly.
259
263
  # Operation <response: google.protobuf.Empty>
264
+ # An operation which tracks when importing is complete. It only tracks
265
+ # when the draft agent is updated not when it is done training.
260
266
  # @param [String] parent
261
267
  # Required. The project that the agent to import is associated with.
262
268
  # Format: `projects/<Project ID>`.
@@ -292,8 +298,14 @@ module Google
292
298
 
293
299
  # Restores the specified agent from a ZIP file.
294
300
  # Replaces the current agent version with a new one. All the intents and
295
- # entity types in the older version are deleted.
301
+ # entity types in the older version are deleted. After the restore, the
302
+ # restored draft agent will be trained automatically (unless disabled in
303
+ # agent settings). However, once the restore is done, training may not be
304
+ # completed yet. Please call TrainAgent and wait for the operation it
305
+ # returns in order to train explicitly.
296
306
  # Operation <response: google.protobuf.Empty>
307
+ # An operation which tracks when restoring is complete. It only tracks
308
+ # when the draft agent is updated not when it is done training.
297
309
  # @param [String] parent
298
310
  # Required. The project that the agent to restore is associated with.
299
311
  # Format: `projects/<Project ID>`.
@@ -26,7 +26,7 @@ module Google
26
26
  # @see https://cloud.google.com/dialogflow/
27
27
  module DialogflowV2beta1
28
28
  VERSION = 'V2beta1'
29
- REVISION = '20200601'
29
+ REVISION = '20200615'
30
30
 
31
31
  # View and manage your data across Google Cloud Platform services
32
32
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -255,8 +255,14 @@ module Google
255
255
  # Imports the specified agent from a ZIP file.
256
256
  # Uploads new intents and entity types without deleting the existing ones.
257
257
  # Intents and entity types with the same name are replaced with the new
258
- # versions from ImportAgentRequest.
258
+ # versions from ImportAgentRequest. After the import, the imported draft
259
+ # agent will be trained automatically (unless disabled in agent settings).
260
+ # However, once the import is done, training may not be completed yet. Please
261
+ # call TrainAgent and wait for the operation it returns in order to train
262
+ # explicitly.
259
263
  # Operation <response: google.protobuf.Empty>
264
+ # An operation which tracks when importing is complete. It only tracks
265
+ # when the draft agent is updated not when it is done training.
260
266
  # @param [String] parent
261
267
  # Required. The project that the agent to import is associated with.
262
268
  # Format: `projects/<Project ID>`.
@@ -292,8 +298,14 @@ module Google
292
298
 
293
299
  # Restores the specified agent from a ZIP file.
294
300
  # Replaces the current agent version with a new one. All the intents and
295
- # entity types in the older version are deleted.
301
+ # entity types in the older version are deleted. After the restore, the
302
+ # restored draft agent will be trained automatically (unless disabled in
303
+ # agent settings). However, once the restore is done, training may not be
304
+ # completed yet. Please call TrainAgent and wait for the operation it
305
+ # returns in order to train explicitly.
296
306
  # Operation <response: google.protobuf.Empty>
307
+ # An operation which tracks when restoring is complete. It only tracks
308
+ # when the draft agent is updated not when it is done training.
297
309
  # @param [String] parent
298
310
  # Required. The project that the agent to restore is associated with.
299
311
  # Format: `projects/<Project ID>`.
@@ -3165,8 +3177,14 @@ module Google
3165
3177
  # Imports the specified agent from a ZIP file.
3166
3178
  # Uploads new intents and entity types without deleting the existing ones.
3167
3179
  # Intents and entity types with the same name are replaced with the new
3168
- # versions from ImportAgentRequest.
3180
+ # versions from ImportAgentRequest. After the import, the imported draft
3181
+ # agent will be trained automatically (unless disabled in agent settings).
3182
+ # However, once the import is done, training may not be completed yet. Please
3183
+ # call TrainAgent and wait for the operation it returns in order to train
3184
+ # explicitly.
3169
3185
  # Operation <response: google.protobuf.Empty>
3186
+ # An operation which tracks when importing is complete. It only tracks
3187
+ # when the draft agent is updated not when it is done training.
3170
3188
  # @param [String] parent
3171
3189
  # Required. The project that the agent to import is associated with.
3172
3190
  # Format: `projects/<Project ID>`.
@@ -3202,8 +3220,14 @@ module Google
3202
3220
 
3203
3221
  # Restores the specified agent from a ZIP file.
3204
3222
  # Replaces the current agent version with a new one. All the intents and
3205
- # entity types in the older version are deleted.
3223
+ # entity types in the older version are deleted. After the restore, the
3224
+ # restored draft agent will be trained automatically (unless disabled in
3225
+ # agent settings). However, once the restore is done, training may not be
3226
+ # completed yet. Please call TrainAgent and wait for the operation it
3227
+ # returns in order to train explicitly.
3206
3228
  # Operation <response: google.protobuf.Empty>
3229
+ # An operation which tracks when restoring is complete. It only tracks
3230
+ # when the draft agent is updated not when it is done training.
3207
3231
  # @param [String] parent
3208
3232
  # Required. The project that the agent to restore is associated with.
3209
3233
  # Format: `projects/<Project ID>`.
@@ -0,0 +1,36 @@
1
+ # Copyright 2015 Google Inc.
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
+
15
+ require 'google/apis/documentai_v1beta2/service.rb'
16
+ require 'google/apis/documentai_v1beta2/classes.rb'
17
+ require 'google/apis/documentai_v1beta2/representations.rb'
18
+
19
+ module Google
20
+ module Apis
21
+ # Cloud Document AI API
22
+ #
23
+ # Service to parse structured information from unstructured or semi-structured
24
+ # documents using state-of-the-art Google AI such as natural language, computer
25
+ # vision, translation, and AutoML.
26
+ #
27
+ # @see https://cloud.google.com/document-ai/docs/
28
+ module DocumentaiV1beta2
29
+ VERSION = 'V1beta2'
30
+ REVISION = '20200612'
31
+
32
+ # View and manage your data across Google Cloud Platform services
33
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,3284 @@
1
+ # Copyright 2015 Google Inc.
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
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module DocumentaiV1beta2
24
+
25
+ # Response to an batch document processing request. This is returned in
26
+ # the LRO Operation after the operation is complete.
27
+ class GoogleCloudDocumentaiV1beta1BatchProcessDocumentsResponse
28
+ include Google::Apis::Core::Hashable
29
+
30
+ # Responses for each individual document.
31
+ # Corresponds to the JSON property `responses`
32
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1ProcessDocumentResponse>]
33
+ attr_accessor :responses
34
+
35
+ def initialize(**args)
36
+ update!(**args)
37
+ end
38
+
39
+ # Update properties of this object
40
+ def update!(**args)
41
+ @responses = args[:responses] if args.key?(:responses)
42
+ end
43
+ end
44
+
45
+ # A bounding polygon for the detected image annotation.
46
+ class GoogleCloudDocumentaiV1beta1BoundingPoly
47
+ include Google::Apis::Core::Hashable
48
+
49
+ # The bounding polygon normalized vertices.
50
+ # Corresponds to the JSON property `normalizedVertices`
51
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1NormalizedVertex>]
52
+ attr_accessor :normalized_vertices
53
+
54
+ # The bounding polygon vertices.
55
+ # Corresponds to the JSON property `vertices`
56
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1Vertex>]
57
+ attr_accessor :vertices
58
+
59
+ def initialize(**args)
60
+ update!(**args)
61
+ end
62
+
63
+ # Update properties of this object
64
+ def update!(**args)
65
+ @normalized_vertices = args[:normalized_vertices] if args.key?(:normalized_vertices)
66
+ @vertices = args[:vertices] if args.key?(:vertices)
67
+ end
68
+ end
69
+
70
+ # Document represents the canonical document resource in Document Understanding
71
+ # AI.
72
+ # It is an interchange format that provides insights into documents and allows
73
+ # for collaboration between users and Document Understanding AI to iterate and
74
+ # optimize for quality.
75
+ class GoogleCloudDocumentaiV1beta1Document
76
+ include Google::Apis::Core::Hashable
77
+
78
+ # Inline document content, represented as a stream of bytes.
79
+ # Note: As with all `bytes` fields, protobuffers use a pure binary
80
+ # representation, whereas JSON representations use base64.
81
+ # Corresponds to the JSON property `content`
82
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
83
+ # @return [String]
84
+ attr_accessor :content
85
+
86
+ # A list of entities detected on Document.text. For document shards,
87
+ # entities in this list may cross shard boundaries.
88
+ # Corresponds to the JSON property `entities`
89
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntity>]
90
+ attr_accessor :entities
91
+
92
+ # Relationship among Document.entities.
93
+ # Corresponds to the JSON property `entityRelations`
94
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentEntityRelation>]
95
+ attr_accessor :entity_relations
96
+
97
+ # The `Status` type defines a logical error model that is suitable for
98
+ # different programming environments, including REST APIs and RPC APIs. It is
99
+ # used by [gRPC](https://github.com/grpc). Each `Status` message contains
100
+ # three pieces of data: error code, error message, and error details.
101
+ # You can find out more about this error model and how to work with it in the
102
+ # [API Design Guide](https://cloud.google.com/apis/design/errors).
103
+ # Corresponds to the JSON property `error`
104
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleRpcStatus]
105
+ attr_accessor :error
106
+
107
+ # An IANA published MIME type (also referred to as media type). For more
108
+ # information, see
109
+ # https://www.iana.org/assignments/media-types/media-types.xhtml.
110
+ # Corresponds to the JSON property `mimeType`
111
+ # @return [String]
112
+ attr_accessor :mime_type
113
+
114
+ # Visual page layout for the Document.
115
+ # Corresponds to the JSON property `pages`
116
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPage>]
117
+ attr_accessor :pages
118
+
119
+ # For a large document, sharding may be performed to produce several
120
+ # document shards. Each document shard contains this field to detail which
121
+ # shard it is.
122
+ # Corresponds to the JSON property `shardInfo`
123
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentShardInfo]
124
+ attr_accessor :shard_info
125
+
126
+ # UTF-8 encoded text in reading order from the document.
127
+ # Corresponds to the JSON property `text`
128
+ # @return [String]
129
+ attr_accessor :text
130
+
131
+ # Styles for the Document.text.
132
+ # Corresponds to the JSON property `textStyles`
133
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentStyle>]
134
+ attr_accessor :text_styles
135
+
136
+ # A list of translations on Document.text. For document shards,
137
+ # translations in this list may cross shard boundaries.
138
+ # Corresponds to the JSON property `translations`
139
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTranslation>]
140
+ attr_accessor :translations
141
+
142
+ # Currently supports Google Cloud Storage URI of the form
143
+ # `gs://bucket_name/object_name`. Object versioning is not supported.
144
+ # See [Google Cloud Storage Request
145
+ # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
146
+ # info.
147
+ # Corresponds to the JSON property `uri`
148
+ # @return [String]
149
+ attr_accessor :uri
150
+
151
+ def initialize(**args)
152
+ update!(**args)
153
+ end
154
+
155
+ # Update properties of this object
156
+ def update!(**args)
157
+ @content = args[:content] if args.key?(:content)
158
+ @entities = args[:entities] if args.key?(:entities)
159
+ @entity_relations = args[:entity_relations] if args.key?(:entity_relations)
160
+ @error = args[:error] if args.key?(:error)
161
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
162
+ @pages = args[:pages] if args.key?(:pages)
163
+ @shard_info = args[:shard_info] if args.key?(:shard_info)
164
+ @text = args[:text] if args.key?(:text)
165
+ @text_styles = args[:text_styles] if args.key?(:text_styles)
166
+ @translations = args[:translations] if args.key?(:translations)
167
+ @uri = args[:uri] if args.key?(:uri)
168
+ end
169
+ end
170
+
171
+ # A phrase in the text that is a known entity type, such as a person, an
172
+ # organization, or location.
173
+ class GoogleCloudDocumentaiV1beta1DocumentEntity
174
+ include Google::Apis::Core::Hashable
175
+
176
+ # Optional. Confidence of detected Schema entity. Range [0, 1].
177
+ # Corresponds to the JSON property `confidence`
178
+ # @return [Float]
179
+ attr_accessor :confidence
180
+
181
+ # Deprecated. Use `id` field instead.
182
+ # Corresponds to the JSON property `mentionId`
183
+ # @return [String]
184
+ attr_accessor :mention_id
185
+
186
+ # Text value in the document e.g. `1600 Amphitheatre Pkwy`.
187
+ # Corresponds to the JSON property `mentionText`
188
+ # @return [String]
189
+ attr_accessor :mention_text
190
+
191
+ # Text reference indexing into the Document.text.
192
+ # Corresponds to the JSON property `textAnchor`
193
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor]
194
+ attr_accessor :text_anchor
195
+
196
+ # Entity type from a schema e.g. `Address`.
197
+ # Corresponds to the JSON property `type`
198
+ # @return [String]
199
+ attr_accessor :type
200
+
201
+ def initialize(**args)
202
+ update!(**args)
203
+ end
204
+
205
+ # Update properties of this object
206
+ def update!(**args)
207
+ @confidence = args[:confidence] if args.key?(:confidence)
208
+ @mention_id = args[:mention_id] if args.key?(:mention_id)
209
+ @mention_text = args[:mention_text] if args.key?(:mention_text)
210
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
211
+ @type = args[:type] if args.key?(:type)
212
+ end
213
+ end
214
+
215
+ # Relationship between Entities.
216
+ class GoogleCloudDocumentaiV1beta1DocumentEntityRelation
217
+ include Google::Apis::Core::Hashable
218
+
219
+ # Object entity id.
220
+ # Corresponds to the JSON property `objectId`
221
+ # @return [String]
222
+ attr_accessor :object_id_prop
223
+
224
+ # Relationship description.
225
+ # Corresponds to the JSON property `relation`
226
+ # @return [String]
227
+ attr_accessor :relation
228
+
229
+ # Subject entity id.
230
+ # Corresponds to the JSON property `subjectId`
231
+ # @return [String]
232
+ attr_accessor :subject_id
233
+
234
+ def initialize(**args)
235
+ update!(**args)
236
+ end
237
+
238
+ # Update properties of this object
239
+ def update!(**args)
240
+ @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)
241
+ @relation = args[:relation] if args.key?(:relation)
242
+ @subject_id = args[:subject_id] if args.key?(:subject_id)
243
+ end
244
+ end
245
+
246
+ # A page in a Document.
247
+ class GoogleCloudDocumentaiV1beta1DocumentPage
248
+ include Google::Apis::Core::Hashable
249
+
250
+ # A list of visually detected text blocks on the page.
251
+ # A block has a set of lines (collected into paragraphs) that have a common
252
+ # line-spacing and orientation.
253
+ # Corresponds to the JSON property `blocks`
254
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageBlock>]
255
+ attr_accessor :blocks
256
+
257
+ # A list of detected languages together with confidence.
258
+ # Corresponds to the JSON property `detectedLanguages`
259
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
260
+ attr_accessor :detected_languages
261
+
262
+ # Dimension for the page.
263
+ # Corresponds to the JSON property `dimension`
264
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDimension]
265
+ attr_accessor :dimension
266
+
267
+ # A list of visually detected form fields on the page.
268
+ # Corresponds to the JSON property `formFields`
269
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageFormField>]
270
+ attr_accessor :form_fields
271
+
272
+ # Visual element describing a layout unit on a page.
273
+ # Corresponds to the JSON property `layout`
274
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
275
+ attr_accessor :layout
276
+
277
+ # A list of visually detected text lines on the page.
278
+ # A collection of tokens that a human would perceive as a line.
279
+ # Corresponds to the JSON property `lines`
280
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLine>]
281
+ attr_accessor :lines
282
+
283
+ # 1-based index for current Page in a parent Document.
284
+ # Useful when a page is taken out of a Document for individual
285
+ # processing.
286
+ # Corresponds to the JSON property `pageNumber`
287
+ # @return [Fixnum]
288
+ attr_accessor :page_number
289
+
290
+ # A list of visually detected text paragraphs on the page.
291
+ # A collection of lines that a human would perceive as a paragraph.
292
+ # Corresponds to the JSON property `paragraphs`
293
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageParagraph>]
294
+ attr_accessor :paragraphs
295
+
296
+ # A list of visually detected tables on the page.
297
+ # Corresponds to the JSON property `tables`
298
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTable>]
299
+ attr_accessor :tables
300
+
301
+ # A list of visually detected tokens on the page.
302
+ # Corresponds to the JSON property `tokens`
303
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageToken>]
304
+ attr_accessor :tokens
305
+
306
+ # A list of detected non-text visual elements e.g. checkbox,
307
+ # signature etc. on the page.
308
+ # Corresponds to the JSON property `visualElements`
309
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageVisualElement>]
310
+ attr_accessor :visual_elements
311
+
312
+ def initialize(**args)
313
+ update!(**args)
314
+ end
315
+
316
+ # Update properties of this object
317
+ def update!(**args)
318
+ @blocks = args[:blocks] if args.key?(:blocks)
319
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
320
+ @dimension = args[:dimension] if args.key?(:dimension)
321
+ @form_fields = args[:form_fields] if args.key?(:form_fields)
322
+ @layout = args[:layout] if args.key?(:layout)
323
+ @lines = args[:lines] if args.key?(:lines)
324
+ @page_number = args[:page_number] if args.key?(:page_number)
325
+ @paragraphs = args[:paragraphs] if args.key?(:paragraphs)
326
+ @tables = args[:tables] if args.key?(:tables)
327
+ @tokens = args[:tokens] if args.key?(:tokens)
328
+ @visual_elements = args[:visual_elements] if args.key?(:visual_elements)
329
+ end
330
+ end
331
+
332
+ # A block has a set of lines (collected into paragraphs) that have a
333
+ # common line-spacing and orientation.
334
+ class GoogleCloudDocumentaiV1beta1DocumentPageBlock
335
+ include Google::Apis::Core::Hashable
336
+
337
+ # A list of detected languages together with confidence.
338
+ # Corresponds to the JSON property `detectedLanguages`
339
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
340
+ attr_accessor :detected_languages
341
+
342
+ # Visual element describing a layout unit on a page.
343
+ # Corresponds to the JSON property `layout`
344
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
345
+ attr_accessor :layout
346
+
347
+ def initialize(**args)
348
+ update!(**args)
349
+ end
350
+
351
+ # Update properties of this object
352
+ def update!(**args)
353
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
354
+ @layout = args[:layout] if args.key?(:layout)
355
+ end
356
+ end
357
+
358
+ # Detected language for a structural component.
359
+ class GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage
360
+ include Google::Apis::Core::Hashable
361
+
362
+ # Confidence of detected language. Range [0, 1].
363
+ # Corresponds to the JSON property `confidence`
364
+ # @return [Float]
365
+ attr_accessor :confidence
366
+
367
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
368
+ # information, see
369
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
370
+ # Corresponds to the JSON property `languageCode`
371
+ # @return [String]
372
+ attr_accessor :language_code
373
+
374
+ def initialize(**args)
375
+ update!(**args)
376
+ end
377
+
378
+ # Update properties of this object
379
+ def update!(**args)
380
+ @confidence = args[:confidence] if args.key?(:confidence)
381
+ @language_code = args[:language_code] if args.key?(:language_code)
382
+ end
383
+ end
384
+
385
+ # Dimension for the page.
386
+ class GoogleCloudDocumentaiV1beta1DocumentPageDimension
387
+ include Google::Apis::Core::Hashable
388
+
389
+ # Page height.
390
+ # Corresponds to the JSON property `height`
391
+ # @return [Float]
392
+ attr_accessor :height
393
+
394
+ # Dimension unit.
395
+ # Corresponds to the JSON property `unit`
396
+ # @return [String]
397
+ attr_accessor :unit
398
+
399
+ # Page width.
400
+ # Corresponds to the JSON property `width`
401
+ # @return [Float]
402
+ attr_accessor :width
403
+
404
+ def initialize(**args)
405
+ update!(**args)
406
+ end
407
+
408
+ # Update properties of this object
409
+ def update!(**args)
410
+ @height = args[:height] if args.key?(:height)
411
+ @unit = args[:unit] if args.key?(:unit)
412
+ @width = args[:width] if args.key?(:width)
413
+ end
414
+ end
415
+
416
+ # A form field detected on the page.
417
+ class GoogleCloudDocumentaiV1beta1DocumentPageFormField
418
+ include Google::Apis::Core::Hashable
419
+
420
+ # Visual element describing a layout unit on a page.
421
+ # Corresponds to the JSON property `fieldName`
422
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
423
+ attr_accessor :field_name
424
+
425
+ # Visual element describing a layout unit on a page.
426
+ # Corresponds to the JSON property `fieldValue`
427
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
428
+ attr_accessor :field_value
429
+
430
+ # A list of detected languages for name together with confidence.
431
+ # Corresponds to the JSON property `nameDetectedLanguages`
432
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
433
+ attr_accessor :name_detected_languages
434
+
435
+ # A list of detected languages for value together with confidence.
436
+ # Corresponds to the JSON property `valueDetectedLanguages`
437
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
438
+ attr_accessor :value_detected_languages
439
+
440
+ def initialize(**args)
441
+ update!(**args)
442
+ end
443
+
444
+ # Update properties of this object
445
+ def update!(**args)
446
+ @field_name = args[:field_name] if args.key?(:field_name)
447
+ @field_value = args[:field_value] if args.key?(:field_value)
448
+ @name_detected_languages = args[:name_detected_languages] if args.key?(:name_detected_languages)
449
+ @value_detected_languages = args[:value_detected_languages] if args.key?(:value_detected_languages)
450
+ end
451
+ end
452
+
453
+ # Visual element describing a layout unit on a page.
454
+ class GoogleCloudDocumentaiV1beta1DocumentPageLayout
455
+ include Google::Apis::Core::Hashable
456
+
457
+ # A bounding polygon for the detected image annotation.
458
+ # Corresponds to the JSON property `boundingPoly`
459
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1BoundingPoly]
460
+ attr_accessor :bounding_poly
461
+
462
+ # Confidence of the current Layout within context of the object this
463
+ # layout is for. e.g. confidence can be for a single token, a table,
464
+ # a visual element, etc. depending on context. Range [0, 1].
465
+ # Corresponds to the JSON property `confidence`
466
+ # @return [Float]
467
+ attr_accessor :confidence
468
+
469
+ # Detected orientation for the Layout.
470
+ # Corresponds to the JSON property `orientation`
471
+ # @return [String]
472
+ attr_accessor :orientation
473
+
474
+ # Text reference indexing into the Document.text.
475
+ # Corresponds to the JSON property `textAnchor`
476
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor]
477
+ attr_accessor :text_anchor
478
+
479
+ def initialize(**args)
480
+ update!(**args)
481
+ end
482
+
483
+ # Update properties of this object
484
+ def update!(**args)
485
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
486
+ @confidence = args[:confidence] if args.key?(:confidence)
487
+ @orientation = args[:orientation] if args.key?(:orientation)
488
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
489
+ end
490
+ end
491
+
492
+ # A collection of tokens that a human would perceive as a line.
493
+ # Does not cross column boundaries, can be horizontal, vertical, etc.
494
+ class GoogleCloudDocumentaiV1beta1DocumentPageLine
495
+ include Google::Apis::Core::Hashable
496
+
497
+ # A list of detected languages together with confidence.
498
+ # Corresponds to the JSON property `detectedLanguages`
499
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
500
+ attr_accessor :detected_languages
501
+
502
+ # Visual element describing a layout unit on a page.
503
+ # Corresponds to the JSON property `layout`
504
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
505
+ attr_accessor :layout
506
+
507
+ def initialize(**args)
508
+ update!(**args)
509
+ end
510
+
511
+ # Update properties of this object
512
+ def update!(**args)
513
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
514
+ @layout = args[:layout] if args.key?(:layout)
515
+ end
516
+ end
517
+
518
+ # A collection of lines that a human would perceive as a paragraph.
519
+ class GoogleCloudDocumentaiV1beta1DocumentPageParagraph
520
+ include Google::Apis::Core::Hashable
521
+
522
+ # A list of detected languages together with confidence.
523
+ # Corresponds to the JSON property `detectedLanguages`
524
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
525
+ attr_accessor :detected_languages
526
+
527
+ # Visual element describing a layout unit on a page.
528
+ # Corresponds to the JSON property `layout`
529
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
530
+ attr_accessor :layout
531
+
532
+ def initialize(**args)
533
+ update!(**args)
534
+ end
535
+
536
+ # Update properties of this object
537
+ def update!(**args)
538
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
539
+ @layout = args[:layout] if args.key?(:layout)
540
+ end
541
+ end
542
+
543
+ # A table representation similar to HTML table structure.
544
+ class GoogleCloudDocumentaiV1beta1DocumentPageTable
545
+ include Google::Apis::Core::Hashable
546
+
547
+ # Body rows of the table.
548
+ # Corresponds to the JSON property `bodyRows`
549
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow>]
550
+ attr_accessor :body_rows
551
+
552
+ # A list of detected languages together with confidence.
553
+ # Corresponds to the JSON property `detectedLanguages`
554
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
555
+ attr_accessor :detected_languages
556
+
557
+ # Header rows of the table.
558
+ # Corresponds to the JSON property `headerRows`
559
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow>]
560
+ attr_accessor :header_rows
561
+
562
+ # Visual element describing a layout unit on a page.
563
+ # Corresponds to the JSON property `layout`
564
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
565
+ attr_accessor :layout
566
+
567
+ def initialize(**args)
568
+ update!(**args)
569
+ end
570
+
571
+ # Update properties of this object
572
+ def update!(**args)
573
+ @body_rows = args[:body_rows] if args.key?(:body_rows)
574
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
575
+ @header_rows = args[:header_rows] if args.key?(:header_rows)
576
+ @layout = args[:layout] if args.key?(:layout)
577
+ end
578
+ end
579
+
580
+ # A cell representation inside the table.
581
+ class GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell
582
+ include Google::Apis::Core::Hashable
583
+
584
+ # How many columns this cell spans.
585
+ # Corresponds to the JSON property `colSpan`
586
+ # @return [Fixnum]
587
+ attr_accessor :col_span
588
+
589
+ # A list of detected languages together with confidence.
590
+ # Corresponds to the JSON property `detectedLanguages`
591
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
592
+ attr_accessor :detected_languages
593
+
594
+ # Visual element describing a layout unit on a page.
595
+ # Corresponds to the JSON property `layout`
596
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
597
+ attr_accessor :layout
598
+
599
+ # How many rows this cell spans.
600
+ # Corresponds to the JSON property `rowSpan`
601
+ # @return [Fixnum]
602
+ attr_accessor :row_span
603
+
604
+ def initialize(**args)
605
+ update!(**args)
606
+ end
607
+
608
+ # Update properties of this object
609
+ def update!(**args)
610
+ @col_span = args[:col_span] if args.key?(:col_span)
611
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
612
+ @layout = args[:layout] if args.key?(:layout)
613
+ @row_span = args[:row_span] if args.key?(:row_span)
614
+ end
615
+ end
616
+
617
+ # A row of table cells.
618
+ class GoogleCloudDocumentaiV1beta1DocumentPageTableTableRow
619
+ include Google::Apis::Core::Hashable
620
+
621
+ # Cells that make up this row.
622
+ # Corresponds to the JSON property `cells`
623
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTableTableCell>]
624
+ attr_accessor :cells
625
+
626
+ def initialize(**args)
627
+ update!(**args)
628
+ end
629
+
630
+ # Update properties of this object
631
+ def update!(**args)
632
+ @cells = args[:cells] if args.key?(:cells)
633
+ end
634
+ end
635
+
636
+ # A detected token.
637
+ class GoogleCloudDocumentaiV1beta1DocumentPageToken
638
+ include Google::Apis::Core::Hashable
639
+
640
+ # Detected break at the end of a Token.
641
+ # Corresponds to the JSON property `detectedBreak`
642
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak]
643
+ attr_accessor :detected_break
644
+
645
+ # A list of detected languages together with confidence.
646
+ # Corresponds to the JSON property `detectedLanguages`
647
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
648
+ attr_accessor :detected_languages
649
+
650
+ # Visual element describing a layout unit on a page.
651
+ # Corresponds to the JSON property `layout`
652
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
653
+ attr_accessor :layout
654
+
655
+ def initialize(**args)
656
+ update!(**args)
657
+ end
658
+
659
+ # Update properties of this object
660
+ def update!(**args)
661
+ @detected_break = args[:detected_break] if args.key?(:detected_break)
662
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
663
+ @layout = args[:layout] if args.key?(:layout)
664
+ end
665
+ end
666
+
667
+ # Detected break at the end of a Token.
668
+ class GoogleCloudDocumentaiV1beta1DocumentPageTokenDetectedBreak
669
+ include Google::Apis::Core::Hashable
670
+
671
+ # Detected break type.
672
+ # Corresponds to the JSON property `type`
673
+ # @return [String]
674
+ attr_accessor :type
675
+
676
+ def initialize(**args)
677
+ update!(**args)
678
+ end
679
+
680
+ # Update properties of this object
681
+ def update!(**args)
682
+ @type = args[:type] if args.key?(:type)
683
+ end
684
+ end
685
+
686
+ # Detected non-text visual elements e.g. checkbox, signature etc. on the
687
+ # page.
688
+ class GoogleCloudDocumentaiV1beta1DocumentPageVisualElement
689
+ include Google::Apis::Core::Hashable
690
+
691
+ # A list of detected languages together with confidence.
692
+ # Corresponds to the JSON property `detectedLanguages`
693
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageDetectedLanguage>]
694
+ attr_accessor :detected_languages
695
+
696
+ # Visual element describing a layout unit on a page.
697
+ # Corresponds to the JSON property `layout`
698
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentPageLayout]
699
+ attr_accessor :layout
700
+
701
+ # Type of the VisualElement.
702
+ # Corresponds to the JSON property `type`
703
+ # @return [String]
704
+ attr_accessor :type
705
+
706
+ def initialize(**args)
707
+ update!(**args)
708
+ end
709
+
710
+ # Update properties of this object
711
+ def update!(**args)
712
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
713
+ @layout = args[:layout] if args.key?(:layout)
714
+ @type = args[:type] if args.key?(:type)
715
+ end
716
+ end
717
+
718
+ # For a large document, sharding may be performed to produce several
719
+ # document shards. Each document shard contains this field to detail which
720
+ # shard it is.
721
+ class GoogleCloudDocumentaiV1beta1DocumentShardInfo
722
+ include Google::Apis::Core::Hashable
723
+
724
+ # Total number of shards.
725
+ # Corresponds to the JSON property `shardCount`
726
+ # @return [Fixnum]
727
+ attr_accessor :shard_count
728
+
729
+ # The 0-based index of this shard.
730
+ # Corresponds to the JSON property `shardIndex`
731
+ # @return [Fixnum]
732
+ attr_accessor :shard_index
733
+
734
+ # The index of the first character in Document.text in the overall
735
+ # document global text.
736
+ # Corresponds to the JSON property `textOffset`
737
+ # @return [Fixnum]
738
+ attr_accessor :text_offset
739
+
740
+ def initialize(**args)
741
+ update!(**args)
742
+ end
743
+
744
+ # Update properties of this object
745
+ def update!(**args)
746
+ @shard_count = args[:shard_count] if args.key?(:shard_count)
747
+ @shard_index = args[:shard_index] if args.key?(:shard_index)
748
+ @text_offset = args[:text_offset] if args.key?(:text_offset)
749
+ end
750
+ end
751
+
752
+ # Annotation for common text style attributes. This adheres to CSS
753
+ # conventions as much as possible.
754
+ class GoogleCloudDocumentaiV1beta1DocumentStyle
755
+ include Google::Apis::Core::Hashable
756
+
757
+ # Represents a color in the RGBA color space. This representation is designed
758
+ # for simplicity of conversion to/from color representations in various
759
+ # languages over compactness; for example, the fields of this representation
760
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
761
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
762
+ # method in iOS; and, with just a little work, it can be easily formatted into
763
+ # a CSS "rgba()" string in JavaScript, as well.
764
+ # Note: this proto does not carry information about the absolute color space
765
+ # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
766
+ # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
767
+ # space.
768
+ # Note: when color equality needs to be decided, implementations, unless
769
+ # documented otherwise, will treat two colors to be equal if all their red,
770
+ # green, blue and alpha values each differ by at most 1e-5.
771
+ # Example (Java):
772
+ # import com.google.type.Color;
773
+ # // ...
774
+ # public static java.awt.Color fromProto(Color protocolor) `
775
+ # float alpha = protocolor.hasAlpha()
776
+ # ? protocolor.getAlpha().getValue()
777
+ # : 1.0;
778
+ # return new java.awt.Color(
779
+ # protocolor.getRed(),
780
+ # protocolor.getGreen(),
781
+ # protocolor.getBlue(),
782
+ # alpha);
783
+ # `
784
+ # public static Color toProto(java.awt.Color color) `
785
+ # float red = (float) color.getRed();
786
+ # float green = (float) color.getGreen();
787
+ # float blue = (float) color.getBlue();
788
+ # float denominator = 255.0;
789
+ # Color.Builder resultBuilder =
790
+ # Color
791
+ # .newBuilder()
792
+ # .setRed(red / denominator)
793
+ # .setGreen(green / denominator)
794
+ # .setBlue(blue / denominator);
795
+ # int alpha = color.getAlpha();
796
+ # if (alpha != 255) `
797
+ # result.setAlpha(
798
+ # FloatValue
799
+ # .newBuilder()
800
+ # .setValue(((float) alpha) / denominator)
801
+ # .build());
802
+ # `
803
+ # return resultBuilder.build();
804
+ # `
805
+ # // ...
806
+ # Example (iOS / Obj-C):
807
+ # // ...
808
+ # static UIColor* fromProto(Color* protocolor) `
809
+ # float red = [protocolor red];
810
+ # float green = [protocolor green];
811
+ # float blue = [protocolor blue];
812
+ # FloatValue* alpha_wrapper = [protocolor alpha];
813
+ # float alpha = 1.0;
814
+ # if (alpha_wrapper != nil) `
815
+ # alpha = [alpha_wrapper value];
816
+ # `
817
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
818
+ # `
819
+ # static Color* toProto(UIColor* color) `
820
+ # CGFloat red, green, blue, alpha;
821
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
822
+ # return nil;
823
+ # `
824
+ # Color* result = [[Color alloc] init];
825
+ # [result setRed:red];
826
+ # [result setGreen:green];
827
+ # [result setBlue:blue];
828
+ # if (alpha <= 0.9999) `
829
+ # [result setAlpha:floatWrapperWithValue(alpha)];
830
+ # `
831
+ # [result autorelease];
832
+ # return result;
833
+ # `
834
+ # // ...
835
+ # Example (JavaScript):
836
+ # // ...
837
+ # var protoToCssColor = function(rgb_color) `
838
+ # var redFrac = rgb_color.red || 0.0;
839
+ # var greenFrac = rgb_color.green || 0.0;
840
+ # var blueFrac = rgb_color.blue || 0.0;
841
+ # var red = Math.floor(redFrac * 255);
842
+ # var green = Math.floor(greenFrac * 255);
843
+ # var blue = Math.floor(blueFrac * 255);
844
+ # if (!('alpha' in rgb_color)) `
845
+ # return rgbToCssColor_(red, green, blue);
846
+ # `
847
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
848
+ # var rgbParams = [red, green, blue].join(',');
849
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
850
+ # `;
851
+ # var rgbToCssColor_ = function(red, green, blue) `
852
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
853
+ # var hexString = rgbNumber.toString(16);
854
+ # var missingZeros = 6 - hexString.length;
855
+ # var resultBuilder = ['#'];
856
+ # for (var i = 0; i < missingZeros; i++) `
857
+ # resultBuilder.push('0');
858
+ # `
859
+ # resultBuilder.push(hexString);
860
+ # return resultBuilder.join('');
861
+ # `;
862
+ # // ...
863
+ # Corresponds to the JSON property `backgroundColor`
864
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleTypeColor]
865
+ attr_accessor :background_color
866
+
867
+ # Represents a color in the RGBA color space. This representation is designed
868
+ # for simplicity of conversion to/from color representations in various
869
+ # languages over compactness; for example, the fields of this representation
870
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
871
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
872
+ # method in iOS; and, with just a little work, it can be easily formatted into
873
+ # a CSS "rgba()" string in JavaScript, as well.
874
+ # Note: this proto does not carry information about the absolute color space
875
+ # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
876
+ # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
877
+ # space.
878
+ # Note: when color equality needs to be decided, implementations, unless
879
+ # documented otherwise, will treat two colors to be equal if all their red,
880
+ # green, blue and alpha values each differ by at most 1e-5.
881
+ # Example (Java):
882
+ # import com.google.type.Color;
883
+ # // ...
884
+ # public static java.awt.Color fromProto(Color protocolor) `
885
+ # float alpha = protocolor.hasAlpha()
886
+ # ? protocolor.getAlpha().getValue()
887
+ # : 1.0;
888
+ # return new java.awt.Color(
889
+ # protocolor.getRed(),
890
+ # protocolor.getGreen(),
891
+ # protocolor.getBlue(),
892
+ # alpha);
893
+ # `
894
+ # public static Color toProto(java.awt.Color color) `
895
+ # float red = (float) color.getRed();
896
+ # float green = (float) color.getGreen();
897
+ # float blue = (float) color.getBlue();
898
+ # float denominator = 255.0;
899
+ # Color.Builder resultBuilder =
900
+ # Color
901
+ # .newBuilder()
902
+ # .setRed(red / denominator)
903
+ # .setGreen(green / denominator)
904
+ # .setBlue(blue / denominator);
905
+ # int alpha = color.getAlpha();
906
+ # if (alpha != 255) `
907
+ # result.setAlpha(
908
+ # FloatValue
909
+ # .newBuilder()
910
+ # .setValue(((float) alpha) / denominator)
911
+ # .build());
912
+ # `
913
+ # return resultBuilder.build();
914
+ # `
915
+ # // ...
916
+ # Example (iOS / Obj-C):
917
+ # // ...
918
+ # static UIColor* fromProto(Color* protocolor) `
919
+ # float red = [protocolor red];
920
+ # float green = [protocolor green];
921
+ # float blue = [protocolor blue];
922
+ # FloatValue* alpha_wrapper = [protocolor alpha];
923
+ # float alpha = 1.0;
924
+ # if (alpha_wrapper != nil) `
925
+ # alpha = [alpha_wrapper value];
926
+ # `
927
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
928
+ # `
929
+ # static Color* toProto(UIColor* color) `
930
+ # CGFloat red, green, blue, alpha;
931
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
932
+ # return nil;
933
+ # `
934
+ # Color* result = [[Color alloc] init];
935
+ # [result setRed:red];
936
+ # [result setGreen:green];
937
+ # [result setBlue:blue];
938
+ # if (alpha <= 0.9999) `
939
+ # [result setAlpha:floatWrapperWithValue(alpha)];
940
+ # `
941
+ # [result autorelease];
942
+ # return result;
943
+ # `
944
+ # // ...
945
+ # Example (JavaScript):
946
+ # // ...
947
+ # var protoToCssColor = function(rgb_color) `
948
+ # var redFrac = rgb_color.red || 0.0;
949
+ # var greenFrac = rgb_color.green || 0.0;
950
+ # var blueFrac = rgb_color.blue || 0.0;
951
+ # var red = Math.floor(redFrac * 255);
952
+ # var green = Math.floor(greenFrac * 255);
953
+ # var blue = Math.floor(blueFrac * 255);
954
+ # if (!('alpha' in rgb_color)) `
955
+ # return rgbToCssColor_(red, green, blue);
956
+ # `
957
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
958
+ # var rgbParams = [red, green, blue].join(',');
959
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
960
+ # `;
961
+ # var rgbToCssColor_ = function(red, green, blue) `
962
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
963
+ # var hexString = rgbNumber.toString(16);
964
+ # var missingZeros = 6 - hexString.length;
965
+ # var resultBuilder = ['#'];
966
+ # for (var i = 0; i < missingZeros; i++) `
967
+ # resultBuilder.push('0');
968
+ # `
969
+ # resultBuilder.push(hexString);
970
+ # return resultBuilder.join('');
971
+ # `;
972
+ # // ...
973
+ # Corresponds to the JSON property `color`
974
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleTypeColor]
975
+ attr_accessor :color
976
+
977
+ # Font size with unit.
978
+ # Corresponds to the JSON property `fontSize`
979
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentStyleFontSize]
980
+ attr_accessor :font_size
981
+
982
+ # Font weight. Possible values are normal, bold, bolder, and lighter.
983
+ # https://www.w3schools.com/cssref/pr_font_weight.asp
984
+ # Corresponds to the JSON property `fontWeight`
985
+ # @return [String]
986
+ attr_accessor :font_weight
987
+
988
+ # Text reference indexing into the Document.text.
989
+ # Corresponds to the JSON property `textAnchor`
990
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor]
991
+ attr_accessor :text_anchor
992
+
993
+ # Text decoration. Follows CSS standard.
994
+ # <text-decoration-line> <text-decoration-color> <text-decoration-style>
995
+ # https://www.w3schools.com/cssref/pr_text_text-decoration.asp
996
+ # Corresponds to the JSON property `textDecoration`
997
+ # @return [String]
998
+ attr_accessor :text_decoration
999
+
1000
+ # Text style. Possible values are normal, italic, and oblique.
1001
+ # https://www.w3schools.com/cssref/pr_font_font-style.asp
1002
+ # Corresponds to the JSON property `textStyle`
1003
+ # @return [String]
1004
+ attr_accessor :text_style
1005
+
1006
+ def initialize(**args)
1007
+ update!(**args)
1008
+ end
1009
+
1010
+ # Update properties of this object
1011
+ def update!(**args)
1012
+ @background_color = args[:background_color] if args.key?(:background_color)
1013
+ @color = args[:color] if args.key?(:color)
1014
+ @font_size = args[:font_size] if args.key?(:font_size)
1015
+ @font_weight = args[:font_weight] if args.key?(:font_weight)
1016
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
1017
+ @text_decoration = args[:text_decoration] if args.key?(:text_decoration)
1018
+ @text_style = args[:text_style] if args.key?(:text_style)
1019
+ end
1020
+ end
1021
+
1022
+ # Font size with unit.
1023
+ class GoogleCloudDocumentaiV1beta1DocumentStyleFontSize
1024
+ include Google::Apis::Core::Hashable
1025
+
1026
+ # Font size for the text.
1027
+ # Corresponds to the JSON property `size`
1028
+ # @return [Float]
1029
+ attr_accessor :size
1030
+
1031
+ # Unit for the font size. Follows CSS naming (in, px, pt, etc.).
1032
+ # Corresponds to the JSON property `unit`
1033
+ # @return [String]
1034
+ attr_accessor :unit
1035
+
1036
+ def initialize(**args)
1037
+ update!(**args)
1038
+ end
1039
+
1040
+ # Update properties of this object
1041
+ def update!(**args)
1042
+ @size = args[:size] if args.key?(:size)
1043
+ @unit = args[:unit] if args.key?(:unit)
1044
+ end
1045
+ end
1046
+
1047
+ # Text reference indexing into the Document.text.
1048
+ class GoogleCloudDocumentaiV1beta1DocumentTextAnchor
1049
+ include Google::Apis::Core::Hashable
1050
+
1051
+ # The text segments from the Document.text.
1052
+ # Corresponds to the JSON property `textSegments`
1053
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment>]
1054
+ attr_accessor :text_segments
1055
+
1056
+ def initialize(**args)
1057
+ update!(**args)
1058
+ end
1059
+
1060
+ # Update properties of this object
1061
+ def update!(**args)
1062
+ @text_segments = args[:text_segments] if args.key?(:text_segments)
1063
+ end
1064
+ end
1065
+
1066
+ # A text segment in the Document.text. The indices may be out of bounds
1067
+ # which indicate that the text extends into another document shard for
1068
+ # large sharded documents. See ShardInfo.text_offset
1069
+ class GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment
1070
+ include Google::Apis::Core::Hashable
1071
+
1072
+ # TextSegment half open end UTF-8 char index in the
1073
+ # Document.text.
1074
+ # Corresponds to the JSON property `endIndex`
1075
+ # @return [Fixnum]
1076
+ attr_accessor :end_index
1077
+
1078
+ # TextSegment start UTF-8 char index in the Document.text.
1079
+ # Corresponds to the JSON property `startIndex`
1080
+ # @return [Fixnum]
1081
+ attr_accessor :start_index
1082
+
1083
+ def initialize(**args)
1084
+ update!(**args)
1085
+ end
1086
+
1087
+ # Update properties of this object
1088
+ def update!(**args)
1089
+ @end_index = args[:end_index] if args.key?(:end_index)
1090
+ @start_index = args[:start_index] if args.key?(:start_index)
1091
+ end
1092
+ end
1093
+
1094
+ # A translation of the text segment.
1095
+ class GoogleCloudDocumentaiV1beta1DocumentTranslation
1096
+ include Google::Apis::Core::Hashable
1097
+
1098
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
1099
+ # information, see
1100
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1101
+ # Corresponds to the JSON property `languageCode`
1102
+ # @return [String]
1103
+ attr_accessor :language_code
1104
+
1105
+ # Text reference indexing into the Document.text.
1106
+ # Corresponds to the JSON property `textAnchor`
1107
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchor]
1108
+ attr_accessor :text_anchor
1109
+
1110
+ # Text translated into the target language.
1111
+ # Corresponds to the JSON property `translatedText`
1112
+ # @return [String]
1113
+ attr_accessor :translated_text
1114
+
1115
+ def initialize(**args)
1116
+ update!(**args)
1117
+ end
1118
+
1119
+ # Update properties of this object
1120
+ def update!(**args)
1121
+ @language_code = args[:language_code] if args.key?(:language_code)
1122
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
1123
+ @translated_text = args[:translated_text] if args.key?(:translated_text)
1124
+ end
1125
+ end
1126
+
1127
+ # The Google Cloud Storage location where the output file will be written to.
1128
+ class GoogleCloudDocumentaiV1beta1GcsDestination
1129
+ include Google::Apis::Core::Hashable
1130
+
1131
+ #
1132
+ # Corresponds to the JSON property `uri`
1133
+ # @return [String]
1134
+ attr_accessor :uri
1135
+
1136
+ def initialize(**args)
1137
+ update!(**args)
1138
+ end
1139
+
1140
+ # Update properties of this object
1141
+ def update!(**args)
1142
+ @uri = args[:uri] if args.key?(:uri)
1143
+ end
1144
+ end
1145
+
1146
+ # The Google Cloud Storage location where the input file will be read from.
1147
+ class GoogleCloudDocumentaiV1beta1GcsSource
1148
+ include Google::Apis::Core::Hashable
1149
+
1150
+ #
1151
+ # Corresponds to the JSON property `uri`
1152
+ # @return [String]
1153
+ attr_accessor :uri
1154
+
1155
+ def initialize(**args)
1156
+ update!(**args)
1157
+ end
1158
+
1159
+ # Update properties of this object
1160
+ def update!(**args)
1161
+ @uri = args[:uri] if args.key?(:uri)
1162
+ end
1163
+ end
1164
+
1165
+ # The desired input location and metadata.
1166
+ class GoogleCloudDocumentaiV1beta1InputConfig
1167
+ include Google::Apis::Core::Hashable
1168
+
1169
+ # The Google Cloud Storage location where the input file will be read from.
1170
+ # Corresponds to the JSON property `gcsSource`
1171
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1GcsSource]
1172
+ attr_accessor :gcs_source
1173
+
1174
+ # Required. Mimetype of the input. Current supported mimetypes are application/
1175
+ # pdf,
1176
+ # image/tiff, and image/gif.
1177
+ # In addition, application/json type is supported for requests with
1178
+ # ProcessDocumentRequest.automl_params field set. The JSON file needs to
1179
+ # be in Document format.
1180
+ # Corresponds to the JSON property `mimeType`
1181
+ # @return [String]
1182
+ attr_accessor :mime_type
1183
+
1184
+ def initialize(**args)
1185
+ update!(**args)
1186
+ end
1187
+
1188
+ # Update properties of this object
1189
+ def update!(**args)
1190
+ @gcs_source = args[:gcs_source] if args.key?(:gcs_source)
1191
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
1192
+ end
1193
+ end
1194
+
1195
+ # A vertex represents a 2D point in the image.
1196
+ # NOTE: the normalized vertex coordinates are relative to the original image
1197
+ # and range from 0 to 1.
1198
+ class GoogleCloudDocumentaiV1beta1NormalizedVertex
1199
+ include Google::Apis::Core::Hashable
1200
+
1201
+ # X coordinate.
1202
+ # Corresponds to the JSON property `x`
1203
+ # @return [Float]
1204
+ attr_accessor :x
1205
+
1206
+ # Y coordinate.
1207
+ # Corresponds to the JSON property `y`
1208
+ # @return [Float]
1209
+ attr_accessor :y
1210
+
1211
+ def initialize(**args)
1212
+ update!(**args)
1213
+ end
1214
+
1215
+ # Update properties of this object
1216
+ def update!(**args)
1217
+ @x = args[:x] if args.key?(:x)
1218
+ @y = args[:y] if args.key?(:y)
1219
+ end
1220
+ end
1221
+
1222
+ # Contains metadata for the BatchProcessDocuments operation.
1223
+ class GoogleCloudDocumentaiV1beta1OperationMetadata
1224
+ include Google::Apis::Core::Hashable
1225
+
1226
+ # The creation time of the operation.
1227
+ # Corresponds to the JSON property `createTime`
1228
+ # @return [String]
1229
+ attr_accessor :create_time
1230
+
1231
+ # The state of the current batch processing.
1232
+ # Corresponds to the JSON property `state`
1233
+ # @return [String]
1234
+ attr_accessor :state
1235
+
1236
+ # A message providing more details about the current state of processing.
1237
+ # Corresponds to the JSON property `stateMessage`
1238
+ # @return [String]
1239
+ attr_accessor :state_message
1240
+
1241
+ # The last update time of the operation.
1242
+ # Corresponds to the JSON property `updateTime`
1243
+ # @return [String]
1244
+ attr_accessor :update_time
1245
+
1246
+ def initialize(**args)
1247
+ update!(**args)
1248
+ end
1249
+
1250
+ # Update properties of this object
1251
+ def update!(**args)
1252
+ @create_time = args[:create_time] if args.key?(:create_time)
1253
+ @state = args[:state] if args.key?(:state)
1254
+ @state_message = args[:state_message] if args.key?(:state_message)
1255
+ @update_time = args[:update_time] if args.key?(:update_time)
1256
+ end
1257
+ end
1258
+
1259
+ # The desired output location and metadata.
1260
+ class GoogleCloudDocumentaiV1beta1OutputConfig
1261
+ include Google::Apis::Core::Hashable
1262
+
1263
+ # The Google Cloud Storage location where the output file will be written to.
1264
+ # Corresponds to the JSON property `gcsDestination`
1265
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1GcsDestination]
1266
+ attr_accessor :gcs_destination
1267
+
1268
+ # The max number of pages to include into each output Document shard JSON on
1269
+ # Google Cloud Storage.
1270
+ # The valid range is [1, 100]. If not specified, the default value is 20.
1271
+ # For example, for one pdf file with 100 pages, 100 parsed pages will be
1272
+ # produced. If `pages_per_shard` = 20, then 5 Document shard JSON files each
1273
+ # containing 20 parsed pages will be written under the prefix
1274
+ # OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where
1275
+ # x and y are 1-indexed page numbers.
1276
+ # Example GCS outputs with 157 pages and pages_per_shard = 50:
1277
+ # <prefix>pages-001-to-050.json
1278
+ # <prefix>pages-051-to-100.json
1279
+ # <prefix>pages-101-to-150.json
1280
+ # <prefix>pages-151-to-157.json
1281
+ # Corresponds to the JSON property `pagesPerShard`
1282
+ # @return [Fixnum]
1283
+ attr_accessor :pages_per_shard
1284
+
1285
+ def initialize(**args)
1286
+ update!(**args)
1287
+ end
1288
+
1289
+ # Update properties of this object
1290
+ def update!(**args)
1291
+ @gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
1292
+ @pages_per_shard = args[:pages_per_shard] if args.key?(:pages_per_shard)
1293
+ end
1294
+ end
1295
+
1296
+ # Response to a single document processing request.
1297
+ class GoogleCloudDocumentaiV1beta1ProcessDocumentResponse
1298
+ include Google::Apis::Core::Hashable
1299
+
1300
+ # The desired input location and metadata.
1301
+ # Corresponds to the JSON property `inputConfig`
1302
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1InputConfig]
1303
+ attr_accessor :input_config
1304
+
1305
+ # The desired output location and metadata.
1306
+ # Corresponds to the JSON property `outputConfig`
1307
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1OutputConfig]
1308
+ attr_accessor :output_config
1309
+
1310
+ def initialize(**args)
1311
+ update!(**args)
1312
+ end
1313
+
1314
+ # Update properties of this object
1315
+ def update!(**args)
1316
+ @input_config = args[:input_config] if args.key?(:input_config)
1317
+ @output_config = args[:output_config] if args.key?(:output_config)
1318
+ end
1319
+ end
1320
+
1321
+ # A vertex represents a 2D point in the image.
1322
+ # NOTE: the vertex coordinates are in the same scale as the original image.
1323
+ class GoogleCloudDocumentaiV1beta1Vertex
1324
+ include Google::Apis::Core::Hashable
1325
+
1326
+ # X coordinate.
1327
+ # Corresponds to the JSON property `x`
1328
+ # @return [Fixnum]
1329
+ attr_accessor :x
1330
+
1331
+ # Y coordinate.
1332
+ # Corresponds to the JSON property `y`
1333
+ # @return [Fixnum]
1334
+ attr_accessor :y
1335
+
1336
+ def initialize(**args)
1337
+ update!(**args)
1338
+ end
1339
+
1340
+ # Update properties of this object
1341
+ def update!(**args)
1342
+ @x = args[:x] if args.key?(:x)
1343
+ @y = args[:y] if args.key?(:y)
1344
+ end
1345
+ end
1346
+
1347
+ # Parameters to control AutoML model prediction behavior.
1348
+ class GoogleCloudDocumentaiV1beta2AutoMlParams
1349
+ include Google::Apis::Core::Hashable
1350
+
1351
+ # Resource name of the AutoML model.
1352
+ # Format: `projects/`project-id`/locations/`location-id`/models/`model-id``.
1353
+ # Corresponds to the JSON property `model`
1354
+ # @return [String]
1355
+ attr_accessor :model
1356
+
1357
+ def initialize(**args)
1358
+ update!(**args)
1359
+ end
1360
+
1361
+ # Update properties of this object
1362
+ def update!(**args)
1363
+ @model = args[:model] if args.key?(:model)
1364
+ end
1365
+ end
1366
+
1367
+ # Request to batch process documents as an asynchronous operation. The output
1368
+ # is written to Cloud Storage as JSON in the [Document] format.
1369
+ class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest
1370
+ include Google::Apis::Core::Hashable
1371
+
1372
+ # Required. Individual requests for each document.
1373
+ # Corresponds to the JSON property `requests`
1374
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentRequest>]
1375
+ attr_accessor :requests
1376
+
1377
+ def initialize(**args)
1378
+ update!(**args)
1379
+ end
1380
+
1381
+ # Update properties of this object
1382
+ def update!(**args)
1383
+ @requests = args[:requests] if args.key?(:requests)
1384
+ end
1385
+ end
1386
+
1387
+ # Response to an batch document processing request. This is returned in
1388
+ # the LRO Operation after the operation is complete.
1389
+ class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsResponse
1390
+ include Google::Apis::Core::Hashable
1391
+
1392
+ # Responses for each individual document.
1393
+ # Corresponds to the JSON property `responses`
1394
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentResponse>]
1395
+ attr_accessor :responses
1396
+
1397
+ def initialize(**args)
1398
+ update!(**args)
1399
+ end
1400
+
1401
+ # Update properties of this object
1402
+ def update!(**args)
1403
+ @responses = args[:responses] if args.key?(:responses)
1404
+ end
1405
+ end
1406
+
1407
+ # A bounding polygon for the detected image annotation.
1408
+ class GoogleCloudDocumentaiV1beta2BoundingPoly
1409
+ include Google::Apis::Core::Hashable
1410
+
1411
+ # The bounding polygon normalized vertices.
1412
+ # Corresponds to the JSON property `normalizedVertices`
1413
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2NormalizedVertex>]
1414
+ attr_accessor :normalized_vertices
1415
+
1416
+ # The bounding polygon vertices.
1417
+ # Corresponds to the JSON property `vertices`
1418
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Vertex>]
1419
+ attr_accessor :vertices
1420
+
1421
+ def initialize(**args)
1422
+ update!(**args)
1423
+ end
1424
+
1425
+ # Update properties of this object
1426
+ def update!(**args)
1427
+ @normalized_vertices = args[:normalized_vertices] if args.key?(:normalized_vertices)
1428
+ @vertices = args[:vertices] if args.key?(:vertices)
1429
+ end
1430
+ end
1431
+
1432
+ # Document represents the canonical document resource in Document Understanding
1433
+ # AI.
1434
+ # It is an interchange format that provides insights into documents and allows
1435
+ # for collaboration between users and Document Understanding AI to iterate and
1436
+ # optimize for quality.
1437
+ class GoogleCloudDocumentaiV1beta2Document
1438
+ include Google::Apis::Core::Hashable
1439
+
1440
+ # Inline document content, represented as a stream of bytes.
1441
+ # Note: As with all `bytes` fields, protobuffers use a pure binary
1442
+ # representation, whereas JSON representations use base64.
1443
+ # Corresponds to the JSON property `content`
1444
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
1445
+ # @return [String]
1446
+ attr_accessor :content
1447
+
1448
+ # A list of entities detected on Document.text. For document shards,
1449
+ # entities in this list may cross shard boundaries.
1450
+ # Corresponds to the JSON property `entities`
1451
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntity>]
1452
+ attr_accessor :entities
1453
+
1454
+ # Relationship among Document.entities.
1455
+ # Corresponds to the JSON property `entityRelations`
1456
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentEntityRelation>]
1457
+ attr_accessor :entity_relations
1458
+
1459
+ # The `Status` type defines a logical error model that is suitable for
1460
+ # different programming environments, including REST APIs and RPC APIs. It is
1461
+ # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1462
+ # three pieces of data: error code, error message, and error details.
1463
+ # You can find out more about this error model and how to work with it in the
1464
+ # [API Design Guide](https://cloud.google.com/apis/design/errors).
1465
+ # Corresponds to the JSON property `error`
1466
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleRpcStatus]
1467
+ attr_accessor :error
1468
+
1469
+ # Labels for this document.
1470
+ # Corresponds to the JSON property `labels`
1471
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentLabel>]
1472
+ attr_accessor :labels
1473
+
1474
+ # An IANA published MIME type (also referred to as media type). For more
1475
+ # information, see
1476
+ # https://www.iana.org/assignments/media-types/media-types.xhtml.
1477
+ # Corresponds to the JSON property `mimeType`
1478
+ # @return [String]
1479
+ attr_accessor :mime_type
1480
+
1481
+ # Visual page layout for the Document.
1482
+ # Corresponds to the JSON property `pages`
1483
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPage>]
1484
+ attr_accessor :pages
1485
+
1486
+ # For a large document, sharding may be performed to produce several
1487
+ # document shards. Each document shard contains this field to detail which
1488
+ # shard it is.
1489
+ # Corresponds to the JSON property `shardInfo`
1490
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentShardInfo]
1491
+ attr_accessor :shard_info
1492
+
1493
+ # UTF-8 encoded text in reading order from the document.
1494
+ # Corresponds to the JSON property `text`
1495
+ # @return [String]
1496
+ attr_accessor :text
1497
+
1498
+ # Styles for the Document.text.
1499
+ # Corresponds to the JSON property `textStyles`
1500
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentStyle>]
1501
+ attr_accessor :text_styles
1502
+
1503
+ # A list of translations on Document.text. For document shards,
1504
+ # translations in this list may cross shard boundaries.
1505
+ # Corresponds to the JSON property `translations`
1506
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTranslation>]
1507
+ attr_accessor :translations
1508
+
1509
+ # Currently supports Google Cloud Storage URI of the form
1510
+ # `gs://bucket_name/object_name`. Object versioning is not supported.
1511
+ # See [Google Cloud Storage Request
1512
+ # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
1513
+ # info.
1514
+ # Corresponds to the JSON property `uri`
1515
+ # @return [String]
1516
+ attr_accessor :uri
1517
+
1518
+ def initialize(**args)
1519
+ update!(**args)
1520
+ end
1521
+
1522
+ # Update properties of this object
1523
+ def update!(**args)
1524
+ @content = args[:content] if args.key?(:content)
1525
+ @entities = args[:entities] if args.key?(:entities)
1526
+ @entity_relations = args[:entity_relations] if args.key?(:entity_relations)
1527
+ @error = args[:error] if args.key?(:error)
1528
+ @labels = args[:labels] if args.key?(:labels)
1529
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
1530
+ @pages = args[:pages] if args.key?(:pages)
1531
+ @shard_info = args[:shard_info] if args.key?(:shard_info)
1532
+ @text = args[:text] if args.key?(:text)
1533
+ @text_styles = args[:text_styles] if args.key?(:text_styles)
1534
+ @translations = args[:translations] if args.key?(:translations)
1535
+ @uri = args[:uri] if args.key?(:uri)
1536
+ end
1537
+ end
1538
+
1539
+ # A phrase in the text that is a known entity type, such as a person, an
1540
+ # organization, or location.
1541
+ class GoogleCloudDocumentaiV1beta2DocumentEntity
1542
+ include Google::Apis::Core::Hashable
1543
+
1544
+ # Optional. Confidence of detected Schema entity. Range [0, 1].
1545
+ # Corresponds to the JSON property `confidence`
1546
+ # @return [Float]
1547
+ attr_accessor :confidence
1548
+
1549
+ # Deprecated. Use `id` field instead.
1550
+ # Corresponds to the JSON property `mentionId`
1551
+ # @return [String]
1552
+ attr_accessor :mention_id
1553
+
1554
+ # Text value in the document e.g. `1600 Amphitheatre Pkwy`.
1555
+ # Corresponds to the JSON property `mentionText`
1556
+ # @return [String]
1557
+ attr_accessor :mention_text
1558
+
1559
+ # Text reference indexing into the Document.text.
1560
+ # Corresponds to the JSON property `textAnchor`
1561
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor]
1562
+ attr_accessor :text_anchor
1563
+
1564
+ # Entity type from a schema e.g. `Address`.
1565
+ # Corresponds to the JSON property `type`
1566
+ # @return [String]
1567
+ attr_accessor :type
1568
+
1569
+ def initialize(**args)
1570
+ update!(**args)
1571
+ end
1572
+
1573
+ # Update properties of this object
1574
+ def update!(**args)
1575
+ @confidence = args[:confidence] if args.key?(:confidence)
1576
+ @mention_id = args[:mention_id] if args.key?(:mention_id)
1577
+ @mention_text = args[:mention_text] if args.key?(:mention_text)
1578
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
1579
+ @type = args[:type] if args.key?(:type)
1580
+ end
1581
+ end
1582
+
1583
+ # Relationship between Entities.
1584
+ class GoogleCloudDocumentaiV1beta2DocumentEntityRelation
1585
+ include Google::Apis::Core::Hashable
1586
+
1587
+ # Object entity id.
1588
+ # Corresponds to the JSON property `objectId`
1589
+ # @return [String]
1590
+ attr_accessor :object_id_prop
1591
+
1592
+ # Relationship description.
1593
+ # Corresponds to the JSON property `relation`
1594
+ # @return [String]
1595
+ attr_accessor :relation
1596
+
1597
+ # Subject entity id.
1598
+ # Corresponds to the JSON property `subjectId`
1599
+ # @return [String]
1600
+ attr_accessor :subject_id
1601
+
1602
+ def initialize(**args)
1603
+ update!(**args)
1604
+ end
1605
+
1606
+ # Update properties of this object
1607
+ def update!(**args)
1608
+ @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)
1609
+ @relation = args[:relation] if args.key?(:relation)
1610
+ @subject_id = args[:subject_id] if args.key?(:subject_id)
1611
+ end
1612
+ end
1613
+
1614
+ # Label attaches schema information and/or other metadata to segments within
1615
+ # a Document. Multiple Labels on a single field can denote either
1616
+ # different labels, different instances of the same label created at
1617
+ # different times, or some combination of both.
1618
+ class GoogleCloudDocumentaiV1beta2DocumentLabel
1619
+ include Google::Apis::Core::Hashable
1620
+
1621
+ # Label is generated AutoML model. This field stores the full resource
1622
+ # name of the AutoML model.
1623
+ # Format:
1624
+ # `projects/`project-id`/locations/`location-id`/models/`model-id``
1625
+ # Corresponds to the JSON property `automlModel`
1626
+ # @return [String]
1627
+ attr_accessor :automl_model
1628
+
1629
+ # Confidence score between 0 and 1 for label assignment.
1630
+ # Corresponds to the JSON property `confidence`
1631
+ # @return [Float]
1632
+ attr_accessor :confidence
1633
+
1634
+ # Name of the label.
1635
+ # When the label is generated from AutoML Text Classification model, this
1636
+ # field represents the name of the category.
1637
+ # Corresponds to the JSON property `name`
1638
+ # @return [String]
1639
+ attr_accessor :name
1640
+
1641
+ def initialize(**args)
1642
+ update!(**args)
1643
+ end
1644
+
1645
+ # Update properties of this object
1646
+ def update!(**args)
1647
+ @automl_model = args[:automl_model] if args.key?(:automl_model)
1648
+ @confidence = args[:confidence] if args.key?(:confidence)
1649
+ @name = args[:name] if args.key?(:name)
1650
+ end
1651
+ end
1652
+
1653
+ # A page in a Document.
1654
+ class GoogleCloudDocumentaiV1beta2DocumentPage
1655
+ include Google::Apis::Core::Hashable
1656
+
1657
+ # A list of visually detected text blocks on the page.
1658
+ # A block has a set of lines (collected into paragraphs) that have a common
1659
+ # line-spacing and orientation.
1660
+ # Corresponds to the JSON property `blocks`
1661
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageBlock>]
1662
+ attr_accessor :blocks
1663
+
1664
+ # A list of detected languages together with confidence.
1665
+ # Corresponds to the JSON property `detectedLanguages`
1666
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1667
+ attr_accessor :detected_languages
1668
+
1669
+ # Dimension for the page.
1670
+ # Corresponds to the JSON property `dimension`
1671
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDimension]
1672
+ attr_accessor :dimension
1673
+
1674
+ # A list of visually detected form fields on the page.
1675
+ # Corresponds to the JSON property `formFields`
1676
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageFormField>]
1677
+ attr_accessor :form_fields
1678
+
1679
+ # Visual element describing a layout unit on a page.
1680
+ # Corresponds to the JSON property `layout`
1681
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1682
+ attr_accessor :layout
1683
+
1684
+ # A list of visually detected text lines on the page.
1685
+ # A collection of tokens that a human would perceive as a line.
1686
+ # Corresponds to the JSON property `lines`
1687
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLine>]
1688
+ attr_accessor :lines
1689
+
1690
+ # 1-based index for current Page in a parent Document.
1691
+ # Useful when a page is taken out of a Document for individual
1692
+ # processing.
1693
+ # Corresponds to the JSON property `pageNumber`
1694
+ # @return [Fixnum]
1695
+ attr_accessor :page_number
1696
+
1697
+ # A list of visually detected text paragraphs on the page.
1698
+ # A collection of lines that a human would perceive as a paragraph.
1699
+ # Corresponds to the JSON property `paragraphs`
1700
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageParagraph>]
1701
+ attr_accessor :paragraphs
1702
+
1703
+ # A list of visually detected tables on the page.
1704
+ # Corresponds to the JSON property `tables`
1705
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTable>]
1706
+ attr_accessor :tables
1707
+
1708
+ # A list of visually detected tokens on the page.
1709
+ # Corresponds to the JSON property `tokens`
1710
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageToken>]
1711
+ attr_accessor :tokens
1712
+
1713
+ # A list of detected non-text visual elements e.g. checkbox,
1714
+ # signature etc. on the page.
1715
+ # Corresponds to the JSON property `visualElements`
1716
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageVisualElement>]
1717
+ attr_accessor :visual_elements
1718
+
1719
+ def initialize(**args)
1720
+ update!(**args)
1721
+ end
1722
+
1723
+ # Update properties of this object
1724
+ def update!(**args)
1725
+ @blocks = args[:blocks] if args.key?(:blocks)
1726
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
1727
+ @dimension = args[:dimension] if args.key?(:dimension)
1728
+ @form_fields = args[:form_fields] if args.key?(:form_fields)
1729
+ @layout = args[:layout] if args.key?(:layout)
1730
+ @lines = args[:lines] if args.key?(:lines)
1731
+ @page_number = args[:page_number] if args.key?(:page_number)
1732
+ @paragraphs = args[:paragraphs] if args.key?(:paragraphs)
1733
+ @tables = args[:tables] if args.key?(:tables)
1734
+ @tokens = args[:tokens] if args.key?(:tokens)
1735
+ @visual_elements = args[:visual_elements] if args.key?(:visual_elements)
1736
+ end
1737
+ end
1738
+
1739
+ # A block has a set of lines (collected into paragraphs) that have a
1740
+ # common line-spacing and orientation.
1741
+ class GoogleCloudDocumentaiV1beta2DocumentPageBlock
1742
+ include Google::Apis::Core::Hashable
1743
+
1744
+ # A list of detected languages together with confidence.
1745
+ # Corresponds to the JSON property `detectedLanguages`
1746
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1747
+ attr_accessor :detected_languages
1748
+
1749
+ # Visual element describing a layout unit on a page.
1750
+ # Corresponds to the JSON property `layout`
1751
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1752
+ attr_accessor :layout
1753
+
1754
+ def initialize(**args)
1755
+ update!(**args)
1756
+ end
1757
+
1758
+ # Update properties of this object
1759
+ def update!(**args)
1760
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
1761
+ @layout = args[:layout] if args.key?(:layout)
1762
+ end
1763
+ end
1764
+
1765
+ # Detected language for a structural component.
1766
+ class GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage
1767
+ include Google::Apis::Core::Hashable
1768
+
1769
+ # Confidence of detected language. Range [0, 1].
1770
+ # Corresponds to the JSON property `confidence`
1771
+ # @return [Float]
1772
+ attr_accessor :confidence
1773
+
1774
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
1775
+ # information, see
1776
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1777
+ # Corresponds to the JSON property `languageCode`
1778
+ # @return [String]
1779
+ attr_accessor :language_code
1780
+
1781
+ def initialize(**args)
1782
+ update!(**args)
1783
+ end
1784
+
1785
+ # Update properties of this object
1786
+ def update!(**args)
1787
+ @confidence = args[:confidence] if args.key?(:confidence)
1788
+ @language_code = args[:language_code] if args.key?(:language_code)
1789
+ end
1790
+ end
1791
+
1792
+ # Dimension for the page.
1793
+ class GoogleCloudDocumentaiV1beta2DocumentPageDimension
1794
+ include Google::Apis::Core::Hashable
1795
+
1796
+ # Page height.
1797
+ # Corresponds to the JSON property `height`
1798
+ # @return [Float]
1799
+ attr_accessor :height
1800
+
1801
+ # Dimension unit.
1802
+ # Corresponds to the JSON property `unit`
1803
+ # @return [String]
1804
+ attr_accessor :unit
1805
+
1806
+ # Page width.
1807
+ # Corresponds to the JSON property `width`
1808
+ # @return [Float]
1809
+ attr_accessor :width
1810
+
1811
+ def initialize(**args)
1812
+ update!(**args)
1813
+ end
1814
+
1815
+ # Update properties of this object
1816
+ def update!(**args)
1817
+ @height = args[:height] if args.key?(:height)
1818
+ @unit = args[:unit] if args.key?(:unit)
1819
+ @width = args[:width] if args.key?(:width)
1820
+ end
1821
+ end
1822
+
1823
+ # A form field detected on the page.
1824
+ class GoogleCloudDocumentaiV1beta2DocumentPageFormField
1825
+ include Google::Apis::Core::Hashable
1826
+
1827
+ # Visual element describing a layout unit on a page.
1828
+ # Corresponds to the JSON property `fieldName`
1829
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1830
+ attr_accessor :field_name
1831
+
1832
+ # Visual element describing a layout unit on a page.
1833
+ # Corresponds to the JSON property `fieldValue`
1834
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1835
+ attr_accessor :field_value
1836
+
1837
+ # A list of detected languages for name together with confidence.
1838
+ # Corresponds to the JSON property `nameDetectedLanguages`
1839
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1840
+ attr_accessor :name_detected_languages
1841
+
1842
+ # A list of detected languages for value together with confidence.
1843
+ # Corresponds to the JSON property `valueDetectedLanguages`
1844
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1845
+ attr_accessor :value_detected_languages
1846
+
1847
+ # If the value is non-textual, this field represents the type. Current
1848
+ # valid values are:
1849
+ # - blank (this indicates the field_value is normal text)
1850
+ # - "unfilled_checkbox"
1851
+ # - "filled_checkbox"
1852
+ # Corresponds to the JSON property `valueType`
1853
+ # @return [String]
1854
+ attr_accessor :value_type
1855
+
1856
+ def initialize(**args)
1857
+ update!(**args)
1858
+ end
1859
+
1860
+ # Update properties of this object
1861
+ def update!(**args)
1862
+ @field_name = args[:field_name] if args.key?(:field_name)
1863
+ @field_value = args[:field_value] if args.key?(:field_value)
1864
+ @name_detected_languages = args[:name_detected_languages] if args.key?(:name_detected_languages)
1865
+ @value_detected_languages = args[:value_detected_languages] if args.key?(:value_detected_languages)
1866
+ @value_type = args[:value_type] if args.key?(:value_type)
1867
+ end
1868
+ end
1869
+
1870
+ # Visual element describing a layout unit on a page.
1871
+ class GoogleCloudDocumentaiV1beta2DocumentPageLayout
1872
+ include Google::Apis::Core::Hashable
1873
+
1874
+ # A bounding polygon for the detected image annotation.
1875
+ # Corresponds to the JSON property `boundingPoly`
1876
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly]
1877
+ attr_accessor :bounding_poly
1878
+
1879
+ # Confidence of the current Layout within context of the object this
1880
+ # layout is for. e.g. confidence can be for a single token, a table,
1881
+ # a visual element, etc. depending on context. Range [0, 1].
1882
+ # Corresponds to the JSON property `confidence`
1883
+ # @return [Float]
1884
+ attr_accessor :confidence
1885
+
1886
+ # Detected orientation for the Layout.
1887
+ # Corresponds to the JSON property `orientation`
1888
+ # @return [String]
1889
+ attr_accessor :orientation
1890
+
1891
+ # Text reference indexing into the Document.text.
1892
+ # Corresponds to the JSON property `textAnchor`
1893
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor]
1894
+ attr_accessor :text_anchor
1895
+
1896
+ def initialize(**args)
1897
+ update!(**args)
1898
+ end
1899
+
1900
+ # Update properties of this object
1901
+ def update!(**args)
1902
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
1903
+ @confidence = args[:confidence] if args.key?(:confidence)
1904
+ @orientation = args[:orientation] if args.key?(:orientation)
1905
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
1906
+ end
1907
+ end
1908
+
1909
+ # A collection of tokens that a human would perceive as a line.
1910
+ # Does not cross column boundaries, can be horizontal, vertical, etc.
1911
+ class GoogleCloudDocumentaiV1beta2DocumentPageLine
1912
+ include Google::Apis::Core::Hashable
1913
+
1914
+ # A list of detected languages together with confidence.
1915
+ # Corresponds to the JSON property `detectedLanguages`
1916
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1917
+ attr_accessor :detected_languages
1918
+
1919
+ # Visual element describing a layout unit on a page.
1920
+ # Corresponds to the JSON property `layout`
1921
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1922
+ attr_accessor :layout
1923
+
1924
+ def initialize(**args)
1925
+ update!(**args)
1926
+ end
1927
+
1928
+ # Update properties of this object
1929
+ def update!(**args)
1930
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
1931
+ @layout = args[:layout] if args.key?(:layout)
1932
+ end
1933
+ end
1934
+
1935
+ # A collection of lines that a human would perceive as a paragraph.
1936
+ class GoogleCloudDocumentaiV1beta2DocumentPageParagraph
1937
+ include Google::Apis::Core::Hashable
1938
+
1939
+ # A list of detected languages together with confidence.
1940
+ # Corresponds to the JSON property `detectedLanguages`
1941
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1942
+ attr_accessor :detected_languages
1943
+
1944
+ # Visual element describing a layout unit on a page.
1945
+ # Corresponds to the JSON property `layout`
1946
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1947
+ attr_accessor :layout
1948
+
1949
+ def initialize(**args)
1950
+ update!(**args)
1951
+ end
1952
+
1953
+ # Update properties of this object
1954
+ def update!(**args)
1955
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
1956
+ @layout = args[:layout] if args.key?(:layout)
1957
+ end
1958
+ end
1959
+
1960
+ # A table representation similar to HTML table structure.
1961
+ class GoogleCloudDocumentaiV1beta2DocumentPageTable
1962
+ include Google::Apis::Core::Hashable
1963
+
1964
+ # Body rows of the table.
1965
+ # Corresponds to the JSON property `bodyRows`
1966
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow>]
1967
+ attr_accessor :body_rows
1968
+
1969
+ # A list of detected languages together with confidence.
1970
+ # Corresponds to the JSON property `detectedLanguages`
1971
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
1972
+ attr_accessor :detected_languages
1973
+
1974
+ # Header rows of the table.
1975
+ # Corresponds to the JSON property `headerRows`
1976
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow>]
1977
+ attr_accessor :header_rows
1978
+
1979
+ # Visual element describing a layout unit on a page.
1980
+ # Corresponds to the JSON property `layout`
1981
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
1982
+ attr_accessor :layout
1983
+
1984
+ def initialize(**args)
1985
+ update!(**args)
1986
+ end
1987
+
1988
+ # Update properties of this object
1989
+ def update!(**args)
1990
+ @body_rows = args[:body_rows] if args.key?(:body_rows)
1991
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
1992
+ @header_rows = args[:header_rows] if args.key?(:header_rows)
1993
+ @layout = args[:layout] if args.key?(:layout)
1994
+ end
1995
+ end
1996
+
1997
+ # A cell representation inside the table.
1998
+ class GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell
1999
+ include Google::Apis::Core::Hashable
2000
+
2001
+ # How many columns this cell spans.
2002
+ # Corresponds to the JSON property `colSpan`
2003
+ # @return [Fixnum]
2004
+ attr_accessor :col_span
2005
+
2006
+ # A list of detected languages together with confidence.
2007
+ # Corresponds to the JSON property `detectedLanguages`
2008
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
2009
+ attr_accessor :detected_languages
2010
+
2011
+ # Visual element describing a layout unit on a page.
2012
+ # Corresponds to the JSON property `layout`
2013
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
2014
+ attr_accessor :layout
2015
+
2016
+ # How many rows this cell spans.
2017
+ # Corresponds to the JSON property `rowSpan`
2018
+ # @return [Fixnum]
2019
+ attr_accessor :row_span
2020
+
2021
+ def initialize(**args)
2022
+ update!(**args)
2023
+ end
2024
+
2025
+ # Update properties of this object
2026
+ def update!(**args)
2027
+ @col_span = args[:col_span] if args.key?(:col_span)
2028
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
2029
+ @layout = args[:layout] if args.key?(:layout)
2030
+ @row_span = args[:row_span] if args.key?(:row_span)
2031
+ end
2032
+ end
2033
+
2034
+ # A row of table cells.
2035
+ class GoogleCloudDocumentaiV1beta2DocumentPageTableTableRow
2036
+ include Google::Apis::Core::Hashable
2037
+
2038
+ # Cells that make up this row.
2039
+ # Corresponds to the JSON property `cells`
2040
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTableTableCell>]
2041
+ attr_accessor :cells
2042
+
2043
+ def initialize(**args)
2044
+ update!(**args)
2045
+ end
2046
+
2047
+ # Update properties of this object
2048
+ def update!(**args)
2049
+ @cells = args[:cells] if args.key?(:cells)
2050
+ end
2051
+ end
2052
+
2053
+ # A detected token.
2054
+ class GoogleCloudDocumentaiV1beta2DocumentPageToken
2055
+ include Google::Apis::Core::Hashable
2056
+
2057
+ # Detected break at the end of a Token.
2058
+ # Corresponds to the JSON property `detectedBreak`
2059
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak]
2060
+ attr_accessor :detected_break
2061
+
2062
+ # A list of detected languages together with confidence.
2063
+ # Corresponds to the JSON property `detectedLanguages`
2064
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
2065
+ attr_accessor :detected_languages
2066
+
2067
+ # Visual element describing a layout unit on a page.
2068
+ # Corresponds to the JSON property `layout`
2069
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
2070
+ attr_accessor :layout
2071
+
2072
+ def initialize(**args)
2073
+ update!(**args)
2074
+ end
2075
+
2076
+ # Update properties of this object
2077
+ def update!(**args)
2078
+ @detected_break = args[:detected_break] if args.key?(:detected_break)
2079
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
2080
+ @layout = args[:layout] if args.key?(:layout)
2081
+ end
2082
+ end
2083
+
2084
+ # Detected break at the end of a Token.
2085
+ class GoogleCloudDocumentaiV1beta2DocumentPageTokenDetectedBreak
2086
+ include Google::Apis::Core::Hashable
2087
+
2088
+ # Detected break type.
2089
+ # Corresponds to the JSON property `type`
2090
+ # @return [String]
2091
+ attr_accessor :type
2092
+
2093
+ def initialize(**args)
2094
+ update!(**args)
2095
+ end
2096
+
2097
+ # Update properties of this object
2098
+ def update!(**args)
2099
+ @type = args[:type] if args.key?(:type)
2100
+ end
2101
+ end
2102
+
2103
+ # Detected non-text visual elements e.g. checkbox, signature etc. on the
2104
+ # page.
2105
+ class GoogleCloudDocumentaiV1beta2DocumentPageVisualElement
2106
+ include Google::Apis::Core::Hashable
2107
+
2108
+ # A list of detected languages together with confidence.
2109
+ # Corresponds to the JSON property `detectedLanguages`
2110
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageDetectedLanguage>]
2111
+ attr_accessor :detected_languages
2112
+
2113
+ # Visual element describing a layout unit on a page.
2114
+ # Corresponds to the JSON property `layout`
2115
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentPageLayout]
2116
+ attr_accessor :layout
2117
+
2118
+ # Type of the VisualElement.
2119
+ # Corresponds to the JSON property `type`
2120
+ # @return [String]
2121
+ attr_accessor :type
2122
+
2123
+ def initialize(**args)
2124
+ update!(**args)
2125
+ end
2126
+
2127
+ # Update properties of this object
2128
+ def update!(**args)
2129
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
2130
+ @layout = args[:layout] if args.key?(:layout)
2131
+ @type = args[:type] if args.key?(:type)
2132
+ end
2133
+ end
2134
+
2135
+ # For a large document, sharding may be performed to produce several
2136
+ # document shards. Each document shard contains this field to detail which
2137
+ # shard it is.
2138
+ class GoogleCloudDocumentaiV1beta2DocumentShardInfo
2139
+ include Google::Apis::Core::Hashable
2140
+
2141
+ # Total number of shards.
2142
+ # Corresponds to the JSON property `shardCount`
2143
+ # @return [Fixnum]
2144
+ attr_accessor :shard_count
2145
+
2146
+ # The 0-based index of this shard.
2147
+ # Corresponds to the JSON property `shardIndex`
2148
+ # @return [Fixnum]
2149
+ attr_accessor :shard_index
2150
+
2151
+ # The index of the first character in Document.text in the overall
2152
+ # document global text.
2153
+ # Corresponds to the JSON property `textOffset`
2154
+ # @return [Fixnum]
2155
+ attr_accessor :text_offset
2156
+
2157
+ def initialize(**args)
2158
+ update!(**args)
2159
+ end
2160
+
2161
+ # Update properties of this object
2162
+ def update!(**args)
2163
+ @shard_count = args[:shard_count] if args.key?(:shard_count)
2164
+ @shard_index = args[:shard_index] if args.key?(:shard_index)
2165
+ @text_offset = args[:text_offset] if args.key?(:text_offset)
2166
+ end
2167
+ end
2168
+
2169
+ # Annotation for common text style attributes. This adheres to CSS
2170
+ # conventions as much as possible.
2171
+ class GoogleCloudDocumentaiV1beta2DocumentStyle
2172
+ include Google::Apis::Core::Hashable
2173
+
2174
+ # Represents a color in the RGBA color space. This representation is designed
2175
+ # for simplicity of conversion to/from color representations in various
2176
+ # languages over compactness; for example, the fields of this representation
2177
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2178
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2179
+ # method in iOS; and, with just a little work, it can be easily formatted into
2180
+ # a CSS "rgba()" string in JavaScript, as well.
2181
+ # Note: this proto does not carry information about the absolute color space
2182
+ # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
2183
+ # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
2184
+ # space.
2185
+ # Note: when color equality needs to be decided, implementations, unless
2186
+ # documented otherwise, will treat two colors to be equal if all their red,
2187
+ # green, blue and alpha values each differ by at most 1e-5.
2188
+ # Example (Java):
2189
+ # import com.google.type.Color;
2190
+ # // ...
2191
+ # public static java.awt.Color fromProto(Color protocolor) `
2192
+ # float alpha = protocolor.hasAlpha()
2193
+ # ? protocolor.getAlpha().getValue()
2194
+ # : 1.0;
2195
+ # return new java.awt.Color(
2196
+ # protocolor.getRed(),
2197
+ # protocolor.getGreen(),
2198
+ # protocolor.getBlue(),
2199
+ # alpha);
2200
+ # `
2201
+ # public static Color toProto(java.awt.Color color) `
2202
+ # float red = (float) color.getRed();
2203
+ # float green = (float) color.getGreen();
2204
+ # float blue = (float) color.getBlue();
2205
+ # float denominator = 255.0;
2206
+ # Color.Builder resultBuilder =
2207
+ # Color
2208
+ # .newBuilder()
2209
+ # .setRed(red / denominator)
2210
+ # .setGreen(green / denominator)
2211
+ # .setBlue(blue / denominator);
2212
+ # int alpha = color.getAlpha();
2213
+ # if (alpha != 255) `
2214
+ # result.setAlpha(
2215
+ # FloatValue
2216
+ # .newBuilder()
2217
+ # .setValue(((float) alpha) / denominator)
2218
+ # .build());
2219
+ # `
2220
+ # return resultBuilder.build();
2221
+ # `
2222
+ # // ...
2223
+ # Example (iOS / Obj-C):
2224
+ # // ...
2225
+ # static UIColor* fromProto(Color* protocolor) `
2226
+ # float red = [protocolor red];
2227
+ # float green = [protocolor green];
2228
+ # float blue = [protocolor blue];
2229
+ # FloatValue* alpha_wrapper = [protocolor alpha];
2230
+ # float alpha = 1.0;
2231
+ # if (alpha_wrapper != nil) `
2232
+ # alpha = [alpha_wrapper value];
2233
+ # `
2234
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2235
+ # `
2236
+ # static Color* toProto(UIColor* color) `
2237
+ # CGFloat red, green, blue, alpha;
2238
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
2239
+ # return nil;
2240
+ # `
2241
+ # Color* result = [[Color alloc] init];
2242
+ # [result setRed:red];
2243
+ # [result setGreen:green];
2244
+ # [result setBlue:blue];
2245
+ # if (alpha <= 0.9999) `
2246
+ # [result setAlpha:floatWrapperWithValue(alpha)];
2247
+ # `
2248
+ # [result autorelease];
2249
+ # return result;
2250
+ # `
2251
+ # // ...
2252
+ # Example (JavaScript):
2253
+ # // ...
2254
+ # var protoToCssColor = function(rgb_color) `
2255
+ # var redFrac = rgb_color.red || 0.0;
2256
+ # var greenFrac = rgb_color.green || 0.0;
2257
+ # var blueFrac = rgb_color.blue || 0.0;
2258
+ # var red = Math.floor(redFrac * 255);
2259
+ # var green = Math.floor(greenFrac * 255);
2260
+ # var blue = Math.floor(blueFrac * 255);
2261
+ # if (!('alpha' in rgb_color)) `
2262
+ # return rgbToCssColor_(red, green, blue);
2263
+ # `
2264
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
2265
+ # var rgbParams = [red, green, blue].join(',');
2266
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2267
+ # `;
2268
+ # var rgbToCssColor_ = function(red, green, blue) `
2269
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2270
+ # var hexString = rgbNumber.toString(16);
2271
+ # var missingZeros = 6 - hexString.length;
2272
+ # var resultBuilder = ['#'];
2273
+ # for (var i = 0; i < missingZeros; i++) `
2274
+ # resultBuilder.push('0');
2275
+ # `
2276
+ # resultBuilder.push(hexString);
2277
+ # return resultBuilder.join('');
2278
+ # `;
2279
+ # // ...
2280
+ # Corresponds to the JSON property `backgroundColor`
2281
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleTypeColor]
2282
+ attr_accessor :background_color
2283
+
2284
+ # Represents a color in the RGBA color space. This representation is designed
2285
+ # for simplicity of conversion to/from color representations in various
2286
+ # languages over compactness; for example, the fields of this representation
2287
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2288
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2289
+ # method in iOS; and, with just a little work, it can be easily formatted into
2290
+ # a CSS "rgba()" string in JavaScript, as well.
2291
+ # Note: this proto does not carry information about the absolute color space
2292
+ # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
2293
+ # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
2294
+ # space.
2295
+ # Note: when color equality needs to be decided, implementations, unless
2296
+ # documented otherwise, will treat two colors to be equal if all their red,
2297
+ # green, blue and alpha values each differ by at most 1e-5.
2298
+ # Example (Java):
2299
+ # import com.google.type.Color;
2300
+ # // ...
2301
+ # public static java.awt.Color fromProto(Color protocolor) `
2302
+ # float alpha = protocolor.hasAlpha()
2303
+ # ? protocolor.getAlpha().getValue()
2304
+ # : 1.0;
2305
+ # return new java.awt.Color(
2306
+ # protocolor.getRed(),
2307
+ # protocolor.getGreen(),
2308
+ # protocolor.getBlue(),
2309
+ # alpha);
2310
+ # `
2311
+ # public static Color toProto(java.awt.Color color) `
2312
+ # float red = (float) color.getRed();
2313
+ # float green = (float) color.getGreen();
2314
+ # float blue = (float) color.getBlue();
2315
+ # float denominator = 255.0;
2316
+ # Color.Builder resultBuilder =
2317
+ # Color
2318
+ # .newBuilder()
2319
+ # .setRed(red / denominator)
2320
+ # .setGreen(green / denominator)
2321
+ # .setBlue(blue / denominator);
2322
+ # int alpha = color.getAlpha();
2323
+ # if (alpha != 255) `
2324
+ # result.setAlpha(
2325
+ # FloatValue
2326
+ # .newBuilder()
2327
+ # .setValue(((float) alpha) / denominator)
2328
+ # .build());
2329
+ # `
2330
+ # return resultBuilder.build();
2331
+ # `
2332
+ # // ...
2333
+ # Example (iOS / Obj-C):
2334
+ # // ...
2335
+ # static UIColor* fromProto(Color* protocolor) `
2336
+ # float red = [protocolor red];
2337
+ # float green = [protocolor green];
2338
+ # float blue = [protocolor blue];
2339
+ # FloatValue* alpha_wrapper = [protocolor alpha];
2340
+ # float alpha = 1.0;
2341
+ # if (alpha_wrapper != nil) `
2342
+ # alpha = [alpha_wrapper value];
2343
+ # `
2344
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2345
+ # `
2346
+ # static Color* toProto(UIColor* color) `
2347
+ # CGFloat red, green, blue, alpha;
2348
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
2349
+ # return nil;
2350
+ # `
2351
+ # Color* result = [[Color alloc] init];
2352
+ # [result setRed:red];
2353
+ # [result setGreen:green];
2354
+ # [result setBlue:blue];
2355
+ # if (alpha <= 0.9999) `
2356
+ # [result setAlpha:floatWrapperWithValue(alpha)];
2357
+ # `
2358
+ # [result autorelease];
2359
+ # return result;
2360
+ # `
2361
+ # // ...
2362
+ # Example (JavaScript):
2363
+ # // ...
2364
+ # var protoToCssColor = function(rgb_color) `
2365
+ # var redFrac = rgb_color.red || 0.0;
2366
+ # var greenFrac = rgb_color.green || 0.0;
2367
+ # var blueFrac = rgb_color.blue || 0.0;
2368
+ # var red = Math.floor(redFrac * 255);
2369
+ # var green = Math.floor(greenFrac * 255);
2370
+ # var blue = Math.floor(blueFrac * 255);
2371
+ # if (!('alpha' in rgb_color)) `
2372
+ # return rgbToCssColor_(red, green, blue);
2373
+ # `
2374
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
2375
+ # var rgbParams = [red, green, blue].join(',');
2376
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2377
+ # `;
2378
+ # var rgbToCssColor_ = function(red, green, blue) `
2379
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2380
+ # var hexString = rgbNumber.toString(16);
2381
+ # var missingZeros = 6 - hexString.length;
2382
+ # var resultBuilder = ['#'];
2383
+ # for (var i = 0; i < missingZeros; i++) `
2384
+ # resultBuilder.push('0');
2385
+ # `
2386
+ # resultBuilder.push(hexString);
2387
+ # return resultBuilder.join('');
2388
+ # `;
2389
+ # // ...
2390
+ # Corresponds to the JSON property `color`
2391
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleTypeColor]
2392
+ attr_accessor :color
2393
+
2394
+ # Font size with unit.
2395
+ # Corresponds to the JSON property `fontSize`
2396
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentStyleFontSize]
2397
+ attr_accessor :font_size
2398
+
2399
+ # Font weight. Possible values are normal, bold, bolder, and lighter.
2400
+ # https://www.w3schools.com/cssref/pr_font_weight.asp
2401
+ # Corresponds to the JSON property `fontWeight`
2402
+ # @return [String]
2403
+ attr_accessor :font_weight
2404
+
2405
+ # Text reference indexing into the Document.text.
2406
+ # Corresponds to the JSON property `textAnchor`
2407
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor]
2408
+ attr_accessor :text_anchor
2409
+
2410
+ # Text decoration. Follows CSS standard.
2411
+ # <text-decoration-line> <text-decoration-color> <text-decoration-style>
2412
+ # https://www.w3schools.com/cssref/pr_text_text-decoration.asp
2413
+ # Corresponds to the JSON property `textDecoration`
2414
+ # @return [String]
2415
+ attr_accessor :text_decoration
2416
+
2417
+ # Text style. Possible values are normal, italic, and oblique.
2418
+ # https://www.w3schools.com/cssref/pr_font_font-style.asp
2419
+ # Corresponds to the JSON property `textStyle`
2420
+ # @return [String]
2421
+ attr_accessor :text_style
2422
+
2423
+ def initialize(**args)
2424
+ update!(**args)
2425
+ end
2426
+
2427
+ # Update properties of this object
2428
+ def update!(**args)
2429
+ @background_color = args[:background_color] if args.key?(:background_color)
2430
+ @color = args[:color] if args.key?(:color)
2431
+ @font_size = args[:font_size] if args.key?(:font_size)
2432
+ @font_weight = args[:font_weight] if args.key?(:font_weight)
2433
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
2434
+ @text_decoration = args[:text_decoration] if args.key?(:text_decoration)
2435
+ @text_style = args[:text_style] if args.key?(:text_style)
2436
+ end
2437
+ end
2438
+
2439
+ # Font size with unit.
2440
+ class GoogleCloudDocumentaiV1beta2DocumentStyleFontSize
2441
+ include Google::Apis::Core::Hashable
2442
+
2443
+ # Font size for the text.
2444
+ # Corresponds to the JSON property `size`
2445
+ # @return [Float]
2446
+ attr_accessor :size
2447
+
2448
+ # Unit for the font size. Follows CSS naming (in, px, pt, etc.).
2449
+ # Corresponds to the JSON property `unit`
2450
+ # @return [String]
2451
+ attr_accessor :unit
2452
+
2453
+ def initialize(**args)
2454
+ update!(**args)
2455
+ end
2456
+
2457
+ # Update properties of this object
2458
+ def update!(**args)
2459
+ @size = args[:size] if args.key?(:size)
2460
+ @unit = args[:unit] if args.key?(:unit)
2461
+ end
2462
+ end
2463
+
2464
+ # Text reference indexing into the Document.text.
2465
+ class GoogleCloudDocumentaiV1beta2DocumentTextAnchor
2466
+ include Google::Apis::Core::Hashable
2467
+
2468
+ # The text segments from the Document.text.
2469
+ # Corresponds to the JSON property `textSegments`
2470
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment>]
2471
+ attr_accessor :text_segments
2472
+
2473
+ def initialize(**args)
2474
+ update!(**args)
2475
+ end
2476
+
2477
+ # Update properties of this object
2478
+ def update!(**args)
2479
+ @text_segments = args[:text_segments] if args.key?(:text_segments)
2480
+ end
2481
+ end
2482
+
2483
+ # A text segment in the Document.text. The indices may be out of bounds
2484
+ # which indicate that the text extends into another document shard for
2485
+ # large sharded documents. See ShardInfo.text_offset
2486
+ class GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment
2487
+ include Google::Apis::Core::Hashable
2488
+
2489
+ # TextSegment half open end UTF-8 char index in the
2490
+ # Document.text.
2491
+ # Corresponds to the JSON property `endIndex`
2492
+ # @return [Fixnum]
2493
+ attr_accessor :end_index
2494
+
2495
+ # TextSegment start UTF-8 char index in the Document.text.
2496
+ # Corresponds to the JSON property `startIndex`
2497
+ # @return [Fixnum]
2498
+ attr_accessor :start_index
2499
+
2500
+ def initialize(**args)
2501
+ update!(**args)
2502
+ end
2503
+
2504
+ # Update properties of this object
2505
+ def update!(**args)
2506
+ @end_index = args[:end_index] if args.key?(:end_index)
2507
+ @start_index = args[:start_index] if args.key?(:start_index)
2508
+ end
2509
+ end
2510
+
2511
+ # A translation of the text segment.
2512
+ class GoogleCloudDocumentaiV1beta2DocumentTranslation
2513
+ include Google::Apis::Core::Hashable
2514
+
2515
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
2516
+ # information, see
2517
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
2518
+ # Corresponds to the JSON property `languageCode`
2519
+ # @return [String]
2520
+ attr_accessor :language_code
2521
+
2522
+ # Text reference indexing into the Document.text.
2523
+ # Corresponds to the JSON property `textAnchor`
2524
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2DocumentTextAnchor]
2525
+ attr_accessor :text_anchor
2526
+
2527
+ # Text translated into the target language.
2528
+ # Corresponds to the JSON property `translatedText`
2529
+ # @return [String]
2530
+ attr_accessor :translated_text
2531
+
2532
+ def initialize(**args)
2533
+ update!(**args)
2534
+ end
2535
+
2536
+ # Update properties of this object
2537
+ def update!(**args)
2538
+ @language_code = args[:language_code] if args.key?(:language_code)
2539
+ @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
2540
+ @translated_text = args[:translated_text] if args.key?(:translated_text)
2541
+ end
2542
+ end
2543
+
2544
+ # Parameters to control entity extraction behavior.
2545
+ class GoogleCloudDocumentaiV1beta2EntityExtractionParams
2546
+ include Google::Apis::Core::Hashable
2547
+
2548
+ # Whether to enable entity extraction.
2549
+ # Corresponds to the JSON property `enabled`
2550
+ # @return [Boolean]
2551
+ attr_accessor :enabled
2552
+ alias_method :enabled?, :enabled
2553
+
2554
+ # Model version of the entity extraction. Default is
2555
+ # "builtin/stable". Specify "builtin/latest" for the latest model.
2556
+ # Corresponds to the JSON property `modelVersion`
2557
+ # @return [String]
2558
+ attr_accessor :model_version
2559
+
2560
+ def initialize(**args)
2561
+ update!(**args)
2562
+ end
2563
+
2564
+ # Update properties of this object
2565
+ def update!(**args)
2566
+ @enabled = args[:enabled] if args.key?(:enabled)
2567
+ @model_version = args[:model_version] if args.key?(:model_version)
2568
+ end
2569
+ end
2570
+
2571
+ # Parameters to control form extraction behavior.
2572
+ class GoogleCloudDocumentaiV1beta2FormExtractionParams
2573
+ include Google::Apis::Core::Hashable
2574
+
2575
+ # Whether to enable form extraction.
2576
+ # Corresponds to the JSON property `enabled`
2577
+ # @return [Boolean]
2578
+ attr_accessor :enabled
2579
+ alias_method :enabled?, :enabled
2580
+
2581
+ # Reserved for future use.
2582
+ # Corresponds to the JSON property `keyValuePairHints`
2583
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2KeyValuePairHint>]
2584
+ attr_accessor :key_value_pair_hints
2585
+
2586
+ # Model version of the form extraction system. Default is
2587
+ # "builtin/stable". Specify "builtin/latest" for the latest model.
2588
+ # For custom form models, specify: “custom/`model_name`". Model name
2589
+ # format is "bucket_name/path/to/modeldir" corresponding to
2590
+ # "gs://bucket_name/path/to/modeldir" where annotated examples are stored.
2591
+ # Corresponds to the JSON property `modelVersion`
2592
+ # @return [String]
2593
+ attr_accessor :model_version
2594
+
2595
+ def initialize(**args)
2596
+ update!(**args)
2597
+ end
2598
+
2599
+ # Update properties of this object
2600
+ def update!(**args)
2601
+ @enabled = args[:enabled] if args.key?(:enabled)
2602
+ @key_value_pair_hints = args[:key_value_pair_hints] if args.key?(:key_value_pair_hints)
2603
+ @model_version = args[:model_version] if args.key?(:model_version)
2604
+ end
2605
+ end
2606
+
2607
+ # The Google Cloud Storage location where the output file will be written to.
2608
+ class GoogleCloudDocumentaiV1beta2GcsDestination
2609
+ include Google::Apis::Core::Hashable
2610
+
2611
+ #
2612
+ # Corresponds to the JSON property `uri`
2613
+ # @return [String]
2614
+ attr_accessor :uri
2615
+
2616
+ def initialize(**args)
2617
+ update!(**args)
2618
+ end
2619
+
2620
+ # Update properties of this object
2621
+ def update!(**args)
2622
+ @uri = args[:uri] if args.key?(:uri)
2623
+ end
2624
+ end
2625
+
2626
+ # The Google Cloud Storage location where the input file will be read from.
2627
+ class GoogleCloudDocumentaiV1beta2GcsSource
2628
+ include Google::Apis::Core::Hashable
2629
+
2630
+ #
2631
+ # Corresponds to the JSON property `uri`
2632
+ # @return [String]
2633
+ attr_accessor :uri
2634
+
2635
+ def initialize(**args)
2636
+ update!(**args)
2637
+ end
2638
+
2639
+ # Update properties of this object
2640
+ def update!(**args)
2641
+ @uri = args[:uri] if args.key?(:uri)
2642
+ end
2643
+ end
2644
+
2645
+ # The desired input location and metadata.
2646
+ class GoogleCloudDocumentaiV1beta2InputConfig
2647
+ include Google::Apis::Core::Hashable
2648
+
2649
+ # Content in bytes, represented as a stream of bytes.
2650
+ # Note: As with all `bytes` fields, proto buffer messages use a pure binary
2651
+ # representation, whereas JSON representations use base64.
2652
+ # This field only works for synchronous ProcessDocument method.
2653
+ # Corresponds to the JSON property `contents`
2654
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
2655
+ # @return [String]
2656
+ attr_accessor :contents
2657
+
2658
+ # The Google Cloud Storage location where the input file will be read from.
2659
+ # Corresponds to the JSON property `gcsSource`
2660
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2GcsSource]
2661
+ attr_accessor :gcs_source
2662
+
2663
+ # Required. Mimetype of the input. Current supported mimetypes are application/
2664
+ # pdf,
2665
+ # image/tiff, and image/gif.
2666
+ # In addition, application/json type is supported for requests with
2667
+ # ProcessDocumentRequest.automl_params field set. The JSON file needs to
2668
+ # be in Document format.
2669
+ # Corresponds to the JSON property `mimeType`
2670
+ # @return [String]
2671
+ attr_accessor :mime_type
2672
+
2673
+ def initialize(**args)
2674
+ update!(**args)
2675
+ end
2676
+
2677
+ # Update properties of this object
2678
+ def update!(**args)
2679
+ @contents = args[:contents] if args.key?(:contents)
2680
+ @gcs_source = args[:gcs_source] if args.key?(:gcs_source)
2681
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
2682
+ end
2683
+ end
2684
+
2685
+ # Reserved for future use.
2686
+ class GoogleCloudDocumentaiV1beta2KeyValuePairHint
2687
+ include Google::Apis::Core::Hashable
2688
+
2689
+ # The key text for the hint.
2690
+ # Corresponds to the JSON property `key`
2691
+ # @return [String]
2692
+ attr_accessor :key
2693
+
2694
+ # Type of the value. This is case-insensitive, and could be one of:
2695
+ # ADDRESS, LOCATION, ORGANIZATION, PERSON, PHONE_NUMBER,
2696
+ # ID, NUMBER, EMAIL, PRICE, TERMS, DATE, NAME. Types not in this list will
2697
+ # be ignored.
2698
+ # Corresponds to the JSON property `valueTypes`
2699
+ # @return [Array<String>]
2700
+ attr_accessor :value_types
2701
+
2702
+ def initialize(**args)
2703
+ update!(**args)
2704
+ end
2705
+
2706
+ # Update properties of this object
2707
+ def update!(**args)
2708
+ @key = args[:key] if args.key?(:key)
2709
+ @value_types = args[:value_types] if args.key?(:value_types)
2710
+ end
2711
+ end
2712
+
2713
+ # A vertex represents a 2D point in the image.
2714
+ # NOTE: the normalized vertex coordinates are relative to the original image
2715
+ # and range from 0 to 1.
2716
+ class GoogleCloudDocumentaiV1beta2NormalizedVertex
2717
+ include Google::Apis::Core::Hashable
2718
+
2719
+ # X coordinate.
2720
+ # Corresponds to the JSON property `x`
2721
+ # @return [Float]
2722
+ attr_accessor :x
2723
+
2724
+ # Y coordinate.
2725
+ # Corresponds to the JSON property `y`
2726
+ # @return [Float]
2727
+ attr_accessor :y
2728
+
2729
+ def initialize(**args)
2730
+ update!(**args)
2731
+ end
2732
+
2733
+ # Update properties of this object
2734
+ def update!(**args)
2735
+ @x = args[:x] if args.key?(:x)
2736
+ @y = args[:y] if args.key?(:y)
2737
+ end
2738
+ end
2739
+
2740
+ # Parameters to control Optical Character Recognition (OCR) behavior.
2741
+ class GoogleCloudDocumentaiV1beta2OcrParams
2742
+ include Google::Apis::Core::Hashable
2743
+
2744
+ # List of languages to use for OCR. In most cases, an empty value
2745
+ # yields the best results since it enables automatic language detection. For
2746
+ # languages based on the Latin alphabet, setting `language_hints` is not
2747
+ # needed. In rare cases, when the language of the text in the image is known,
2748
+ # setting a hint will help get better results (although it will be a
2749
+ # significant hindrance if the hint is wrong). Document processing returns an
2750
+ # error if one or more of the specified languages is not one of the
2751
+ # supported languages.
2752
+ # Corresponds to the JSON property `languageHints`
2753
+ # @return [Array<String>]
2754
+ attr_accessor :language_hints
2755
+
2756
+ def initialize(**args)
2757
+ update!(**args)
2758
+ end
2759
+
2760
+ # Update properties of this object
2761
+ def update!(**args)
2762
+ @language_hints = args[:language_hints] if args.key?(:language_hints)
2763
+ end
2764
+ end
2765
+
2766
+ # Contains metadata for the BatchProcessDocuments operation.
2767
+ class GoogleCloudDocumentaiV1beta2OperationMetadata
2768
+ include Google::Apis::Core::Hashable
2769
+
2770
+ # The creation time of the operation.
2771
+ # Corresponds to the JSON property `createTime`
2772
+ # @return [String]
2773
+ attr_accessor :create_time
2774
+
2775
+ # The state of the current batch processing.
2776
+ # Corresponds to the JSON property `state`
2777
+ # @return [String]
2778
+ attr_accessor :state
2779
+
2780
+ # A message providing more details about the current state of processing.
2781
+ # Corresponds to the JSON property `stateMessage`
2782
+ # @return [String]
2783
+ attr_accessor :state_message
2784
+
2785
+ # The last update time of the operation.
2786
+ # Corresponds to the JSON property `updateTime`
2787
+ # @return [String]
2788
+ attr_accessor :update_time
2789
+
2790
+ def initialize(**args)
2791
+ update!(**args)
2792
+ end
2793
+
2794
+ # Update properties of this object
2795
+ def update!(**args)
2796
+ @create_time = args[:create_time] if args.key?(:create_time)
2797
+ @state = args[:state] if args.key?(:state)
2798
+ @state_message = args[:state_message] if args.key?(:state_message)
2799
+ @update_time = args[:update_time] if args.key?(:update_time)
2800
+ end
2801
+ end
2802
+
2803
+ # The desired output location and metadata.
2804
+ class GoogleCloudDocumentaiV1beta2OutputConfig
2805
+ include Google::Apis::Core::Hashable
2806
+
2807
+ # The Google Cloud Storage location where the output file will be written to.
2808
+ # Corresponds to the JSON property `gcsDestination`
2809
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2GcsDestination]
2810
+ attr_accessor :gcs_destination
2811
+
2812
+ # The max number of pages to include into each output Document shard JSON on
2813
+ # Google Cloud Storage.
2814
+ # The valid range is [1, 100]. If not specified, the default value is 20.
2815
+ # For example, for one pdf file with 100 pages, 100 parsed pages will be
2816
+ # produced. If `pages_per_shard` = 20, then 5 Document shard JSON files each
2817
+ # containing 20 parsed pages will be written under the prefix
2818
+ # OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where
2819
+ # x and y are 1-indexed page numbers.
2820
+ # Example GCS outputs with 157 pages and pages_per_shard = 50:
2821
+ # <prefix>pages-001-to-050.json
2822
+ # <prefix>pages-051-to-100.json
2823
+ # <prefix>pages-101-to-150.json
2824
+ # <prefix>pages-151-to-157.json
2825
+ # Corresponds to the JSON property `pagesPerShard`
2826
+ # @return [Fixnum]
2827
+ attr_accessor :pages_per_shard
2828
+
2829
+ def initialize(**args)
2830
+ update!(**args)
2831
+ end
2832
+
2833
+ # Update properties of this object
2834
+ def update!(**args)
2835
+ @gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
2836
+ @pages_per_shard = args[:pages_per_shard] if args.key?(:pages_per_shard)
2837
+ end
2838
+ end
2839
+
2840
+ # Request to process one document.
2841
+ class GoogleCloudDocumentaiV1beta2ProcessDocumentRequest
2842
+ include Google::Apis::Core::Hashable
2843
+
2844
+ # Parameters to control AutoML model prediction behavior.
2845
+ # Corresponds to the JSON property `automlParams`
2846
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2AutoMlParams]
2847
+ attr_accessor :automl_params
2848
+
2849
+ # Specifies a known document type for deeper structure detection. Valid
2850
+ # values are currently "general" and "invoice". If not provided, "general"\
2851
+ # is used as default. If any other value is given, the request is rejected.
2852
+ # Corresponds to the JSON property `documentType`
2853
+ # @return [String]
2854
+ attr_accessor :document_type
2855
+
2856
+ # Parameters to control entity extraction behavior.
2857
+ # Corresponds to the JSON property `entityExtractionParams`
2858
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2EntityExtractionParams]
2859
+ attr_accessor :entity_extraction_params
2860
+
2861
+ # Parameters to control form extraction behavior.
2862
+ # Corresponds to the JSON property `formExtractionParams`
2863
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2FormExtractionParams]
2864
+ attr_accessor :form_extraction_params
2865
+
2866
+ # The desired input location and metadata.
2867
+ # Corresponds to the JSON property `inputConfig`
2868
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2InputConfig]
2869
+ attr_accessor :input_config
2870
+
2871
+ # Parameters to control Optical Character Recognition (OCR) behavior.
2872
+ # Corresponds to the JSON property `ocrParams`
2873
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OcrParams]
2874
+ attr_accessor :ocr_params
2875
+
2876
+ # The desired output location and metadata.
2877
+ # Corresponds to the JSON property `outputConfig`
2878
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OutputConfig]
2879
+ attr_accessor :output_config
2880
+
2881
+ # Target project and location to make a call.
2882
+ # Format: `projects/`project-id`/locations/`location-id``.
2883
+ # If no location is specified, a region will be chosen automatically.
2884
+ # This field is only populated when used in ProcessDocument method.
2885
+ # Corresponds to the JSON property `parent`
2886
+ # @return [String]
2887
+ attr_accessor :parent
2888
+
2889
+ # Parameters to control table extraction behavior.
2890
+ # Corresponds to the JSON property `tableExtractionParams`
2891
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2TableExtractionParams]
2892
+ attr_accessor :table_extraction_params
2893
+
2894
+ def initialize(**args)
2895
+ update!(**args)
2896
+ end
2897
+
2898
+ # Update properties of this object
2899
+ def update!(**args)
2900
+ @automl_params = args[:automl_params] if args.key?(:automl_params)
2901
+ @document_type = args[:document_type] if args.key?(:document_type)
2902
+ @entity_extraction_params = args[:entity_extraction_params] if args.key?(:entity_extraction_params)
2903
+ @form_extraction_params = args[:form_extraction_params] if args.key?(:form_extraction_params)
2904
+ @input_config = args[:input_config] if args.key?(:input_config)
2905
+ @ocr_params = args[:ocr_params] if args.key?(:ocr_params)
2906
+ @output_config = args[:output_config] if args.key?(:output_config)
2907
+ @parent = args[:parent] if args.key?(:parent)
2908
+ @table_extraction_params = args[:table_extraction_params] if args.key?(:table_extraction_params)
2909
+ end
2910
+ end
2911
+
2912
+ # Response to a single document processing request.
2913
+ class GoogleCloudDocumentaiV1beta2ProcessDocumentResponse
2914
+ include Google::Apis::Core::Hashable
2915
+
2916
+ # The desired input location and metadata.
2917
+ # Corresponds to the JSON property `inputConfig`
2918
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2InputConfig]
2919
+ attr_accessor :input_config
2920
+
2921
+ # The desired output location and metadata.
2922
+ # Corresponds to the JSON property `outputConfig`
2923
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2OutputConfig]
2924
+ attr_accessor :output_config
2925
+
2926
+ def initialize(**args)
2927
+ update!(**args)
2928
+ end
2929
+
2930
+ # Update properties of this object
2931
+ def update!(**args)
2932
+ @input_config = args[:input_config] if args.key?(:input_config)
2933
+ @output_config = args[:output_config] if args.key?(:output_config)
2934
+ end
2935
+ end
2936
+
2937
+ # A hint for a table bounding box on the page for table parsing.
2938
+ class GoogleCloudDocumentaiV1beta2TableBoundHint
2939
+ include Google::Apis::Core::Hashable
2940
+
2941
+ # A bounding polygon for the detected image annotation.
2942
+ # Corresponds to the JSON property `boundingBox`
2943
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BoundingPoly]
2944
+ attr_accessor :bounding_box
2945
+
2946
+ # Optional. Page number for multi-paged inputs this hint applies to. If not
2947
+ # provided, this hint will apply to all pages by default. This value is
2948
+ # 1-based.
2949
+ # Corresponds to the JSON property `pageNumber`
2950
+ # @return [Fixnum]
2951
+ attr_accessor :page_number
2952
+
2953
+ def initialize(**args)
2954
+ update!(**args)
2955
+ end
2956
+
2957
+ # Update properties of this object
2958
+ def update!(**args)
2959
+ @bounding_box = args[:bounding_box] if args.key?(:bounding_box)
2960
+ @page_number = args[:page_number] if args.key?(:page_number)
2961
+ end
2962
+ end
2963
+
2964
+ # Parameters to control table extraction behavior.
2965
+ class GoogleCloudDocumentaiV1beta2TableExtractionParams
2966
+ include Google::Apis::Core::Hashable
2967
+
2968
+ # Whether to enable table extraction.
2969
+ # Corresponds to the JSON property `enabled`
2970
+ # @return [Boolean]
2971
+ attr_accessor :enabled
2972
+ alias_method :enabled?, :enabled
2973
+
2974
+ # Optional. Reserved for future use.
2975
+ # Corresponds to the JSON property `headerHints`
2976
+ # @return [Array<String>]
2977
+ attr_accessor :header_hints
2978
+
2979
+ # Model version of the table extraction system. Default is "builtin/stable".
2980
+ # Specify "builtin/latest" for the latest model.
2981
+ # Corresponds to the JSON property `modelVersion`
2982
+ # @return [String]
2983
+ attr_accessor :model_version
2984
+
2985
+ # Optional. Table bounding box hints that can be provided to complex cases
2986
+ # which our algorithm cannot locate the table(s) in.
2987
+ # Corresponds to the JSON property `tableBoundHints`
2988
+ # @return [Array<Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2TableBoundHint>]
2989
+ attr_accessor :table_bound_hints
2990
+
2991
+ def initialize(**args)
2992
+ update!(**args)
2993
+ end
2994
+
2995
+ # Update properties of this object
2996
+ def update!(**args)
2997
+ @enabled = args[:enabled] if args.key?(:enabled)
2998
+ @header_hints = args[:header_hints] if args.key?(:header_hints)
2999
+ @model_version = args[:model_version] if args.key?(:model_version)
3000
+ @table_bound_hints = args[:table_bound_hints] if args.key?(:table_bound_hints)
3001
+ end
3002
+ end
3003
+
3004
+ # A vertex represents a 2D point in the image.
3005
+ # NOTE: the vertex coordinates are in the same scale as the original image.
3006
+ class GoogleCloudDocumentaiV1beta2Vertex
3007
+ include Google::Apis::Core::Hashable
3008
+
3009
+ # X coordinate.
3010
+ # Corresponds to the JSON property `x`
3011
+ # @return [Fixnum]
3012
+ attr_accessor :x
3013
+
3014
+ # Y coordinate.
3015
+ # Corresponds to the JSON property `y`
3016
+ # @return [Fixnum]
3017
+ attr_accessor :y
3018
+
3019
+ def initialize(**args)
3020
+ update!(**args)
3021
+ end
3022
+
3023
+ # Update properties of this object
3024
+ def update!(**args)
3025
+ @x = args[:x] if args.key?(:x)
3026
+ @y = args[:y] if args.key?(:y)
3027
+ end
3028
+ end
3029
+
3030
+ # This resource represents a long-running operation that is the result of a
3031
+ # network API call.
3032
+ class GoogleLongrunningOperation
3033
+ include Google::Apis::Core::Hashable
3034
+
3035
+ # If the value is `false`, it means the operation is still in progress.
3036
+ # If `true`, the operation is completed, and either `error` or `response` is
3037
+ # available.
3038
+ # Corresponds to the JSON property `done`
3039
+ # @return [Boolean]
3040
+ attr_accessor :done
3041
+ alias_method :done?, :done
3042
+
3043
+ # The `Status` type defines a logical error model that is suitable for
3044
+ # different programming environments, including REST APIs and RPC APIs. It is
3045
+ # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3046
+ # three pieces of data: error code, error message, and error details.
3047
+ # You can find out more about this error model and how to work with it in the
3048
+ # [API Design Guide](https://cloud.google.com/apis/design/errors).
3049
+ # Corresponds to the JSON property `error`
3050
+ # @return [Google::Apis::DocumentaiV1beta2::GoogleRpcStatus]
3051
+ attr_accessor :error
3052
+
3053
+ # Service-specific metadata associated with the operation. It typically
3054
+ # contains progress information and common metadata such as create time.
3055
+ # Some services might not provide such metadata. Any method that returns a
3056
+ # long-running operation should document the metadata type, if any.
3057
+ # Corresponds to the JSON property `metadata`
3058
+ # @return [Hash<String,Object>]
3059
+ attr_accessor :metadata
3060
+
3061
+ # The server-assigned name, which is only unique within the same service that
3062
+ # originally returns it. If you use the default HTTP mapping, the
3063
+ # `name` should be a resource name ending with `operations/`unique_id``.
3064
+ # Corresponds to the JSON property `name`
3065
+ # @return [String]
3066
+ attr_accessor :name
3067
+
3068
+ # The normal response of the operation in case of success. If the original
3069
+ # method returns no data on success, such as `Delete`, the response is
3070
+ # `google.protobuf.Empty`. If the original method is standard
3071
+ # `Get`/`Create`/`Update`, the response should be the resource. For other
3072
+ # methods, the response should have the type `XxxResponse`, where `Xxx`
3073
+ # is the original method name. For example, if the original method name
3074
+ # is `TakeSnapshot()`, the inferred response type is
3075
+ # `TakeSnapshotResponse`.
3076
+ # Corresponds to the JSON property `response`
3077
+ # @return [Hash<String,Object>]
3078
+ attr_accessor :response
3079
+
3080
+ def initialize(**args)
3081
+ update!(**args)
3082
+ end
3083
+
3084
+ # Update properties of this object
3085
+ def update!(**args)
3086
+ @done = args[:done] if args.key?(:done)
3087
+ @error = args[:error] if args.key?(:error)
3088
+ @metadata = args[:metadata] if args.key?(:metadata)
3089
+ @name = args[:name] if args.key?(:name)
3090
+ @response = args[:response] if args.key?(:response)
3091
+ end
3092
+ end
3093
+
3094
+ # The `Status` type defines a logical error model that is suitable for
3095
+ # different programming environments, including REST APIs and RPC APIs. It is
3096
+ # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3097
+ # three pieces of data: error code, error message, and error details.
3098
+ # You can find out more about this error model and how to work with it in the
3099
+ # [API Design Guide](https://cloud.google.com/apis/design/errors).
3100
+ class GoogleRpcStatus
3101
+ include Google::Apis::Core::Hashable
3102
+
3103
+ # The status code, which should be an enum value of google.rpc.Code.
3104
+ # Corresponds to the JSON property `code`
3105
+ # @return [Fixnum]
3106
+ attr_accessor :code
3107
+
3108
+ # A list of messages that carry the error details. There is a common set of
3109
+ # message types for APIs to use.
3110
+ # Corresponds to the JSON property `details`
3111
+ # @return [Array<Hash<String,Object>>]
3112
+ attr_accessor :details
3113
+
3114
+ # A developer-facing error message, which should be in English. Any
3115
+ # user-facing error message should be localized and sent in the
3116
+ # google.rpc.Status.details field, or localized by the client.
3117
+ # Corresponds to the JSON property `message`
3118
+ # @return [String]
3119
+ attr_accessor :message
3120
+
3121
+ def initialize(**args)
3122
+ update!(**args)
3123
+ end
3124
+
3125
+ # Update properties of this object
3126
+ def update!(**args)
3127
+ @code = args[:code] if args.key?(:code)
3128
+ @details = args[:details] if args.key?(:details)
3129
+ @message = args[:message] if args.key?(:message)
3130
+ end
3131
+ end
3132
+
3133
+ # Represents a color in the RGBA color space. This representation is designed
3134
+ # for simplicity of conversion to/from color representations in various
3135
+ # languages over compactness; for example, the fields of this representation
3136
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3137
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3138
+ # method in iOS; and, with just a little work, it can be easily formatted into
3139
+ # a CSS "rgba()" string in JavaScript, as well.
3140
+ # Note: this proto does not carry information about the absolute color space
3141
+ # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
3142
+ # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
3143
+ # space.
3144
+ # Note: when color equality needs to be decided, implementations, unless
3145
+ # documented otherwise, will treat two colors to be equal if all their red,
3146
+ # green, blue and alpha values each differ by at most 1e-5.
3147
+ # Example (Java):
3148
+ # import com.google.type.Color;
3149
+ # // ...
3150
+ # public static java.awt.Color fromProto(Color protocolor) `
3151
+ # float alpha = protocolor.hasAlpha()
3152
+ # ? protocolor.getAlpha().getValue()
3153
+ # : 1.0;
3154
+ # return new java.awt.Color(
3155
+ # protocolor.getRed(),
3156
+ # protocolor.getGreen(),
3157
+ # protocolor.getBlue(),
3158
+ # alpha);
3159
+ # `
3160
+ # public static Color toProto(java.awt.Color color) `
3161
+ # float red = (float) color.getRed();
3162
+ # float green = (float) color.getGreen();
3163
+ # float blue = (float) color.getBlue();
3164
+ # float denominator = 255.0;
3165
+ # Color.Builder resultBuilder =
3166
+ # Color
3167
+ # .newBuilder()
3168
+ # .setRed(red / denominator)
3169
+ # .setGreen(green / denominator)
3170
+ # .setBlue(blue / denominator);
3171
+ # int alpha = color.getAlpha();
3172
+ # if (alpha != 255) `
3173
+ # result.setAlpha(
3174
+ # FloatValue
3175
+ # .newBuilder()
3176
+ # .setValue(((float) alpha) / denominator)
3177
+ # .build());
3178
+ # `
3179
+ # return resultBuilder.build();
3180
+ # `
3181
+ # // ...
3182
+ # Example (iOS / Obj-C):
3183
+ # // ...
3184
+ # static UIColor* fromProto(Color* protocolor) `
3185
+ # float red = [protocolor red];
3186
+ # float green = [protocolor green];
3187
+ # float blue = [protocolor blue];
3188
+ # FloatValue* alpha_wrapper = [protocolor alpha];
3189
+ # float alpha = 1.0;
3190
+ # if (alpha_wrapper != nil) `
3191
+ # alpha = [alpha_wrapper value];
3192
+ # `
3193
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3194
+ # `
3195
+ # static Color* toProto(UIColor* color) `
3196
+ # CGFloat red, green, blue, alpha;
3197
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
3198
+ # return nil;
3199
+ # `
3200
+ # Color* result = [[Color alloc] init];
3201
+ # [result setRed:red];
3202
+ # [result setGreen:green];
3203
+ # [result setBlue:blue];
3204
+ # if (alpha <= 0.9999) `
3205
+ # [result setAlpha:floatWrapperWithValue(alpha)];
3206
+ # `
3207
+ # [result autorelease];
3208
+ # return result;
3209
+ # `
3210
+ # // ...
3211
+ # Example (JavaScript):
3212
+ # // ...
3213
+ # var protoToCssColor = function(rgb_color) `
3214
+ # var redFrac = rgb_color.red || 0.0;
3215
+ # var greenFrac = rgb_color.green || 0.0;
3216
+ # var blueFrac = rgb_color.blue || 0.0;
3217
+ # var red = Math.floor(redFrac * 255);
3218
+ # var green = Math.floor(greenFrac * 255);
3219
+ # var blue = Math.floor(blueFrac * 255);
3220
+ # if (!('alpha' in rgb_color)) `
3221
+ # return rgbToCssColor_(red, green, blue);
3222
+ # `
3223
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
3224
+ # var rgbParams = [red, green, blue].join(',');
3225
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3226
+ # `;
3227
+ # var rgbToCssColor_ = function(red, green, blue) `
3228
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3229
+ # var hexString = rgbNumber.toString(16);
3230
+ # var missingZeros = 6 - hexString.length;
3231
+ # var resultBuilder = ['#'];
3232
+ # for (var i = 0; i < missingZeros; i++) `
3233
+ # resultBuilder.push('0');
3234
+ # `
3235
+ # resultBuilder.push(hexString);
3236
+ # return resultBuilder.join('');
3237
+ # `;
3238
+ # // ...
3239
+ class GoogleTypeColor
3240
+ include Google::Apis::Core::Hashable
3241
+
3242
+ # The fraction of this color that should be applied to the pixel. That is,
3243
+ # the final pixel color is defined by the equation:
3244
+ # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3245
+ # This means that a value of 1.0 corresponds to a solid color, whereas
3246
+ # a value of 0.0 corresponds to a completely transparent color. This
3247
+ # uses a wrapper message rather than a simple float scalar so that it is
3248
+ # possible to distinguish between a default value and the value being unset.
3249
+ # If omitted, this color object is to be rendered as a solid color
3250
+ # (as if the alpha value had been explicitly given with a value of 1.0).
3251
+ # Corresponds to the JSON property `alpha`
3252
+ # @return [Float]
3253
+ attr_accessor :alpha
3254
+
3255
+ # The amount of blue in the color as a value in the interval [0, 1].
3256
+ # Corresponds to the JSON property `blue`
3257
+ # @return [Float]
3258
+ attr_accessor :blue
3259
+
3260
+ # The amount of green in the color as a value in the interval [0, 1].
3261
+ # Corresponds to the JSON property `green`
3262
+ # @return [Float]
3263
+ attr_accessor :green
3264
+
3265
+ # The amount of red in the color as a value in the interval [0, 1].
3266
+ # Corresponds to the JSON property `red`
3267
+ # @return [Float]
3268
+ attr_accessor :red
3269
+
3270
+ def initialize(**args)
3271
+ update!(**args)
3272
+ end
3273
+
3274
+ # Update properties of this object
3275
+ def update!(**args)
3276
+ @alpha = args[:alpha] if args.key?(:alpha)
3277
+ @blue = args[:blue] if args.key?(:blue)
3278
+ @green = args[:green] if args.key?(:green)
3279
+ @red = args[:red] if args.key?(:red)
3280
+ end
3281
+ end
3282
+ end
3283
+ end
3284
+ end