@aws-sdk/client-translate 3.193.0 → 3.195.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 (104) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist-cjs/TranslateClient.js +11 -8
  3. package/dist-cjs/commands/CreateParallelDataCommand.js +10 -0
  4. package/dist-cjs/commands/DeleteParallelDataCommand.js +10 -0
  5. package/dist-cjs/commands/DeleteTerminologyCommand.js +10 -0
  6. package/dist-cjs/commands/DescribeTextTranslationJobCommand.js +10 -0
  7. package/dist-cjs/commands/GetParallelDataCommand.js +10 -0
  8. package/dist-cjs/commands/GetTerminologyCommand.js +10 -0
  9. package/dist-cjs/commands/ImportTerminologyCommand.js +10 -0
  10. package/dist-cjs/commands/ListLanguagesCommand.js +10 -0
  11. package/dist-cjs/commands/ListParallelDataCommand.js +10 -0
  12. package/dist-cjs/commands/ListTagsForResourceCommand.js +10 -0
  13. package/dist-cjs/commands/ListTerminologiesCommand.js +10 -0
  14. package/dist-cjs/commands/ListTextTranslationJobsCommand.js +10 -0
  15. package/dist-cjs/commands/StartTextTranslationJobCommand.js +10 -0
  16. package/dist-cjs/commands/StopTextTranslationJobCommand.js +10 -0
  17. package/dist-cjs/commands/TagResourceCommand.js +10 -0
  18. package/dist-cjs/commands/TranslateTextCommand.js +10 -0
  19. package/dist-cjs/commands/UntagResourceCommand.js +10 -0
  20. package/dist-cjs/commands/UpdateParallelDataCommand.js +10 -0
  21. package/dist-cjs/endpoint/EndpointParameters.js +13 -0
  22. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  23. package/dist-cjs/endpoint/ruleset.js +318 -0
  24. package/dist-cjs/runtimeConfig.shared.js +3 -3
  25. package/dist-es/TranslateClient.js +12 -9
  26. package/dist-es/commands/CreateParallelDataCommand.js +10 -0
  27. package/dist-es/commands/DeleteParallelDataCommand.js +10 -0
  28. package/dist-es/commands/DeleteTerminologyCommand.js +10 -0
  29. package/dist-es/commands/DescribeTextTranslationJobCommand.js +10 -0
  30. package/dist-es/commands/GetParallelDataCommand.js +10 -0
  31. package/dist-es/commands/GetTerminologyCommand.js +10 -0
  32. package/dist-es/commands/ImportTerminologyCommand.js +10 -0
  33. package/dist-es/commands/ListLanguagesCommand.js +10 -0
  34. package/dist-es/commands/ListParallelDataCommand.js +10 -0
  35. package/dist-es/commands/ListTagsForResourceCommand.js +10 -0
  36. package/dist-es/commands/ListTerminologiesCommand.js +10 -0
  37. package/dist-es/commands/ListTextTranslationJobsCommand.js +10 -0
  38. package/dist-es/commands/StartTextTranslationJobCommand.js +10 -0
  39. package/dist-es/commands/StopTextTranslationJobCommand.js +10 -0
  40. package/dist-es/commands/TagResourceCommand.js +10 -0
  41. package/dist-es/commands/TranslateTextCommand.js +10 -0
  42. package/dist-es/commands/UntagResourceCommand.js +10 -0
  43. package/dist-es/commands/UpdateParallelDataCommand.js +10 -0
  44. package/dist-es/endpoint/EndpointParameters.js +8 -0
  45. package/dist-es/endpoint/endpointResolver.js +8 -0
  46. package/dist-es/endpoint/ruleset.js +315 -0
  47. package/dist-es/runtimeConfig.shared.js +2 -2
  48. package/dist-types/TranslateClient.d.ts +6 -9
  49. package/dist-types/commands/CreateParallelDataCommand.d.ts +2 -0
  50. package/dist-types/commands/DeleteParallelDataCommand.d.ts +2 -0
  51. package/dist-types/commands/DeleteTerminologyCommand.d.ts +2 -0
  52. package/dist-types/commands/DescribeTextTranslationJobCommand.d.ts +2 -0
  53. package/dist-types/commands/GetParallelDataCommand.d.ts +2 -0
  54. package/dist-types/commands/GetTerminologyCommand.d.ts +2 -0
  55. package/dist-types/commands/ImportTerminologyCommand.d.ts +2 -0
  56. package/dist-types/commands/ListLanguagesCommand.d.ts +2 -0
  57. package/dist-types/commands/ListParallelDataCommand.d.ts +2 -0
  58. package/dist-types/commands/ListTagsForResourceCommand.d.ts +2 -0
  59. package/dist-types/commands/ListTerminologiesCommand.d.ts +2 -0
  60. package/dist-types/commands/ListTextTranslationJobsCommand.d.ts +2 -0
  61. package/dist-types/commands/StartTextTranslationJobCommand.d.ts +2 -0
  62. package/dist-types/commands/StopTextTranslationJobCommand.d.ts +2 -0
  63. package/dist-types/commands/TagResourceCommand.d.ts +2 -0
  64. package/dist-types/commands/TranslateTextCommand.d.ts +2 -0
  65. package/dist-types/commands/UntagResourceCommand.d.ts +2 -0
  66. package/dist-types/commands/UpdateParallelDataCommand.d.ts +2 -0
  67. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  68. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  69. package/dist-types/endpoint/ruleset.d.ts +2 -0
  70. package/dist-types/runtimeConfig.browser.d.ts +4 -2
  71. package/dist-types/runtimeConfig.d.ts +4 -2
  72. package/dist-types/runtimeConfig.native.d.ts +4 -2
  73. package/dist-types/runtimeConfig.shared.d.ts +3 -1
  74. package/dist-types/ts3.4/TranslateClient.d.ts +15 -8
  75. package/dist-types/ts3.4/commands/CreateParallelDataCommand.d.ts +2 -0
  76. package/dist-types/ts3.4/commands/DeleteParallelDataCommand.d.ts +2 -0
  77. package/dist-types/ts3.4/commands/DeleteTerminologyCommand.d.ts +2 -0
  78. package/dist-types/ts3.4/commands/DescribeTextTranslationJobCommand.d.ts +2 -0
  79. package/dist-types/ts3.4/commands/GetParallelDataCommand.d.ts +2 -0
  80. package/dist-types/ts3.4/commands/GetTerminologyCommand.d.ts +2 -0
  81. package/dist-types/ts3.4/commands/ImportTerminologyCommand.d.ts +2 -0
  82. package/dist-types/ts3.4/commands/ListLanguagesCommand.d.ts +2 -0
  83. package/dist-types/ts3.4/commands/ListParallelDataCommand.d.ts +2 -0
  84. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -0
  85. package/dist-types/ts3.4/commands/ListTerminologiesCommand.d.ts +2 -0
  86. package/dist-types/ts3.4/commands/ListTextTranslationJobsCommand.d.ts +2 -0
  87. package/dist-types/ts3.4/commands/StartTextTranslationJobCommand.d.ts +2 -0
  88. package/dist-types/ts3.4/commands/StopTextTranslationJobCommand.d.ts +2 -0
  89. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +2 -0
  90. package/dist-types/ts3.4/commands/TranslateTextCommand.d.ts +2 -0
  91. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +2 -0
  92. package/dist-types/ts3.4/commands/UpdateParallelDataCommand.d.ts +2 -0
  93. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +26 -0
  94. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  95. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  96. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +14 -4
  97. package/dist-types/ts3.4/runtimeConfig.d.ts +14 -4
  98. package/dist-types/ts3.4/runtimeConfig.native.d.ts +14 -3
  99. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +6 -1
  100. package/package.json +4 -2
  101. package/dist-cjs/endpoints.js +0 -168
  102. package/dist-es/endpoints.js +0 -164
  103. package/dist-types/endpoints.d.ts +0 -2
  104. package/dist-types/ts3.4/endpoints.d.ts +0 -2
