google-cloud-document_ai-v1beta3 0.8.0 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +719 -62
  5. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +149 -37
  6. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +17 -0
  7. data/lib/google/cloud/document_ai/v1beta3/version.rb +1 -1
  8. data/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +1 -1
  9. data/lib/google/cloud/documentai/v1beta3/document_pb.rb +5 -2
  10. data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +66 -18
  11. data/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +15 -1
  12. data/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +1 -1
  13. data/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb +36 -0
  14. data/lib/google/cloud/documentai/v1beta3/processor_pb.rb +45 -0
  15. data/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb +32 -0
  16. data/proto_docs/google/api/field_behavior.rb +7 -1
  17. data/proto_docs/google/cloud/documentai/v1beta3/document.rb +12 -0
  18. data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +149 -39
  19. data/proto_docs/google/cloud/documentai/v1beta3/geometry.rb +2 -2
  20. data/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb +65 -0
  21. data/proto_docs/google/cloud/documentai/v1beta3/processor.rb +86 -0
  22. data/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb +59 -0
  23. data/proto_docs/google/type/color.rb +16 -11
  24. data/proto_docs/google/type/date.rb +14 -11
  25. data/proto_docs/google/type/datetime.rb +9 -1
  26. data/proto_docs/google/type/money.rb +1 -1
  27. metadata +19 -7
@@ -0,0 +1,32 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/documentai/v1beta3/processor_type.proto
3
+
4
+ require 'google/api/resource_pb'
5
+ require 'google/api/annotations_pb'
6
+ require 'google/protobuf'
7
+
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("google/cloud/documentai/v1beta3/processor_type.proto", :syntax => :proto3) do
10
+ add_message "google.cloud.documentai.v1beta3.ProcessorType" do
11
+ optional :name, :string, 1
12
+ optional :type, :string, 2
13
+ optional :category, :string, 3
14
+ repeated :available_locations, :message, 4, "google.cloud.documentai.v1beta3.ProcessorType.LocationInfo"
15
+ optional :allow_creation, :bool, 6
16
+ end
17
+ add_message "google.cloud.documentai.v1beta3.ProcessorType.LocationInfo" do
18
+ optional :location_id, :string, 1
19
+ end
20
+ end
21
+ end
22
+
23
+ module Google
24
+ module Cloud
25
+ module DocumentAI
26
+ module V1beta3
27
+ ProcessorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType").msgclass
28
+ ProcessorType::LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ProcessorType.LocationInfo").msgclass
29
+ end
30
+ end
31
+ end
32
+ end
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -190,6 +190,9 @@ module Google
190
190
  # @!attribute [rw] form_fields
191
191
  # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField>]
192
192
  # A list of visually detected form fields on the page.
193
+ # @!attribute [rw] provenance
194
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
195
+ # The history of this page.
193
196
  class Page
194
197
  include ::Google::Protobuf::MessageExts
195
198
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -461,6 +464,9 @@ module Google
461
464
  # - blank (this indicates the field_value is normal text)
462
465
  # - "unfilled_checkbox"
463
466
  # - "filled_checkbox"
467
+ # @!attribute [rw] provenance
468
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
469
+ # The history of this annotation.
464
470
  class FormField
465
471
  include ::Google::Protobuf::MessageExts
466
472
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -621,6 +627,8 @@ module Google
621
627
  # @return [::Integer]
622
628
  # Required. Index into the {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages} element, for example using
623
629
  # [Document.pages][page_refs.page] to locate the related page element.
630
+ # This field is skipped when its value is the default 0. See
631
+ # https://developers.google.com/protocol-buffers/docs/proto3#json.
624
632
  # @!attribute [rw] layout_type
625
633
  # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef::LayoutType]
626
634
  # Optional. The type of the layout element that is being referenced if any.
@@ -691,6 +699,10 @@ module Google
691
699
  # @!attribute [rw] revision
692
700
  # @return [::Integer]
693
701
  # The index of the [Document.revisions] identifying the parent revision.
702
+ # @!attribute [rw] index
703
+ # @return [::Integer]
704
+ # The index of the parent revisions corresponding collection of items
705
+ # (eg. list of entities, properties within entities, etc.)
694
706
  # @!attribute [rw] id
