google-cloud-automl-v1beta1 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +30 -15
- data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +24 -6
- data/lib/google/cloud/automl/v1beta1/automl/client.rb +6 -4
- data/lib/google/cloud/automl/v1beta1/automl/operations.rb +5 -3
- data/lib/google/cloud/automl/v1beta1/automl/rest/client.rb +2224 -0
- data/lib/google/cloud/automl/v1beta1/automl/rest/operations.rb +937 -0
- data/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +1475 -0
- data/lib/google/cloud/automl/v1beta1/automl/rest.rb +66 -0
- data/lib/google/cloud/automl/v1beta1/automl.rb +6 -0
- data/lib/google/cloud/automl/v1beta1/classification_pb.rb +25 -47
- data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +26 -13
- data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +28 -61
- data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +24 -54
- data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +24 -22
- data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +30 -20
- data/lib/google/cloud/automl/v1beta1/detection_pb.rb +26 -33
- data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +24 -8
- data/lib/google/cloud/automl/v1beta1/image_pb.rb +24 -29
- data/lib/google/cloud/automl/v1beta1/io_pb.rb +24 -57
- data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +31 -17
- data/lib/google/cloud/automl/v1beta1/model_pb.rb +30 -25
- data/lib/google/cloud/automl/v1beta1/operations_pb.rb +27 -59
- data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +6 -4
- data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +5 -3
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb +565 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/operations.rb +937 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb +168 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest.rb +56 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service.rb +6 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service_pb.rb +27 -20
- data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +24 -5
- data/lib/google/cloud/automl/v1beta1/regression_pb.rb +24 -8
- data/lib/google/cloud/automl/v1beta1/rest.rb +38 -0
- data/lib/google/cloud/automl/v1beta1/service_pb.rb +32 -125
- data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +25 -10
- data/lib/google/cloud/automl/v1beta1/tables_pb.rb +29 -34
- data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +25 -5
- data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +25 -17
- data/lib/google/cloud/automl/v1beta1/text_pb.rb +24 -17
- data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +24 -6
- data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +25 -15
- data/lib/google/cloud/automl/v1beta1/translation_pb.rb +25 -17
- data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/video_pb.rb +24 -9
- data/lib/google/cloud/automl/v1beta1.rb +5 -0
- data/proto_docs/google/api/client.rb +67 -4
- data/proto_docs/google/protobuf/any.rb +7 -4
- data/proto_docs/google/protobuf/struct.rb +1 -1
- data/proto_docs/google/protobuf/timestamp.rb +1 -3
- metadata +15 -5
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/automl/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/automl/v1beta1/automl/credentials"
|
26
|
+
require "google/cloud/automl/v1beta1/automl/paths"
|
27
|
+
require "google/cloud/automl/v1beta1/automl/rest/operations"
|
28
|
+
require "google/cloud/automl/v1beta1/automl/rest/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module AutoML
|
33
|
+
module V1beta1
|
34
|
+
##
|
35
|
+
# AutoML Server API.
|
36
|
+
#
|
37
|
+
# The resource names are assigned by the server.
|
38
|
+
# The server never reuses names that it has created after the resources with
|
39
|
+
# those names are deleted.
|
40
|
+
#
|
41
|
+
# An ID of a resource is the last element of the item's resource name. For
|
42
|
+
# `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
|
43
|
+
# the id for the item is `{dataset_id}`.
|
44
|
+
#
|
45
|
+
# Currently the only supported `location_id` is "us-central1".
|
46
|
+
#
|
47
|
+
# On any input that is documented to expect a string parameter in
|
48
|
+
# snake_case or kebab-case, either of those cases is accepted.
|
49
|
+
#
|
50
|
+
# To load this service and instantiate a REST client:
|
51
|
+
#
|
52
|
+
# require "google/cloud/automl/v1beta1/automl/rest"
|
53
|
+
# client = ::Google::Cloud::AutoML::V1beta1::AutoML::Rest::Client.new
|
54
|
+
#
|
55
|
+
module AutoML
|
56
|
+
# Client for the REST transport
|
57
|
+
module Rest
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
66
|
+
require "google/cloud/automl/v1beta1/automl/rest/helpers" if ::File.file? helper_path
|
@@ -26,6 +26,7 @@ require "google/cloud/automl/v1beta1/automl/credentials"
|
|
26
26
|
require "google/cloud/automl/v1beta1/automl/paths"
|
27
27
|
require "google/cloud/automl/v1beta1/automl/operations"
|
28
28
|
require "google/cloud/automl/v1beta1/automl/client"
|
29
|
+
require "google/cloud/automl/v1beta1/automl/rest"
|
29
30
|
|
30
31
|
module Google
|
31
32
|
module Cloud
|
@@ -52,6 +53,11 @@ module Google
|
|
52
53
|
# require "google/cloud/automl/v1beta1/automl"
|
53
54
|
# client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new
|
54
55
|
#
|
56
|
+
# @example Load this service and instantiate a REST client
|
57
|
+
#
|
58
|
+
# require "google/cloud/automl/v1beta1/automl/rest"
|
59
|
+
# client = ::Google::Cloud::AutoML::V1beta1::AutoML::Rest::Client.new
|
60
|
+
#
|
55
61
|
module AutoML
|
56
62
|
end
|
57
63
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/automl/v1beta1/classification.proto
|
3
4
|
|
@@ -5,55 +6,32 @@ require 'google/protobuf'
|
|
5
6
|
|
6
7
|
require 'google/cloud/automl/v1beta1/temporal_pb'
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
optional :recall, :float, 2
|
31
|
-
optional :precision, :float, 3
|
32
|
-
optional :false_positive_rate, :float, 8
|
33
|
-
optional :f1_score, :float, 4
|
34
|
-
optional :recall_at1, :float, 5
|
35
|
-
optional :precision_at1, :float, 6
|
36
|
-
optional :false_positive_rate_at1, :float, 9
|
37
|
-
optional :f1_score_at1, :float, 7
|
38
|
-
optional :true_positive_count, :int64, 10
|
39
|
-
optional :false_positive_count, :int64, 11
|
40
|
-
optional :false_negative_count, :int64, 12
|
41
|
-
optional :true_negative_count, :int64, 13
|
42
|
-
end
|
43
|
-
add_message "google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix" do
|
44
|
-
repeated :annotation_spec_id, :string, 1
|
45
|
-
repeated :display_name, :string, 3
|
46
|
-
repeated :row, :message, 2, "google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row"
|
47
|
-
end
|
48
|
-
add_message "google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row" do
|
49
|
-
repeated :example_count, :int32, 1
|
50
|
-
end
|
51
|
-
add_enum "google.cloud.automl.v1beta1.ClassificationType" do
|
52
|
-
value :CLASSIFICATION_TYPE_UNSPECIFIED, 0
|
53
|
-
value :MULTICLASS, 1
|
54
|
-
value :MULTILABEL, 2
|
9
|
+
|
10
|
+
descriptor_data = "\n0google/cloud/automl/v1beta1/classification.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a*google/cloud/automl/v1beta1/temporal.proto\")\n\x18\x43lassificationAnnotation\x12\r\n\x05score\x18\x01 \x01(\x02\"\xc7\x01\n\x1dVideoClassificationAnnotation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12X\n\x19\x63lassification_annotation\x18\x02 \x01(\x0b\x32\x35.google.cloud.automl.v1beta1.ClassificationAnnotation\x12>\n\x0ctime_segment\x18\x03 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TimeSegment\"\xa9\x07\n\x1f\x43lassificationEvaluationMetrics\x12\x0e\n\x06\x61u_prc\x18\x01 \x01(\x02\x12\x17\n\x0b\x62\x61se_au_prc\x18\x02 \x01(\x02\x42\x02\x18\x01\x12\x0e\n\x06\x61u_roc\x18\x06 \x01(\x02\x12\x10\n\x08log_loss\x18\x07 \x01(\x02\x12u\n\x18\x63onfidence_metrics_entry\x18\x03 \x03(\x0b\x32S.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry\x12\x66\n\x10\x63onfusion_matrix\x18\x04 \x01(\x0b\x32L.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix\x12\x1a\n\x12\x61nnotation_spec_id\x18\x05 \x03(\t\x1a\xfc\x02\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x1a\n\x12position_threshold\x18\x0e \x01(\x05\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x11\n\tprecision\x18\x03 \x01(\x02\x12\x1b\n\x13\x66\x61lse_positive_rate\x18\x08 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x04 \x01(\x02\x12\x12\n\nrecall_at1\x18\x05 \x01(\x02\x12\x15\n\rprecision_at1\x18\x06 \x01(\x02\x12\x1f\n\x17\x66\x61lse_positive_rate_at1\x18\t \x01(\x02\x12\x14\n\x0c\x66\x31_score_at1\x18\x07 \x01(\x02\x12\x1b\n\x13true_positive_count\x18\n \x01(\x03\x12\x1c\n\x14\x66\x61lse_positive_count\x18\x0b \x01(\x03\x12\x1c\n\x14\x66\x61lse_negative_count\x18\x0c \x01(\x03\x12\x1b\n\x13true_negative_count\x18\r \x01(\x03\x1a\xc0\x01\n\x0f\x43onfusionMatrix\x12\x1a\n\x12\x61nnotation_spec_id\x18\x01 \x03(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x03(\t\x12]\n\x03row\x18\x02 \x03(\x0b\x32P.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row\x1a\x1c\n\x03Row\x12\x15\n\rexample_count\x18\x01 \x03(\x05*Y\n\x12\x43lassificationType\x12#\n\x1f\x43LASSIFICATION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTICLASS\x10\x01\x12\x0e\n\nMULTILABEL\x10\x02\x42\xae\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\x13\x43lassificationProtoZ7cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3"
|
11
|
+
|
12
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
|
14
|
+
begin
|
15
|
+
pool.add_serialized_file(descriptor_data)
|
16
|
+
rescue TypeError => e
|
17
|
+
# Compatibility code: will be removed in the next major version.
|
18
|
+
require 'google/protobuf/descriptor_pb'
|
19
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
20
|
+
parsed.clear_dependency
|
21
|
+
serialized = parsed.class.encode(parsed)
|
22
|
+
file = pool.add_serialized_file(serialized)
|
23
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
24
|
+
imports = [
|
25
|
+
["google.cloud.automl.v1beta1.TimeSegment", "google/cloud/automl/v1beta1/temporal.proto"],
|
26
|
+
]
|
27
|
+
imports.each do |type_name, expected_filename|
|
28
|
+
import_file = pool.lookup(type_name).file_descriptor
|
29
|
+
if import_file.name != expected_filename
|
30
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
55
31
|
end
|
56
32
|
end
|
33
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
34
|
+
warn "This will become an error in the next major version."
|
57
35
|
end
|
58
36
|
|
59
37
|
module Google
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/automl/v1beta1/column_spec.proto
|
3
4
|
|
@@ -7,21 +8,33 @@ require 'google/api/resource_pb'
|
|
7
8
|
require 'google/cloud/automl/v1beta1/data_stats_pb'
|
8
9
|
require 'google/cloud/automl/v1beta1/data_types_pb'
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
11
|
+
|
12
|
+
descriptor_data = "\n-google/cloud/automl/v1beta1/column_spec.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x19google/api/resource.proto\x1a,google/cloud/automl/v1beta1/data_stats.proto\x1a,google/cloud/automl/v1beta1/data_types.proto\"\x9b\x04\n\nColumnSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\tdata_type\x18\x02 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DataType\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12:\n\ndata_stats\x18\x04 \x01(\x0b\x32&.google.cloud.automl.v1beta1.DataStats\x12X\n\x16top_correlated_columns\x18\x05 \x03(\x0b\x32\x38.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn\x12\x0c\n\x04\x65tag\x18\x06 \x01(\t\x1at\n\x10\x43orrelatedColumn\x12\x16\n\x0e\x63olumn_spec_id\x18\x01 \x01(\t\x12H\n\x11\x63orrelation_stats\x18\x02 \x01(\x0b\x32-.google.cloud.automl.v1beta1.CorrelationStats:\x94\x01\xea\x41\x90\x01\n automl.googleapis.com/ColumnSpec\x12lprojects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}B\x9b\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01Z7cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3"
|
13
|
+
|
14
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
15
|
+
|
16
|
+
begin
|
17
|
+
pool.add_serialized_file(descriptor_data)
|
18
|
+
rescue TypeError => e
|
19
|
+
# Compatibility code: will be removed in the next major version.
|
20
|
+
require 'google/protobuf/descriptor_pb'
|
21
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
22
|
+
parsed.clear_dependency
|
23
|
+
serialized = parsed.class.encode(parsed)
|
24
|
+
file = pool.add_serialized_file(serialized)
|
25
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
26
|
+
imports = [
|
27
|
+
["google.cloud.automl.v1beta1.DataType", "google/cloud/automl/v1beta1/data_types.proto"],
|
28
|
+
["google.cloud.automl.v1beta1.DataStats", "google/cloud/automl/v1beta1/data_stats.proto"],
|
29
|
+
]
|
30
|
+
imports.each do |type_name, expected_filename|
|
31
|
+
import_file = pool.lookup(type_name).file_descriptor
|
32
|
+
if import_file.name != expected_filename
|
33
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
23
34
|
end
|
24
35
|
end
|
36
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
37
|
+
warn "This will become an error in the next major version."
|
25
38
|
end
|
26
39
|
|
27
40
|
module Google
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/automl/v1beta1/data_items.proto
|
3
4
|
|
@@ -9,69 +10,35 @@ require 'google/cloud/automl/v1beta1/temporal_pb'
|
|
9
10
|
require 'google/cloud/automl/v1beta1/text_segment_pb'
|
10
11
|
require 'google/protobuf/struct_pb'
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
add_message "google.cloud.automl.v1beta1.Document" do
|
38
|
-
optional :input_config, :message, 1, "google.cloud.automl.v1beta1.DocumentInputConfig"
|
39
|
-
optional :document_text, :message, 2, "google.cloud.automl.v1beta1.TextSnippet"
|
40
|
-
repeated :layout, :message, 3, "google.cloud.automl.v1beta1.Document.Layout"
|
41
|
-
optional :document_dimensions, :message, 4, "google.cloud.automl.v1beta1.DocumentDimensions"
|
42
|
-
optional :page_count, :int32, 5
|
43
|
-
end
|
44
|
-
add_message "google.cloud.automl.v1beta1.Document.Layout" do
|
45
|
-
optional :text_segment, :message, 1, "google.cloud.automl.v1beta1.TextSegment"
|
46
|
-
optional :page_number, :int32, 2
|
47
|
-
optional :bounding_poly, :message, 3, "google.cloud.automl.v1beta1.BoundingPoly"
|
48
|
-
optional :text_segment_type, :enum, 4, "google.cloud.automl.v1beta1.Document.Layout.TextSegmentType"
|
49
|
-
end
|
50
|
-
add_enum "google.cloud.automl.v1beta1.Document.Layout.TextSegmentType" do
|
51
|
-
value :TEXT_SEGMENT_TYPE_UNSPECIFIED, 0
|
52
|
-
value :TOKEN, 1
|
53
|
-
value :PARAGRAPH, 2
|
54
|
-
value :FORM_FIELD, 3
|
55
|
-
value :FORM_FIELD_NAME, 4
|
56
|
-
value :FORM_FIELD_CONTENTS, 5
|
57
|
-
value :TABLE, 6
|
58
|
-
value :TABLE_HEADER, 7
|
59
|
-
value :TABLE_ROW, 8
|
60
|
-
value :TABLE_CELL, 9
|
61
|
-
end
|
62
|
-
add_message "google.cloud.automl.v1beta1.Row" do
|
63
|
-
repeated :column_spec_ids, :string, 2
|
64
|
-
repeated :values, :message, 3, "google.protobuf.Value"
|
65
|
-
end
|
66
|
-
add_message "google.cloud.automl.v1beta1.ExamplePayload" do
|
67
|
-
oneof :payload do
|
68
|
-
optional :image, :message, 1, "google.cloud.automl.v1beta1.Image"
|
69
|
-
optional :text_snippet, :message, 2, "google.cloud.automl.v1beta1.TextSnippet"
|
70
|
-
optional :document, :message, 4, "google.cloud.automl.v1beta1.Document"
|
71
|
-
optional :row, :message, 3, "google.cloud.automl.v1beta1.Row"
|
72
|
-
end
|
13
|
+
|
14
|
+
descriptor_data = "\n,google/cloud/automl/v1beta1/data_items.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a*google/cloud/automl/v1beta1/geometry.proto\x1a$google/cloud/automl/v1beta1/io.proto\x1a*google/cloud/automl/v1beta1/temporal.proto\x1a.google/cloud/automl/v1beta1/text_segment.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x7f\n\x05Image\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\x0cH\x00\x12@\n\x0cinput_config\x18\x06 \x01(\x0b\x32(.google.cloud.automl.v1beta1.InputConfigH\x00\x12\x15\n\rthumbnail_uri\x18\x04 \x01(\tB\x06\n\x04\x64\x61ta\"F\n\x0bTextSnippet\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x13\n\x0b\x63ontent_uri\x18\x04 \x01(\t\"\xef\x01\n\x12\x44ocumentDimensions\x12S\n\x04unit\x18\x01 \x01(\x0e\x32\x45.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit\x12\r\n\x05width\x18\x02 \x01(\x02\x12\x0e\n\x06height\x18\x03 \x01(\x02\"e\n\x15\x44ocumentDimensionUnit\x12\'\n#DOCUMENT_DIMENSION_UNIT_UNSPECIFIED\x10\x00\x12\x08\n\x04INCH\x10\x01\x12\x0e\n\nCENTIMETER\x10\x02\x12\t\n\x05POINT\x10\x03\"\xf9\x05\n\x08\x44ocument\x12\x46\n\x0cinput_config\x18\x01 \x01(\x0b\x32\x30.google.cloud.automl.v1beta1.DocumentInputConfig\x12?\n\rdocument_text\x18\x02 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSnippet\x12<\n\x06layout\x18\x03 \x03(\x0b\x32,.google.cloud.automl.v1beta1.Document.Layout\x12L\n\x13\x64ocument_dimensions\x18\x04 \x01(\x0b\x32/.google.cloud.automl.v1beta1.DocumentDimensions\x12\x12\n\npage_count\x18\x05 \x01(\x05\x1a\xc3\x03\n\x06Layout\x12>\n\x0ctext_segment\x18\x01 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSegment\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\x12@\n\rbounding_poly\x18\x03 \x01(\x0b\x32).google.cloud.automl.v1beta1.BoundingPoly\x12W\n\x11text_segment_type\x18\x04 \x01(\x0e\x32<.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType\"\xc8\x01\n\x0fTextSegmentType\x12!\n\x1dTEXT_SEGMENT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TOKEN\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x0e\n\nFORM_FIELD\x10\x03\x12\x13\n\x0f\x46ORM_FIELD_NAME\x10\x04\x12\x17\n\x13\x46ORM_FIELD_CONTENTS\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x10\n\x0cTABLE_HEADER\x10\x07\x12\r\n\tTABLE_ROW\x10\x08\x12\x0e\n\nTABLE_CELL\x10\t\"F\n\x03Row\x12\x17\n\x0f\x63olumn_spec_ids\x18\x02 \x03(\t\x12&\n\x06values\x18\x03 \x03(\x0b\x32\x16.google.protobuf.Value\"\xfe\x01\n\x0e\x45xamplePayload\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32\".google.cloud.automl.v1beta1.ImageH\x00\x12@\n\x0ctext_snippet\x18\x02 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSnippetH\x00\x12\x39\n\x08\x64ocument\x18\x04 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DocumentH\x00\x12/\n\x03row\x18\x03 \x01(\x0b\x32 .google.cloud.automl.v1beta1.RowH\x00\x42\t\n\x07payloadB\x9b\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01Z7cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3"
|
15
|
+
|
16
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
17
|
+
|
18
|
+
begin
|
19
|
+
pool.add_serialized_file(descriptor_data)
|
20
|
+
rescue TypeError => e
|
21
|
+
# Compatibility code: will be removed in the next major version.
|
22
|
+
require 'google/protobuf/descriptor_pb'
|
23
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
24
|
+
parsed.clear_dependency
|
25
|
+
serialized = parsed.class.encode(parsed)
|
26
|
+
file = pool.add_serialized_file(serialized)
|
27
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
28
|
+
imports = [
|
29
|
+
["google.cloud.automl.v1beta1.InputConfig", "google/cloud/automl/v1beta1/io.proto"],
|
30
|
+
["google.cloud.automl.v1beta1.TextSegment", "google/cloud/automl/v1beta1/text_segment.proto"],
|
31
|
+
["google.cloud.automl.v1beta1.BoundingPoly", "google/cloud/automl/v1beta1/geometry.proto"],
|
32
|
+
["google.protobuf.Value", "google/protobuf/struct.proto"],
|
33
|
+
]
|
34
|
+
imports.each do |type_name, expected_filename|
|
35
|
+
import_file = pool.lookup(type_name).file_descriptor
|
36
|
+
if import_file.name != expected_filename
|
37
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
73
38
|
end
|
74
39
|
end
|
40
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
41
|
+
warn "This will become an error in the next major version."
|
75
42
|
end
|
76
43
|
|
77
44
|
module Google
|
@@ -1,64 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/automl/v1beta1/data_stats.proto
|
3
4
|
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
add_message "google.cloud.automl.v1beta1.Float64Stats.HistogramBucket" do
|
28
|
-
optional :min, :double, 1
|
29
|
-
optional :max, :double, 2
|
30
|
-
optional :count, :int64, 3
|
31
|
-
end
|
32
|
-
add_message "google.cloud.automl.v1beta1.StringStats" do
|
33
|
-
repeated :top_unigram_stats, :message, 1, "google.cloud.automl.v1beta1.StringStats.UnigramStats"
|
34
|
-
end
|
35
|
-
add_message "google.cloud.automl.v1beta1.StringStats.UnigramStats" do
|
36
|
-
optional :value, :string, 1
|
37
|
-
optional :count, :int64, 2
|
38
|
-
end
|
39
|
-
add_message "google.cloud.automl.v1beta1.TimestampStats" do
|
40
|
-
map :granular_stats, :string, :message, 1, "google.cloud.automl.v1beta1.TimestampStats.GranularStats"
|
41
|
-
end
|
42
|
-
add_message "google.cloud.automl.v1beta1.TimestampStats.GranularStats" do
|
43
|
-
map :buckets, :int32, :int64, 1
|
44
|
-
end
|
45
|
-
add_message "google.cloud.automl.v1beta1.ArrayStats" do
|
46
|
-
optional :member_stats, :message, 2, "google.cloud.automl.v1beta1.DataStats"
|
47
|
-
end
|
48
|
-
add_message "google.cloud.automl.v1beta1.StructStats" do
|
49
|
-
map :field_stats, :string, :message, 1, "google.cloud.automl.v1beta1.DataStats"
|
50
|
-
end
|
51
|
-
add_message "google.cloud.automl.v1beta1.CategoryStats" do
|
52
|
-
repeated :top_category_stats, :message, 1, "google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats"
|
53
|
-
end
|
54
|
-
add_message "google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats" do
|
55
|
-
optional :value, :string, 1
|
56
|
-
optional :count, :int64, 2
|
57
|
-
end
|
58
|
-
add_message "google.cloud.automl.v1beta1.CorrelationStats" do
|
59
|
-
optional :cramers_v, :double, 1
|
7
|
+
|
8
|
+
descriptor_data = "\n,google/cloud/automl/v1beta1/data_stats.proto\x12\x1bgoogle.cloud.automl.v1beta1\"\xfd\x03\n\tDataStats\x12\x42\n\rfloat64_stats\x18\x03 \x01(\x0b\x32).google.cloud.automl.v1beta1.Float64StatsH\x00\x12@\n\x0cstring_stats\x18\x04 \x01(\x0b\x32(.google.cloud.automl.v1beta1.StringStatsH\x00\x12\x46\n\x0ftimestamp_stats\x18\x05 \x01(\x0b\x32+.google.cloud.automl.v1beta1.TimestampStatsH\x00\x12>\n\x0b\x61rray_stats\x18\x06 \x01(\x0b\x32\'.google.cloud.automl.v1beta1.ArrayStatsH\x00\x12@\n\x0cstruct_stats\x18\x07 \x01(\x0b\x32(.google.cloud.automl.v1beta1.StructStatsH\x00\x12\x44\n\x0e\x63\x61tegory_stats\x18\x08 \x01(\x0b\x32*.google.cloud.automl.v1beta1.CategoryStatsH\x00\x12\x1c\n\x14\x64istinct_value_count\x18\x01 \x01(\x03\x12\x18\n\x10null_value_count\x18\x02 \x01(\x03\x12\x19\n\x11valid_value_count\x18\t \x01(\x03\x42\x07\n\x05stats\"\xdd\x01\n\x0c\x46loat64Stats\x12\x0c\n\x04mean\x18\x01 \x01(\x01\x12\x1a\n\x12standard_deviation\x18\x02 \x01(\x01\x12\x11\n\tquantiles\x18\x03 \x03(\x01\x12T\n\x11histogram_buckets\x18\x04 \x03(\x0b\x32\x39.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket\x1a:\n\x0fHistogramBucket\x12\x0b\n\x03min\x18\x01 \x01(\x01\x12\x0b\n\x03max\x18\x02 \x01(\x01\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\"\x8d\x01\n\x0bStringStats\x12P\n\x11top_unigram_stats\x18\x01 \x03(\x0b\x32\x35.google.cloud.automl.v1beta1.StringStats.UnigramStats\x1a,\n\x0cUnigramStats\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\"\xf4\x02\n\x0eTimestampStats\x12V\n\x0egranular_stats\x18\x01 \x03(\x0b\x32>.google.cloud.automl.v1beta1.TimestampStats.GranularStatsEntry\x1a\x98\x01\n\rGranularStats\x12W\n\x07\x62uckets\x18\x01 \x03(\x0b\x32\x46.google.cloud.automl.v1beta1.TimestampStats.GranularStats.BucketsEntry\x1a.\n\x0c\x42ucketsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1ao\n\x12GranularStatsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.TimestampStats.GranularStats:\x02\x38\x01\"J\n\nArrayStats\x12<\n\x0cmember_stats\x18\x02 \x01(\x0b\x32&.google.cloud.automl.v1beta1.DataStats\"\xb7\x01\n\x0bStructStats\x12M\n\x0b\x66ield_stats\x18\x01 \x03(\x0b\x32\x38.google.cloud.automl.v1beta1.StructStats.FieldStatsEntry\x1aY\n\x0f\x46ieldStatsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.google.cloud.automl.v1beta1.DataStats:\x02\x38\x01\"\xa0\x01\n\rCategoryStats\x12Z\n\x12top_category_stats\x18\x01 \x03(\x0b\x32>.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats\x1a\x33\n\x13SingleCategoryStats\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\"%\n\x10\x43orrelationStats\x12\x11\n\tcramers_v\x18\x01 \x01(\x01\x42\x9b\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01Z7cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError => e
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
60
28
|
end
|
61
29
|
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
62
32
|
end
|
63
33
|
|
64
34
|
module Google
|
@@ -1,32 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/automl/v1beta1/data_types.proto
|
3
4
|
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
value :CATEGORY, 10
|
7
|
+
|
8
|
+
descriptor_data = "\n,google/cloud/automl/v1beta1/data_types.proto\x12\x1bgoogle.cloud.automl.v1beta1\"\xfc\x01\n\x08\x44\x61taType\x12\x42\n\x11list_element_type\x18\x02 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DataTypeH\x00\x12>\n\x0bstruct_type\x18\x03 \x01(\x0b\x32\'.google.cloud.automl.v1beta1.StructTypeH\x00\x12\x15\n\x0btime_format\x18\x05 \x01(\tH\x00\x12\x38\n\ttype_code\x18\x01 \x01(\x0e\x32%.google.cloud.automl.v1beta1.TypeCode\x12\x10\n\x08nullable\x18\x04 \x01(\x08\x42\t\n\x07\x64\x65tails\"\xa7\x01\n\nStructType\x12\x43\n\x06\x66ields\x18\x01 \x03(\x0b\x32\x33.google.cloud.automl.v1beta1.StructType.FieldsEntry\x1aT\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DataType:\x02\x38\x01*r\n\x08TypeCode\x12\x19\n\x15TYPE_CODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\r\n\tTIMESTAMP\x10\x04\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x41RRAY\x10\x08\x12\n\n\x06STRUCT\x10\t\x12\x0c\n\x08\x43\x41TEGORY\x10\nB\x9b\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01Z7cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError => e
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
28
28
|
end
|
29
29
|
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
30
32
|
end
|
31
33
|
|
32
34
|
module Google
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/automl/v1beta1/dataset.proto
|
3
4
|
|
@@ -11,28 +12,37 @@ require 'google/cloud/automl/v1beta1/translation_pb'
|
|
11
12
|
require 'google/cloud/automl/v1beta1/video_pb'
|
12
13
|
require 'google/protobuf/timestamp_pb'
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
15
|
+
|
16
|
+
descriptor_data = "\n)google/cloud/automl/v1beta1/dataset.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x19google/api/resource.proto\x1a\'google/cloud/automl/v1beta1/image.proto\x1a(google/cloud/automl/v1beta1/tables.proto\x1a&google/cloud/automl/v1beta1/text.proto\x1a-google/cloud/automl/v1beta1/translation.proto\x1a\'google/cloud/automl/v1beta1/video.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xce\t\n\x07\x44\x61taset\x12_\n\x1ctranslation_dataset_metadata\x18\x17 \x01(\x0b\x32\x37.google.cloud.automl.v1beta1.TranslationDatasetMetadataH\x00\x12p\n%image_classification_dataset_metadata\x18\x18 \x01(\x0b\x32?.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataH\x00\x12n\n$text_classification_dataset_metadata\x18\x19 \x01(\x0b\x32>.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataH\x00\x12s\n\'image_object_detection_dataset_metadata\x18\x1a \x01(\x0b\x32@.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadataH\x00\x12p\n%video_classification_dataset_metadata\x18\x1f \x01(\x0b\x32?.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadataH\x00\x12q\n&video_object_tracking_dataset_metadata\x18\x1d \x01(\x0b\x32?.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadataH\x00\x12\x66\n text_extraction_dataset_metadata\x18\x1c \x01(\x0b\x32:.google.cloud.automl.v1beta1.TextExtractionDatasetMetadataH\x00\x12\x64\n\x1ftext_sentiment_dataset_metadata\x18\x1e \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.TextSentimentDatasetMetadataH\x00\x12U\n\x17tables_dataset_metadata\x18! \x01(\x0b\x32\x32.google.cloud.automl.v1beta1.TablesDatasetMetadataH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x15\n\rexample_count\x18\x15 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04\x65tag\x18\x11 \x01(\t:^\xea\x41[\n\x1d\x61utoml.googleapis.com/Dataset\x12:projects/{project}/locations/{location}/datasets/{dataset}B\x12\n\x10\x64\x61taset_metadataB\x9b\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01Z7cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3"
|
17
|
+
|
18
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
19
|
+
|
20
|
+
begin
|
21
|
+
pool.add_serialized_file(descriptor_data)
|
22
|
+
rescue TypeError => e
|
23
|
+
# Compatibility code: will be removed in the next major version.
|
24
|
+
require 'google/protobuf/descriptor_pb'
|
25
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
26
|
+
parsed.clear_dependency
|
27
|
+
serialized = parsed.class.encode(parsed)
|
28
|
+
file = pool.add_serialized_file(serialized)
|
29
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
30
|
+
imports = [
|
31
|
+
["google.cloud.automl.v1beta1.TranslationDatasetMetadata", "google/cloud/automl/v1beta1/translation.proto"],
|
32
|
+
["google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata", "google/cloud/automl/v1beta1/image.proto"],
|
33
|
+
["google.cloud.automl.v1beta1.TextClassificationDatasetMetadata", "google/cloud/automl/v1beta1/text.proto"],
|
34
|
+
["google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata", "google/cloud/automl/v1beta1/video.proto"],
|
35
|
+
["google.cloud.automl.v1beta1.TablesDatasetMetadata", "google/cloud/automl/v1beta1/tables.proto"],
|
36
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
37
|
+
]
|
38
|
+
imports.each do |type_name, expected_filename|
|
39
|
+
import_file = pool.lookup(type_name).file_descriptor
|
40
|
+
if import_file.name != expected_filename
|
41
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
34
42
|
end
|
35
43
|
end
|
44
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
45
|
+
warn "This will become an error in the next major version."
|
36
46
|
end
|
37
47
|
|
38
48
|
module Google
|