@aws-sdk/client-appsync 3.211.0 → 3.213.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.
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { EvaluateCodeRequestFilterSensitiveLog, EvaluateCodeResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_restJson1EvaluateCodeCommand, serializeAws_restJson1EvaluateCodeCommand, } from "../protocols/Aws_restJson1";
6
+ export class EvaluateCodeCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
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
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, EvaluateCodeCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "AppSyncClient";
25
+ const commandName = "EvaluateCodeCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: EvaluateCodeRequestFilterSensitiveLog,
31
+ outputFilterSensitiveLog: EvaluateCodeResponseFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return serializeAws_restJson1EvaluateCodeCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return deserializeAws_restJson1EvaluateCodeCommand(output, context);
41
+ }
42
+ }
@@ -16,6 +16,7 @@ export * from "./DeleteGraphqlApiCommand";
16
16
  export * from "./DeleteResolverCommand";
17
17
  export * from "./DeleteTypeCommand";
18
18
  export * from "./DisassociateApiCommand";
19
+ export * from "./EvaluateCodeCommand";
19
20
  export * from "./EvaluateMappingTemplateCommand";
20
21
  export * from "./FlushApiCacheCommand";
21
22
  export * from "./GetApiAssociationCommand";
@@ -92,6 +92,14 @@ export class ApiLimitExceededException extends __BaseException {
92
92
  Object.setPrototypeOf(this, ApiLimitExceededException.prototype);
93
93
  }
94
94
  }