695
707
  # @return [::Integer]
696
708
  # The id of the parent provenance.
@@ -229,7 +229,140 @@ module Google
229
229
  end
230
230
  end
231
231
 
232
+ # Request message for fetch processor types.
233
+ # @!attribute [rw] parent
234
+ # @return [::String]
235
+ # Required. The project of processor type to list.
236
+ # Format: projects/\\{project}/locations/\\{location}
237
+ class FetchProcessorTypesRequest
238
+ include ::Google::Protobuf::MessageExts
239
+ extend ::Google::Protobuf::MessageExts::ClassMethods
240
+ end
241
+
242
+ # Response message for fetch processor types.
243
+ # @!attribute [rw] processor_types
244
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>]
245
+ # The list of processor types.
246
+ class FetchProcessorTypesResponse
247
+ include ::Google::Protobuf::MessageExts
248
+ extend ::Google::Protobuf::MessageExts::ClassMethods
249
+ end
250
+
251
+ # Request message for list all processors belongs to a project.
252
+ # @!attribute [rw] parent
253
+ # @return [::String]
254
+ # Required. The parent (project and location) which owns this collection of Processors.
255
+ # Format: projects/\\{project}/locations/\\{location}
256
+ # @!attribute [rw] page_size
257
+ # @return [::Integer]
258
+ # The maximum number of processors to return.
259
+ # If unspecified, at most 50 processors will be returned.
260
+ # The maximum value is 100; values above 100 will be coerced to 100.
261
+ # @!attribute [rw] page_token
262
+ # @return [::String]
263
+ # We will return the processors sorted by creation time. The page token
264
+ # will point to the next processor.
265
+ class ListProcessorsRequest
266
+ include ::Google::Protobuf::MessageExts
267
+ extend ::Google::Protobuf::MessageExts::ClassMethods
268
+ end
269
+
270
+ # Response message for list processors.
271
+ # @!attribute [rw] processors
272
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Processor>]
273
+ # The list of processors.
274
+ # @!attribute [rw] next_page_token
275
+ # @return [::String]
276
+ # Points to the next processor, otherwise empty.
277
+ class ListProcessorsResponse
278
+ include ::Google::Protobuf::MessageExts
279
+ extend ::Google::Protobuf::MessageExts::ClassMethods
280
+ end
281
+
282
+ # Request message for create a processor. Notice this request is sent to
283
+ # a regionalized backend service, and if the processor type is not available
284
+ # on that region, the creation will fail.
285
+ # @!attribute [rw] parent
286
+ # @return [::String]
287
+ # Required. The parent (project and location) under which to create the processor.
288
+ # Format: projects/\\{project}/locations/\\{location}
289
+ # @!attribute [rw] processor
290
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Processor]
291
+ # Required. The processor to be created, requires [processor_type] and [display_name]
292
+ # to be set. Also, the processor is under CMEK if CMEK fields are set.
293
+ class CreateProcessorRequest
294
+ include ::Google::Protobuf::MessageExts
295
+ extend ::Google::Protobuf::MessageExts::ClassMethods
296
+ end
297
+
298
+ # Request message for the delete processor method.
299
+ # @!attribute [rw] name
300
+ # @return [::String]
301
+ # Required. The processor resource name to be deleted.
302
+ class DeleteProcessorRequest
303
+ include ::Google::Protobuf::MessageExts
304
+ extend ::Google::Protobuf::MessageExts::ClassMethods
305
+ end
306
+
307
+ # The long running operation metadata for delete processor method.
308
+ # @!attribute [rw] common_metadata
309
+ # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata]
310
+ # The basic metadata of the long running operation.
311
+ class DeleteProcessorMetadata
312
+ include ::Google::Protobuf::MessageExts
313
+ extend ::Google::Protobuf::MessageExts::ClassMethods
314
+ end
315
+
316
+ # Request message for the enable processor method.
317
+ # @!attribute [rw] name
318
+ # @return [::String]
319
+ # Required. The processor resource name to be enabled.
320
+ class EnableProcessorRequest
321
+ include ::Google::Protobuf::MessageExts
322
+ extend ::Google::Protobuf::MessageExts::ClassMethods
323
+ end
324
+
325
+ # Response message for the enable processor method.
326
+ class EnableProcessorResponse
327
+ include ::Google::Protobuf::MessageExts
328
+ extend ::Google::Protobuf::MessageExts::ClassMethods
329
+ end
330
+
331
+ # The long running operation metadata for enable processor method.
332
+ # @!attribute [rw] common_metadata
333
+ # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata]
334
+ # The basic metadata of the long running operation.
335
+ class EnableProcessorMetadata
336
+ include ::Google::Protobuf::MessageExts
337
+ extend ::Google::Protobuf::MessageExts::ClassMethods
338
+ end
339
+
340
+ # Request message for the disable processor method.
341
+ # @!attribute [rw] name
342
+ # @return [::String]
343
+ # Required. The processor resource name to be disabled.
344
+ class DisableProcessorRequest
345
+ include ::Google::Protobuf::MessageExts
346
+ extend ::Google::Protobuf::MessageExts::ClassMethods
347
+ end
348
+
349
+ # Response message for the disable processor method.
350
+ class DisableProcessorResponse
351
+ include ::Google::Protobuf::MessageExts
352
+ extend ::Google::Protobuf::MessageExts::ClassMethods
353
+ end
354
+
355
+ # The long running operation metadata for disable processor method.
356
+ # @!attribute [rw] common_metadata
357
+ # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata]
358
+ # The basic metadata of the long running operation.
359
+ class DisableProcessorMetadata
360
+ include ::Google::Protobuf::MessageExts
361
+ extend ::Google::Protobuf::MessageExts::ClassMethods
362
+ end
363
+
232
364
  # Request message for review document method.
