google-cloud-translate 2.3.0 → 3.0.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +5 -8
  3. data/AUTHENTICATION.md +67 -81
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +302 -0
  6. data/README.md +80 -0
  7. data/lib/google-cloud-translate.rb +5 -146
  8. data/lib/google/cloud/translate.rb +81 -178
  9. data/lib/google/cloud/translate/helpers.rb +100 -0
  10. data/lib/google/cloud/translate/version.rb +6 -2
  11. metadata +35 -135
  12. data/CHANGELOG.md +0 -164
  13. data/CODE_OF_CONDUCT.md +0 -40
  14. data/CONTRIBUTING.md +0 -188
  15. data/LICENSE +0 -201
  16. data/OVERVIEW.md +0 -390
  17. data/TROUBLESHOOTING.md +0 -37
  18. data/lib/google/cloud/translate/v2.rb +0 -169
  19. data/lib/google/cloud/translate/v2/api.rb +0 -255
  20. data/lib/google/cloud/translate/v2/credentials.rb +0 -58
  21. data/lib/google/cloud/translate/v2/detection.rb +0 -132
  22. data/lib/google/cloud/translate/v2/language.rb +0 -68
  23. data/lib/google/cloud/translate/v2/service.rb +0 -209
  24. data/lib/google/cloud/translate/v2/translation.rb +0 -120
  25. data/lib/google/cloud/translate/v3.rb +0 -144
  26. data/lib/google/cloud/translate/v3/credentials.rb +0 -42
  27. data/lib/google/cloud/translate/v3/doc/google/cloud/translate/v3/translation_service.rb +0 -663
  28. data/lib/google/cloud/translate/v3/doc/google/longrunning/operations.rb +0 -51
  29. data/lib/google/cloud/translate/v3/doc/google/protobuf/any.rb +0 -131
  30. data/lib/google/cloud/translate/v3/doc/google/protobuf/timestamp.rb +0 -113
  31. data/lib/google/cloud/translate/v3/doc/google/rpc/status.rb +0 -39
  32. data/lib/google/cloud/translate/v3/translation_service_client.rb +0 -930
  33. data/lib/google/cloud/translate/v3/translation_service_client_config.json +0 -66
  34. data/lib/google/cloud/translate/v3/translation_service_pb.rb +0 -226
  35. data/lib/google/cloud/translate/v3/translation_service_services_pb.rb +0 -68
