google-cloud-translate-v3 1.0.0 → 1.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.
@@ -21,21 +21,12 @@ module Google
21
21
  module Cloud
22
22
  module Translate
23
23
  module V3
24
- # Configures which glossary is used for a specific target language and defines
25
- # options for applying that glossary.
26
- # @!attribute [rw] glossary
27
- # @return [::String]
28
- # Required. The `glossary` to be applied for this translation.
29
- #
30
- # The format depends on the glossary:
31
- #
32
- # - User-provided custom glossary:
33
- # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
34
- # @!attribute [rw] ignore_case
24
+ # Configures transliteration feature on top of translation.
25
+ # @!attribute [rw] enable_transliteration
35
26
  # @return [::Boolean]
36
- # Optional. Indicates match is case insensitive. The default value is `false`
37
- # if missing.
38
- class TranslateTextGlossaryConfig
27
+ # If true, source text in romanized form can be translated to the target
28
+ # language.
29
+ class TransliterationConfig
39
30
  include ::Google::Protobuf::MessageExts
40
31
  extend ::Google::Protobuf::MessageExts::ClassMethods
41
32
  end
@@ -89,6 +80,8 @@ module Google
89
80
  # - General (built-in) models:
90
81
  # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
91
82
  #
83
+ # - Translation LLM models:
84
+ # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`,
92
85
  #
93
86
  # For global (non-regionalized) requests, use `location-id` `global`.
94
87
  # For example,
@@ -100,6 +93,9 @@ module Google
100
93
  # Optional. Glossary to be applied. The glossary must be
101
94
  # within the same region (have the same location-id) as the model, otherwise
102
95
  # an INVALID_ARGUMENT (400) error is returned.
96
+ # @!attribute [rw] transliteration_config
97
+ # @return [::Google::Cloud::Translate::V3::TransliterationConfig]
98
+ # Optional. Transliteration to be applied.
103
99
  # @!attribute [rw] labels
104
100
  # @return [::Google::Protobuf::Map{::String => ::String}]
105
101
  # Optional. The labels with user-defined metadata for the request.
@@ -172,6 +168,59 @@ module Google
172
168
  extend ::Google::Protobuf::MessageExts::ClassMethods
173
169
  end
174
170
 
171
+ # The request message for synchronous romanization.
172
+ # @!attribute [rw] parent
173
+ # @return [::String]
174
+ # Required. Project or location to make a call. Must refer to a caller's
175
+ # project.
176
+ #
177
+ # Format: `projects/{project-number-or-id}/locations/{location-id}` or
178
+ # `projects/{project-number-or-id}`.
179
+ #
180
+ # For global calls, use `projects/{project-number-or-id}/locations/global` or
181
+ # `projects/{project-number-or-id}`.
182
+ # @!attribute [rw] contents
183
+ # @return [::Array<::String>]
184
+ # Required. The content of the input in string format.
185
+ # @!attribute [rw] source_language_code
186
+ # @return [::String]
187
+ # Optional. The ISO-639 language code of the input text if
188
+ # known, for example, "hi" or "zh". If the source language isn't specified,
189
+ # the API attempts to identify the source language automatically and returns
190
+ # the source language for each content in the response.
191
+ class RomanizeTextRequest
192
+ include ::Google::Protobuf::MessageExts
193
+ extend ::Google::Protobuf::MessageExts::ClassMethods
194
+ end
195
+
196
+ # A single romanization response.
197
+ # @!attribute [rw] romanized_text
198
+ # @return [::String]
199
+ # Romanized text.
200
+ # If an error occurs during romanization, this field might be excluded from
201
+ # the response.
202
+ # @!attribute [rw] detected_language_code
203
+ # @return [::String]
204
+ # The ISO-639 language code of source text in the initial request, detected
205
+ # automatically, if no source language was passed within the initial
206
+ # request. If the source language was passed, auto-detection of the language
207
+ # does not occur and this field is empty.
208
+ class Romanization
209
+ include ::Google::Protobuf::MessageExts
210
+ extend ::Google::Protobuf::MessageExts::ClassMethods
211
+ end
212
+
213
+ # The response message for synchronous romanization.
214
+ # @!attribute [rw] romanizations
215
+ # @return [::Array<::Google::Cloud::Translate::V3::Romanization>]
216
+ # Text romanization responses.
217
+ # This field has the same length as
218
+ # {::Google::Cloud::Translate::V3::RomanizeTextRequest#contents `contents`}.
219
+ class RomanizeTextResponse
220
+ include ::Google::Protobuf::MessageExts
221
+ extend ::Google::Protobuf::MessageExts::ClassMethods
222
+ end
223
+
175
224
  # The request message for language detection.