365
+ # Next Id: 6.
233
366
  # @!attribute [rw] inline_document
234
367
  # @return [::Google::Cloud::DocumentAI::V1beta3::Document]
235
368
  # An inline document proto.
@@ -240,9 +373,25 @@ module Google
240
373
  # @!attribute [rw] document
241
374
  # @return [::Google::Cloud::DocumentAI::V1beta3::Document]
242
375
  # The document that needs human review.
376
+ # @!attribute [rw] enable_schema_validation
377
+ # @return [::Boolean]
378
+ # Whether the validation should be performed on the ad-hoc review request.
379
+ # @!attribute [rw] priority
380
+ # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority]
381
+ # The priority of the human review task.
243
382
  class ReviewDocumentRequest
244
383
  include ::Google::Protobuf::MessageExts
245
384
  extend ::Google::Protobuf::MessageExts::ClassMethods
385
+
386
+ # The priority level of the human review task.
387
+ module Priority
388
+ # The default priority level.
389
+ DEFAULT = 0
390
+
391
+ # The urgent priority level. The labeling manager should allocate labeler
392
+ # resource to the urgent task queue to respect this priority level.
393
+ URGENT = 1
394
+ end
246
395
  end
247
396
 
248
397
  # Response message for review document method.
@@ -296,45 +445,6 @@ module Google
296
445
  CANCELLED = 5
297
446
  end
298
447
  end
299
-
300
- # The common metadata for long running operations.
301
- # @!attribute [rw] state
302
- # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State]
303
- # The state of the operation.
304
- # @!attribute [rw] state_message
305
- # @return [::String]
306
- # A message providing more details about the current state of processing.
307
- # @!attribute [rw] create_time
308
- # @return [::Google::Protobuf::Timestamp]
309
- # The creation time of the operation.
310
- # @!attribute [rw] update_time
311
- # @return [::Google::Protobuf::Timestamp]
312
- # The last update time of the operation.
313
- class CommonOperationMetadata
314
- include ::Google::Protobuf::MessageExts
315
- extend ::Google::Protobuf::MessageExts::ClassMethods
316
-
317
- # State of the longrunning operation.
318
- module State
319
- # Unspecified state.
320
- STATE_UNSPECIFIED = 0
321
-
322
- # Operation is still running.
323
- RUNNING = 1
324
-
325
- # Operation is being cancelled.
326
- CANCELLING = 2
327
-
328
- # Operation succeeded.
329
- SUCCEEDED = 3
330
-
331
- # Operation failed.
332
- FAILED = 4
333
-
334
- # Operation is cancelled.
335
- CANCELLED = 5
336
- end
337
- end
338
448
  end