@@ -1,3 +1,4 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
1
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
3
4
  import { StartTextTranslationJobRequestFilterSensitiveLog, StartTextTranslationJobResponseFilterSensitiveLog, } from "../models/models_0";
@@ -7,8 +8,17 @@ export class StartTextTranslationJobCommand extends $Command {
7
8
  super();
8
9
  this.input = input;
9
10
  }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
10
19
  resolveMiddleware(clientStack, configuration, options) {
11
20
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, StartTextTranslationJobCommand.getEndpointParameterInstructions()));
12
22
  const stack = clientStack.concat(this.middlewareStack);
13
23
  const { logger } = configuration;
14
24
  const clientName = "TranslateClient";
@@ -1,3 +1,4 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
1
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
3
4
  import { StopTextTranslationJobRequestFilterSensitiveLog, StopTextTranslationJobResponseFilterSensitiveLog, } from "../models/models_0";
@@ -7,8 +8,17 @@ export class StopTextTranslationJobCommand extends $Command {
7
8
  super();
8
9
  this.input = input;
9
10
  }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
10
19
  resolveMiddleware(clientStack, configuration, options) {
11
20
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, StopTextTranslationJobCommand.getEndpointParameterInstructions()));
12
22
  const stack = clientStack.concat(this.middlewareStack);