@@ -1,66 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.cloud.translation.v3.TranslationService": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "DEADLINE_EXCEEDED",
7
- "UNAVAILABLE"
8
- ],
9
- "non_idempotent": []
10
- },
11
- "retry_params": {
12
- "default": {
13
- "initial_retry_delay_millis": 100,
14
- "retry_delay_multiplier": 1.3,
15
- "max_retry_delay_millis": 60000,
16
- "initial_rpc_timeout_millis": 20000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 20000,
19
- "total_timeout_millis": 600000
20
- }
21
- },
22
- "methods": {
23
- "TranslateText": {
24
- "timeout_millis": 60000,
25
- "retry_codes_name": "non_idempotent",
26
- "retry_params_name": "default"
27
- },
28
- "DetectLanguage": {
29
- "timeout_millis": 60000,
30
- "retry_codes_name": "non_idempotent",
31
- "retry_params_name": "default"
32
- },
33
- "GetSupportedLanguages": {
34
- "timeout_millis": 60000,
35
- "retry_codes_name": "idempotent",
36
- "retry_params_name": "default"
37
- },
38
- "BatchTranslateText": {
39
- "timeout_millis": 60000,
40
- "retry_codes_name": "non_idempotent",
41
- "retry_params_name": "default"
42
- },
43
- "CreateGlossary": {
44
- "timeout_millis": 60000,
45
- "retry_codes_name": "non_idempotent",
46
- "retry_params_name": "default"
47
- },
48
- "ListGlossaries": {
49
- "timeout_millis": 60000,
50
- "retry_codes_name": "idempotent",
51
- "retry_params_name": "default"
52
- },
53
- "GetGlossary": {
54
- "timeout_millis": 60000,
55
- "retry_codes_name": "idempotent",
56
- "retry_params_name": "default"
57
- },
58
- "DeleteGlossary": {
59
- "timeout_millis": 60000,
60
- "retry_codes_name": "non_idempotent",
61
- "retry_params_name": "default"
62
- }
63
- }
64
- }
65
- }
66
- }
@@ -1,226 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/translate/v3/translation_service.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/api/resource_pb'
11
- require 'google/longrunning/operations_pb'
12
- require 'google/protobuf/timestamp_pb'
13
- Google::Protobuf::DescriptorPool.generated_pool.build do
14
- add_message "google.cloud.translation.v3.TranslateTextGlossaryConfig" do
15
- optional :glossary, :string, 1
16
- optional :ignore_case, :bool, 2
17
- end
18
- add_message "google.cloud.translation.v3.TranslateTextRequest" do
19
- repeated :contents, :string, 1
20
- optional :mime_type, :string, 3
21
- optional :source_language_code, :string, 4
22
- optional :target_language_code, :string, 5
23
- optional :parent, :string, 8
24
- optional :model, :string, 6
25
- optional :glossary_config, :message, 7, "google.cloud.translation.v3.TranslateTextGlossaryConfig"
26
- map :labels, :string, :string, 10
27
- end
28
- add_message "google.cloud.translation.v3.TranslateTextResponse" do
29
- repeated :translations, :message, 1, "google.cloud.translation.v3.Translation"
30
- repeated :glossary_translations, :message, 3, "google.cloud.translation.v3.Translation"
31
- end
32
- add_message "google.cloud.translation.v3.Translation" do
33
- optional :translated_text, :string, 1
34
- optional :model, :string, 2
35
- optional :detected_language_code, :string, 4
36
- optional :glossary_config, :message, 3, "google.cloud.translation.v3.TranslateTextGlossaryConfig"
37
- end
38
- add_message "google.cloud.translation.v3.DetectLanguageRequest" do
39
- optional :parent, :string, 5
40
- optional :model, :string, 4
41
- optional :mime_type, :string, 3
42
- map :labels, :string, :string, 6
43
- oneof :source do
44
- optional :content, :string, 1
45
- end
46
- end
47
- add_message "google.cloud.translation.v3.DetectedLanguage" do
48
- optional :language_code, :string, 1
49
- optional :confidence, :float, 2
50
- end
51
- add_message "google.cloud.translation.v3.DetectLanguageResponse" do
52
- repeated :languages, :message, 1, "google.cloud.translation.v3.DetectedLanguage"
53
- end
54
- add_message "google.cloud.translation.v3.GetSupportedLanguagesRequest" do
55
- optional :parent, :string, 3
56
- optional :display_language_code, :string, 1
57
- optional :model, :string, 2
58
- end
59
- add_message "google.cloud.translation.v3.SupportedLanguages" do
60
- repeated :languages, :message, 1, "google.cloud.translation.v3.SupportedLanguage"
61
- end
62
- add_message "google.cloud.translation.v3.SupportedLanguage" do
63
- optional :language_code, :string, 1
64
- optional :display_name, :string, 2
65
- optional :support_source, :bool, 3
66
- optional :support_target, :bool, 4
67
- end
68
- add_message "google.cloud.translation.v3.GcsSource" do
69
- optional :input_uri, :string, 1
70
- end
71
- add_message "google.cloud.translation.v3.InputConfig" do
72
- optional :mime_type, :string, 1
73
- oneof :source do
74
- optional :gcs_source, :message, 2, "google.cloud.translation.v3.GcsSource"
75
- end
76
- end
77
- add_message "google.cloud.translation.v3.GcsDestination" do
78
- optional :output_uri_prefix, :string, 1
79
- end
80
- add_message "google.cloud.translation.v3.OutputConfig" do
81
- oneof :destination do
82
- optional :gcs_destination, :message, 1, "google.cloud.translation.v3.GcsDestination"
83
- end
84
- end
85
- add_message "google.cloud.translation.v3.BatchTranslateTextRequest" do
86
- optional :parent, :string, 1
87
- optional :source_language_code, :string, 2
88
- repeated :target_language_codes, :string, 3
89
- map :models, :string, :string, 4
90
- repeated :input_configs, :message, 5, "google.cloud.translation.v3.InputConfig"
91
- optional :output_config, :message, 6, "google.cloud.translation.v3.OutputConfig"
92
- map :glossaries, :string, :message, 7, "google.cloud.translation.v3.TranslateTextGlossaryConfig"
93
- map :labels, :string, :string, 9
94
- end
95
- add_message "google.cloud.translation.v3.BatchTranslateMetadata" do
96
- optional :state, :enum, 1, "google.cloud.translation.v3.BatchTranslateMetadata.State"
97
- optional :translated_characters, :int64, 2
98
- optional :failed_characters, :int64, 3
99
- optional :total_characters, :int64, 4
100
- optional :submit_time, :message, 5, "google.protobuf.Timestamp"
101
- end
102
- add_enum "google.cloud.translation.v3.BatchTranslateMetadata.State" do
103
- value :STATE_UNSPECIFIED, 0
104
- value :RUNNING, 1
105
- value :SUCCEEDED, 2
106
- value :FAILED, 3
107
- value :CANCELLING, 4
108
- value :CANCELLED, 5
109
- end
110
- add_message "google.cloud.translation.v3.BatchTranslateResponse" do
111
- optional :total_characters, :int64, 1
112
- optional :translated_characters, :int64, 2
113
- optional :failed_characters, :int64, 3
114
- optional :submit_time, :message, 4, "google.protobuf.Timestamp"
115
- optional :end_time, :message, 5, "google.protobuf.Timestamp"
116
- end
117
- add_message "google.cloud.translation.v3.GlossaryInputConfig" do
118
- oneof :source do
119
- optional :gcs_source, :message, 1, "google.cloud.translation.v3.GcsSource"
120
- end
121
- end
122
- add_message "google.cloud.translation.v3.Glossary" do
123
- optional :name, :string, 1
124
- optional :input_config, :message, 5, "google.cloud.translation.v3.GlossaryInputConfig"
125
- optional :entry_count, :int32, 6
126
- optional :submit_time, :message, 7, "google.protobuf.Timestamp"
127
- optional :end_time, :message, 8, "google.protobuf.Timestamp"
128
- oneof :languages do
129
- optional :language_pair, :message, 3, "google.cloud.translation.v3.Glossary.LanguageCodePair"
130
- optional :language_codes_set, :message, 4, "google.cloud.translation.v3.Glossary.LanguageCodesSet"
131
- end
132
- end
133
- add_message "google.cloud.translation.v3.Glossary.LanguageCodePair" do
134
- optional :source_language_code, :string, 1
135
- optional :target_language_code, :string, 2
136
- end
137
- add_message "google.cloud.translation.v3.Glossary.LanguageCodesSet" do
138
- repeated :language_codes, :string, 1
139
- end
140
- add_message "google.cloud.translation.v3.CreateGlossaryRequest" do
141
- optional :parent, :string, 1
142
- optional :glossary, :message, 2, "google.cloud.translation.v3.Glossary"
143
- end
144
- add_message "google.cloud.translation.v3.GetGlossaryRequest" do
145
- optional :name, :string, 1
146
- end
147
- add_message "google.cloud.translation.v3.DeleteGlossaryRequest" do
148
- optional :name, :string, 1
149
- end
150
- add_message "google.cloud.translation.v3.ListGlossariesRequest" do
151
- optional :parent, :string, 1
152
- optional :page_size, :int32, 2
153
- optional :page_token, :string, 3
154
- optional :filter, :string, 4
155
- end
156
- add_message "google.cloud.translation.v3.ListGlossariesResponse" do
157
- repeated :glossaries, :message, 1, "google.cloud.translation.v3.Glossary"
158
- optional :next_page_token, :string, 2
159
- end
160
- add_message "google.cloud.translation.v3.CreateGlossaryMetadata" do
161
- optional :name, :string, 1
162
- optional :state, :enum, 2, "google.cloud.translation.v3.CreateGlossaryMetadata.State"
163
- optional :submit_time, :message, 3, "google.protobuf.Timestamp"
164
- end
165
- add_enum "google.cloud.translation.v3.CreateGlossaryMetadata.State" do
166
- value :STATE_UNSPECIFIED, 0
167
- value :RUNNING, 1
168
- value :SUCCEEDED, 2
169
- value :FAILED, 3
170
- value :CANCELLING, 4
171
- value :CANCELLED, 5
172
- end
173
- add_message "google.cloud.translation.v3.DeleteGlossaryMetadata" do
174
- optional :name, :string, 1
175
- optional :state, :enum, 2, "google.cloud.translation.v3.DeleteGlossaryMetadata.State"
176
- optional :submit_time, :message, 3, "google.protobuf.Timestamp"
177
- end
178
- add_enum "google.cloud.translation.v3.DeleteGlossaryMetadata.State" do
179
- value :STATE_UNSPECIFIED, 0
180
- value :RUNNING, 1
181
- value :SUCCEEDED, 2
182
- value :FAILED, 3
183
- value :CANCELLING, 4
184
- value :CANCELLED, 5
185
- end
186
- add_message "google.cloud.translation.v3.DeleteGlossaryResponse" do
187
- optional :name, :string, 1
188
- optional :submit_time, :message, 2, "google.protobuf.Timestamp"
189
- optional :end_time, :message, 3, "google.protobuf.Timestamp"
190
- end
191
- end
192
-
193
- module Google::Cloud::Translate::V3
194
- TranslateTextGlossaryConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextGlossaryConfig").msgclass
195
- TranslateTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextRequest").msgclass
196
- TranslateTextResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextResponse").msgclass
197
- Translation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Translation").msgclass
198
- DetectLanguageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectLanguageRequest").msgclass
199
- DetectedLanguage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectedLanguage").msgclass
200
- DetectLanguageResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectLanguageResponse").msgclass
201
- GetSupportedLanguagesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetSupportedLanguagesRequest").msgclass
202
- SupportedLanguages = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.SupportedLanguages").msgclass
203
- SupportedLanguage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.SupportedLanguage").msgclass
204
- GcsSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsSource").msgclass
205
- InputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.InputConfig").msgclass
206
- GcsDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsDestination").msgclass
207
- OutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.OutputConfig").msgclass
208
- BatchTranslateTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateTextRequest").msgclass
209
- BatchTranslateMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateMetadata").msgclass
210
- BatchTranslateMetadata::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateMetadata.State").enummodule
211
- BatchTranslateResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateResponse").msgclass
212
- GlossaryInputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryInputConfig").msgclass
213
- Glossary = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary").msgclass
214
- Glossary::LanguageCodePair = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary.LanguageCodePair").msgclass
215
- Glossary::LanguageCodesSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary.LanguageCodesSet").msgclass
216
- CreateGlossaryRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryRequest").msgclass
217
- GetGlossaryRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetGlossaryRequest").msgclass
218
- DeleteGlossaryRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryRequest").msgclass
219
- ListGlossariesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossariesRequest").msgclass
220
- ListGlossariesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossariesResponse").msgclass
221
- CreateGlossaryMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryMetadata").msgclass
222
- CreateGlossaryMetadata::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryMetadata.State").enummodule
223
- DeleteGlossaryMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryMetadata").msgclass
224
- DeleteGlossaryMetadata::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryMetadata.State").enummodule
225
- DeleteGlossaryResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryResponse").msgclass
226
- end
@@ -1,68 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/cloud/translate/v3/translation_service.proto for package 'Google::Cloud::Translate::V3'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/cloud/translate/v3/translation_service_pb'
23
-
24
- module Google::Cloud::Translate::V3
25
- module TranslationService
26
- # Proto file for the Cloud Translation API (v3 GA).
27
- #
28
- # Provides natural language translation operations.
29
- class Service
30
-
31
- include GRPC::GenericService
32
-
33
- self.marshal_class_method = :encode
34
- self.unmarshal_class_method = :decode
35
- self.service_name = 'google.cloud.translation.v3.TranslationService'
36
-
37
- # Translates input text and returns translated text.
38
- rpc :TranslateText, TranslateTextRequest, TranslateTextResponse
39
- # Detects the language of text within a request.
40
- rpc :DetectLanguage, DetectLanguageRequest, DetectLanguageResponse
41
- # Returns a list of supported languages for translation.
42
- rpc :GetSupportedLanguages, GetSupportedLanguagesRequest, SupportedLanguages
43
- # Translates a large volume of text in asynchronous batch mode.
44
- # This function provides real-time output as the inputs are being processed.
45
- # If caller cancels a request, the partial results (for an input file, it's
46
- # all or nothing) may still be available on the specified output location.
47
- #
48
- # This call returns immediately and you can
49
- # use google.longrunning.Operation.name to poll the status of the call.
50
- rpc :BatchTranslateText, BatchTranslateTextRequest, Google::Longrunning::Operation
51
- # Creates a glossary and returns the long-running operation. Returns
52
- # NOT_FOUND, if the project doesn't exist.
53
- rpc :CreateGlossary, CreateGlossaryRequest, Google::Longrunning::Operation
54
- # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't
55
- # exist.
56
- rpc :ListGlossaries, ListGlossariesRequest, ListGlossariesResponse
57
- # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't
58
- # exist.
59
- rpc :GetGlossary, GetGlossaryRequest, Glossary
60
- # Deletes a glossary, or cancels glossary construction
61
- # if the glossary isn't created yet.
62
- # Returns NOT_FOUND, if the glossary doesn't exist.
63
- rpc :DeleteGlossary, DeleteGlossaryRequest, Google::Longrunning::Operation
64
- end
65
-
66
- Stub = Service.rpc_stub_class
67
- end
68
- end