339
449
  end
340
450
  end
@@ -28,7 +28,7 @@ module Google
28
28
  # X coordinate.
29
29
  # @!attribute [rw] y
30
30
  # @return [::Integer]
31
- # Y coordinate.
31
+ # Y coordinate (starts from the top of the image).
32
32
  class Vertex
33
33
  include ::Google::Protobuf::MessageExts
34
34
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -42,7 +42,7 @@ module Google
42
42
  # X coordinate.
43
43
  # @!attribute [rw] y
44
44
  # @return [::Float]
45
- # Y coordinate.
45
+ # Y coordinate (starts from the top of the image).
46
46
  class NormalizedVertex
47
47
  include ::Google::Protobuf::MessageExts
48
48
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module DocumentAI
23
+ module V1beta3
24
+ # The common metadata for long running operations.
25
+ # @!attribute [rw] state
26
+ # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State]
27
+ # The state of the operation.
28
+ # @!attribute [rw] state_message
29
+ # @return [::String]
30
+ # A message providing more details about the current state of processing.
31
+ # @!attribute [rw] create_time
32
+ # @return [::Google::Protobuf::Timestamp]
33
+ # The creation time of the operation.
34
+ # @!attribute [rw] update_time
35
+ # @return [::Google::Protobuf::Timestamp]
36
+ # The last update time of the operation.
37
+ class CommonOperationMetadata
38
+ include ::Google::Protobuf::MessageExts
39
+ extend ::Google::Protobuf::MessageExts::ClassMethods
40
+
41
+ # State of the longrunning operation.
42
+ module State
43
+ # Unspecified state.
44
+ STATE_UNSPECIFIED = 0
45
+
46
+ # Operation is still running.
47
+ RUNNING = 1
48
+
49
+ # Operation is being cancelled.
50
+ CANCELLING = 2
51
+
52
+ # Operation succeeded.
53
+ SUCCEEDED = 3
54
+
55
+ # Operation failed.
56
+ FAILED = 4
57
+
58
+ # Operation is cancelled.
59
+ CANCELLED = 5
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module DocumentAI
23
+ module V1beta3
24
+ # The first-class citizen for DocumentAI. Each processor defines how to extract
25
+ # structural information from a document.
26
+ # @!attribute [r] name
27
+ # @return [::String]
28
+ # Output only. Immutable. The resource name of the processor.
29
+ # Format: projects/\\{project}/locations/\\{location}/processors/\\{processor}
30
+ # @!attribute [rw] type
31
+ # @return [::String]
32
+ # The processor type.
33
+ # @!attribute [rw] display_name
34
+ # @return [::String]
35
+ # The display name of the processor.
36
+ # @!attribute [r] state
37
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Processor::State]
38
+ # Output only. The state of the processor.
39
+ # @!attribute [rw] default_processor_version
40
+ # @return [::String]
41
+ # The default processor version.
42
+ # @!attribute [r] process_endpoint
43
+ # @return [::String]
44
+ # Output only. Immutable. The http endpoint that can be called to invoke processing.
45
+ # @!attribute [rw] create_time
46
+ # @return [::Google::Protobuf::Timestamp]
47
+ # The time the processor was created.
48
+ # @!attribute [rw] kms_key_name
49
+ # @return [::String]
50
+ # The KMS key used for encryption/decryption in CMEK scenarios.
51
+ # See https://cloud.google.com/security-key-management.
52
+ class Processor
53
+ include ::Google::Protobuf::MessageExts
54
+ extend ::Google::Protobuf::MessageExts::ClassMethods
55
+
56
+ # The possible states of the processor.
57
+ module State
58
+ # The processor is in an unspecified state.
59
+ STATE_UNSPECIFIED = 0
60
+
61
+ # The processor is enabled.
62
+ ENABLED = 1
63
+
64
+ # The processor is disabled.
65
+ DISABLED = 2
66
+
67
+ # The processor is being enabled, will become ENABLED if successful.
68
+ ENABLING = 3
69
+
70
+ # The processor is being disabled, will become DISABLED if successful.
71
+ DISABLING = 4
72
+
73
+ # The processor is being created.
74
+ CREATING = 5
75
+
76
+ # The processor failed during creation.
77
+ FAILED = 6
78
+
79
+ # The processor is being deleted, will be removed if successful.
80
+ DELETING = 7
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module DocumentAI
23
+ module V1beta3
24
+ # A processor type is responsible for performing a certain document
25
+ # understanding task on a certain type of document.
26
+ # @!attribute [rw] name
27
+ # @return [::String]
28
+ # The resource name of the processor type.
29
+ # @!attribute [rw] type
30
+ # @return [::String]
31
+ # The type of the processor.
32
+ # @!attribute [rw] category
33
+ # @return [::String]
34
+ # The processor category.
35
+ # @!attribute [rw] available_locations
36
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType::LocationInfo>]
37
+ # The locations in which this processor is available.
38
+ # @!attribute [rw] allow_creation
39
+ # @return [::Boolean]
40
+ # Whether the processor type allows creation. If yes, user can create a
41
+ # processor of this processor type. Otherwise, user needs to require for
42
+ # whitelisting.
43
+ class ProcessorType
44
+ include ::Google::Protobuf::MessageExts
45
+ extend ::Google::Protobuf::MessageExts::ClassMethods
46
+
47
+ # The location information about where the processor is available.
48
+ # @!attribute [rw] location_id
49
+ # @return [::String]
50
+ # The location id.
51
+ class LocationInfo
52
+ include ::Google::Protobuf::MessageExts
53
+ extend ::Google::Protobuf::MessageExts::ClassMethods
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -21,17 +21,22 @@ module Google
21
21
  module Type