95
+ export var RuntimeName;
96
+ (function (RuntimeName) {
97
+ RuntimeName["APPSYNC_JS"] = "APPSYNC_JS";
98
+ })(RuntimeName || (RuntimeName = {}));
99
+ export var BadRequestReason;
100
+ (function (BadRequestReason) {
101
+ BadRequestReason["CODE_ERROR"] = "CODE_ERROR";
102
+ })(BadRequestReason || (BadRequestReason = {}));
95
103
  export class BadRequestException extends __BaseException {
96
104
  constructor(opts) {
97
105
  super({
@@ -102,6 +110,8 @@ export class BadRequestException extends __BaseException {
102
110
  this.name = "BadRequestException";
103
111
  this.$fault = "client";
104
112
  Object.setPrototypeOf(this, BadRequestException.prototype);
113
+ this.reason = opts.reason;
114
+ this.detail = opts.detail;
105
115
  }
106
116
  }
107
117
  export class InternalFailureException extends __BaseException {
@@ -262,12 +272,24 @@ export const ApiCacheFilterSensitiveLog = (obj) => ({
262
272
  export const ApiKeyFilterSensitiveLog = (obj) => ({
263
273
  ...obj,
264
274
  });
275
+ export const AppSyncRuntimeFilterSensitiveLog = (obj) => ({
276
+ ...obj,
277
+ });
265
278
  export const AssociateApiRequestFilterSensitiveLog = (obj) => ({
266
279
  ...obj,
267
280
  });
268
281
  export const AssociateApiResponseFilterSensitiveLog = (obj) => ({
269
282
  ...obj,
270
283
  });
284
+ export const CodeErrorLocationFilterSensitiveLog = (obj) => ({
285
+ ...obj,
286
+ });
287
+ export const CodeErrorFilterSensitiveLog = (obj) => ({
288
+ ...obj,
289
+ });
290
+ export const BadRequestDetailFilterSensitiveLog = (obj) => ({
291
+ ...obj,
292
+ });
271
293
  export const AwsIamConfigFilterSensitiveLog = (obj) => ({
272
294
  ...obj,
273
295
  });
@@ -436,6 +458,15 @@ export const DisassociateApiRequestFilterSensitiveLog = (obj) => ({
436
458
  export const DisassociateApiResponseFilterSensitiveLog = (obj) => ({
437
459
  ...obj,
438
460
  });
461
+ export const EvaluateCodeRequestFilterSensitiveLog = (obj) => ({
462
+ ...obj,
463
+ });
464
+ export const EvaluateCodeErrorDetailFilterSensitiveLog = (obj) => ({
465
+ ...obj,
466
+ });
467
+ export const EvaluateCodeResponseFilterSensitiveLog = (obj) => ({
468
+ ...obj,
469
+ });
439
470
  export const EvaluateMappingTemplateRequestFilterSensitiveLog = (obj) => ({
440
471
  ...obj,
441
472
  });
@@ -144,6 +144,7 @@ export const serializeAws_restJson1CreateFunctionCommand = async (input, context
144
144
  resolvedPath = __resolvedPath(resolvedPath, input, "apiId", () => input.apiId, "{apiId}", false);
145
145
  let body;
146
146
  body = JSON.stringify({
147
+ ...(input.code != null && { code: input.code }),
147
148
  ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
148
149
  ...(input.description != null && { description: input.description }),
149
150
  ...(input.functionVersion != null && { functionVersion: input.functionVersion }),
@@ -151,6 +152,7 @@ export const serializeAws_restJson1CreateFunctionCommand = async (input, context
151
152
  ...(input.name != null && { name: input.name }),
152
153
  ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
153
154
  ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
155
+ ...(input.runtime != null && { runtime: serializeAws_restJson1AppSyncRuntime(input.runtime, context) }),
154
156
  ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
155
157
  });
156
158
  return new __HttpRequest({
@@ -213,6 +215,7 @@ export const serializeAws_restJson1CreateResolverCommand = async (input, context
213
215
  ...(input.cachingConfig != null && {
214
216
  cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context),
215
217
  }),
218
+ ...(input.code != null && { code: input.code }),
216
219
  ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
217
220
  ...(input.fieldName != null && { fieldName: input.fieldName }),
218
221
  ...(input.kind != null && { kind: input.kind }),
@@ -222,6 +225,7 @@ export const serializeAws_restJson1CreateResolverCommand = async (input, context
222
225
  }),
223
226
  ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
224
227
  ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
228
+ ...(input.runtime != null && { runtime: serializeAws_restJson1AppSyncRuntime(input.runtime, context) }),
225
229
  ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
226
230
  });
227
231
  return new __HttpRequest({
@@ -408,6 +412,29 @@ export const serializeAws_restJson1DisassociateApiCommand = async (input, contex
408
412
  body,
409
413
  });
410
414
  };
415
+ export const serializeAws_restJson1EvaluateCodeCommand = async (input, context) => {
416
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
417
+ const headers = {
418
+ "content-type": "application/json",
419
+ };
420
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/dataplane-evaluatecode";
421
+ let body;
422
+ body = JSON.stringify({
423
+ ...(input.code != null && { code: input.code }),
424
+ ...(input.context != null && { context: input.context }),
425
+ ...(input.function != null && { function: input.function }),
426
+ ...(input.runtime != null && { runtime: serializeAws_restJson1AppSyncRuntime(input.runtime, context) }),
427
+ });
428
+ return new __HttpRequest({
429
+ protocol,
430
+ hostname,
431
+ port,
432
+ method: "POST",
433
+ headers,
434
+ path: resolvedPath,
435
+ body,
436
+ });
437
+ };
411
438
  export const serializeAws_restJson1EvaluateMappingTemplateCommand = async (input, context) => {
412
439
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
413
440
  const headers = {
@@ -989,6 +1016,7 @@ export const serializeAws_restJson1UpdateFunctionCommand = async (input, context
989
1016
  resolvedPath = __resolvedPath(resolvedPath, input, "functionId", () => input.functionId, "{functionId}", false);
990
1017
  let body;
991
1018
  body = JSON.stringify({
1019
+ ...(input.code != null && { code: input.code }),
992
1020
  ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
993
1021
  ...(input.description != null && { description: input.description }),
994
1022
  ...(input.functionVersion != null && { functionVersion: input.functionVersion }),
@@ -996,6 +1024,7 @@ export const serializeAws_restJson1UpdateFunctionCommand = async (input, context
996
1024
  ...(input.name != null && { name: input.name }),
997
1025
  ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
998
1026
  ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
1027
+ ...(input.runtime != null && { runtime: serializeAws_restJson1AppSyncRuntime(input.runtime, context) }),
999
1028
  ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
1000
1029
  });
1001
1030
  return new __HttpRequest({
@@ -1059,6 +1088,7 @@ export const serializeAws_restJson1UpdateResolverCommand = async (input, context
1059
1088
  ...(input.cachingConfig != null && {
1060
1089
  cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context),
1061
1090
  }),
1091
+ ...(input.code != null && { code: input.code }),
1062
1092
  ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
1063
1093
  ...(input.kind != null && { kind: input.kind }),
1064
1094
  ...(input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize }),
@@ -1067,6 +1097,7 @@ export const serializeAws_restJson1UpdateResolverCommand = async (input, context
1067
1097
  }),
1068
1098
  ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
1069
1099
  ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
1100
+ ...(input.runtime != null && { runtime: serializeAws_restJson1AppSyncRuntime(input.runtime, context) }),
1070
1101
  ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
1071
1102
  });
1072
1103
  return new __HttpRequest({
@@ -1434,6 +1465,9 @@ const deserializeAws_restJson1CreateResolverCommandError = async (output, contex
1434
1465
  };
1435
1466
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1436
1467
  switch (errorCode) {
1468
+ case "BadRequestException":
1469
+ case "com.amazonaws.appsync#BadRequestException":
1470
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1437
1471
  case "ConcurrentModificationException":
1438
1472
  case "com.amazonaws.appsync#ConcurrentModificationException":
1439
1473
  throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
@@ -1767,6 +1801,9 @@ const deserializeAws_restJson1DeleteResolverCommandError = async (output, contex
1767
1801
  };
1768
1802
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1769
1803
  switch (errorCode) {
1804
+ case "BadRequestException":
1805
+ case "com.amazonaws.appsync#BadRequestException":
1806
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1770
1807
  case "ConcurrentModificationException":
1771
1808
  case "com.amazonaws.appsync#ConcurrentModificationException":
1772
1809
  throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
@@ -1873,6 +1910,51 @@ const deserializeAws_restJson1DisassociateApiCommandError = async (output, conte
1873
1910
  });
1874
1911
  }
1875
1912
  };
1913
+ export const deserializeAws_restJson1EvaluateCodeCommand = async (output, context) => {
1914
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1915
+ return deserializeAws_restJson1EvaluateCodeCommandError(output, context);
1916
+ }
1917
+ const contents = map({
1918
+ $metadata: deserializeMetadata(output),
1919
+ });
1920
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1921
+ if (data.error != null) {
1922
+ contents.error = deserializeAws_restJson1EvaluateCodeErrorDetail(data.error, context);
1923
+ }
1924
+ if (data.evaluationResult != null) {
1925
+ contents.evaluationResult = __expectString(data.evaluationResult);
1926
+ }
1927
+ if (data.logs != null) {
1928
+ contents.logs = deserializeAws_restJson1Logs(data.logs, context);
1929
+ }
1930
+ return contents;
1931
+ };
1932
+ const deserializeAws_restJson1EvaluateCodeCommandError = async (output, context) => {
1933
+ const parsedOutput = {
1934
+ ...output,
1935
+ body: await parseErrorBody(output.body, context),
1936
+ };
1937
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1938
+ switch (errorCode) {
1939
+ case "AccessDeniedException":
1940
+ case "com.amazonaws.appsync#AccessDeniedException":
1941
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1942
+ case "BadRequestException":
1943
+ case "com.amazonaws.appsync#BadRequestException":
1944
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1945
+ case "InternalFailureException":
1946
+ case "com.amazonaws.appsync#InternalFailureException":
1947
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
1948
+ default:
1949
+ const parsedBody = parsedOutput.body;
1950
+ throwDefaultError({
1951
+ output,
1952
+ parsedBody,
1953
+ exceptionCtor: __BaseException,
1954
+ errorCode,
1955
+ });
1956
+ }
1957
+ };
1876
1958
  export const deserializeAws_restJson1EvaluateMappingTemplateCommand = async (output, context) => {
1877
1959
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1878
1960
  return deserializeAws_restJson1EvaluateMappingTemplateCommandError(output, context);
@@ -1887,6 +1969,9 @@ export const deserializeAws_restJson1EvaluateMappingTemplateCommand = async (out
1887
1969
  if (data.evaluationResult != null) {
1888
1970
  contents.evaluationResult = __expectString(data.evaluationResult);
1889
1971
  }
1972
+ if (data.logs != null) {
1973
+ contents.logs = deserializeAws_restJson1Logs(data.logs, context);
1974
+ }
1890
1975
  return contents;
1891
1976
  };
1892
1977
  const deserializeAws_restJson1EvaluateMappingTemplateCommandError = async (output, context) => {
@@ -3217,6 +3302,9 @@ const deserializeAws_restJson1UpdateResolverCommandError = async (output, contex
3217
3302
  };
3218
3303
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3219
3304
  switch (errorCode) {
3305
+ case "BadRequestException":
3306
+ case "com.amazonaws.appsync#BadRequestException":
3307
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3220
3308
  case "ConcurrentModificationException":
3221
3309
  case "com.amazonaws.appsync#ConcurrentModificationException":
3222
3310
  throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
@@ -3336,9 +3424,15 @@ const deserializeAws_restJson1ApiLimitExceededExceptionResponse = async (parsedO
3336
3424
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
3337
3425
  const contents = map({});
3338
3426
  const data = parsedOutput.body;
3427
+ if (data.detail != null) {
3428
+ contents.detail = deserializeAws_restJson1BadRequestDetail(data.detail, context);
3429
+ }
3339
3430
  if (data.message != null) {
3340
3431
  contents.message = __expectString(data.message);
3341
3432
  }
3433
+ if (data.reason != null) {
3434
+ contents.reason = __expectString(data.reason);
3435
+ }
3342
3436
  const exception = new BadRequestException({
3343
3437
  $metadata: deserializeMetadata(parsedOutput),
3344
3438
  ...contents,
@@ -3438,6 +3532,12 @@ const serializeAws_restJson1AdditionalAuthenticationProviders = (input, context)
3438
3532
  return serializeAws_restJson1AdditionalAuthenticationProvider(entry, context);
3439
3533
  });
3440
3534
  };
3535
+ const serializeAws_restJson1AppSyncRuntime = (input, context) => {
3536
+ return {
3537
+ ...(input.name != null && { name: input.name }),
3538
+ ...(input.runtimeVersion != null && { runtimeVersion: input.runtimeVersion }),
3539
+ };
3540
+ };
3441
3541
  const serializeAws_restJson1AuthorizationConfig = (input, context) => {
3442
3542
  return {
3443
3543
  ...(input.authorizationType != null && { authorizationType: input.authorizationType }),
@@ -3591,10 +3691,8 @@ const serializeAws_restJson1TagMap = (input, context) => {
3591
3691
  if (value === null) {
3592
3692
  return acc;
3593
3693
  }
3594
- return {
3595
- ...acc,
3596
- [key]: value,
3597
- };
3694
+ acc[key] = value;
3695
+ return acc;
3598
3696
  }, {});
3599
3697
  };
3600
3698
  const serializeAws_restJson1UserPoolConfig = (input, context) => {
@@ -3667,6 +3765,12 @@ const deserializeAws_restJson1ApiKeys = (output, context) => {
3667
3765
  });
3668
3766
  return retVal;
3669
3767
  };
3768
+ const deserializeAws_restJson1AppSyncRuntime = (output, context) => {
3769
+ return {
3770
+ name: __expectString(output.name),
3771
+ runtimeVersion: __expectString(output.runtimeVersion),
3772
+ };
3773
+ };
3670
3774
  const deserializeAws_restJson1AuthorizationConfig = (output, context) => {
3671
3775
  return {
3672
3776
  authorizationType: __expectString(output.authorizationType),
@@ -3679,6 +3783,11 @@ const deserializeAws_restJson1AwsIamConfig = (output, context) => {
3679
3783
  signingServiceName: __expectString(output.signingServiceName),
3680
3784
  };
3681
3785
  };
3786
+ const deserializeAws_restJson1BadRequestDetail = (output, context) => {
3787
+ return {
3788
+ codeErrors: output.codeErrors != null ? deserializeAws_restJson1CodeErrors(output.codeErrors, context) : undefined,
3789
+ };
3790
+ };
3682
3791
  const deserializeAws_restJson1CachingConfig = (output, context) => {
3683
3792
  return {
3684
3793
  cachingKeys: output.cachingKeys != null ? deserializeAws_restJson1CachingKeys(output.cachingKeys, context) : undefined,
@@ -3696,6 +3805,31 @@ const deserializeAws_restJson1CachingKeys = (output, context) => {
3696
3805
  });
3697
3806
  return retVal;
3698
3807
  };
3808
+ const deserializeAws_restJson1CodeError = (output, context) => {
3809
+ return {
3810
+ errorType: __expectString(output.errorType),
3811
+ location: output.location != null ? deserializeAws_restJson1CodeErrorLocation(output.location, context) : undefined,
3812
+ value: __expectString(output.value),
3813
+ };
3814
+ };
3815
+ const deserializeAws_restJson1CodeErrorLocation = (output, context) => {
3816
+ return {
3817
+ column: __expectInt32(output.column),
3818
+ line: __expectInt32(output.line),
3819
+ span: __expectInt32(output.span),
3820
+ };
3821
+ };
3822
+ const deserializeAws_restJson1CodeErrors = (output, context) => {
3823
+ const retVal = (output || [])
3824
+ .filter((e) => e != null)
3825
+ .map((entry) => {
3826
+ if (entry === null) {
3827
+ return null;
3828
+ }
3829
+ return deserializeAws_restJson1CodeError(entry, context);
3830
+ });
3831
+ return retVal;
3832
+ };
3699
3833
  const deserializeAws_restJson1CognitoUserPoolConfig = (output, context) => {
3700
3834
  return {
3701
3835
  appIdClientRegex: __expectString(output.appIdClientRegex),
@@ -3788,8 +3922,15 @@ const deserializeAws_restJson1ErrorDetail = (output, context) => {
3788
3922
  message: __expectString(output.message),
3789
3923
  };
3790
3924
  };
3925
+ const deserializeAws_restJson1EvaluateCodeErrorDetail = (output, context) => {
3926
+ return {
3927
+ codeErrors: output.codeErrors != null ? deserializeAws_restJson1CodeErrors(output.codeErrors, context) : undefined,
3928
+ message: __expectString(output.message),
3929
+ };
3930
+ };
3791
3931
  const deserializeAws_restJson1FunctionConfiguration = (output, context) => {
3792
3932
  return {
3933
+ code: __expectString(output.code),
3793
3934
  dataSourceName: __expectString(output.dataSourceName),
3794
3935
  description: __expectString(output.description),
3795
3936
  functionArn: __expectString(output.functionArn),
@@ -3799,6 +3940,7 @@ const deserializeAws_restJson1FunctionConfiguration = (output, context) => {
3799
3940
  name: __expectString(output.name),
3800
3941
  requestMappingTemplate: __expectString(output.requestMappingTemplate),
3801
3942
  responseMappingTemplate: __expectString(output.responseMappingTemplate),
3943
+ runtime: output.runtime != null ? deserializeAws_restJson1AppSyncRuntime(output.runtime, context) : undefined,
3802
3944
  syncConfig: output.syncConfig != null ? deserializeAws_restJson1SyncConfig(output.syncConfig, context) : undefined,
3803
3945
  };
3804
3946
  };
@@ -3892,15 +4034,24 @@ const deserializeAws_restJson1LogConfig = (output, context) => {
3892
4034
  fieldLogLevel: __expectString(output.fieldLogLevel),
3893
4035
  };
3894
4036
  };
4037
+ const deserializeAws_restJson1Logs = (output, context) => {
4038
+ const retVal = (output || [])
4039
+ .filter((e) => e != null)
4040
+ .map((entry) => {
4041
+ if (entry === null) {
4042
+ return null;
4043
+ }
4044
+ return __expectString(entry);
4045
+ });
4046
+ return retVal;
4047
+ };
3895
4048
  const deserializeAws_restJson1MapOfStringToString = (output, context) => {
3896
4049
  return Object.entries(output).reduce((acc, [key, value]) => {
3897
4050
  if (value === null) {
3898
4051
  return acc;
3899
4052
  }
3900
- return {
3901
- ...acc,
3902
- [key]: __expectString(value),
3903
- };
4053
+ acc[key] = __expectString(value);
4054
+ return acc;
3904
4055
  }, {});
3905
4056
  };
3906
4057
  const deserializeAws_restJson1OpenIDConnectConfig = (output, context) => {
@@ -3942,6 +4093,7 @@ const deserializeAws_restJson1RelationalDatabaseDataSourceConfig = (output, cont
3942
4093
  const deserializeAws_restJson1Resolver = (output, context) => {
3943
4094
  return {
3944
4095
  cachingConfig: output.cachingConfig != null ? deserializeAws_restJson1CachingConfig(output.cachingConfig, context) : undefined,
4096
+ code: __expectString(output.code),
3945
4097
  dataSourceName: __expectString(output.dataSourceName),
3946
4098
  fieldName: __expectString(output.fieldName),
3947
4099
  kind: __expectString(output.kind),
@@ -3952,6 +4104,7 @@ const deserializeAws_restJson1Resolver = (output, context) => {
3952
4104
  requestMappingTemplate: __expectString(output.requestMappingTemplate),
3953
4105
  resolverArn: __expectString(output.resolverArn),
3954
4106
  responseMappingTemplate: __expectString(output.responseMappingTemplate),
4107
+ runtime: output.runtime != null ? deserializeAws_restJson1AppSyncRuntime(output.runtime, context) : undefined,
3955
4108
  syncConfig: output.syncConfig != null ? deserializeAws_restJson1SyncConfig(output.syncConfig, context) : undefined,
3956
4109
  typeName: __expectString(output.typeName),
3957
4110
  };
@@ -3981,10 +4134,8 @@ const deserializeAws_restJson1TagMap = (output, context) => {
3981
4134
  if (value === null) {
3982
4135
  return acc;
3983
4136
  }
3984
- return {
3985
- ...acc,
3986
- [key]: __expectString(value),
3987
- };
4137
+ acc[key] = __expectString(value);
4138
+ return acc;
3988
4139
  }, {});
3989
4140
  };
3990
4141
  const deserializeAws_restJson1Type = (output, context) => {
@@ -18,6 +18,7 @@ import { DeleteGraphqlApiCommandInput, DeleteGraphqlApiCommandOutput } from "./c
18
18
  import { DeleteResolverCommandInput, DeleteResolverCommandOutput } from "./commands/DeleteResolverCommand";
19
19
  import { DeleteTypeCommandInput, DeleteTypeCommandOutput } from "./commands/DeleteTypeCommand";
20
20
  import { DisassociateApiCommandInput, DisassociateApiCommandOutput } from "./commands/DisassociateApiCommand";
21
+ import { EvaluateCodeCommandInput, EvaluateCodeCommandOutput } from "./commands/EvaluateCodeCommand";
21
22
  import { EvaluateMappingTemplateCommandInput, EvaluateMappingTemplateCommandOutput } from "./commands/EvaluateMappingTemplateCommand";
22
23
  import { FlushApiCacheCommandInput, FlushApiCacheCommandOutput } from "./commands/FlushApiCacheCommand";
23
24
  import { GetApiAssociationCommandInput, GetApiAssociationCommandOutput } from "./commands/GetApiAssociationCommand";
@@ -51,8 +52,8 @@ import { UpdateGraphqlApiCommandInput, UpdateGraphqlApiCommandOutput } from "./c
51
52
  import { UpdateResolverCommandInput, UpdateResolverCommandOutput } from "./commands/UpdateResolverCommand";
52
53
  import { UpdateTypeCommandInput, UpdateTypeCommandOutput } from "./commands/UpdateTypeCommand";
53
54
  /**
54
- * <p>AppSync provides API actions for creating and interacting with data
55
- * sources using GraphQL from your application.</p>
55
+ * <p>AppSync provides API actions for creating and interacting with data sources using GraphQL
56
+ * from your application.</p>
56
57
  */
57
58
  export declare class AppSync extends AppSyncClient {
58
59
  /**
@@ -87,8 +88,7 @@ export declare class AppSync extends AppSyncClient {
87
88
  createDomainName(args: CreateDomainNameCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateDomainNameCommandOutput) => void): void;
88
89
  /**
89
90
  * <p>Creates a <code>Function</code> object.</p>
90
- * <p>A function is a reusable entity. You can use multiple functions to compose the resolver
91
- * logic.</p>
91
+ * <p>A function is a reusable entity. You can use multiple functions to compose the resolver logic.</p>
92
92
  */
93
93
  createFunction(args: CreateFunctionCommandInput, options?: __HttpHandlerOptions): Promise<CreateFunctionCommandOutput>;
94
94
  createFunction(args: CreateFunctionCommandInput, cb: (err: any, data?: CreateFunctionCommandOutput) => void): void;
@@ -101,8 +101,8 @@ export declare class AppSync extends AppSyncClient {
101
101
  createGraphqlApi(args: CreateGraphqlApiCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateGraphqlApiCommandOutput) => void): void;
102
102
  /**
103
103
  * <p>Creates a <code>Resolver</code> object.</p>
104
- * <p>A resolver converts incoming requests into a format that a data source can understand,
105
- * and converts the data source's responses into GraphQL.</p>
104
+ * <p>A resolver converts incoming requests into a format that a data source can understand, and converts the data
105
+ * source's responses into GraphQL.</p>
106
106
  */
107
107
  createResolver(args: CreateResolverCommandInput, options?: __HttpHandlerOptions): Promise<CreateResolverCommandOutput>;
108
108
  createResolver(args: CreateResolverCommandInput, cb: (err: any, data?: CreateResolverCommandOutput) => void): void;
@@ -168,12 +168,21 @@ export declare class AppSync extends AppSyncClient {
168
168
  disassociateApi(args: DisassociateApiCommandInput, cb: (err: any, data?: DisassociateApiCommandOutput) => void): void;
169
169
  disassociateApi(args: DisassociateApiCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DisassociateApiCommandOutput) => void): void;
170
170
  /**
171
- * <p>Evaluates a given template and returns the response. The mapping template can be a
172
- * request or response template.</p>
173
- * <p>Request templates take the incoming request after a GraphQL operation is parsed and
174
- * convert it into a request configuration for the selected data source operation. Response
175
- * templates interpret responses from the data source and map it to the shape of the GraphQL
176
- * field output type.</p>
171
+ * <p>Evaluates the given code and returns the response. The code definition requirements depend on the specified
172
+ * runtime. For <code>APPSYNC_JS</code> runtimes, the code defines the request and response functions. The request
173
+ * function takes the incoming request after a GraphQL operation is parsed and converts it into a request
174
+ * configuration for the selected data source operation. The response function interprets responses from the data
175
+ * source and maps it to the shape of the GraphQL field output type. </p>
176
+ */
177
+ evaluateCode(args: EvaluateCodeCommandInput, options?: __HttpHandlerOptions): Promise<EvaluateCodeCommandOutput>;
178
+ evaluateCode(args: EvaluateCodeCommandInput, cb: (err: any, data?: EvaluateCodeCommandOutput) => void): void;
179
+ evaluateCode(args: EvaluateCodeCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: EvaluateCodeCommandOutput) => void): void;
180
+ /**
181
+ * <p>Evaluates a given template and returns the response. The mapping template can be a request or response
182
+ * template.</p>
183
+ * <p>Request templates take the incoming request after a GraphQL operation is parsed and convert it into a
184
+ * request configuration for the selected data source operation. Response templates interpret responses from the
185
+ * data source and map it to the shape of the GraphQL field output type.</p>
177
186
  * <p>Mapping templates are written in the Apache Velocity Template Language (VTL).</p>
178
187
  */
179
188
  evaluateMappingTemplate(args: EvaluateMappingTemplateCommandInput, options?: __HttpHandlerOptions): Promise<EvaluateMappingTemplateCommandOutput>;
@@ -248,10 +257,9 @@ export declare class AppSync extends AppSyncClient {
248
257
  /**
249
258
  * <p>Lists the API keys for a given API.</p>
250
259
  * <note>
251
- * <p>API keys are deleted automatically 60 days after they expire. However, they may still
252
- * be included in the response until they have actually been deleted. You can safely call
253
- * <code>DeleteApiKey</code> to manually delete a key before it's automatically
254
- * deleted.</p>
260
+ * <p>API keys are deleted automatically 60 days after they expire. However, they may still be included in the
261
+ * response until they have actually been deleted. You can safely call <code>DeleteApiKey</code> to manually
262
+ * delete a key before it's automatically deleted.</p>
255
263
  * </note>
256
264
  */
257
265
  listApiKeys(args: ListApiKeysCommandInput, options?: __HttpHandlerOptions): Promise<ListApiKeysCommandOutput>;
@@ -307,8 +315,8 @@ export declare class AppSync extends AppSyncClient {
307
315
  listTypes(args: ListTypesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListTypesCommandOutput) => void): void;
308
316
  /**
309
317
  * <p>Adds a new schema to your GraphQL API.</p>
310
- * <p>This operation is asynchronous. Use to
311
- * determine when it has completed.</p>
318
+ * <p>This operation is asynchronous. Use to determine when it has
319
+ * completed.</p>
312
320
  */
313
321
  startSchemaCreation(args: StartSchemaCreationCommandInput, options?: __HttpHandlerOptions): Promise<StartSchemaCreationCommandOutput>;
314
322
  startSchemaCreation(args: StartSchemaCreationCommandInput, cb: (err: any, data?: StartSchemaCreationCommandOutput) => void): void;
@@ -25,6 +25,7 @@ import { DeleteGraphqlApiCommandInput, DeleteGraphqlApiCommandOutput } from "./c
25
25
  import { DeleteResolverCommandInput, DeleteResolverCommandOutput } from "./commands/DeleteResolverCommand";
26
26
  import { DeleteTypeCommandInput, DeleteTypeCommandOutput } from "./commands/DeleteTypeCommand";
27
27
  import { DisassociateApiCommandInput, DisassociateApiCommandOutput } from "./commands/DisassociateApiCommand";
28
+ import { EvaluateCodeCommandInput, EvaluateCodeCommandOutput } from "./commands/EvaluateCodeCommand";
28
29
  import { EvaluateMappingTemplateCommandInput, EvaluateMappingTemplateCommandOutput } from "./commands/EvaluateMappingTemplateCommand";
29
30
  import { FlushApiCacheCommandInput, FlushApiCacheCommandOutput } from "./commands/FlushApiCacheCommand";
30
31
  import { GetApiAssociationCommandInput, GetApiAssociationCommandOutput } from "./commands/GetApiAssociationCommand";
@@ -58,8 +59,8 @@ import { UpdateGraphqlApiCommandInput, UpdateGraphqlApiCommandOutput } from "./c
58
59
  import { UpdateResolverCommandInput, UpdateResolverCommandOutput } from "./commands/UpdateResolverCommand";
59
60
  import { UpdateTypeCommandInput, UpdateTypeCommandOutput } from "./commands/UpdateTypeCommand";
60
61
  import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
61
- export declare type ServiceInputTypes = AssociateApiCommandInput | CreateApiCacheCommandInput | CreateApiKeyCommandInput | CreateDataSourceCommandInput | CreateDomainNameCommandInput | CreateFunctionCommandInput | CreateGraphqlApiCommandInput | CreateResolverCommandInput | CreateTypeCommandInput | DeleteApiCacheCommandInput | DeleteApiKeyCommandInput | DeleteDataSourceCommandInput | DeleteDomainNameCommandInput | DeleteFunctionCommandInput | DeleteGraphqlApiCommandInput | DeleteResolverCommandInput | DeleteTypeCommandInput | DisassociateApiCommandInput | EvaluateMappingTemplateCommandInput | FlushApiCacheCommandInput | GetApiAssociationCommandInput | GetApiCacheCommandInput | GetDataSourceCommandInput | GetDomainNameCommandInput | GetFunctionCommandInput | GetGraphqlApiCommandInput | GetIntrospectionSchemaCommandInput | GetResolverCommandInput | GetSchemaCreationStatusCommandInput | GetTypeCommandInput | ListApiKeysCommandInput | ListDataSourcesCommandInput | ListDomainNamesCommandInput | ListFunctionsCommandInput | ListGraphqlApisCommandInput | ListResolversByFunctionCommandInput | ListResolversCommandInput | ListTagsForResourceCommandInput | ListTypesCommandInput | StartSchemaCreationCommandInput | TagResourceCommandInput | UntagResourceCommandInput | UpdateApiCacheCommandInput | UpdateApiKeyCommandInput | UpdateDataSourceCommandInput | UpdateDomainNameCommandInput | UpdateFunctionCommandInput | UpdateGraphqlApiCommandInput | UpdateResolverCommandInput | UpdateTypeCommandInput;
62
- export declare type ServiceOutputTypes = AssociateApiCommandOutput | CreateApiCacheCommandOutput | CreateApiKeyCommandOutput | CreateDataSourceCommandOutput | CreateDomainNameCommandOutput | CreateFunctionCommandOutput | CreateGraphqlApiCommandOutput | CreateResolverCommandOutput | CreateTypeCommandOutput | DeleteApiCacheCommandOutput | DeleteApiKeyCommandOutput | DeleteDataSourceCommandOutput | DeleteDomainNameCommandOutput | DeleteFunctionCommandOutput | DeleteGraphqlApiCommandOutput | DeleteResolverCommandOutput | DeleteTypeCommandOutput | DisassociateApiCommandOutput | EvaluateMappingTemplateCommandOutput | FlushApiCacheCommandOutput | GetApiAssociationCommandOutput | GetApiCacheCommandOutput | GetDataSourceCommandOutput | GetDomainNameCommandOutput | GetFunctionCommandOutput | GetGraphqlApiCommandOutput | GetIntrospectionSchemaCommandOutput | GetResolverCommandOutput | GetSchemaCreationStatusCommandOutput | GetTypeCommandOutput | ListApiKeysCommandOutput | ListDataSourcesCommandOutput | ListDomainNamesCommandOutput | ListFunctionsCommandOutput | ListGraphqlApisCommandOutput | ListResolversByFunctionCommandOutput | ListResolversCommandOutput | ListTagsForResourceCommandOutput | ListTypesCommandOutput | StartSchemaCreationCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput | UpdateApiCacheCommandOutput | UpdateApiKeyCommandOutput | UpdateDataSourceCommandOutput | UpdateDomainNameCommandOutput | UpdateFunctionCommandOutput | UpdateGraphqlApiCommandOutput | UpdateResolverCommandOutput | UpdateTypeCommandOutput;
62
+ export declare type ServiceInputTypes = AssociateApiCommandInput | CreateApiCacheCommandInput | CreateApiKeyCommandInput | CreateDataSourceCommandInput | CreateDomainNameCommandInput | CreateFunctionCommandInput | CreateGraphqlApiCommandInput | CreateResolverCommandInput | CreateTypeCommandInput | DeleteApiCacheCommandInput | DeleteApiKeyCommandInput | DeleteDataSourceCommandInput | DeleteDomainNameCommandInput | DeleteFunctionCommandInput | DeleteGraphqlApiCommandInput | DeleteResolverCommandInput | DeleteTypeCommandInput | DisassociateApiCommandInput | EvaluateCodeCommandInput | EvaluateMappingTemplateCommandInput | FlushApiCacheCommandInput | GetApiAssociationCommandInput | GetApiCacheCommandInput | GetDataSourceCommandInput | GetDomainNameCommandInput | GetFunctionCommandInput | GetGraphqlApiCommandInput | GetIntrospectionSchemaCommandInput | GetResolverCommandInput | GetSchemaCreationStatusCommandInput | GetTypeCommandInput | ListApiKeysCommandInput | ListDataSourcesCommandInput | ListDomainNamesCommandInput | ListFunctionsCommandInput | ListGraphqlApisCommandInput | ListResolversByFunctionCommandInput | ListResolversCommandInput | ListTagsForResourceCommandInput | ListTypesCommandInput | StartSchemaCreationCommandInput | TagResourceCommandInput | UntagResourceCommandInput | UpdateApiCacheCommandInput | UpdateApiKeyCommandInput | UpdateDataSourceCommandInput | UpdateDomainNameCommandInput | UpdateFunctionCommandInput | UpdateGraphqlApiCommandInput | UpdateResolverCommandInput | UpdateTypeCommandInput;
63
+ export declare type ServiceOutputTypes = AssociateApiCommandOutput | CreateApiCacheCommandOutput | CreateApiKeyCommandOutput | CreateDataSourceCommandOutput | CreateDomainNameCommandOutput | CreateFunctionCommandOutput | CreateGraphqlApiCommandOutput | CreateResolverCommandOutput | CreateTypeCommandOutput | DeleteApiCacheCommandOutput | DeleteApiKeyCommandOutput | DeleteDataSourceCommandOutput | DeleteDomainNameCommandOutput | DeleteFunctionCommandOutput | DeleteGraphqlApiCommandOutput | DeleteResolverCommandOutput | DeleteTypeCommandOutput | DisassociateApiCommandOutput | EvaluateCodeCommandOutput | EvaluateMappingTemplateCommandOutput | FlushApiCacheCommandOutput | GetApiAssociationCommandOutput | GetApiCacheCommandOutput | GetDataSourceCommandOutput | GetDomainNameCommandOutput | GetFunctionCommandOutput | GetGraphqlApiCommandOutput | GetIntrospectionSchemaCommandOutput | GetResolverCommandOutput | GetSchemaCreationStatusCommandOutput | GetTypeCommandOutput | ListApiKeysCommandOutput | ListDataSourcesCommandOutput | ListDomainNamesCommandOutput | ListFunctionsCommandOutput | ListGraphqlApisCommandOutput | ListResolversByFunctionCommandOutput | ListResolversCommandOutput | ListTagsForResourceCommandOutput | ListTypesCommandOutput | StartSchemaCreationCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput | UpdateApiCacheCommandOutput | UpdateApiKeyCommandOutput | UpdateDataSourceCommandOutput | UpdateDomainNameCommandOutput | UpdateFunctionCommandOutput | UpdateGraphqlApiCommandOutput | UpdateResolverCommandOutput | UpdateTypeCommandOutput;
63
64
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
64
65
  /**
65
66
  * The HTTP handler to use. Fetch in browser and Https in Nodejs.
@@ -173,8 +174,8 @@ declare type AppSyncClientResolvedConfigType = __SmithyResolvedConfiguration<__H
173
174
  export interface AppSyncClientResolvedConfig extends AppSyncClientResolvedConfigType {
174
175
  }
175
176
  /**
176
- * <p>AppSync provides API actions for creating and interacting with data
177
- * sources using GraphQL from your application.</p>
177
+ * <p>AppSync provides API actions for creating and interacting with data sources using GraphQL
178
+ * from your application.</p>
178
179
  */
179
180
  export declare class AppSyncClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, AppSyncClientResolvedConfig> {
180
181
  /**
@@ -9,8 +9,7 @@ export interface CreateFunctionCommandOutput extends CreateFunctionResponse, __M
9
9
  }
10
10
  /**
11
11
  * <p>Creates a <code>Function</code> object.</p>
12
- * <p>A function is a reusable entity. You can use multiple functions to compose the resolver
13
- * logic.</p>
12
+ * <p>A function is a reusable entity. You can use multiple functions to compose the resolver logic.</p>
14
13
  * @example
15
14
  * Use a bare-bones client and the command you need to make an API call.
16
15
  * ```javascript
@@ -9,8 +9,8 @@ export interface CreateResolverCommandOutput extends CreateResolverResponse, __M
9
9
  }
10
10
  /**
11
11
  * <p>Creates a <code>Resolver</code> object.</p>
12
- * <p>A resolver converts incoming requests into a format that a data source can understand,
13
- * and converts the data source's responses into GraphQL.</p>
12
+ * <p>A resolver converts incoming requests into a format that a data source can understand, and converts the data
13
+ * source's responses into GraphQL.</p>
14
14
  * @example
15
15
  * Use a bare-bones client and the command you need to make an API call.
16
16
  * ```javascript