@aws-sdk/client-cognito-sync 3.180.0 → 3.183.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 (30) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_restJson1.js +23 -17
  3. package/dist-es/CognitoSync.js +70 -77
  4. package/dist-es/CognitoSyncClient.js +22 -28
  5. package/dist-es/commands/BulkPublishCommand.js +21 -28
  6. package/dist-es/commands/DeleteDatasetCommand.js +21 -28
  7. package/dist-es/commands/DescribeDatasetCommand.js +21 -28
  8. package/dist-es/commands/DescribeIdentityPoolUsageCommand.js +21 -28
  9. package/dist-es/commands/DescribeIdentityUsageCommand.js +21 -28
  10. package/dist-es/commands/GetBulkPublishDetailsCommand.js +21 -28
  11. package/dist-es/commands/GetCognitoEventsCommand.js +21 -28
  12. package/dist-es/commands/GetIdentityPoolConfigurationCommand.js +21 -28
  13. package/dist-es/commands/ListDatasetsCommand.js +21 -28
  14. package/dist-es/commands/ListIdentityPoolUsageCommand.js +21 -28
  15. package/dist-es/commands/ListRecordsCommand.js +21 -28
  16. package/dist-es/commands/RegisterDeviceCommand.js +21 -28
  17. package/dist-es/commands/SetCognitoEventsCommand.js +22 -29
  18. package/dist-es/commands/SetIdentityPoolConfigurationCommand.js +21 -28
  19. package/dist-es/commands/SubscribeToDatasetCommand.js +21 -28
  20. package/dist-es/commands/UnsubscribeFromDatasetCommand.js +21 -28
  21. package/dist-es/commands/UpdateRecordsCommand.js +21 -28
  22. package/dist-es/endpoints.js +8 -8
  23. package/dist-es/models/CognitoSyncServiceException.js +5 -10
  24. package/dist-es/models/models_0.js +263 -184
  25. package/dist-es/protocols/Aws_restJson1.js +1389 -1929
  26. package/dist-es/runtimeConfig.browser.js +26 -12
  27. package/dist-es/runtimeConfig.js +30 -12
  28. package/dist-es/runtimeConfig.native.js +8 -5
  29. package/dist-es/runtimeConfig.shared.js +8 -11
  30. package/package.json +33 -33
