google-cloud-translate-v3 0.12.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/translate/v3/adaptive_mt_pb.rb +5 -1
  3. data/lib/google/cloud/translate/v3/automl_translation_pb.rb +78 -0
  4. data/lib/google/cloud/translate/v3/bindings_override.rb +102 -0
  5. data/lib/google/cloud/translate/v3/common_pb.rb +7 -1
  6. data/lib/google/cloud/translate/v3/rest.rb +1 -0
  7. data/lib/google/cloud/translate/v3/translation_service/client.rb +2196 -312
  8. data/lib/google/cloud/translate/v3/translation_service/operations.rb +13 -5
  9. data/lib/google/cloud/translate/v3/translation_service/paths.rb +59 -0
  10. data/lib/google/cloud/translate/v3/translation_service/rest/client.rb +2063 -297
  11. data/lib/google/cloud/translate/v3/translation_service/rest/operations.rb +13 -5
  12. data/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +1258 -180
  13. data/lib/google/cloud/translate/v3/translation_service/rest.rb +1 -0
  14. data/lib/google/cloud/translate/v3/translation_service_pb.rb +21 -3
  15. data/lib/google/cloud/translate/v3/translation_service_services_pb.rb +37 -0
  16. data/lib/google/cloud/translate/v3/version.rb +1 -1
  17. data/proto_docs/google/api/client.rb +18 -10
  18. data/proto_docs/google/api/resource.rb +7 -2
  19. data/proto_docs/google/cloud/translate/v3/adaptive_mt.rb +71 -1
  20. data/proto_docs/google/cloud/translate/v3/automl_translation.rb +487 -0
  21. data/proto_docs/google/cloud/translate/v3/common.rb +78 -0
  22. data/proto_docs/google/cloud/translate/v3/translation_service.rb +207 -14
  23. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  24. metadata +46 -2
@@ -26,6 +26,9 @@ module Google
26
26
  module TranslationService
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ API_VERSION = ""
31
+
29
32
  # @private
30
33
  DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$"
31
34
 
@@ -191,10 +194,11 @@ module Google
191
194
  # Customize the options with defaults
192
195
  metadata = @config.rpcs.list_operations.metadata.to_h
193
196
 
194
- # Set x-goog-api-client and x-goog-user-project headers
197
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
195
198
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
196
199
  lib_name: @config.lib_name, lib_version: @config.lib_version,
197
200
  gapic_version: ::Google::Cloud::Translate::V3::VERSION
201
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
198
202
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
199
203
 
200
204
  header_params = {}
@@ -287,10 +291,11 @@ module Google
287
291
  # Customize the options with defaults
288
292
  metadata = @config.rpcs.get_operation.metadata.to_h
289
293
 
290
- # Set x-goog-api-client and x-goog-user-project headers
294
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
291
295
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
296
  lib_name: @config.lib_name, lib_version: @config.lib_version,
293
297
  gapic_version: ::Google::Cloud::Translate::V3::VERSION
298
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
294
299
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
300
 
296
301
  header_params = {}
@@ -376,10 +381,11 @@ module Google
376
381
  # Customize the options with defaults
377
382
  metadata = @config.rpcs.delete_operation.metadata.to_h
378
383
 
379
- # Set x-goog-api-client and x-goog-user-project headers
384
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
380
385
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
381
386
  lib_name: @config.lib_name, lib_version: @config.lib_version,
382
387
  gapic_version: ::Google::Cloud::Translate::V3::VERSION
388
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
383
389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
390
 
385
391
  header_params = {}
@@ -470,10 +476,11 @@ module Google
470
476
  # Customize the options with defaults
471
477
  metadata = @config.rpcs.cancel_operation.metadata.to_h
472
478
 
473
- # Set x-goog-api-client and x-goog-user-project headers
479
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
474
480
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
475
481
  lib_name: @config.lib_name, lib_version: @config.lib_version,
476
482
  gapic_version: ::Google::Cloud::Translate::V3::VERSION
483
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
477
484
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
485
 
479
486
  header_params = {}
@@ -574,10 +581,11 @@ module Google
574
581
  # Customize the options with defaults
575
582
  metadata = @config.rpcs.wait_operation.metadata.to_h
576
583
 
577
- # Set x-goog-api-client and x-goog-user-project headers
584
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
578
585
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
579
586
  lib_name: @config.lib_name, lib_version: @config.lib_version,
580
587
  gapic_version: ::Google::Cloud::Translate::V3::VERSION
588
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
581
589
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
582
590
 
583
591
  header_params = {}
@@ -64,6 +64,25 @@ module Google
64
64
  "projects/#{project}/locations/#{location}/adaptiveMtDatasets/#{dataset}/adaptiveMtFiles/#{file}"
65
65
  end
66
66
 
67
+ ##
68
+ # Create a fully-qualified Dataset resource string.
69
+ #
70
+ # The resource will be in the following format:
71
+ #
72
+ # `projects/{project}/locations/{location}/datasets/{dataset}`
73
+ #
74
+ # @param project [String]
75
+ # @param location [String]
76
+ # @param dataset [String]
77
+ #
78
+ # @return [::String]
79
+ def dataset_path project:, location:, dataset:
80
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
81
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
82
+
83
+ "projects/#{project}/locations/#{location}/datasets/#{dataset}"
84
+ end
85
+
67
86
  ##
68
87
  # Create a fully-qualified Glossary resource string.
69
88
  #
@@ -83,6 +102,27 @@ module Google
83
102
  "projects/#{project}/locations/#{location}/glossaries/#{glossary}"
84
103
  end
85
104
 
105
+ ##
106
+ # Create a fully-qualified GlossaryEntry resource string.
107
+ #
108
+ # The resource will be in the following format:
109
+ #
110
+ # `projects/{project}/locations/{location}/glossaries/{glossary}/glossaryEntries/{glossary_entry}`
111
+ #
112
+ # @param project [String]
113
+ # @param location [String]
114
+ # @param glossary [String]
115
+ # @param glossary_entry [String]
116
+ #
117
+ # @return [::String]
118
+ def glossary_entry_path project:, location:, glossary:, glossary_entry:
119
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
120
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
121
+ raise ::ArgumentError, "glossary cannot contain /" if glossary.to_s.include? "/"
122
+
123
+ "projects/#{project}/locations/#{location}/glossaries/#{glossary}/glossaryEntries/#{glossary_entry}"
124
+ end
125
+
86
126
  ##
87
127
  # Create a fully-qualified Location resource string.
88
128
  #
@@ -100,6 +140,25 @@ module Google
100
140
  "projects/#{project}/locations/#{location}"
101
141
  end
102
142
 
143
+ ##
144
+ # Create a fully-qualified Model resource string.
145
+ #
146
+ # The resource will be in the following format:
147
+ #
148
+ # `projects/{project}/locations/{location}/models/{model}`
149
+ #
150
+ # @param project [String]
151
+ # @param location [String]
152
+ # @param model [String]
153
+ #
154
+ # @return [::String]
155
+ def model_path project:, location:, model:
156
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
157
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
158
+
159
+ "projects/#{project}/locations/#{location}/models/#{model}"
160
+ end
161
+
103
162
  extend self
104
163
  end
105
164
  end