176
225
  # @!attribute [rw] parent
177
226
  # @return [::String]
@@ -962,6 +1011,19 @@ module Google
962
1011
  extend ::Google::Protobuf::MessageExts::ClassMethods
963
1012
  end
964
1013
 
1014
+ # Request message for the update glossary flow
1015
+ # @!attribute [rw] glossary
1016
+ # @return [::Google::Cloud::Translate::V3::Glossary]
1017
+ # Required. The glossary entry to update.
1018
+ # @!attribute [rw] update_mask
1019
+ # @return [::Google::Protobuf::FieldMask]
1020
+ # The list of fields to be updated. Currently only `display_name` and
1021
+ # 'input_config'
1022
+ class UpdateGlossaryRequest
1023
+ include ::Google::Protobuf::MessageExts
1024
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1025
+ end
1026
+
965
1027
  # Request message for GetGlossary.
966
1028
  # @!attribute [rw] name
967
1029
  # @return [::String]
@@ -1031,6 +1093,78 @@ module Google
1031
1093
  extend ::Google::Protobuf::MessageExts::ClassMethods
1032
1094
  end
1033
1095
 
1096
+ # Request message for the Get Glossary Entry Api
1097
+ # @!attribute [rw] name
1098
+ # @return [::String]
1099
+ # Required. The resource name of the glossary entry to get
1100
+ class GetGlossaryEntryRequest
1101
+ include ::Google::Protobuf::MessageExts
1102
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1103
+ end
1104
+
1105
+ # Request message for Delete Glossary Entry
1106
+ # @!attribute [rw] name
1107
+ # @return [::String]
1108
+ # Required. The resource name of the glossary entry to delete
1109
+ class DeleteGlossaryEntryRequest
1110
+ include ::Google::Protobuf::MessageExts
1111
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1112
+ end
1113
+
1114
+ # Request message for ListGlossaryEntries
1115
+ # @!attribute [rw] parent
1116
+ # @return [::String]
1117
+ # Required. The parent glossary resource name for listing the glossary's
1118
+ # entries.
1119
+ # @!attribute [rw] page_size
1120
+ # @return [::Integer]
1121
+ # Optional. Requested page size. The server may return fewer glossary entries
1122
+ # than requested. If unspecified, the server picks an appropriate default.
1123
+ # @!attribute [rw] page_token
1124
+ # @return [::String]
1125
+ # Optional. A token identifying a page of results the server should return.
1126
+ # Typically, this is the value of
1127
+ # [ListGlossaryEntriesResponse.next_page_token] returned from the previous
1128
+ # call. The first page is returned if `page_token`is empty or missing.
1129
+ class ListGlossaryEntriesRequest
1130
+ include ::Google::Protobuf::MessageExts
1131
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1132
+ end
1133
+
1134
+ # Response message for ListGlossaryEntries
1135
+ # @!attribute [rw] glossary_entries
1136
+ # @return [::Array<::Google::Cloud::Translate::V3::GlossaryEntry>]
1137
+ # Optional. The Glossary Entries
1138
+ # @!attribute [rw] next_page_token
1139
+ # @return [::String]
1140
+ # Optional. A token to retrieve a page of results. Pass this value in the
1141
+ # [ListGLossaryEntriesRequest.page_token] field in the subsequent calls.
1142
+ class ListGlossaryEntriesResponse
1143
+ include ::Google::Protobuf::MessageExts
1144
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1145
+ end
1146
+
1147
+ # Request message for CreateGlossaryEntry
1148
+ # @!attribute [rw] parent
1149
+ # @return [::String]
1150
+ # Required. The resource name of the glossary to create the entry under.
1151
+ # @!attribute [rw] glossary_entry
1152
+ # @return [::Google::Cloud::Translate::V3::GlossaryEntry]
1153
+ # Required. The glossary entry to create
1154
+ class CreateGlossaryEntryRequest
1155
+ include ::Google::Protobuf::MessageExts
1156
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1157
+ end
1158
+
1159
+ # Request message for UpdateGlossaryEntry
1160
+ # @!attribute [rw] glossary_entry
1161
+ # @return [::Google::Cloud::Translate::V3::GlossaryEntry]
1162
+ # Required. The glossary entry to update.
1163
+ class UpdateGlossaryEntryRequest
1164
+ include ::Google::Protobuf::MessageExts
1165
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1166
+ end
1167
+
1034
1168
  # Stored in the