13
23
  const { logger } = configuration;
14
24
  const clientName = "TranslateClient";
@@ -1,3 +1,4 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
1
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
3
4
  import { TagResourceRequestFilterSensitiveLog, TagResourceResponseFilterSensitiveLog, } from "../models/models_0";
@@ -7,8 +8,17 @@ export class TagResourceCommand extends $Command {
7
8
  super();
8
9
  this.input = input;
9
10
  }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
10
19
  resolveMiddleware(clientStack, configuration, options) {
11
20
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, TagResourceCommand.getEndpointParameterInstructions()));
12
22
  const stack = clientStack.concat(this.middlewareStack);
13
23
  const { logger } = configuration;
14
24
  const clientName = "TranslateClient";
@@ -1,3 +1,4 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
1
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
3
4
  import { TranslateTextRequestFilterSensitiveLog, TranslateTextResponseFilterSensitiveLog, } from "../models/models_0";
@@ -7,8 +8,17 @@ export class TranslateTextCommand extends $Command {
7
8
  super();
8
9
  this.input = input;
9
10
  }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
10
19
  resolveMiddleware(clientStack, configuration, options) {
11
20
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, TranslateTextCommand.getEndpointParameterInstructions()));
12
22
  const stack = clientStack.concat(this.middlewareStack);
13
23
  const { logger } = configuration;
14
24
  const clientName = "TranslateClient";
@@ -1,3 +1,4 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
1
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
3
4
  import { UntagResourceRequestFilterSensitiveLog, UntagResourceResponseFilterSensitiveLog, } from "../models/models_0";
@@ -7,8 +8,17 @@ export class UntagResourceCommand extends $Command {
7
8
  super();
8
9
  this.input = input;
9
10
  }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
10
19
  resolveMiddleware(clientStack, configuration, options) {
11
20
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, UntagResourceCommand.getEndpointParameterInstructions()));
12
22
  const stack = clientStack.concat(this.middlewareStack);
13
23
  const { logger } = configuration;
14
24
  const clientName = "TranslateClient";
@@ -1,3 +1,4 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
1
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
3
4
  import { UpdateParallelDataRequestFilterSensitiveLog, UpdateParallelDataResponseFilterSensitiveLog, } from "../models/models_0";
@@ -7,8 +8,17 @@ export class UpdateParallelDataCommand extends $Command {
7
8
  super();
8
9
  this.input = input;
9
10
  }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
10
19
  resolveMiddleware(clientStack, configuration, options) {
11
20
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, UpdateParallelDataCommand.getEndpointParameterInstructions()));
12
22
  const stack = clientStack.concat(this.middlewareStack);
13
23
  const { logger } = configuration;
14
24
  const clientName = "TranslateClient";