package/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-cognito-sync
9
+
10
+
11
+
12
+
13
+
14
+ # [3.181.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.180.0...v3.181.0) (2022-09-29)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **clients:** make parseErrorBody async ([#3999](https://github.com/aws/aws-sdk-js-v3/issues/3999)) ([2558c93](https://github.com/aws/aws-sdk-js-v3/commit/2558c93c050357ac6dc47aa0452b15b12ebfd676))
20
+ * **clients:** populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/issues/3995)) ([02e47f1](https://github.com/aws/aws-sdk-js-v3/commit/02e47f14397ae0a5d2e2883350d038b307fdcdb4))
21
+
22
+
23
+
24
+
25
+
6
26
  # [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
7
27
 
8
28
  **Note:** Version bump only for package @aws-sdk/client-cognito-sync
@@ -386,7 +386,7 @@ exports.deserializeAws_restJson1BulkPublishCommand = deserializeAws_restJson1Bul
386
386
  const deserializeAws_restJson1BulkPublishCommandError = async (output, context) => {
387
387
  const parsedOutput = {
388
388
  ...output,
389
- body: await parseBody(output.body, context),
389
+ body: await parseErrorBody(output.body, context),
390
390
  };
391
391
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
392
392
  switch (errorCode) {
@@ -435,7 +435,7 @@ exports.deserializeAws_restJson1DeleteDatasetCommand = deserializeAws_restJson1D
435
435
  const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context) => {
436
436
  const parsedOutput = {
437
437
  ...output,
438
- body: await parseBody(output.body, context),
438
+ body: await parseErrorBody(output.body, context),
439
439
  };
440
440
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
441
441
  switch (errorCode) {
@@ -484,7 +484,7 @@ exports.deserializeAws_restJson1DescribeDatasetCommand = deserializeAws_restJson
484
484
  const deserializeAws_restJson1DescribeDatasetCommandError = async (output, context) => {
485
485
  const parsedOutput = {
486
486
  ...output,
487
- body: await parseBody(output.body, context),
487
+ body: await parseErrorBody(output.body, context),
488
488
  };
489
489
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
490
490
  switch (errorCode) {
@@ -530,7 +530,7 @@ exports.deserializeAws_restJson1DescribeIdentityPoolUsageCommand = deserializeAw
530
530
  const deserializeAws_restJson1DescribeIdentityPoolUsageCommandError = async (output, context) => {
531
531
  const parsedOutput = {
532
532
  ...output,
533
- body: await parseBody(output.body, context),
533
+ body: await parseErrorBody(output.body, context),
534
534
  };
535
535
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
536
536
  switch (errorCode) {
@@ -576,7 +576,7 @@ exports.deserializeAws_restJson1DescribeIdentityUsageCommand = deserializeAws_re
576
576
  const deserializeAws_restJson1DescribeIdentityUsageCommandError = async (output, context) => {
577
577
  const parsedOutput = {
578
578
  ...output,
579
- body: await parseBody(output.body, context),
579
+ body: await parseErrorBody(output.body, context),
580
580
  };
581
581
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
582
582
  switch (errorCode) {
@@ -634,7 +634,7 @@ exports.deserializeAws_restJson1GetBulkPublishDetailsCommand = deserializeAws_re
634
634
  const deserializeAws_restJson1GetBulkPublishDetailsCommandError = async (output, context) => {
635
635
  const parsedOutput = {
636
636
  ...output,
637
- body: await parseBody(output.body, context),
637
+ body: await parseErrorBody(output.body, context),
638
638
  };
639
639
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
640
640
  switch (errorCode) {
@@ -677,7 +677,7 @@ exports.deserializeAws_restJson1GetCognitoEventsCommand = deserializeAws_restJso
677
677
  const deserializeAws_restJson1GetCognitoEventsCommandError = async (output, context) => {
678
678
  const parsedOutput = {
679
679
  ...output,
680
- body: await parseBody(output.body, context),
680
+ body: await parseErrorBody(output.body, context),
681
681
  };
682
682
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
683
683
  switch (errorCode) {
@@ -729,7 +729,7 @@ exports.deserializeAws_restJson1GetIdentityPoolConfigurationCommand = deserializ
729
729
  const deserializeAws_restJson1GetIdentityPoolConfigurationCommandError = async (output, context) => {
730
730
  const parsedOutput = {
731
731
  ...output,
732
- body: await parseBody(output.body, context),
732
+ body: await parseErrorBody(output.body, context),
733
733
  };
734
734
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
735
735
  switch (errorCode) {
@@ -781,7 +781,7 @@ exports.deserializeAws_restJson1ListDatasetsCommand = deserializeAws_restJson1Li
781
781
  const deserializeAws_restJson1ListDatasetsCommandError = async (output, context) => {
782
782
  const parsedOutput = {
783
783
  ...output,
784
- body: await parseBody(output.body, context),
784
+ body: await parseErrorBody(output.body, context),
785
785
  };
786
786
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
787
787
  switch (errorCode) {
@@ -833,7 +833,7 @@ exports.deserializeAws_restJson1ListIdentityPoolUsageCommand = deserializeAws_re
833
833
  const deserializeAws_restJson1ListIdentityPoolUsageCommandError = async (output, context) => {
834
834
  const parsedOutput = {
835
835
  ...output,
836
- body: await parseBody(output.body, context),
836
+ body: await parseErrorBody(output.body, context),
837
837
  };
838
838
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
839
839
  switch (errorCode) {
@@ -900,7 +900,7 @@ exports.deserializeAws_restJson1ListRecordsCommand = deserializeAws_restJson1Lis
900
900
  const deserializeAws_restJson1ListRecordsCommandError = async (output, context) => {
901
901
  const parsedOutput = {
902
902
  ...output,
903
- body: await parseBody(output.body, context),
903
+ body: await parseErrorBody(output.body, context),
904
904
  };
905
905
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
906
906
  switch (errorCode) {
@@ -943,7 +943,7 @@ exports.deserializeAws_restJson1RegisterDeviceCommand = deserializeAws_restJson1
943
943
  const deserializeAws_restJson1RegisterDeviceCommandError = async (output, context) => {
944
944
  const parsedOutput = {
945
945
  ...output,
946
- body: await parseBody(output.body, context),
946
+ body: await parseErrorBody(output.body, context),
947
947
  };
948
948
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
949
949
  switch (errorCode) {
@@ -989,7 +989,7 @@ exports.deserializeAws_restJson1SetCognitoEventsCommand = deserializeAws_restJso
989
989
  const deserializeAws_restJson1SetCognitoEventsCommandError = async (output, context) => {
990
990
  const parsedOutput = {
991
991
  ...output,
992
- body: await parseBody(output.body, context),
992
+ body: await parseErrorBody(output.body, context),
993
993
  };
994
994
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
995
995
  switch (errorCode) {
@@ -1041,7 +1041,7 @@ exports.deserializeAws_restJson1SetIdentityPoolConfigurationCommand = deserializ
1041
1041
  const deserializeAws_restJson1SetIdentityPoolConfigurationCommandError = async (output, context) => {
1042
1042
  const parsedOutput = {
1043
1043
  ...output,
1044
- body: await parseBody(output.body, context),
1044
+ body: await parseErrorBody(output.body, context),
1045
1045
  };
1046
1046
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1047
1047
  switch (errorCode) {
@@ -1087,7 +1087,7 @@ exports.deserializeAws_restJson1SubscribeToDatasetCommand = deserializeAws_restJ
1087
1087
  const deserializeAws_restJson1SubscribeToDatasetCommandError = async (output, context) => {
1088
1088
  const parsedOutput = {
1089
1089
  ...output,
1090
- body: await parseBody(output.body, context),
1090
+ body: await parseErrorBody(output.body, context),
1091
1091
  };
1092
1092
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1093
1093
  switch (errorCode) {
@@ -1133,7 +1133,7 @@ exports.deserializeAws_restJson1UnsubscribeFromDatasetCommand = deserializeAws_r
1133
1133
  const deserializeAws_restJson1UnsubscribeFromDatasetCommandError = async (output, context) => {
1134
1134
  const parsedOutput = {
1135
1135
  ...output,
1136
- body: await parseBody(output.body, context),
1136
+ body: await parseErrorBody(output.body, context),
1137
1137
  };
1138
1138
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1139
1139
  switch (errorCode) {
@@ -1182,7 +1182,7 @@ exports.deserializeAws_restJson1UpdateRecordsCommand = deserializeAws_restJson1U
1182
1182
  const deserializeAws_restJson1UpdateRecordsCommandError = async (output, context) => {
1183
1183
  const parsedOutput = {
1184
1184
  ...output,
1185
- body: await parseBody(output.body, context),
1185
+ body: await parseErrorBody(output.body, context),
1186
1186
  };
1187
1187
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1188
1188
  switch (errorCode) {
@@ -1589,6 +1589,12 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
1589
1589
  }
1590
1590
  return {};
1591
1591
  });
1592
+ const parseErrorBody = async (errorBody, context) => {
1593
+ var _a;
1594
+ const value = await parseBody(errorBody, context);
1595
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1596
+ return value;
1597
+ };
1592
1598
  const loadRestJsonErrorCode = (output, data) => {
1593
1599
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1594
1600
  const sanitizeErrorCode = (rawValue) => {
@@ -1,4 +1,3 @@
1
- import { __extends } from "tslib";
2
1
  import { CognitoSyncClient } from "./CognitoSyncClient";
3
2
  import { BulkPublishCommand } from "./commands/BulkPublishCommand";
4
3
  import { DeleteDatasetCommand, } from "./commands/DeleteDatasetCommand";
@@ -17,249 +16,243 @@ import { SetIdentityPoolConfigurationCommand, } from "./commands/SetIdentityPool
17
16
  import { SubscribeToDatasetCommand, } from "./commands/SubscribeToDatasetCommand";
18
17
  import { UnsubscribeFromDatasetCommand, } from "./commands/UnsubscribeFromDatasetCommand";
19
18
  import { UpdateRecordsCommand, } from "./commands/UpdateRecordsCommand";
20
- var CognitoSync = (function (_super) {
21
- __extends(CognitoSync, _super);
22
- function CognitoSync() {
23
- return _super !== null && _super.apply(this, arguments) || this;
24
- }
25
- CognitoSync.prototype.bulkPublish = function (args, optionsOrCb, cb) {
26
- var command = new BulkPublishCommand(args);
19
+ export class CognitoSync extends CognitoSyncClient {
20
+ bulkPublish(args, optionsOrCb, cb) {
21
+ const command = new BulkPublishCommand(args);
27
22
  if (typeof optionsOrCb === "function") {
28
23
  this.send(command, optionsOrCb);
29
24
  }
30
25
  else if (typeof cb === "function") {
31
26
  if (typeof optionsOrCb !== "object")
32
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
27
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
33
28
  this.send(command, optionsOrCb || {}, cb);
34
29
  }
35
30
  else {
36
31
  return this.send(command, optionsOrCb);
37
32
  }
38
- };
39
- CognitoSync.prototype.deleteDataset = function (args, optionsOrCb, cb) {
40
- var command = new DeleteDatasetCommand(args);
33
+ }
34
+ deleteDataset(args, optionsOrCb, cb) {
35
+ const command = new DeleteDatasetCommand(args);
41
36
  if (typeof optionsOrCb === "function") {
42
37
  this.send(command, optionsOrCb);
43
38
  }
44
39
  else if (typeof cb === "function") {
45
40
  if (typeof optionsOrCb !== "object")
46
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
41
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
47
42
  this.send(command, optionsOrCb || {}, cb);
48
43
  }
49
44
  else {
50
45
  return this.send(command, optionsOrCb);
51
46
  }
52
- };
53
- CognitoSync.prototype.describeDataset = function (args, optionsOrCb, cb) {
54
- var command = new DescribeDatasetCommand(args);
47
+ }
48
+ describeDataset(args, optionsOrCb, cb) {
49
+ const command = new DescribeDatasetCommand(args);
55
50
  if (typeof optionsOrCb === "function") {
56
51
  this.send(command, optionsOrCb);
57
52
  }
58
53
  else if (typeof cb === "function") {
59
54
  if (typeof optionsOrCb !== "object")
60
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
55
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
61
56
  this.send(command, optionsOrCb || {}, cb);
62
57
  }
63
58
  else {
64
59
  return this.send(command, optionsOrCb);
65
60
  }
66
- };
67
- CognitoSync.prototype.describeIdentityPoolUsage = function (args, optionsOrCb, cb) {
68
- var command = new DescribeIdentityPoolUsageCommand(args);
61
+ }
62
+ describeIdentityPoolUsage(args, optionsOrCb, cb) {
63
+ const command = new DescribeIdentityPoolUsageCommand(args);
69
64
  if (typeof optionsOrCb === "function") {
70
65
  this.send(command, optionsOrCb);
71
66
  }
72
67
  else if (typeof cb === "function") {
73
68
  if (typeof optionsOrCb !== "object")
74
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
69
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
75
70
  this.send(command, optionsOrCb || {}, cb);
76
71
  }
77
72
  else {
78
73
  return this.send(command, optionsOrCb);
79
74
  }
80
- };
81
- CognitoSync.prototype.describeIdentityUsage = function (args, optionsOrCb, cb) {
82
- var command = new DescribeIdentityUsageCommand(args);
75
+ }
76
+ describeIdentityUsage(args, optionsOrCb, cb) {
77
+ const command = new DescribeIdentityUsageCommand(args);
83
78
  if (typeof optionsOrCb === "function") {
84
79
  this.send(command, optionsOrCb);
85
80
  }
86
81
  else if (typeof cb === "function") {
87
82
  if (typeof optionsOrCb !== "object")
88
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
83
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
89
84
  this.send(command, optionsOrCb || {}, cb);
90
85
  }
91
86
  else {
92
87
  return this.send(command, optionsOrCb);
93
88
  }
94
- };
95
- CognitoSync.prototype.getBulkPublishDetails = function (args, optionsOrCb, cb) {
96
- var command = new GetBulkPublishDetailsCommand(args);
89
+ }
90
+ getBulkPublishDetails(args, optionsOrCb, cb) {
91
+ const command = new GetBulkPublishDetailsCommand(args);
97
92
  if (typeof optionsOrCb === "function") {
98
93
  this.send(command, optionsOrCb);
99
94
  }
100
95
  else if (typeof cb === "function") {
101
96
  if (typeof optionsOrCb !== "object")
102
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
97
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
103
98
  this.send(command, optionsOrCb || {}, cb);
104
99
  }
105
100
  else {
106
101
  return this.send(command, optionsOrCb);
107
102
  }
108
- };
109
- CognitoSync.prototype.getCognitoEvents = function (args, optionsOrCb, cb) {
110
- var command = new GetCognitoEventsCommand(args);
103
+ }
104
+ getCognitoEvents(args, optionsOrCb, cb) {
105
+ const command = new GetCognitoEventsCommand(args);
111
106
  if (typeof optionsOrCb === "function") {
112
107
  this.send(command, optionsOrCb);
113
108
  }
114
109
  else if (typeof cb === "function") {
115
110
  if (typeof optionsOrCb !== "object")
116
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
111
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
117
112
  this.send(command, optionsOrCb || {}, cb);
118
113
  }
119
114
  else {
120
115
  return this.send(command, optionsOrCb);
121
116
  }
122
- };
123
- CognitoSync.prototype.getIdentityPoolConfiguration = function (args, optionsOrCb, cb) {
124
- var command = new GetIdentityPoolConfigurationCommand(args);
117
+ }
118
+ getIdentityPoolConfiguration(args, optionsOrCb, cb) {
119
+ const command = new GetIdentityPoolConfigurationCommand(args);
125
120
  if (typeof optionsOrCb === "function") {
126
121
  this.send(command, optionsOrCb);
127
122
  }
128
123
  else if (typeof cb === "function") {
129
124
  if (typeof optionsOrCb !== "object")
130
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
125
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
131
126
  this.send(command, optionsOrCb || {}, cb);
132
127
  }
133
128
  else {
134
129
  return this.send(command, optionsOrCb);
135
130
  }
136
- };
137
- CognitoSync.prototype.listDatasets = function (args, optionsOrCb, cb) {
138
- var command = new ListDatasetsCommand(args);
131
+ }
132
+ listDatasets(args, optionsOrCb, cb) {
133
+ const command = new ListDatasetsCommand(args);
139
134
  if (typeof optionsOrCb === "function") {
140
135
  this.send(command, optionsOrCb);
141
136
  }
142
137
  else if (typeof cb === "function") {
143
138
  if (typeof optionsOrCb !== "object")
144
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
139
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
145
140
  this.send(command, optionsOrCb || {}, cb);
146
141
  }
147
142
  else {
148
143
  return this.send(command, optionsOrCb);
149
144
  }
150
- };
151
- CognitoSync.prototype.listIdentityPoolUsage = function (args, optionsOrCb, cb) {
152
- var command = new ListIdentityPoolUsageCommand(args);
145
+ }
146
+ listIdentityPoolUsage(args, optionsOrCb, cb) {
147
+ const command = new ListIdentityPoolUsageCommand(args);
153
148
  if (typeof optionsOrCb === "function") {
154
149
  this.send(command, optionsOrCb);
155
150
  }
156
151
  else if (typeof cb === "function") {
157
152
  if (typeof optionsOrCb !== "object")
158
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
153
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
159
154
  this.send(command, optionsOrCb || {}, cb);
160
155
  }
161
156
  else {
162
157
  return this.send(command, optionsOrCb);
163
158
  }
164
- };
165
- CognitoSync.prototype.listRecords = function (args, optionsOrCb, cb) {
166
- var command = new ListRecordsCommand(args);
159
+ }
160
+ listRecords(args, optionsOrCb, cb) {
161
+ const command = new ListRecordsCommand(args);
167
162
  if (typeof optionsOrCb === "function") {
168
163
  this.send(command, optionsOrCb);
169
164
  }
170
165
  else if (typeof cb === "function") {
171
166
  if (typeof optionsOrCb !== "object")
172
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
167
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
173
168
  this.send(command, optionsOrCb || {}, cb);
174
169
  }
175
170
  else {
176
171
  return this.send(command, optionsOrCb);
177
172
  }
178
- };
179
- CognitoSync.prototype.registerDevice = function (args, optionsOrCb, cb) {
180
- var command = new RegisterDeviceCommand(args);
173
+ }
174
+ registerDevice(args, optionsOrCb, cb) {
175
+ const command = new RegisterDeviceCommand(args);
181
176
  if (typeof optionsOrCb === "function") {
182
177
  this.send(command, optionsOrCb);
183
178
  }
184
179
  else if (typeof cb === "function") {
185
180
  if (typeof optionsOrCb !== "object")
186
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
181
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
187
182
  this.send(command, optionsOrCb || {}, cb);
188
183
  }
189
184
  else {
190
185
  return this.send(command, optionsOrCb);
191
186
  }
192
- };
193
- CognitoSync.prototype.setCognitoEvents = function (args, optionsOrCb, cb) {
194
- var command = new SetCognitoEventsCommand(args);
187
+ }
188
+ setCognitoEvents(args, optionsOrCb, cb) {
189
+ const command = new SetCognitoEventsCommand(args);
195
190
  if (typeof optionsOrCb === "function") {
196
191
  this.send(command, optionsOrCb);
197
192
  }
198
193
  else if (typeof cb === "function") {
199
194
  if (typeof optionsOrCb !== "object")
200
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
195
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
201
196
  this.send(command, optionsOrCb || {}, cb);
202
197
  }
203
198
  else {
204
199
  return this.send(command, optionsOrCb);
205
200
  }
206
- };
207
- CognitoSync.prototype.setIdentityPoolConfiguration = function (args, optionsOrCb, cb) {
208
- var command = new SetIdentityPoolConfigurationCommand(args);
201
+ }
202
+ setIdentityPoolConfiguration(args, optionsOrCb, cb) {
203
+ const command = new SetIdentityPoolConfigurationCommand(args);
209
204
  if (typeof optionsOrCb === "function") {
210
205
  this.send(command, optionsOrCb);
211
206
  }
212
207
  else if (typeof cb === "function") {
213
208
  if (typeof optionsOrCb !== "object")
214
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
209
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
215
210
  this.send(command, optionsOrCb || {}, cb);
216
211
  }
217
212
  else {
218
213
  return this.send(command, optionsOrCb);
219
214
  }
220
- };
221
- CognitoSync.prototype.subscribeToDataset = function (args, optionsOrCb, cb) {
222
- var command = new SubscribeToDatasetCommand(args);
215
+ }
216
+ subscribeToDataset(args, optionsOrCb, cb) {
217
+ const command = new SubscribeToDatasetCommand(args);
223
218
  if (typeof optionsOrCb === "function") {
224
219
  this.send(command, optionsOrCb);
225
220
  }
226
221
  else if (typeof cb === "function") {
227
222
  if (typeof optionsOrCb !== "object")
228
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
223
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
229
224
  this.send(command, optionsOrCb || {}, cb);
230
225
  }
231
226
  else {
232
227
  return this.send(command, optionsOrCb);
233
228
  }
234
- };
235
- CognitoSync.prototype.unsubscribeFromDataset = function (args, optionsOrCb, cb) {
236
- var command = new UnsubscribeFromDatasetCommand(args);
229
+ }
230
+ unsubscribeFromDataset(args, optionsOrCb, cb) {
231
+ const command = new UnsubscribeFromDatasetCommand(args);
237
232
  if (typeof optionsOrCb === "function") {
238
233
  this.send(command, optionsOrCb);
239
234
  }
240
235
  else if (typeof cb === "function") {
241
236
  if (typeof optionsOrCb !== "object")
242
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
237
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
243
238
  this.send(command, optionsOrCb || {}, cb);
244
239
  }
245
240
  else {
246
241
  return this.send(command, optionsOrCb);
247
242
  }
248
- };
249
- CognitoSync.prototype.updateRecords = function (args, optionsOrCb, cb) {
250
- var command = new UpdateRecordsCommand(args);
243
+ }
244
+ updateRecords(args, optionsOrCb, cb) {
245
+ const command = new UpdateRecordsCommand(args);
251
246
  if (typeof optionsOrCb === "function") {
252
247
  this.send(command, optionsOrCb);
253
248
  }
254
249
  else if (typeof cb === "function") {
255
250
  if (typeof optionsOrCb !== "object")
256
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
251
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
257
252
  this.send(command, optionsOrCb || {}, cb);
258
253
  }
259
254
  else {
260
255
  return this.send(command, optionsOrCb);
261
256
  }
262
- };
263
- return CognitoSync;
264
- }(CognitoSyncClient));
265
- export { CognitoSync };
257
+ }
258
+ }
@@ -1,4 +1,3 @@
1
- import { __extends } from "tslib";
2
1
  import { resolveEndpointsConfig, resolveRegionConfig, } from "@aws-sdk/config-resolver";
3
2
  import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4
3
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
@@ -9,31 +8,26 @@ import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-sig
9
8
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
10
9
  import { Client as __Client, } from "@aws-sdk/smithy-client";
11
10
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
12
- var CognitoSyncClient = (function (_super) {
13
- __extends(CognitoSyncClient, _super);
14
- function CognitoSyncClient(configuration) {
15
- var _this = this;
16
- var _config_0 = __getRuntimeConfig(configuration);
17
- var _config_1 = resolveRegionConfig(_config_0);
18
- var _config_2 = resolveEndpointsConfig(_config_1);
19
- var _config_3 = resolveRetryConfig(_config_2);
20
- var _config_4 = resolveHostHeaderConfig(_config_3);
21
- var _config_5 = resolveAwsAuthConfig(_config_4);
22
- var _config_6 = resolveUserAgentConfig(_config_5);
23
- _this = _super.call(this, _config_6) || this;
24
- _this.config = _config_6;
25
- _this.middlewareStack.use(getRetryPlugin(_this.config));
26
- _this.middlewareStack.use(getContentLengthPlugin(_this.config));
27
- _this.middlewareStack.use(getHostHeaderPlugin(_this.config));
28
- _this.middlewareStack.use(getLoggerPlugin(_this.config));
29
- _this.middlewareStack.use(getRecursionDetectionPlugin(_this.config));
30
- _this.middlewareStack.use(getAwsAuthPlugin(_this.config));
31
- _this.middlewareStack.use(getUserAgentPlugin(_this.config));
32
- return _this;
11
+ export class CognitoSyncClient extends __Client {
12
+ constructor(configuration) {
13
+ const _config_0 = __getRuntimeConfig(configuration);
14
+ const _config_1 = resolveRegionConfig(_config_0);
15
+ const _config_2 = resolveEndpointsConfig(_config_1);
16
+ const _config_3 = resolveRetryConfig(_config_2);
17
+ const _config_4 = resolveHostHeaderConfig(_config_3);
18
+ const _config_5 = resolveAwsAuthConfig(_config_4);
19
+ const _config_6 = resolveUserAgentConfig(_config_5);
20
+ super(_config_6);
21
+ this.config = _config_6;
22
+ this.middlewareStack.use(getRetryPlugin(this.config));
23
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
24
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
25
+ this.middlewareStack.use(getLoggerPlugin(this.config));
26
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
27
+ this.middlewareStack.use(getAwsAuthPlugin(this.config));
28
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
33
29
  }
34
- CognitoSyncClient.prototype.destroy = function () {
35
- _super.prototype.destroy.call(this);
36
- };
37
- return CognitoSyncClient;
38
- }(__Client));
39
- export { CognitoSyncClient };
30
+ destroy() {
31
+ super.destroy();
32
+ }
33
+ }
@@ -1,39 +1,32 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { BulkPublishRequestFilterSensitiveLog, BulkPublishResponseFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_restJson1BulkPublishCommand, serializeAws_restJson1BulkPublishCommand, } from "../protocols/Aws_restJson1";
6
- var BulkPublishCommand = (function (_super) {
7
- __extends(BulkPublishCommand, _super);
8
- function BulkPublishCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class BulkPublishCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- BulkPublishCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
10
+ resolveMiddleware(clientStack, configuration, options) {
14
11
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
- var stack = clientStack.concat(this.middlewareStack);
16
- var logger = configuration.logger;
17
- var clientName = "CognitoSyncClient";
18
- var commandName = "BulkPublishCommand";
19
- var handlerExecutionContext = {
20
- logger: logger,
21
- clientName: clientName,
22
- commandName: commandName,
12
+ const stack = clientStack.concat(this.middlewareStack);
13
+ const { logger } = configuration;
14
+ const clientName = "CognitoSyncClient";
15
+ const commandName = "BulkPublishCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: BulkPublishRequestFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: BulkPublishResponseFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- BulkPublishCommand.prototype.serialize = function (input, context) {
23
+ const { requestHandler } = configuration;
24
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
25
+ }
26
+ serialize(input, context) {
32
27
  return serializeAws_restJson1BulkPublishCommand(input, context);
33
- };
34
- BulkPublishCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_restJson1BulkPublishCommand(output, context);
36
- };
37
- return BulkPublishCommand;
38
- }($Command));
39
- export { BulkPublishCommand };
31
+ }
32
+ }