1035
1169
  # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}
1036
1170
  # field returned by CreateGlossary.
@@ -1070,6 +1204,46 @@ module Google
1070
1204
  end
1071
1205
  end
1072
1206
 
1207
+ # Stored in the
1208
+ # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}
1209
+ # field returned by UpdateGlossary.
1210
+ # @!attribute [rw] glossary
1211
+ # @return [::Google::Cloud::Translate::V3::Glossary]
1212
+ # The updated glossary object.
1213
+ # @!attribute [rw] state
1214
+ # @return [::Google::Cloud::Translate::V3::UpdateGlossaryMetadata::State]
1215
+ # The current state of the glossary update operation. If the glossary input
1216
+ # file was not updated this will be completed immediately
1217
+ # @!attribute [rw] submit_time
1218
+ # @return [::Google::Protobuf::Timestamp]
1219
+ # The time when the operation was submitted to the server.
1220
+ class UpdateGlossaryMetadata
1221
+ include ::Google::Protobuf::MessageExts
1222
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1223
+
1224
+ # Enumerates the possible states that the update request can be in.
1225
+ module State
1226
+ # Invalid.
1227
+ STATE_UNSPECIFIED = 0
1228
+
1229
+ # Request is being processed.
1230
+ RUNNING = 1
1231
+
1232
+ # The glossary was successfully updated.
1233
+ SUCCEEDED = 2
1234
+
1235
+ # Failed to update the glossary.
1236
+ FAILED = 3
1237
+
1238
+ # Request is in the process of being canceled after caller invoked
1239
+ # longrunning.Operations.CancelOperation on the request id.
1240
+ CANCELLING = 4
1241
+
1242
+ # The glossary update request was successfully canceled.
1243
+ CANCELLED = 5
1244
+ end
1245
+ end
1246
+
1073
1247
  # Stored in the
1074
1248
  # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}
1075
1249
  # field returned by DeleteGlossary.
@@ -1433,6 +1607,25 @@ module Google
1433
1607
  CANCELLED = 5
1434
1608
  end
1435
1609
  end
1610
+
1611
+ # Configures which glossary is used for a specific target language and defines
1612
+ # options for applying that glossary.
1613
+ # @!attribute [rw] glossary
1614
+ # @return [::String]
1615
+ # Required. The `glossary` to be applied for this translation.
1616
+ #
1617
+ # The format depends on the glossary:
1618
+ #
1619
+ # - User-provided custom glossary:
1620
+ # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
1621
+ # @!attribute [rw] ignore_case
1622
+ # @return [::Boolean]
1623
+ # Optional. Indicates match is case insensitive. The default value is `false`
1624
+ # if missing.
1625
+ class TranslateTextGlossaryConfig
1626
+ include ::Google::Protobuf::MessageExts
1627
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1628
+ end
1436
1629
  end
1437
1630
  end
1438
1631
  end