22
22
  # Represents a color in the RGBA color space. This representation is designed
23
23
  # for simplicity of conversion to/from color representations in various
24
- # languages over compactness; for example, the fields of this representation
25
- # can be trivially provided to the constructor of "java.awt.Color" in Java; it
26
- # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24
+ # languages over compactness. For example, the fields of this representation
25
+ # can be trivially provided to the constructor of `java.awt.Color` in Java; it
26
+ # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
27
27
  # method in iOS; and, with just a little work, it can be easily formatted into
28
- # a CSS "rgba()" string in JavaScript, as well.
28
+ # a CSS `rgba()` string in JavaScript.
29
29
  #
30
- # Note: this proto does not carry information about the absolute color space
30
+ # This reference page doesn't carry information about the absolute color
31
+ # space
31
32
  # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
32
- # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
33
+ # DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color
33
34
  # space.
34
35
  #
36
+ # When color equality needs to be decided, implementations, unless
37
+ # documented otherwise, treat two colors as equal if all their red,
38
+ # green, blue, and alpha values each differ by at most 1e-5.
39
+ #
35
40
  # Example (Java):
36
41
  #
37
42
  # import com.google.type.Color;
@@ -117,7 +122,7 @@ module Google
117
122
  # var blue = Math.floor(blueFrac * 255);
118
123
  #
119
124
  # if (!('alpha' in rgb_color)) {
120
- # return rgbToCssColor_(red, green, blue);
125
+ # return rgbToCssColor(red, green, blue);
121
126
  # }
122
127
  #
123
128
  # var alphaFrac = rgb_color.alpha.value || 0.0;
@@ -125,7 +130,7 @@ module Google
125
130
  # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
126
131
  # };
127
132
  #
128
- # var rgbToCssColor_ = function(red, green, blue) {
133
+ # var rgbToCssColor = function(red, green, blue) {
129
134
  # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
130
135
  # var hexString = rgbNumber.toString(16);
131
136
  # var missingZeros = 6 - hexString.length;
@@ -152,14 +157,14 @@ module Google
152
157
  # The fraction of this color that should be applied to the pixel. That is,
153
158
  # the final pixel color is defined by the equation:
154
159
  #
155
- # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
160
+ # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
156
161
  #
157
162
  # This means that a value of 1.0 corresponds to a solid color, whereas
