google-cloud-document_ai-v1beta3 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-document_ai-v1beta3.rb +21 -0
  7. data/lib/google/cloud/document_ai/v1beta3.rb +35 -0
  8. data/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb +53 -0
  9. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +570 -0
  10. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb +51 -0
  11. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +570 -0
  12. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +71 -0
  13. data/lib/google/cloud/document_ai/v1beta3/version.rb +28 -0
  14. data/lib/google/cloud/documentai/v1beta3/document_pb.rb +303 -0
  15. data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +106 -0
  16. data/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +54 -0
  17. data/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +34 -0
  18. data/proto_docs/README.md +4 -0
  19. data/proto_docs/google/api/field_behavior.rb +59 -0
  20. data/proto_docs/google/api/resource.rb +283 -0
  21. data/proto_docs/google/cloud/documentai/v1beta3/document.rb +816 -0
  22. data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +235 -0
  23. data/proto_docs/google/cloud/documentai/v1beta3/geometry.rb +65 -0
  24. data/proto_docs/google/longrunning/operations.rb +150 -0
  25. data/proto_docs/google/protobuf/any.rb +138 -0
  26. data/proto_docs/google/protobuf/duration.rb +98 -0
  27. data/proto_docs/google/protobuf/empty.rb +36 -0
  28. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  29. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  30. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  31. data/proto_docs/google/rpc/status.rb +46 -0
  32. data/proto_docs/google/type/color.rb +168 -0
  33. data/proto_docs/google/type/date.rb +50 -0
  34. data/proto_docs/google/type/datetime.rb +91 -0
  35. data/proto_docs/google/type/money.rb +43 -0
  36. data/proto_docs/google/type/postal_address.rb +135 -0
  37. metadata +219 -0
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Protobuf
22
+ # A Timestamp represents a point in time independent of any time zone or local
23
+ # calendar, encoded as a count of seconds and fractions of seconds at
24
+ # nanosecond resolution. The count is relative to an epoch at UTC midnight on
25
+ # January 1, 1970, in the proleptic Gregorian calendar which extends the
26
+ # Gregorian calendar backwards to year one.
27
+ #
28
+ # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
29
+ # second table is needed for interpretation, using a [24-hour linear
30
+ # smear](https://developers.google.com/time/smear).
31
+ #
32
+ # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
33
+ # restricting to that range, we ensure that we can convert to and from [RFC
34
+ # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
35
+ #
36
+ # # Examples
37
+ #
38
+ # Example 1: Compute Timestamp from POSIX `time()`.
39
+ #
40
+ # Timestamp timestamp;
41
+ # timestamp.set_seconds(time(NULL));
42
+ # timestamp.set_nanos(0);
43
+ #
44
+ # Example 2: Compute Timestamp from POSIX `gettimeofday()`.
45
+ #
46
+ # struct timeval tv;
47
+ # gettimeofday(&tv, NULL);
48
+ #
49
+ # Timestamp timestamp;
50
+ # timestamp.set_seconds(tv.tv_sec);
51
+ # timestamp.set_nanos(tv.tv_usec * 1000);
52
+ #
53
+ # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
54
+ #
55
+ # FILETIME ft;
56
+ # GetSystemTimeAsFileTime(&ft);
57
+ # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
58
+ #
59
+ # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
60
+ # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
61
+ # Timestamp timestamp;
62
+ # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
63
+ # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
64
+ #
65
+ # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
66
+ #
67
+ # long millis = System.currentTimeMillis();
68
+ #
69
+ # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
+ # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
+ #
72
+ #
73
+ # Example 5: Compute Timestamp from current time in Python.
74
+ #
75
+ # timestamp = Timestamp()
76
+ # timestamp.GetCurrentTime()
77
+ #
78
+ # # JSON Mapping
79
+ #
80
+ # In JSON format, the Timestamp type is encoded as a string in the
81
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
82
+ # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
83
+ # where \\{year} is always expressed using four digits while \\{month}, \\{day},
84
+ # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
85
+ # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
86
+ # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
87
+ # is required. A proto3 JSON serializer should always use UTC (as indicated by
88
+ # "Z") when printing the Timestamp type and a proto3 JSON parser should be
89
+ # able to accept both UTC and other timezones (as indicated by an offset).
90
+ #
91
+ # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
92
+ # 01:30 UTC on January 15, 2017.
93
+ #
94
+ # In JavaScript, one can convert a Date object to this format using the
95
+ # standard
96
+ # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
97
+ # method. In Python, a standard `datetime.datetime` object can be converted
98
+ # to this format using
99
+ # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
100
+ # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
101
+ # the Joda Time's [`ISODateTimeFormat.dateTime()`](
102
+ # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
103
+ # ) to obtain a formatter capable of generating timestamps in this format.
104
+ # @!attribute [rw] seconds
105
+ # @return [::Integer]
106
+ # Represents seconds of UTC time since Unix epoch
107
+ # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
108
+ # 9999-12-31T23:59:59Z inclusive.
109
+ # @!attribute [rw] nanos
110
+ # @return [::Integer]
111
+ # Non-negative fractions of a second at nanosecond resolution. Negative
112
+ # second values with fractions must still have non-negative nanos values
113
+ # that count forward in time. Must be from 0 to 999,999,999
114
+ # inclusive.
115
+ class Timestamp
116
+ include ::Google::Protobuf::MessageExts
117
+ extend ::Google::Protobuf::MessageExts::ClassMethods
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,121 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Protobuf
22
+ # Wrapper message for `double`.
23
+ #
24
+ # The JSON representation for `DoubleValue` is JSON number.
25
+ # @!attribute [rw] value
26
+ # @return [::Float]
27
+ # The double value.
28
+ class DoubleValue
29
+ include ::Google::Protobuf::MessageExts
30
+ extend ::Google::Protobuf::MessageExts::ClassMethods
31
+ end
32
+
33
+ # Wrapper message for `float`.
34
+ #
35
+ # The JSON representation for `FloatValue` is JSON number.
36
+ # @!attribute [rw] value
37
+ # @return [::Float]
38
+ # The float value.
39
+ class FloatValue
40
+ include ::Google::Protobuf::MessageExts
41
+ extend ::Google::Protobuf::MessageExts::ClassMethods
42
+ end
43
+
44
+ # Wrapper message for `int64`.
45
+ #
46
+ # The JSON representation for `Int64Value` is JSON string.
47
+ # @!attribute [rw] value
48
+ # @return [::Integer]
49
+ # The int64 value.
50
+ class Int64Value
51
+ include ::Google::Protobuf::MessageExts
52
+ extend ::Google::Protobuf::MessageExts::ClassMethods
53
+ end
54
+
55
+ # Wrapper message for `uint64`.
56
+ #
57
+ # The JSON representation for `UInt64Value` is JSON string.
58
+ # @!attribute [rw] value
59
+ # @return [::Integer]
60
+ # The uint64 value.
61
+ class UInt64Value
62
+ include ::Google::Protobuf::MessageExts
63
+ extend ::Google::Protobuf::MessageExts::ClassMethods
64
+ end
65
+
66
+ # Wrapper message for `int32`.
67
+ #
68
+ # The JSON representation for `Int32Value` is JSON number.
69
+ # @!attribute [rw] value
70
+ # @return [::Integer]
71
+ # The int32 value.
72
+ class Int32Value
73
+ include ::Google::Protobuf::MessageExts
74
+ extend ::Google::Protobuf::MessageExts::ClassMethods
75
+ end
76
+
77
+ # Wrapper message for `uint32`.
78
+ #
79
+ # The JSON representation for `UInt32Value` is JSON number.
80
+ # @!attribute [rw] value
81
+ # @return [::Integer]
82
+ # The uint32 value.
83
+ class UInt32Value
84
+ include ::Google::Protobuf::MessageExts
85
+ extend ::Google::Protobuf::MessageExts::ClassMethods
86
+ end
87
+
88
+ # Wrapper message for `bool`.
89
+ #
90
+ # The JSON representation for `BoolValue` is JSON `true` and `false`.
91
+ # @!attribute [rw] value
92
+ # @return [::Boolean]
93
+ # The bool value.
94
+ class BoolValue
95
+ include ::Google::Protobuf::MessageExts
96
+ extend ::Google::Protobuf::MessageExts::ClassMethods
97
+ end
98
+
99
+ # Wrapper message for `string`.
100
+ #
101
+ # The JSON representation for `StringValue` is JSON string.
102
+ # @!attribute [rw] value
103
+ # @return [::String]
104
+ # The string value.
105
+ class StringValue
106
+ include ::Google::Protobuf::MessageExts
107
+ extend ::Google::Protobuf::MessageExts::ClassMethods
108
+ end
109
+
110
+ # Wrapper message for `bytes`.
111
+ #
112
+ # The JSON representation for `BytesValue` is JSON string.
113
+ # @!attribute [rw] value
114
+ # @return [::String]
115
+ # The bytes value.
116
+ class BytesValue
117
+ include ::Google::Protobuf::MessageExts
118
+ extend ::Google::Protobuf::MessageExts::ClassMethods
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Rpc
22
+ # The `Status` type defines a logical error model that is suitable for
23
+ # different programming environments, including REST APIs and RPC APIs. It is
24
+ # used by [gRPC](https://github.com/grpc). Each `Status` message contains
25
+ # three pieces of data: error code, error message, and error details.
26
+ #
27
+ # You can find out more about this error model and how to work with it in the
28
+ # [API Design Guide](https://cloud.google.com/apis/design/errors).
29
+ # @!attribute [rw] code
30
+ # @return [::Integer]
31
+ # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
32
+ # @!attribute [rw] message
33
+ # @return [::String]
34
+ # A developer-facing error message, which should be in English. Any
35
+ # user-facing error message should be localized and sent in the
36
+ # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized by the client.
37
+ # @!attribute [rw] details
38
+ # @return [::Array<::Google::Protobuf::Any>]
39
+ # A list of messages that carry the error details. There is a common set of
40
+ # message types for APIs to use.
41
+ class Status
42
+ include ::Google::Protobuf::MessageExts
43
+ extend ::Google::Protobuf::MessageExts::ClassMethods
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,168 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Type
22
+ # Represents a color in the RGBA color space. This representation is designed
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"
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.
29
+ #
30
+ # Note: this proto does not carry information about the absolute color space
31
+ # 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
+ # space.
34
+ #
35
+ # Example (Java):
36
+ #
37
+ # import com.google.type.Color;
38
+ #
39
+ # // ...
40
+ # public static java.awt.Color fromProto(Color protocolor) {
41
+ # float alpha = protocolor.hasAlpha()
42
+ # ? protocolor.getAlpha().getValue()
43
+ # : 1.0;
44
+ #
45
+ # return new java.awt.Color(
46
+ # protocolor.getRed(),
47
+ # protocolor.getGreen(),
48
+ # protocolor.getBlue(),
49
+ # alpha);
50
+ # }
51
+ #
52
+ # public static Color toProto(java.awt.Color color) {
53
+ # float red = (float) color.getRed();
54
+ # float green = (float) color.getGreen();
55
+ # float blue = (float) color.getBlue();
56
+ # float denominator = 255.0;
57
+ # Color.Builder resultBuilder =
58
+ # Color
59
+ # .newBuilder()
60
+ # .setRed(red / denominator)
61
+ # .setGreen(green / denominator)
62
+ # .setBlue(blue / denominator);
63
+ # int alpha = color.getAlpha();
64
+ # if (alpha != 255) {
65
+ # result.setAlpha(
66
+ # FloatValue
67
+ # .newBuilder()
68
+ # .setValue(((float) alpha) / denominator)
69
+ # .build());
70
+ # }
71
+ # return resultBuilder.build();
72
+ # }
73
+ # // ...
74
+ #
75
+ # Example (iOS / Obj-C):
76
+ #
77
+ # // ...
78
+ # static UIColor* fromProto(Color* protocolor) {
79
+ # float red = [protocolor red];
80
+ # float green = [protocolor green];
81
+ # float blue = [protocolor blue];
82
+ # FloatValue* alpha_wrapper = [protocolor alpha];
83
+ # float alpha = 1.0;
84
+ # if (alpha_wrapper != nil) {
85
+ # alpha = [alpha_wrapper value];
86
+ # }
87
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
88
+ # }
89
+ #
90
+ # static Color* toProto(UIColor* color) {
91
+ # CGFloat red, green, blue, alpha;
92
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
93
+ # return nil;
94
+ # }
95
+ # Color* result = [[Color alloc] init];
96
+ # [result setRed:red];
97
+ # [result setGreen:green];
98
+ # [result setBlue:blue];
99
+ # if (alpha <= 0.9999) {
100
+ # [result setAlpha:floatWrapperWithValue(alpha)];
101
+ # }
102
+ # [result autorelease];
103
+ # return result;
104
+ # }
105
+ # // ...
106
+ #
107
+ # Example (JavaScript):
108
+ #
109
+ # // ...
110
+ #
111
+ # var protoToCssColor = function(rgb_color) {
112
+ # var redFrac = rgb_color.red || 0.0;
113
+ # var greenFrac = rgb_color.green || 0.0;
114
+ # var blueFrac = rgb_color.blue || 0.0;
115
+ # var red = Math.floor(redFrac * 255);
116
+ # var green = Math.floor(greenFrac * 255);
117
+ # var blue = Math.floor(blueFrac * 255);
118
+ #
119
+ # if (!('alpha' in rgb_color)) {
120
+ # return rgbToCssColor_(red, green, blue);
121
+ # }
122
+ #
123
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
124
+ # var rgbParams = [red, green, blue].join(',');
125
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
126
+ # };
127
+ #
128
+ # var rgbToCssColor_ = function(red, green, blue) {
129
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
130
+ # var hexString = rgbNumber.toString(16);
131
+ # var missingZeros = 6 - hexString.length;
132
+ # var resultBuilder = ['#'];
133
+ # for (var i = 0; i < missingZeros; i++) {
134
+ # resultBuilder.push('0');
135
+ # }
136
+ # resultBuilder.push(hexString);
137
+ # return resultBuilder.join('');
138
+ # };
139
+ #
140
+ # // ...
141
+ # @!attribute [rw] red
142
+ # @return [::Float]
143
+ # The amount of red in the color as a value in the interval [0, 1].
144
+ # @!attribute [rw] green
145
+ # @return [::Float]
146
+ # The amount of green in the color as a value in the interval [0, 1].
147
+ # @!attribute [rw] blue
148
+ # @return [::Float]
149
+ # The amount of blue in the color as a value in the interval [0, 1].
150
+ # @!attribute [rw] alpha
151
+ # @return [::Google::Protobuf::FloatValue]
152
+ # The fraction of this color that should be applied to the pixel. That is,
153
+ # the final pixel color is defined by the equation:
154
+ #
155
+ # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
156
+ #
157
+ # This means that a value of 1.0 corresponds to a solid color, whereas
158
+ # a value of 0.0 corresponds to a completely transparent color. This
159
+ # uses a wrapper message rather than a simple float scalar so that it is
160
+ # 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).
163
+ class Color
164
+ include ::Google::Protobuf::MessageExts
165
+ extend ::Google::Protobuf::MessageExts::ClassMethods
166
+ end
167
+ end
168
+ end