@@ -0,0 +1,229 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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
+ # `FieldMask` represents a set of symbolic field paths, for example:
23
+ #
24
+ # paths: "f.a"
25
+ # paths: "f.b.d"
26
+ #
27
+ # Here `f` represents a field in some root message, `a` and `b`
28
+ # fields in the message found in `f`, and `d` a field found in the
29
+ # message in `f.b`.
30
+ #
31
+ # Field masks are used to specify a subset of fields that should be
32
+ # returned by a get operation or modified by an update operation.
33
+ # Field masks also have a custom JSON encoding (see below).
34
+ #
35
+ # # Field Masks in Projections
36
+ #
37
+ # When used in the context of a projection, a response message or
38
+ # sub-message is filtered by the API to only contain those fields as
39
+ # specified in the mask. For example, if the mask in the previous
40
+ # example is applied to a response message as follows:
41
+ #
42
+ # f {
43
+ # a : 22
44
+ # b {
45
+ # d : 1
46
+ # x : 2
47
+ # }
48
+ # y : 13
49
+ # }
50
+ # z: 8
51
+ #
52
+ # The result will not contain specific values for fields x,y and z
53
+ # (their value will be set to the default, and omitted in proto text
54
+ # output):
55
+ #
56
+ #
57
+ # f {
58
+ # a : 22
59
+ # b {
60
+ # d : 1
61
+ # }
62
+ # }
63
+ #
64
+ # A repeated field is not allowed except at the last position of a
65
+ # paths string.
66
+ #
67
+ # If a FieldMask object is not present in a get operation, the
68
+ # operation applies to all fields (as if a FieldMask of all fields
69
+ # had been specified).
70
+ #
71
+ # Note that a field mask does not necessarily apply to the
72
+ # top-level response message. In case of a REST get operation, the
73
+ # field mask applies directly to the response, but in case of a REST
74
+ # list operation, the mask instead applies to each individual message
75
+ # in the returned resource list. In case of a REST custom method,
76
+ # other definitions may be used. Where the mask applies will be
77
+ # clearly documented together with its declaration in the API. In
78
+ # any case, the effect on the returned resource/resources is required
79
+ # behavior for APIs.
80
+ #
81
+ # # Field Masks in Update Operations
82
+ #
83
+ # A field mask in update operations specifies which fields of the
84
+ # targeted resource are going to be updated. The API is required
85
+ # to only change the values of the fields as specified in the mask
86
+ # and leave the others untouched. If a resource is passed in to
87
+ # describe the updated values, the API ignores the values of all
88
+ # fields not covered by the mask.
89
+ #
90
+ # If a repeated field is specified for an update operation, new values will
91
+ # be appended to the existing repeated field in the target resource. Note that
92
+ # a repeated field is only allowed in the last position of a `paths` string.
93
+ #
94
+ # If a sub-message is specified in the last position of the field mask for an
95
+ # update operation, then new value will be merged into the existing sub-message
96
+ # in the target resource.
97
+ #
98
+ # For example, given the target message:
99
+ #
100
+ # f {
101
+ # b {
102
+ # d: 1
103
+ # x: 2
104
+ # }
105
+ # c: [1]
106
+ # }
107
+ #
108
+ # And an update message:
109
+ #
110
+ # f {
111
+ # b {
112
+ # d: 10
113
+ # }
114
+ # c: [2]
115
+ # }
116
+ #
117
+ # then if the field mask is:
118
+ #
119
+ # paths: ["f.b", "f.c"]
120
+ #
121
+ # then the result will be:
122
+ #
123
+ # f {
124
+ # b {
125
+ # d: 10
126
+ # x: 2
127
+ # }
128
+ # c: [1, 2]
129
+ # }
130
+ #
131
+ # An implementation may provide options to override this default behavior for
132
+ # repeated and message fields.
133
+ #
134
+ # In order to reset a field's value to the default, the field must
135
+ # be in the mask and set to the default value in the provided resource.
136
+ # Hence, in order to reset all fields of a resource, provide a default
137
+ # instance of the resource and set all fields in the mask, or do
138
+ # not provide a mask as described below.
139
+ #
140
+ # If a field mask is not present on update, the operation applies to
141
+ # all fields (as if a field mask of all fields has been specified).
142
+ # Note that in the presence of schema evolution, this may mean that
143
+ # fields the client does not know and has therefore not filled into
144
+ # the request will be reset to their default. If this is unwanted
145
+ # behavior, a specific service may require a client to always specify
146
+ # a field mask, producing an error if not.
147
+ #
148
+ # As with get operations, the location of the resource which
149
+ # describes the updated values in the request message depends on the
150
+ # operation kind. In any case, the effect of the field mask is
151
+ # required to be honored by the API.
152
+ #
153
+ # ## Considerations for HTTP REST
154
+ #
155
+ # The HTTP kind of an update operation which uses a field mask must
156
+ # be set to PATCH instead of PUT in order to satisfy HTTP semantics
157
+ # (PUT must only be used for full updates).
158
+ #
159
+ # # JSON Encoding of Field Masks
160
+ #
161
+ # In JSON, a field mask is encoded as a single string where paths are
162
+ # separated by a comma. Fields name in each path are converted
163
+ # to/from lower-camel naming conventions.
164
+ #
165
+ # As an example, consider the following message declarations:
166
+ #
167
+ # message Profile {
168
+ # User user = 1;
169
+ # Photo photo = 2;
170
+ # }
171
+ # message User {
172
+ # string display_name = 1;
173
+ # string address = 2;
174
+ # }
175
+ #
176
+ # In proto a field mask for `Profile` may look as such:
177
+ #
178
+ # mask {
179
+ # paths: "user.display_name"
180
+ # paths: "photo"
181
+ # }
182
+ #
183
+ # In JSON, the same mask is represented as below:
184
+ #
185
+ # {
186
+ # mask: "user.displayName,photo"
187
+ # }
188
+ #
189
+ # # Field Masks and Oneof Fields
190
+ #
191
+ # Field masks treat fields in oneofs just as regular fields. Consider the
192
+ # following message:
193
+ #
194
+ # message SampleMessage {
195
+ # oneof test_oneof {
196
+ # string name = 4;
197
+ # SubMessage sub_message = 9;
198
+ # }
199
+ # }
200
+ #
201
+ # The field mask can be:
202
+ #
203
+ # mask {
204
+ # paths: "name"
205
+ # }
206
+ #
207
+ # Or:
208
+ #
209
+ # mask {
210
+ # paths: "sub_message"
211
+ # }
212
+ #
213
+ # Note that oneof type names ("test_oneof" in this case) cannot be used in
214
+ # paths.
215
+ #
216
+ # ## Field Mask Verification
217
+ #
218
+ # The implementation of any API method which has a FieldMask type field in the
219
+ # request should verify the included field paths, and return an
220
+ # `INVALID_ARGUMENT` error if any path is unmappable.
221
+ # @!attribute [rw] paths
222
+ # @return [::Array<::String>]
223
+ # The set of field mask paths.
224
+ class FieldMask
225
+ include ::Google::Protobuf::MessageExts
226
+ extend ::Google::Protobuf::MessageExts::ClassMethods
227
+ end
228
+ end
229
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-translate-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -44,6 +44,46 @@ dependencies:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: google-cloud-location
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0.7'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: 2.a
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0.7'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: 2.a
67
+ - !ruby/object:Gem::Dependency
68
+ name: google-iam-v1
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0.7'
74
+ - - "<"
75
+ - !ruby/object:Gem::Version
76
+ version: 2.a
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0.7'
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: 2.a
47
87
  description: Cloud Translation can dynamically translate text between thousands of