158
163
  # a value of 0.0 corresponds to a completely transparent color. This
159
164
  # uses a wrapper message rather than a simple float scalar so that it is
160
165
  # possible to distinguish between a default value and the value being unset.
161
- # If omitted, this color object is to be rendered as a solid color
162
- # (as if the alpha value had been explicitly given with a value of 1.0).
166
+ # If omitted, this color object is rendered as a solid color
167
+ # (as if the alpha value had been explicitly given a value of 1.0).
163
168
  class Color
164
169
  include ::Google::Protobuf::MessageExts
165
170
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -19,28 +19,31 @@
19
19
 
20
20
  module Google
21
21
  module Type
22
- # Represents a whole or partial calendar date, e.g. a birthday. The time of day
23
- # and time zone are either specified elsewhere or are not significant. The date
24
- # is relative to the Proleptic Gregorian Calendar. This can represent:
22
+ # Represents a whole or partial calendar date, such as a birthday. The time of
23
+ # day and time zone are either specified elsewhere or are insignificant. The
24
+ # date is relative to the Gregorian Calendar. This can represent one of the
25
+ # following:
25
26
  #
26
- # * A full date, with non-zero year, month and day values
27
- # * A month and day value, with a zero year, e.g. an anniversary
27
+ # * A full date, with non-zero year, month, and day values
28
+ # * A month and day value, with a zero year, such as an anniversary
28
29
  # * A year on its own, with zero month and day values
29
- # * A year and month value, with a zero day, e.g. a credit card expiration date
30
+ # * A year and month value, with a zero day, such as a credit card expiration
31
+ # date
30
32
  #
31
- # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
33
+ # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
34
+ # `google.protobuf.Timestamp`.
32
35
  # @!attribute [rw] year
33
36
  # @return [::Integer]
34
- # Year of date. Must be from 1 to 9999, or 0 if specifying a date without
37
+ # Year of the date. Must be from 1 to 9999, or 0 to specify a date without
35
38
  # a year.
36
39
  # @!attribute [rw] month
37
40
  # @return [::Integer]
38
- # Month of year. Must be from 1 to 12, or 0 if specifying a year without a
41
+ # Month of a year. Must be from 1 to 12, or 0 to specify a year without a
39
42
  # month and day.
40
43
  # @!attribute [rw] day
41
44
  # @return [::Integer]
42
- # Day of month. Must be from 1 to 31 and valid for the year and month, or 0
43
- # if specifying a year by itself or a year and month where the day is not
45
+ # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
46
+ # to specify a year by itself or a year and month where the day isn't
44
47
  # significant.
45
48
  class Date
46
49
  include ::Google::Protobuf::MessageExts
@@ -19,7 +19,9 @@
19
19
 
20
20
  module Google
21
21
  module Type
22
- # Represents civil time in one of a few possible ways:
22
+ # Represents civil time (or occasionally physical time).
23
+ #
24
+ # This type can represent a civil time in one of a few possible ways:
23
25
  #
24
26
  # * When utc_offset is set and time_zone is unset: a civil time on a calendar
25
27
  # day with a particular offset from UTC.
@@ -33,6 +35,12 @@ module Google
33
35
  # If year is 0, the DateTime is considered not to have a specific year. month
34
36
  # and day must have valid, non-zero values.
35
37
  #
38
+ # This type may also be used to represent a physical time if all the date and
39
+ # time fields are set and either case of the `time_offset` oneof is set.
40
+ # Consider using `Timestamp` message for physical time instead. If your use
41
+ # case also would like to store the user's timezone, that can be done in
42
+ # another field.
43
+ #
36
44
  # This type is more flexible than some applications may want. Make sure to
37
45
  # document and validate your application's limitations.
38
46
  # @!attribute [rw] year
@@ -22,7 +22,7 @@ module Google
22
22
  # Represents an amount of money with its currency type.
23
23
  # @!attribute [rw] currency_code
24
24
  # @return [::String]
25
- # The 3-letter currency code defined in ISO 4217.
25
+ # The three-letter currency code defined in ISO 4217.
26
26
  # @!attribute [rw] units
27
27
  # @return [::Integer]
28
28
  # The whole units of the amount.