@@ -0,0 +1,8 @@
1
+ export const resolveClientEndpointParameters = (options) => {
2
+ return {
3
+ ...options,
4
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
5
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
6
+ defaultSigningName: "translate",
7
+ };
8
+ };
@@ -0,0 +1,8 @@
1
+ import { resolveEndpoint } from "@aws-sdk/util-endpoints";
2
+ import { ruleSet } from "./ruleset";
3
+ export const defaultEndpointResolver = (endpointParams, context = {}) => {
4
+ return resolveEndpoint(ruleSet, {
5
+ endpointParams: endpointParams,
6
+ logger: context.logger,
7
+ });
8
+ };
@@ -0,0 +1,315 @@
1
+ export const ruleSet = {
2
+ version: "1.0",
3
+ parameters: {
4
+ Region: {
5
+ builtIn: "AWS::Region",
6
+ required: false,
7
+ documentation: "The AWS region used to dispatch the request.",
8
+ type: "String",
9
+ },
10
+ UseDualStack: {
11
+ builtIn: "AWS::UseDualStack",
12
+ required: true,
13
+ default: false,
14
+ documentation: "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
15
+ type: "Boolean",
16
+ },
17
+ UseFIPS: {
18
+ builtIn: "AWS::UseFIPS",
19
+ required: true,
20
+ default: false,
21
+ documentation: "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
22
+ type: "Boolean",
23
+ },
24
+ Endpoint: {
25
+ builtIn: "SDK::Endpoint",
26
+ required: false,
27
+ documentation: "Override the endpoint used to send this request",
28
+ type: "String",
29
+ },
30
+ },
31
+ rules: [
32
+ {
33
+ conditions: [
34
+ {
35
+ fn: "aws.partition",
36
+ argv: [
37
+ {
38
+ ref: "Region",
39
+ },
40
+ ],
41
+ assign: "PartitionResult",
42
+ },
43
+ ],
44
+ type: "tree",
45
+ rules: [
46
+ {
47
+ conditions: [
48
+ {
49
+ fn: "isSet",
50
+ argv: [
51
+ {
52
+ ref: "Endpoint",
53
+ },
54
+ ],
55
+ },
56
+ {
57
+ fn: "parseURL",
58
+ argv: [
59
+ {
60
+ ref: "Endpoint",
61
+ },
62
+ ],
63
+ assign: "url",
64
+ },
65
+ ],
66
+ type: "tree",
67
+ rules: [
68
+ {
69
+ conditions: [
70
+ {
71
+ fn: "booleanEquals",
72
+ argv: [
73
+ {
74
+ ref: "UseFIPS",
75
+ },
76
+ true,
77
+ ],
78
+ },
79
+ ],
80
+ error: "Invalid Configuration: FIPS and custom endpoint are not supported",
81
+ type: "error",
82
+ },
83
+ {
84
+ conditions: [],
85
+ type: "tree",
86
+ rules: [
87
+ {
88
+ conditions: [
89
+ {
90
+ fn: "booleanEquals",
91
+ argv: [
92
+ {
93
+ ref: "UseDualStack",
94
+ },
95
+ true,
96
+ ],
97
+ },
98
+ ],
99
+ error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
100
+ type: "error",
101
+ },
102
+ {
103
+ conditions: [],
104
+ endpoint: {
105
+ url: {
106
+ ref: "Endpoint",
107
+ },
108
+ properties: {},
109
+ headers: {},
110
+ },
111
+ type: "endpoint",
112
+ },
113
+ ],
114
+ },
115
+ ],
116
+ },
117
+ {
118
+ conditions: [
119
+ {
120
+ fn: "booleanEquals",
121
+ argv: [
122
+ {
123
+ ref: "UseFIPS",
124
+ },
125
+ true,
126
+ ],
127
+ },
128
+ {
129
+ fn: "booleanEquals",
130
+ argv: [
131
+ {
132
+ ref: "UseDualStack",
133
+ },
134
+ true,
135
+ ],
136
+ },
137
+ ],
138
+ type: "tree",
139
+ rules: [
140
+ {
141
+ conditions: [
142
+ {
143
+ fn: "booleanEquals",
144
+ argv: [
145
+ true,
146
+ {
147
+ fn: "getAttr",
148
+ argv: [
149
+ {
150
+ ref: "PartitionResult",
151
+ },
152
+ "supportsFIPS",
153
+ ],
154
+ },
155
+ ],
156
+ },
157
+ {
158
+ fn: "booleanEquals",
159
+ argv: [
160
+ true,
161
+ {
162
+ fn: "getAttr",
163
+ argv: [
164
+ {
165
+ ref: "PartitionResult",
166
+ },
167
+ "supportsDualStack",
168
+ ],
169
+ },
170
+ ],
171
+ },
172
+ ],
173
+ type: "tree",
174
+ rules: [
175
+ {
176
+ conditions: [],
177
+ endpoint: {
178
+ url: "https://translate-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
179
+ properties: {},
180
+ headers: {},
181
+ },
182
+ type: "endpoint",
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ conditions: [],
188
+ error: "FIPS and DualStack are enabled, but this partition does not support one or both",
189
+ type: "error",
190
+ },
191
+ ],
192
+ },
193
+ {
194
+ conditions: [
195
+ {
196
+ fn: "booleanEquals",
197
+ argv: [
198
+ {
199
+ ref: "UseFIPS",
200
+ },
201
+ true,
202
+ ],
203
+ },
204
+ ],
205
+ type: "tree",
206
+ rules: [
207
+ {
208
+ conditions: [
209
+ {
210
+ fn: "booleanEquals",
211
+ argv: [
212
+ true,
213
+ {
214
+ fn: "getAttr",
215
+ argv: [
216
+ {
217
+ ref: "PartitionResult",
218
+ },
219
+ "supportsFIPS",
220
+ ],
221
+ },
222
+ ],
223
+ },
224
+ ],
225
+ type: "tree",
226
+ rules: [
227
+ {
228
+ conditions: [],
229
+ type: "tree",
230
+ rules: [
231
+ {
232
+ conditions: [],
233
+ endpoint: {
234
+ url: "https://translate-fips.{Region}.{PartitionResult#dnsSuffix}",
235
+ properties: {},
236
+ headers: {},
237
+ },
238
+ type: "endpoint",
239
+ },
240
+ ],
241
+ },
242
+ ],
243
+ },
244
+ {
245
+ conditions: [],
246
+ error: "FIPS is enabled but this partition does not support FIPS",
247
+ type: "error",
248
+ },
249
+ ],
250
+ },
251
+ {
252
+ conditions: [
253
+ {
254
+ fn: "booleanEquals",
255
+ argv: [
256
+ {
257
+ ref: "UseDualStack",
258
+ },
259
+ true,
260
+ ],
261
+ },
262
+ ],
263
+ type: "tree",
264
+ rules: [
265
+ {
266
+ conditions: [
267
+ {
268
+ fn: "booleanEquals",
269
+ argv: [
270
+ true,
271
+ {
272
+ fn: "getAttr",
273
+ argv: [
274
+ {
275
+ ref: "PartitionResult",
276
+ },
277
+ "supportsDualStack",
278
+ ],
279
+ },
280
+ ],
281
+ },
282
+ ],
283
+ type: "tree",
284
+ rules: [
285
+ {
286
+ conditions: [],
287
+ endpoint: {
288
+ url: "https://translate.{Region}.{PartitionResult#dualStackDnsSuffix}",
289
+ properties: {},
290
+ headers: {},
291
+ },
292
+ type: "endpoint",
293
+ },
294
+ ],
295
+ },
296
+ {
297
+ conditions: [],
298
+ error: "DualStack is enabled but this partition does not support DualStack",
299
+ type: "error",
300
+ },
301
+ ],
302
+ },
303
+ {
304
+ conditions: [],
305
+ endpoint: {
306
+ url: "https://translate.{Region}.{PartitionResult#dnsSuffix}",
307
+ properties: {},
308
+ headers: {},
309
+ },
310
+ type: "endpoint",
311
+ },
312
+ ],
313
+ },
314
+ ],
315
+ };
@@ -1,10 +1,10 @@
1
1
  import { parseUrl } from "@aws-sdk/url-parser";
2
- import { defaultRegionInfoProvider } from "./endpoints";
2
+ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
3
3
  export const getRuntimeConfig = (config) => ({
4
4
  apiVersion: "2017-07-01",
5
5
  disableHostPrefix: config?.disableHostPrefix ?? false,
6
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
6
7
  logger: config?.logger ?? {},
7
- regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
8
8
  serviceId: config?.serviceId ?? "Translate",
9
9
  urlParser: config?.urlParser ?? parseUrl,
10
10
  });
@@ -1,11 +1,12 @@
1
- import { EndpointsInputConfig, EndpointsResolvedConfig, RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver";
1
+ import { RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver";
2
+ import { EndpointInputConfig, EndpointResolvedConfig } from "@aws-sdk/middleware-endpoint";
2
3
  import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
3
4
  import { RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry";
4
5
  import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
5
6
  import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
6
7
  import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
7
8
  import { Client as __Client, DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client";
8
- import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
9
+ import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
9
10
  import { CreateParallelDataCommandInput, CreateParallelDataCommandOutput } from "./commands/CreateParallelDataCommand";
10
11
  import { DeleteParallelDataCommandInput, DeleteParallelDataCommandOutput } from "./commands/DeleteParallelDataCommand";
11
12
  import { DeleteTerminologyCommandInput, DeleteTerminologyCommandOutput } from "./commands/DeleteTerminologyCommand";
@@ -24,6 +25,7 @@ import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/Ta
24
25
  import { TranslateTextCommandInput, TranslateTextCommandOutput } from "./commands/TranslateTextCommand";
25
26
  import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
26
27
  import { UpdateParallelDataCommandInput, UpdateParallelDataCommandOutput } from "./commands/UpdateParallelDataCommand";
28
+ import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
27
29
  export declare type ServiceInputTypes = CreateParallelDataCommandInput | DeleteParallelDataCommandInput | DeleteTerminologyCommandInput | DescribeTextTranslationJobCommandInput | GetParallelDataCommandInput | GetTerminologyCommandInput | ImportTerminologyCommandInput | ListLanguagesCommandInput | ListParallelDataCommandInput | ListTagsForResourceCommandInput | ListTerminologiesCommandInput | ListTextTranslationJobsCommandInput | StartTextTranslationJobCommandInput | StopTextTranslationJobCommandInput | TagResourceCommandInput | TranslateTextCommandInput | UntagResourceCommandInput | UpdateParallelDataCommandInput;
28
30
  export declare type ServiceOutputTypes = CreateParallelDataCommandOutput | DeleteParallelDataCommandOutput | DeleteTerminologyCommandOutput | DescribeTextTranslationJobCommandOutput | GetParallelDataCommandOutput | GetTerminologyCommandOutput | ImportTerminologyCommandOutput | ListLanguagesCommandOutput | ListParallelDataCommandOutput | ListTagsForResourceCommandOutput | ListTerminologiesCommandOutput | ListTextTranslationJobsCommandOutput | StartTextTranslationJobCommandOutput | StopTextTranslationJobCommandOutput | TagResourceCommandOutput | TranslateTextCommandOutput | UntagResourceCommandOutput | UpdateParallelDataCommandOutput;
29
31
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
@@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
116
118
  * @internal
117
119
  */
118
120
  credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
119
- /**
120
- * Fetch related hostname, signing name or signing region with given region.
121
- * @internal
122
- */
123
- regionInfoProvider?: RegionInfoProvider;
124
121
  /**
125
122
  * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
126
123
  * @internal
@@ -131,13 +128,13 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
131
128
  */
132
129
  defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
133
130
  }
134
- declare type TranslateClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig;
131
+ declare type TranslateClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
135
132
  /**
136
133
  * The configuration interface of TranslateClient class constructor that set the region, credentials and other options.
137
134
  */
138
135
  export interface TranslateClientConfig extends TranslateClientConfigType {
139
136
  }
140
- declare type TranslateClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RegionResolvedConfig & EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig;
137
+ declare type TranslateClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
141
138
  /**
142
139
  * The resolved configuration interface of TranslateClient class. This is resolved and normalized from the {@link TranslateClientConfig | constructor configuration interface}.
143
140
  */
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { CreateParallelDataRequest, CreateParallelDataResponse } from "../models/models_0";
@@ -28,6 +29,7 @@ export interface CreateParallelDataCommandOutput extends CreateParallelDataRespo
28
29
  */
29
30
  export declare class CreateParallelDataCommand extends $Command<CreateParallelDataCommandInput, CreateParallelDataCommandOutput, TranslateClientResolvedConfig> {
30
31
  readonly input: CreateParallelDataCommandInput;
32
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
31
33
  constructor(input: CreateParallelDataCommandInput);
32
34
  /**
33
35
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { DeleteParallelDataRequest, DeleteParallelDataResponse } from "../models/models_0";
@@ -25,6 +26,7 @@ export interface DeleteParallelDataCommandOutput extends DeleteParallelDataRespo
25
26
  */
26
27
  export declare class DeleteParallelDataCommand extends $Command<DeleteParallelDataCommandInput, DeleteParallelDataCommandOutput, TranslateClientResolvedConfig> {
27
28
  readonly input: DeleteParallelDataCommandInput;
29
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
28
30
  constructor(input: DeleteParallelDataCommandInput);
29
31
  /**
30
32
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { DeleteTerminologyRequest } from "../models/models_0";
@@ -25,6 +26,7 @@ export interface DeleteTerminologyCommandOutput extends __MetadataBearer {
25
26
  */
26
27
  export declare class DeleteTerminologyCommand extends $Command<DeleteTerminologyCommandInput, DeleteTerminologyCommandOutput, TranslateClientResolvedConfig> {
27
28
  readonly input: DeleteTerminologyCommandInput;
29
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
28
30
  constructor(input: DeleteTerminologyCommandInput);
29
31
  /**
30
32
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { DescribeTextTranslationJobRequest, DescribeTextTranslationJobResponse } from "../models/models_0";
@@ -26,6 +27,7 @@ export interface DescribeTextTranslationJobCommandOutput extends DescribeTextTra
26
27
  */
27
28
  export declare class DescribeTextTranslationJobCommand extends $Command<DescribeTextTranslationJobCommandInput, DescribeTextTranslationJobCommandOutput, TranslateClientResolvedConfig> {
28
29
  readonly input: DescribeTextTranslationJobCommandInput;
30
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
29
31
  constructor(input: DescribeTextTranslationJobCommandInput);
30
32
  /**
31
33
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { GetParallelDataRequest, GetParallelDataResponse } from "../models/models_0";
@@ -25,6 +26,7 @@ export interface GetParallelDataCommandOutput extends GetParallelDataResponse, _
25
26
  */
26
27
  export declare class GetParallelDataCommand extends $Command<GetParallelDataCommandInput, GetParallelDataCommandOutput, TranslateClientResolvedConfig> {
27
28
  readonly input: GetParallelDataCommandInput;
29
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
28
30
  constructor(input: GetParallelDataCommandInput);
29
31
  /**
30
32
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { GetTerminologyRequest, GetTerminologyResponse } from "../models/models_0";
@@ -25,6 +26,7 @@ export interface GetTerminologyCommandOutput extends GetTerminologyResponse, __M
25
26
  */
26
27
  export declare class GetTerminologyCommand extends $Command<GetTerminologyCommandInput, GetTerminologyCommandOutput, TranslateClientResolvedConfig> {
27
28
  readonly input: GetTerminologyCommandInput;
29
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
28
30
  constructor(input: GetTerminologyCommandInput);
29
31
  /**
30
32
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { ImportTerminologyRequest, ImportTerminologyResponse } from "../models/models_0";
@@ -32,6 +33,7 @@ export interface ImportTerminologyCommandOutput extends ImportTerminologyRespons
32
33
  */
33
34
  export declare class ImportTerminologyCommand extends $Command<ImportTerminologyCommandInput, ImportTerminologyCommandOutput, TranslateClientResolvedConfig> {
34
35
  readonly input: ImportTerminologyCommandInput;
36
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
35
37
  constructor(input: ImportTerminologyCommandInput);
36
38
  /**
37
39
  * @internal
@@ -1,3 +1,4 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
1
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
2
3
  import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
4
  import { ListLanguagesRequest, ListLanguagesResponse } from "../models/models_0";
@@ -25,6 +26,7 @@ export interface ListLanguagesCommandOutput extends ListLanguagesResponse, __Met
25
26
  */
26
27
  export declare class ListLanguagesCommand extends $Command<ListLanguagesCommandInput, ListLanguagesCommandOutput, TranslateClientResolvedConfig> {
27
28
  readonly input: ListLanguagesCommandInput;
29
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
28
30
  constructor(input: ListLanguagesCommandInput);
29
31
  /**
30
32
  * @internal