48
88
  language pairs. Translation lets websites and programs programmatically integrate
49
89
  with the translation service. Note that google-cloud-translate-v3 is a version-specific
@@ -61,6 +101,8 @@ files:
61
101
  - lib/google-cloud-translate-v3.rb
62
102
  - lib/google/cloud/translate/v3.rb
63
103
  - lib/google/cloud/translate/v3/adaptive_mt_pb.rb
104
+ - lib/google/cloud/translate/v3/automl_translation_pb.rb
105
+ - lib/google/cloud/translate/v3/bindings_override.rb
64
106
  - lib/google/cloud/translate/v3/common_pb.rb
65
107
  - lib/google/cloud/translate/v3/rest.rb
66
108
  - lib/google/cloud/translate/v3/translation_service.rb
@@ -81,12 +123,14 @@ files:
81
123
  - proto_docs/google/api/launch_stage.rb
82
124
  - proto_docs/google/api/resource.rb
83
125
  - proto_docs/google/cloud/translate/v3/adaptive_mt.rb
126
+ - proto_docs/google/cloud/translate/v3/automl_translation.rb
84
127
  - proto_docs/google/cloud/translate/v3/common.rb
85
128
  - proto_docs/google/cloud/translate/v3/translation_service.rb
86
129
  - proto_docs/google/longrunning/operations.rb
87
130
  - proto_docs/google/protobuf/any.rb
88
131
  - proto_docs/google/protobuf/duration.rb
89
132
  - proto_docs/google/protobuf/empty.rb
133
+ - proto_docs/google/protobuf/field_mask.rb
90
134
  - proto_docs/google/protobuf/timestamp.rb
91
135
  - proto_docs/google/rpc/status.rb
92
136
  homepage: https://github.com/googleapis/google-cloud-ruby