@aws-sdk/client-amplifybackend 3.476.0 → 3.478.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.
@@ -1,36 +1,28 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { AmplifyBackendServiceException as __BaseException } from "../models/AmplifyBackendServiceException";
4
4
  import { BadRequestException, GatewayTimeoutException, NotFoundException, TooManyRequestsException, } from "../models/models_0";
5
5
  export const se_CloneBackendCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
6
+ const b = rb(input, context);
7
7
  const headers = {
8
8
  "content-type": "application/json",
9
9
  };
10
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
11
- "/backend/{AppId}/environments/{BackendEnvironmentName}/clone";
12
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
13
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
10
+ b.bp("/backend/{AppId}/environments/{BackendEnvironmentName}/clone");
11
+ b.p("AppId", () => input.AppId, "{AppId}", false);
12
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
14
13
  let body;
15
14
  body = JSON.stringify(take(input, {
16
15
  targetEnvironmentName: [, , `TargetEnvironmentName`],
17
16
  }));
18
- return new __HttpRequest({
19
- protocol,
20
- hostname,
21
- port,
22
- method: "POST",
23
- headers,
24
- path: resolvedPath,
25
- body,
26
- });
17
+ b.m("POST").h(headers).b(body);
18
+ return b.build();
27
19
  };
28
20
  export const se_CreateBackendCommand = async (input, context) => {
29
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
21
+ const b = rb(input, context);
30
22
  const headers = {
31
23
  "content-type": "application/json",
32
24
  };
33
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend";
25
+ b.bp("/backend");
34
26
  let body;
35
27
  body = JSON.stringify(take(input, {
36
28
  appId: [, , `AppId`],
@@ -39,411 +31,266 @@ export const se_CreateBackendCommand = async (input, context) => {
39
31
  resourceConfig: [, (_) => _json(_), `ResourceConfig`],
40
32
  resourceName: [, , `ResourceName`],
41
33
  }));
42
- return new __HttpRequest({
43
- protocol,
44
- hostname,
45
- port,
46
- method: "POST",
47
- headers,
48
- path: resolvedPath,
49
- body,
50
- });
34
+ b.m("POST").h(headers).b(body);
35
+ return b.build();
51
36
  };
52
37
  export const se_CreateBackendAPICommand = async (input, context) => {
53
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
38
+ const b = rb(input, context);
54
39
  const headers = {
55
40
  "content-type": "application/json",
56
41
  };
57
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/api";
58
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
42
+ b.bp("/backend/{AppId}/api");
43
+ b.p("AppId", () => input.AppId, "{AppId}", false);
59
44
  let body;
60
45
  body = JSON.stringify(take(input, {
61
46
  backendEnvironmentName: [, , `BackendEnvironmentName`],
62
47
  resourceConfig: [, (_) => se_BackendAPIResourceConfig(_, context), `ResourceConfig`],
63
48
  resourceName: [, , `ResourceName`],
64
49
  }));
65
- return new __HttpRequest({
66
- protocol,
67
- hostname,
68
- port,
69
- method: "POST",
70
- headers,
71
- path: resolvedPath,
72
- body,
73
- });
50
+ b.m("POST").h(headers).b(body);
51
+ return b.build();
74
52
  };
75
53
  export const se_CreateBackendAuthCommand = async (input, context) => {
76
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const b = rb(input, context);
77
55
  const headers = {
78
56
  "content-type": "application/json",
79
57
  };
80
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/auth";
81
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
58
+ b.bp("/backend/{AppId}/auth");
59
+ b.p("AppId", () => input.AppId, "{AppId}", false);
82
60
  let body;
83
61
  body = JSON.stringify(take(input, {
84
62
  backendEnvironmentName: [, , `BackendEnvironmentName`],
85
63
  resourceConfig: [, (_) => se_CreateBackendAuthResourceConfig(_, context), `ResourceConfig`],
86
64
  resourceName: [, , `ResourceName`],
87
65
  }));
88
- return new __HttpRequest({
89
- protocol,
90
- hostname,
91
- port,
92
- method: "POST",
93
- headers,
94
- path: resolvedPath,
95
- body,
96
- });
66
+ b.m("POST").h(headers).b(body);
67
+ return b.build();
97
68
  };
98
69
  export const se_CreateBackendConfigCommand = async (input, context) => {
99
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
+ const b = rb(input, context);
100
71
  const headers = {
101
72
  "content-type": "application/json",
102
73
  };
103
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/config";
104
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
74
+ b.bp("/backend/{AppId}/config");
75
+ b.p("AppId", () => input.AppId, "{AppId}", false);
105
76
  let body;
106
77
  body = JSON.stringify(take(input, {
107
78
  backendManagerAppId: [, , `BackendManagerAppId`],
108
79
  }));
109
- return new __HttpRequest({
110
- protocol,
111
- hostname,
112
- port,
113
- method: "POST",
114
- headers,
115
- path: resolvedPath,
116
- body,
117
- });
80
+ b.m("POST").h(headers).b(body);
81
+ return b.build();
118
82
  };
119
83
  export const se_CreateBackendStorageCommand = async (input, context) => {
120
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
84
+ const b = rb(input, context);
121
85
  const headers = {
122
86
  "content-type": "application/json",
123
87
  };
124
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/storage";
125
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
88
+ b.bp("/backend/{AppId}/storage");
89
+ b.p("AppId", () => input.AppId, "{AppId}", false);
126
90
  let body;
127
91
  body = JSON.stringify(take(input, {
128
92
  backendEnvironmentName: [, , `BackendEnvironmentName`],
129
93
  resourceConfig: [, (_) => se_CreateBackendStorageResourceConfig(_, context), `ResourceConfig`],
130
94
  resourceName: [, , `ResourceName`],
131
95
  }));
132
- return new __HttpRequest({
133
- protocol,
134
- hostname,
135
- port,
136
- method: "POST",
137
- headers,
138
- path: resolvedPath,
139
- body,
140
- });
96
+ b.m("POST").h(headers).b(body);
97
+ return b.build();
141
98
  };
142
99
  export const se_CreateTokenCommand = async (input, context) => {
143
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
100
+ const b = rb(input, context);
144
101
  const headers = {};
145
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/challenge";
146
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
102
+ b.bp("/backend/{AppId}/challenge");
103
+ b.p("AppId", () => input.AppId, "{AppId}", false);
147
104
  let body;
148
- return new __HttpRequest({
149
- protocol,
150
- hostname,
151
- port,
152
- method: "POST",
153
- headers,
154
- path: resolvedPath,
155
- body,
156
- });
105
+ b.m("POST").h(headers).b(body);
106
+ return b.build();
157
107
  };
158
108
  export const se_DeleteBackendCommand = async (input, context) => {
159
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const b = rb(input, context);
160
110
  const headers = {};
161
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
162
- "/backend/{AppId}/environments/{BackendEnvironmentName}/remove";
163
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
164
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
111
+ b.bp("/backend/{AppId}/environments/{BackendEnvironmentName}/remove");
112
+ b.p("AppId", () => input.AppId, "{AppId}", false);
113
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
165
114
  let body;
166
- return new __HttpRequest({
167
- protocol,
168
- hostname,
169
- port,
170
- method: "POST",
171
- headers,
172
- path: resolvedPath,
173
- body,
174
- });
115
+ b.m("POST").h(headers).b(body);
116
+ return b.build();
175
117
  };
176
118
  export const se_DeleteBackendAPICommand = async (input, context) => {
177
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
119
+ const b = rb(input, context);
178
120
  const headers = {
179
121
  "content-type": "application/json",
180
122
  };
181
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
182
- "/backend/{AppId}/api/{BackendEnvironmentName}/remove";
183
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
184
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
123
+ b.bp("/backend/{AppId}/api/{BackendEnvironmentName}/remove");
124
+ b.p("AppId", () => input.AppId, "{AppId}", false);
125
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
185
126
  let body;
186
127
  body = JSON.stringify(take(input, {
187
128
  resourceConfig: [, (_) => se_BackendAPIResourceConfig(_, context), `ResourceConfig`],
188
129
  resourceName: [, , `ResourceName`],
189
130
  }));
190
- return new __HttpRequest({
191
- protocol,
192
- hostname,
193
- port,
194
- method: "POST",
195
- headers,
196
- path: resolvedPath,
197
- body,
198
- });
131
+ b.m("POST").h(headers).b(body);
132
+ return b.build();
199
133
  };
200
134
  export const se_DeleteBackendAuthCommand = async (input, context) => {
201
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
135
+ const b = rb(input, context);
202
136
  const headers = {
203
137
  "content-type": "application/json",
204
138
  };
205
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
206
- "/backend/{AppId}/auth/{BackendEnvironmentName}/remove";
207
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
208
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
139
+ b.bp("/backend/{AppId}/auth/{BackendEnvironmentName}/remove");
140
+ b.p("AppId", () => input.AppId, "{AppId}", false);
141
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
209
142
  let body;
210
143
  body = JSON.stringify(take(input, {
211
144
  resourceName: [, , `ResourceName`],
212
145
  }));
213
- return new __HttpRequest({
214
- protocol,
215
- hostname,
216
- port,
217
- method: "POST",
218
- headers,
219
- path: resolvedPath,
220
- body,
221
- });
146
+ b.m("POST").h(headers).b(body);
147
+ return b.build();
222
148
  };
223
149
  export const se_DeleteBackendStorageCommand = async (input, context) => {
224
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
150
+ const b = rb(input, context);
225
151
  const headers = {
226
152
  "content-type": "application/json",
227
153
  };
228
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
229
- "/backend/{AppId}/storage/{BackendEnvironmentName}/remove";
230
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
231
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
154
+ b.bp("/backend/{AppId}/storage/{BackendEnvironmentName}/remove");
155
+ b.p("AppId", () => input.AppId, "{AppId}", false);
156
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
232
157
  let body;
233
158
  body = JSON.stringify(take(input, {
234
159
  resourceName: [, , `ResourceName`],
235
160
  serviceName: [, , `ServiceName`],
236
161
  }));
237
- return new __HttpRequest({
238
- protocol,
239
- hostname,
240
- port,
241
- method: "POST",
242
- headers,
243
- path: resolvedPath,
244
- body,
245
- });
162
+ b.m("POST").h(headers).b(body);
163
+ return b.build();
246
164
  };
247
165
  export const se_DeleteTokenCommand = async (input, context) => {
248
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
166
+ const b = rb(input, context);
249
167
  const headers = {};
250
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
251
- "/backend/{AppId}/challenge/{SessionId}/remove";
252
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
253
- resolvedPath = __resolvedPath(resolvedPath, input, "SessionId", () => input.SessionId, "{SessionId}", false);
168
+ b.bp("/backend/{AppId}/challenge/{SessionId}/remove");
169
+ b.p("AppId", () => input.AppId, "{AppId}", false);
170
+ b.p("SessionId", () => input.SessionId, "{SessionId}", false);
254
171
  let body;
255
- return new __HttpRequest({
256
- protocol,
257
- hostname,
258
- port,
259
- method: "POST",
260
- headers,
261
- path: resolvedPath,
262
- body,
263
- });
172
+ b.m("POST").h(headers).b(body);
173
+ return b.build();
264
174
  };
265
175
  export const se_GenerateBackendAPIModelsCommand = async (input, context) => {
266
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
176
+ const b = rb(input, context);
267
177
  const headers = {
268
178
  "content-type": "application/json",
269
179
  };
270
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
271
- "/backend/{AppId}/api/{BackendEnvironmentName}/generateModels";
272
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
273
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
180
+ b.bp("/backend/{AppId}/api/{BackendEnvironmentName}/generateModels");
181
+ b.p("AppId", () => input.AppId, "{AppId}", false);
182
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
274
183
  let body;
275
184
  body = JSON.stringify(take(input, {
276
185
  resourceName: [, , `ResourceName`],
277
186
  }));
278
- return new __HttpRequest({
279
- protocol,
280
- hostname,
281
- port,
282
- method: "POST",
283
- headers,
284
- path: resolvedPath,
285
- body,
286
- });
187
+ b.m("POST").h(headers).b(body);
188
+ return b.build();
287
189
  };
288
190
  export const se_GetBackendCommand = async (input, context) => {
289
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
191
+ const b = rb(input, context);
290
192
  const headers = {
291
193
  "content-type": "application/json",
292
194
  };
293
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/details";
294
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
195
+ b.bp("/backend/{AppId}/details");
196
+ b.p("AppId", () => input.AppId, "{AppId}", false);
295
197
  let body;
296
198
  body = JSON.stringify(take(input, {
297
199
  backendEnvironmentName: [, , `BackendEnvironmentName`],
298
200
  }));
299
- return new __HttpRequest({
300
- protocol,
301
- hostname,
302
- port,
303
- method: "POST",
304
- headers,
305
- path: resolvedPath,
306
- body,
307
- });
201
+ b.m("POST").h(headers).b(body);
202
+ return b.build();
308
203
  };
309
204
  export const se_GetBackendAPICommand = async (input, context) => {
310
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
205
+ const b = rb(input, context);
311
206
  const headers = {
312
207
  "content-type": "application/json",
313
208
  };
314
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
315
- "/backend/{AppId}/api/{BackendEnvironmentName}/details";
316
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
317
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
209
+ b.bp("/backend/{AppId}/api/{BackendEnvironmentName}/details");
210
+ b.p("AppId", () => input.AppId, "{AppId}", false);
211
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
318
212
  let body;
319
213
  body = JSON.stringify(take(input, {
320
214
  resourceConfig: [, (_) => se_BackendAPIResourceConfig(_, context), `ResourceConfig`],
321
215
  resourceName: [, , `ResourceName`],
322
216
  }));
323
- return new __HttpRequest({
324
- protocol,
325
- hostname,
326
- port,
327
- method: "POST",
328
- headers,
329
- path: resolvedPath,
330
- body,
331
- });
217
+ b.m("POST").h(headers).b(body);
218
+ return b.build();
332
219
  };
333
220
  export const se_GetBackendAPIModelsCommand = async (input, context) => {
334
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
221
+ const b = rb(input, context);
335
222
  const headers = {
336
223
  "content-type": "application/json",
337
224
  };
338
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
339
- "/backend/{AppId}/api/{BackendEnvironmentName}/getModels";
340
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
341
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
225
+ b.bp("/backend/{AppId}/api/{BackendEnvironmentName}/getModels");
226
+ b.p("AppId", () => input.AppId, "{AppId}", false);
227
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
342
228
  let body;
343
229
  body = JSON.stringify(take(input, {
344
230
  resourceName: [, , `ResourceName`],
345
231
  }));
346
- return new __HttpRequest({
347
- protocol,
348
- hostname,
349
- port,
350
- method: "POST",
351
- headers,
352
- path: resolvedPath,
353
- body,
354
- });
232
+ b.m("POST").h(headers).b(body);
233
+ return b.build();
355
234
  };
356
235
  export const se_GetBackendAuthCommand = async (input, context) => {
357
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
236
+ const b = rb(input, context);
358
237
  const headers = {
359
238
  "content-type": "application/json",
360
239
  };
361
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
362
- "/backend/{AppId}/auth/{BackendEnvironmentName}/details";
363
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
364
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
240
+ b.bp("/backend/{AppId}/auth/{BackendEnvironmentName}/details");
241
+ b.p("AppId", () => input.AppId, "{AppId}", false);
242
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
365
243
  let body;
366
244
  body = JSON.stringify(take(input, {
367
245
  resourceName: [, , `ResourceName`],
368
246
  }));
369
- return new __HttpRequest({
370
- protocol,
371
- hostname,
372
- port,
373
- method: "POST",
374
- headers,
375
- path: resolvedPath,
376
- body,
377
- });
247
+ b.m("POST").h(headers).b(body);
248
+ return b.build();
378
249
  };
379
250
  export const se_GetBackendJobCommand = async (input, context) => {
380
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
251
+ const b = rb(input, context);
381
252
  const headers = {};
382
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
383
- "/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}";
384
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
385
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
386
- resolvedPath = __resolvedPath(resolvedPath, input, "JobId", () => input.JobId, "{JobId}", false);
253
+ b.bp("/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}");
254
+ b.p("AppId", () => input.AppId, "{AppId}", false);
255
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
256
+ b.p("JobId", () => input.JobId, "{JobId}", false);
387
257
  let body;
388
- return new __HttpRequest({
389
- protocol,
390
- hostname,
391
- port,
392
- method: "GET",
393
- headers,
394
- path: resolvedPath,
395
- body,
396
- });
258
+ b.m("GET").h(headers).b(body);
259
+ return b.build();
397
260
  };
398
261
  export const se_GetBackendStorageCommand = async (input, context) => {
399
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
262
+ const b = rb(input, context);
400
263
  const headers = {
401
264
  "content-type": "application/json",
402
265
  };
403
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
404
- "/backend/{AppId}/storage/{BackendEnvironmentName}/details";
405
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
406
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
266
+ b.bp("/backend/{AppId}/storage/{BackendEnvironmentName}/details");
267
+ b.p("AppId", () => input.AppId, "{AppId}", false);
268
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
407
269
  let body;
408
270
  body = JSON.stringify(take(input, {
409
271
  resourceName: [, , `ResourceName`],
410
272
  }));
411
- return new __HttpRequest({
412
- protocol,
413
- hostname,
414
- port,
415
- method: "POST",
416
- headers,
417
- path: resolvedPath,
418
- body,
419
- });
273
+ b.m("POST").h(headers).b(body);
274
+ return b.build();
420
275
  };
421
276
  export const se_GetTokenCommand = async (input, context) => {
422
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
277
+ const b = rb(input, context);
423
278
  const headers = {};
424
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/challenge/{SessionId}";
425
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
426
- resolvedPath = __resolvedPath(resolvedPath, input, "SessionId", () => input.SessionId, "{SessionId}", false);
279
+ b.bp("/backend/{AppId}/challenge/{SessionId}");
280
+ b.p("AppId", () => input.AppId, "{AppId}", false);
281
+ b.p("SessionId", () => input.SessionId, "{SessionId}", false);
427
282
  let body;
428
- return new __HttpRequest({
429
- protocol,
430
- hostname,
431
- port,
432
- method: "GET",
433
- headers,
434
- path: resolvedPath,
435
- body,
436
- });
283
+ b.m("GET").h(headers).b(body);
284
+ return b.build();
437
285
  };
438
286
  export const se_ImportBackendAuthCommand = async (input, context) => {
439
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
287
+ const b = rb(input, context);
440
288
  const headers = {
441
289
  "content-type": "application/json",
442
290
  };
443
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
444
- "/backend/{AppId}/auth/{BackendEnvironmentName}/import";
445
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
446
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
291
+ b.bp("/backend/{AppId}/auth/{BackendEnvironmentName}/import");
292
+ b.p("AppId", () => input.AppId, "{AppId}", false);
293
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
447
294
  let body;
448
295
  body = JSON.stringify(take(input, {
449
296
  identityPoolId: [, , `IdentityPoolId`],
@@ -451,49 +298,33 @@ export const se_ImportBackendAuthCommand = async (input, context) => {
451
298
  userPoolId: [, , `UserPoolId`],
452
299
  webClientId: [, , `WebClientId`],
453
300
  }));
454
- return new __HttpRequest({
455
- protocol,
456
- hostname,
457
- port,
458
- method: "POST",
459
- headers,
460
- path: resolvedPath,
461
- body,
462
- });
301
+ b.m("POST").h(headers).b(body);
302
+ return b.build();
463
303
  };
464
304
  export const se_ImportBackendStorageCommand = async (input, context) => {
465
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
305
+ const b = rb(input, context);
466
306
  const headers = {
467
307
  "content-type": "application/json",
468
308
  };
469
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
470
- "/backend/{AppId}/storage/{BackendEnvironmentName}/import";
471
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
472
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
309
+ b.bp("/backend/{AppId}/storage/{BackendEnvironmentName}/import");
310
+ b.p("AppId", () => input.AppId, "{AppId}", false);
311
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
473
312
  let body;
474
313
  body = JSON.stringify(take(input, {
475
314
  bucketName: [, , `BucketName`],
476
315
  serviceName: [, , `ServiceName`],
477
316
  }));
478
- return new __HttpRequest({
479
- protocol,
480
- hostname,
481
- port,
482
- method: "POST",
483
- headers,
484
- path: resolvedPath,
485
- body,
486
- });
317
+ b.m("POST").h(headers).b(body);
318
+ return b.build();
487
319
  };
488
320
  export const se_ListBackendJobsCommand = async (input, context) => {
489
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
321
+ const b = rb(input, context);
490
322
  const headers = {
491
323
  "content-type": "application/json",
492
324
  };
493
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
494
- "/backend/{AppId}/job/{BackendEnvironmentName}";
495
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
496
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
325
+ b.bp("/backend/{AppId}/job/{BackendEnvironmentName}");
326
+ b.p("AppId", () => input.AppId, "{AppId}", false);
327
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
497
328
  let body;
498
329
  body = JSON.stringify(take(input, {
499
330
  jobId: [, , `JobId`],
@@ -502,190 +333,123 @@ export const se_ListBackendJobsCommand = async (input, context) => {
502
333
  operation: [, , `Operation`],
503
334
  status: [, , `Status`],
504
335
  }));
505
- return new __HttpRequest({
506
- protocol,
507
- hostname,
508
- port,
509
- method: "POST",
510
- headers,
511
- path: resolvedPath,
512
- body,
513
- });
336
+ b.m("POST").h(headers).b(body);
337
+ return b.build();
514
338
  };
515
339
  export const se_ListS3BucketsCommand = async (input, context) => {
516
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
340
+ const b = rb(input, context);
517
341
  const headers = {
518
342
  "content-type": "application/json",
519
343
  };
520
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/s3Buckets";
344
+ b.bp("/s3Buckets");
521
345
  let body;
522
346
  body = JSON.stringify(take(input, {
523
347
  nextToken: [, , `NextToken`],
524
348
  }));
525
- return new __HttpRequest({
526
- protocol,
527
- hostname,
528
- port,
529
- method: "POST",
530
- headers,
531
- path: resolvedPath,
532
- body,
533
- });
349
+ b.m("POST").h(headers).b(body);
350
+ return b.build();
534
351
  };
535
352
  export const se_RemoveAllBackendsCommand = async (input, context) => {
536
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
353
+ const b = rb(input, context);
537
354
  const headers = {
538
355
  "content-type": "application/json",
539
356
  };
540
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/remove";
541
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
357
+ b.bp("/backend/{AppId}/remove");
358
+ b.p("AppId", () => input.AppId, "{AppId}", false);
542
359
  let body;
543
360
  body = JSON.stringify(take(input, {
544
361
  cleanAmplifyApp: [, , `CleanAmplifyApp`],
545
362
  }));
546
- return new __HttpRequest({
547
- protocol,
548
- hostname,
549
- port,
550
- method: "POST",
551
- headers,
552
- path: resolvedPath,
553
- body,
554
- });
363
+ b.m("POST").h(headers).b(body);
364
+ return b.build();
555
365
  };
556
366
  export const se_RemoveBackendConfigCommand = async (input, context) => {
557
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
367
+ const b = rb(input, context);
558
368
  const headers = {};
559
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/config/remove";
560
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
369
+ b.bp("/backend/{AppId}/config/remove");
370
+ b.p("AppId", () => input.AppId, "{AppId}", false);
561
371
  let body;
562
- return new __HttpRequest({
563
- protocol,
564
- hostname,
565
- port,
566
- method: "POST",
567
- headers,
568
- path: resolvedPath,
569
- body,
570
- });
372
+ b.m("POST").h(headers).b(body);
373
+ return b.build();
571
374
  };
572
375
  export const se_UpdateBackendAPICommand = async (input, context) => {
573
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
376
+ const b = rb(input, context);
574
377
  const headers = {
575
378
  "content-type": "application/json",
576
379
  };
577
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
578
- "/backend/{AppId}/api/{BackendEnvironmentName}";
579
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
580
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
380
+ b.bp("/backend/{AppId}/api/{BackendEnvironmentName}");
381
+ b.p("AppId", () => input.AppId, "{AppId}", false);
382
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
581
383
  let body;
582
384
  body = JSON.stringify(take(input, {
583
385
  resourceConfig: [, (_) => se_BackendAPIResourceConfig(_, context), `ResourceConfig`],
584
386
  resourceName: [, , `ResourceName`],
585
387
  }));
586
- return new __HttpRequest({
587
- protocol,
588
- hostname,
589
- port,
590
- method: "POST",
591
- headers,
592
- path: resolvedPath,
593
- body,
594
- });
388
+ b.m("POST").h(headers).b(body);
389
+ return b.build();
595
390
  };
596
391
  export const se_UpdateBackendAuthCommand = async (input, context) => {
597
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
392
+ const b = rb(input, context);
598
393
  const headers = {
599
394
  "content-type": "application/json",
600
395
  };
601
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
602
- "/backend/{AppId}/auth/{BackendEnvironmentName}";
603
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
604
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
396
+ b.bp("/backend/{AppId}/auth/{BackendEnvironmentName}");
397
+ b.p("AppId", () => input.AppId, "{AppId}", false);
398
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
605
399
  let body;
606
400
  body = JSON.stringify(take(input, {
607
401
  resourceConfig: [, (_) => se_UpdateBackendAuthResourceConfig(_, context), `ResourceConfig`],
608
402
  resourceName: [, , `ResourceName`],
609
403
  }));
610
- return new __HttpRequest({
611
- protocol,
612
- hostname,
613
- port,
614
- method: "POST",
615
- headers,
616
- path: resolvedPath,
617
- body,
618
- });
404
+ b.m("POST").h(headers).b(body);
405
+ return b.build();
619
406
  };
620
407
  export const se_UpdateBackendConfigCommand = async (input, context) => {
621
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
408
+ const b = rb(input, context);
622
409
  const headers = {
623
410
  "content-type": "application/json",
624
411
  };
625
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/backend/{AppId}/config/update";
626
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
412
+ b.bp("/backend/{AppId}/config/update");
413
+ b.p("AppId", () => input.AppId, "{AppId}", false);
627
414
  let body;
628
415
  body = JSON.stringify(take(input, {
629
416
  loginAuthConfig: [, (_) => se_LoginAuthConfigReqObj(_, context), `LoginAuthConfig`],
630
417
  }));
631
- return new __HttpRequest({
632
- protocol,
633
- hostname,
634
- port,
635
- method: "POST",
636
- headers,
637
- path: resolvedPath,
638
- body,
639
- });
418
+ b.m("POST").h(headers).b(body);
419
+ return b.build();
640
420
  };
641
421
  export const se_UpdateBackendJobCommand = async (input, context) => {
642
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
422
+ const b = rb(input, context);
643
423
  const headers = {
644
424
  "content-type": "application/json",
645
425
  };
646
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
647
- "/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}";
648
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
649
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
650
- resolvedPath = __resolvedPath(resolvedPath, input, "JobId", () => input.JobId, "{JobId}", false);
426
+ b.bp("/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}");
427
+ b.p("AppId", () => input.AppId, "{AppId}", false);
428
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
429
+ b.p("JobId", () => input.JobId, "{JobId}", false);
651
430
  let body;
652
431
  body = JSON.stringify(take(input, {
653
432
  operation: [, , `Operation`],
654
433
  status: [, , `Status`],
655
434
  }));
656
- return new __HttpRequest({
657
- protocol,
658
- hostname,
659
- port,
660
- method: "POST",
661
- headers,
662
- path: resolvedPath,
663
- body,
664
- });
435
+ b.m("POST").h(headers).b(body);
436
+ return b.build();
665
437
  };
666
438
  export const se_UpdateBackendStorageCommand = async (input, context) => {
667
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
439
+ const b = rb(input, context);
668
440
  const headers = {
669
441
  "content-type": "application/json",
670
442
  };
671
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
672
- "/backend/{AppId}/storage/{BackendEnvironmentName}";
673
- resolvedPath = __resolvedPath(resolvedPath, input, "AppId", () => input.AppId, "{AppId}", false);
674
- resolvedPath = __resolvedPath(resolvedPath, input, "BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
443
+ b.bp("/backend/{AppId}/storage/{BackendEnvironmentName}");
444
+ b.p("AppId", () => input.AppId, "{AppId}", false);
445
+ b.p("BackendEnvironmentName", () => input.BackendEnvironmentName, "{BackendEnvironmentName}", false);
675
446
  let body;
676
447
  body = JSON.stringify(take(input, {
677
448
  resourceConfig: [, (_) => se_UpdateBackendStorageResourceConfig(_, context), `ResourceConfig`],
678
449
  resourceName: [, , `ResourceName`],
679
450
  }));
680
- return new __HttpRequest({
681
- protocol,
682
- hostname,
683
- port,
684
- method: "POST",
685
- headers,
686
- path: resolvedPath,
687
- body,
688
- });
451
+ b.m("POST").h(headers).b(body);
452
+ return b.build();
689
453
  };
690
454
  export const de_CloneBackendCommand = async (output, context) => {
691
455
  if (output.statusCode !== 200 && output.statusCode >= 300) {