@maxim_mazurok/gapi.client.translate-v3 0.0.20230428 → 0.0.20230519

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.
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://translation.googleapis.com/$discovery/rest?version=v3
12
- // Revision: 20230428
12
+ // Revision: 20230519
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -596,6 +596,33 @@ declare namespace gapi.client {
596
596
  gcsDestination?:
597
597
  GcsDestination;
598
598
  }
599
+ interface Romanization {
600
+ /**
601
+ * The ISO-639 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request. If the source language was
602
+ * passed, auto-detection of the language does not occur and this field is empty.
603
+ */
604
+ detectedLanguageCode?:
605
+ string;
606
+ /** Romanized text. If an error occurs during romanization, this field might be excluded from the response. */
607
+ romanizedText?:
608
+ string;
609
+ }
610
+ interface RomanizeTextRequest {
611
+ /** Required. The content of the input in string format. */
612
+ contents?:
613
+ string[];
614
+ /**
615
+ * Optional. The ISO-639 language code of the input text if known, for example, "hi" or "zh". If the source language isn't specified, the API attempts to identify the source language
616
+ * automatically and returns the source language for each content in the response.
617
+ */
618
+ sourceLanguageCode?:
619
+ string;
620
+ }
621
+ interface RomanizeTextResponse {
622
+ /** Text romanization responses. This field has the same length as `contents`. */
623
+ romanizations?:
624
+ Romanization[];
625
+ }
599
626
  interface Status {
600
627
  /** The status code, which should be an enum value of google.rpc.Code. */
601
628
  code?:
@@ -753,6 +780,9 @@ declare namespace gapi.client {
753
780
  /** Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. */
754
781
  targetLanguageCode?:
755
782
  string;
783
+ /** Optional. Transliteration to be applied. */
784
+ transliterationConfig?:
785
+ TransliterationConfig;
756
786
  }
757
787
  interface TranslateTextResponse {
758
788
  /** Text translation responses if a glossary is provided in the request. This can be the same as `translations` if no terms apply. This field has the same length as `contents`. */
@@ -782,6 +812,11 @@ declare namespace gapi.client {
782
812
  translatedText?:
783
813
  string;
784
814
  }
815
+ interface TransliterationConfig {
816
+ /** If true, source text in romanized form can be translated to the target language. */
817
+ enableTransliteration?:
818
+ boolean;
819
+ }
785
820
  interface WaitOperationRequest {
786
821
  /**
787
822
  * The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also
@@ -2738,6 +2773,93 @@ declare namespace gapi.client {
2738
2773
  uploadType?:
2739
2774
  string;
2740
2775
  }): Request<ListLocationsResponse>;
2776
+ /** Romanize input text written in non-Latin scripts to Latin text. */
2777
+ romanizeText(request: {
2778
+ /** V1 error format. */
2779
+ "$.xgafv"?:
2780
+ string;
2781
+ /** OAuth access token. */
2782
+ access_token?:
2783
+ string;
2784
+ /** Data format for response. */
2785
+ alt?:
2786
+ string;
2787
+ /** JSONP */
2788
+ callback?:
2789
+ string;
2790
+ /** Selector specifying which fields to include in a partial response. */
2791
+ fields?:
2792
+ string;
2793
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2794
+ key?:
2795
+ string;
2796
+ /** OAuth 2.0 token for the current user. */
2797
+ oauth_token?:
2798
+ string;
2799
+ /**
2800
+ * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
2801
+ * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
2802
+ */
2803
+ parent:
2804
+ string;
2805
+ /** Returns response with indentations and line breaks. */
2806
+ prettyPrint?:
2807
+ boolean;
2808
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
2809
+ quotaUser?:
2810
+ string;
2811
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2812
+ upload_protocol?:
2813
+ string;
2814
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2815
+ uploadType?:
2816
+ string;
2817
+ /** Request body */
2818
+ resource:
2819
+ RomanizeTextRequest;
2820
+ }): Request<RomanizeTextResponse>;
2821
+ romanizeText(request: {
2822
+ /** V1 error format. */
2823
+ "$.xgafv"?:
2824
+ string;
2825
+ /** OAuth access token. */
2826
+ access_token?:
2827
+ string;
2828
+ /** Data format for response. */
2829
+ alt?:
2830
+ string;
2831
+ /** JSONP */
2832
+ callback?:
2833
+ string;
2834
+ /** Selector specifying which fields to include in a partial response. */
2835
+ fields?:
2836
+ string;
2837
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2838
+ key?:
2839
+ string;
2840
+ /** OAuth 2.0 token for the current user. */
2841
+ oauth_token?:
2842
+ string;
2843
+ /**
2844
+ * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
2845
+ * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
2846
+ */
2847
+ parent:
2848
+ string;
2849
+ /** Returns response with indentations and line breaks. */
2850
+ prettyPrint?:
2851
+ boolean;
2852
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
2853
+ quotaUser?:
2854
+ string;
2855
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2856
+ upload_protocol?:
2857
+ string;
2858
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2859
+ uploadType?:
2860
+ string;
2861
+ },
2862
+ body: RomanizeTextRequest): Request<RomanizeTextResponse>;
2741
2863
  /** Translates documents in synchronous mode. */
2742
2864
  translateDocument(request: {
2743
2865
  /** V1 error format. */
@@ -3071,6 +3193,93 @@ declare namespace gapi.client {
3071
3193
  uploadType?:
3072
3194
  string;
3073
3195
  }): Request<SupportedLanguages>;
3196
+ /** Romanize input text written in non-Latin scripts to Latin text. */
3197
+ romanizeText(request: {
3198
+ /** V1 error format. */
3199
+ "$.xgafv"?:
3200
+ string;
3201
+ /** OAuth access token. */
3202
+ access_token?:
3203
+ string;
3204
+ /** Data format for response. */
3205
+ alt?:
3206
+ string;
3207
+ /** JSONP */
3208
+ callback?:
3209
+ string;
3210
+ /** Selector specifying which fields to include in a partial response. */
3211
+ fields?:
3212
+ string;
3213
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
3214
+ key?:
3215
+ string;
3216
+ /** OAuth 2.0 token for the current user. */
3217
+ oauth_token?:
3218
+ string;
3219
+ /**
3220
+ * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
3221
+ * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
3222
+ */
3223
+ parent:
3224
+ string;
3225
+ /** Returns response with indentations and line breaks. */
3226
+ prettyPrint?:
3227
+ boolean;
3228
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
3229
+ quotaUser?:
3230
+ string;
3231
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
3232
+ upload_protocol?:
3233
+ string;
3234
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
3235
+ uploadType?:
3236
+ string;
3237
+ /** Request body */
3238
+ resource:
3239
+ RomanizeTextRequest;
3240
+ }): Request<RomanizeTextResponse>;
3241
+ romanizeText(request: {
3242
+ /** V1 error format. */
3243
+ "$.xgafv"?:
3244
+ string;
3245
+ /** OAuth access token. */
3246
+ access_token?:
3247
+ string;
3248
+ /** Data format for response. */
3249
+ alt?:
3250
+ string;
3251
+ /** JSONP */
3252
+ callback?:
3253
+ string;
3254
+ /** Selector specifying which fields to include in a partial response. */
3255
+ fields?:
3256
+ string;
3257
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
3258
+ key?:
3259
+ string;
3260
+ /** OAuth 2.0 token for the current user. */
3261
+ oauth_token?:
3262
+ string;
3263
+ /**
3264
+ * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
3265
+ * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
3266
+ */
3267
+ parent:
3268
+ string;
3269
+ /** Returns response with indentations and line breaks. */
3270
+ prettyPrint?:
3271
+ boolean;
3272
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
3273
+ quotaUser?:
3274
+ string;
3275
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
3276
+ upload_protocol?:
3277
+ string;
3278
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
3279
+ uploadType?:
3280
+ string;
3281
+ },
3282
+ body: RomanizeTextRequest): Request<RomanizeTextResponse>;
3074
3283
  /** Translates input text and returns translated text. */
3075
3284
  translateText(request: {
3076
3285
  /** V1 error format. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.translate-v3",
3
- "version": "0.0.20230428",
3
+ "version": "0.0.20230519",
4
4
  "description": "TypeScript typings for Cloud Translation API v3",
5
5
  "license": "MIT",
6
6
  "author": {
package/readme.md CHANGED
@@ -79,6 +79,11 @@ Returns a list of supported languages for translation.
79
79
  */
80
80
  await gapi.client.translate.projects.getSupportedLanguages({ parent: "parent", });
81
81
 
82
+ /*
83
+ Romanize input text written in non-Latin scripts to Latin text.
84
+ */
85
+ await gapi.client.translate.projects.romanizeText({ parent: "parent", });
86
+
82
87
  /*
83
88
  Translates input text and returns translated text.
84
89
  */
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20230428
6
+ // Revision: 20230519
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -48,6 +48,15 @@ gapi.load('client', async () => {
48
48
  model: "Test string",
49
49
  parent: "Test string",
50
50
  });
51
+ /** Romanize input text written in non-Latin scripts to Latin text. */
52
+ await gapi.client.translate.projects.romanizeText({
53
+ parent: "Test string",
54
+ }, {
55
+ contents: [
56
+ "Test string"
57
+ ],
58
+ sourceLanguageCode: "Test string",
59
+ });
51
60
  /** Translates input text and returns translated text. */
52
61
  await gapi.client.translate.projects.translateText({
53
62
  parent: "Test string",
@@ -66,6 +75,9 @@ gapi.load('client', async () => {
66
75
  model: "Test string",
67
76
  sourceLanguageCode: "Test string",
68
77
  targetLanguageCode: "Test string",
78
+ transliterationConfig: {
79
+ enableTransliteration: true,
80
+ },
69
81
  });
70
82
  /**
71
83
  * Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial
@@ -172,6 +184,15 @@ gapi.load('client', async () => {
172
184
  pageSize: 42,
173
185
  pageToken: "Test string",
174
186
  });
187
+ /** Romanize input text written in non-Latin scripts to Latin text. */
188
+ await gapi.client.translate.projects.locations.romanizeText({
189
+ parent: "Test string",
190
+ }, {
191
+ contents: [
192
+ "Test string"
193
+ ],
194
+ sourceLanguageCode: "Test string",
195
+ });
175
196
  /** Translates documents in synchronous mode. */
176
197
  await gapi.client.translate.projects.locations.translateDocument({
177
198
  parent: "Test string",
@@ -222,6 +243,9 @@ gapi.load('client', async () => {
222
243
  model: "Test string",
223
244
  sourceLanguageCode: "Test string",
224
245
  targetLanguageCode: "Test string",
246
+ transliterationConfig: {
247
+ enableTransliteration: true,
248
+ },
225
249
  });
226
250
  /** Creates a Dataset. */
227
251
  await gapi.client.translate.projects.locations.datasets.create({