@aws-sdk/client-appconfigdata 3.50.0 → 3.53.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
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.53.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.52.0...v3.53.0) (2022-02-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **clients:** generate service exceptions as classes ([#3267](https://github.com/aws/aws-sdk-js-v3/issues/3267)) ([ca64fee](https://github.com/aws/aws-sdk-js-v3/commit/ca64feed3351c394c07dc26b782a5760a396a074))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-appconfigdata
20
+
21
+
22
+
23
+
24
+
25
+ # [3.51.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.50.0...v3.51.0) (2022-02-12)
26
+
27
+ **Note:** Version bump only for package @aws-sdk/client-appconfigdata
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.50.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.49.0...v3.50.0) (2022-02-08)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-appconfigdata
package/dist-cjs/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppConfigDataServiceException = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  tslib_1.__exportStar(require("./AppConfigData"), exports);
5
6
  tslib_1.__exportStar(require("./AppConfigDataClient"), exports);
6
7
  tslib_1.__exportStar(require("./commands"), exports);
7
8
  tslib_1.__exportStar(require("./models"), exports);
9
+ var AppConfigDataServiceException_1 = require("./models/AppConfigDataServiceException");
10
+ Object.defineProperty(exports, "AppConfigDataServiceException", { enumerable: true, get: function () { return AppConfigDataServiceException_1.AppConfigDataServiceException; } });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppConfigDataServiceException = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
5
+ class AppConfigDataServiceException extends smithy_client_1.ServiceException {
6
+ constructor(options) {
7
+ super(options);
8
+ Object.setPrototypeOf(this, AppConfigDataServiceException.prototype);
9
+ }
10
+ }
11
+ exports.AppConfigDataServiceException = AppConfigDataServiceException;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetLatestConfigurationResponse = exports.GetLatestConfigurationRequest = exports.StartConfigurationSessionResponse = exports.StartConfigurationSessionRequest = exports.ResourceType = exports.BadRequestReason = exports.BadRequestDetails = exports.InvalidParameterDetail = exports.InvalidParameterProblem = void 0;
3
+ exports.GetLatestConfigurationResponse = exports.GetLatestConfigurationRequest = exports.ThrottlingException = exports.StartConfigurationSessionResponse = exports.StartConfigurationSessionRequest = exports.ResourceNotFoundException = exports.ResourceType = exports.InternalServerException = exports.BadRequestException = exports.BadRequestReason = exports.BadRequestDetails = exports.InvalidParameterDetail = exports.InvalidParameterProblem = void 0;
4
4
  const smithy_client_1 = require("@aws-sdk/smithy-client");
5
+ const AppConfigDataServiceException_1 = require("./AppConfigDataServiceException");
5
6
  var InvalidParameterProblem;
6
7
  (function (InvalidParameterProblem) {
7
8
  InvalidParameterProblem["CORRUPTED"] = "Corrupted";
@@ -37,6 +38,36 @@ var BadRequestReason;
37
38
  (function (BadRequestReason) {
38
39
  BadRequestReason["INVALID_PARAMETERS"] = "InvalidParameters";
39
40
  })(BadRequestReason = exports.BadRequestReason || (exports.BadRequestReason = {}));
41
+ class BadRequestException extends AppConfigDataServiceException_1.AppConfigDataServiceException {
42
+ constructor(opts) {
43
+ super({
44
+ name: "BadRequestException",
45
+ $fault: "client",
46
+ ...opts,
47
+ });
48
+ this.name = "BadRequestException";
49
+ this.$fault = "client";
50
+ Object.setPrototypeOf(this, BadRequestException.prototype);
51
+ this.Message = opts.Message;
52
+ this.Reason = opts.Reason;
53
+ this.Details = opts.Details;
54
+ }
55
+ }
56
+ exports.BadRequestException = BadRequestException;
57
+ class InternalServerException extends AppConfigDataServiceException_1.AppConfigDataServiceException {
58
+ constructor(opts) {
59
+ super({
60
+ name: "InternalServerException",
61
+ $fault: "server",
62
+ ...opts,
63
+ });
64
+ this.name = "InternalServerException";
65
+ this.$fault = "server";
66
+ Object.setPrototypeOf(this, InternalServerException.prototype);
67
+ this.Message = opts.Message;
68
+ }
69
+ }
70
+ exports.InternalServerException = InternalServerException;
40
71
  var ResourceType;
41
72
  (function (ResourceType) {
42
73
  ResourceType["APPLICATION"] = "Application";
@@ -45,6 +76,22 @@ var ResourceType;
45
76
  ResourceType["DEPLOYMENT"] = "Deployment";
46
77
  ResourceType["ENVIRONMENT"] = "Environment";
47
78
  })(ResourceType = exports.ResourceType || (exports.ResourceType = {}));
79
+ class ResourceNotFoundException extends AppConfigDataServiceException_1.AppConfigDataServiceException {
80
+ constructor(opts) {
81
+ super({
82
+ name: "ResourceNotFoundException",
83
+ $fault: "client",
84
+ ...opts,
85
+ });
86
+ this.name = "ResourceNotFoundException";
87
+ this.$fault = "client";
88
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
89
+ this.Message = opts.Message;
90
+ this.ResourceType = opts.ResourceType;
91
+ this.ReferencedBy = opts.ReferencedBy;
92
+ }
93
+ }
94
+ exports.ResourceNotFoundException = ResourceNotFoundException;
48
95
  var StartConfigurationSessionRequest;
49
96
  (function (StartConfigurationSessionRequest) {
50
97
  StartConfigurationSessionRequest.filterSensitiveLog = (obj) => ({
@@ -57,6 +104,20 @@ var StartConfigurationSessionResponse;
57
104
  ...obj,
58
105
  });
59
106
  })(StartConfigurationSessionResponse = exports.StartConfigurationSessionResponse || (exports.StartConfigurationSessionResponse = {}));
107
+ class ThrottlingException extends AppConfigDataServiceException_1.AppConfigDataServiceException {
108
+ constructor(opts) {
109
+ super({
110
+ name: "ThrottlingException",
111
+ $fault: "client",
112
+ ...opts,
113
+ });
114
+ this.name = "ThrottlingException";
115
+ this.$fault = "client";
116
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
117
+ this.Message = opts.Message;
118
+ }
119
+ }
120
+ exports.ThrottlingException = ThrottlingException;
60
121
  var GetLatestConfigurationRequest;
61
122
  (function (GetLatestConfigurationRequest) {
62
123
  GetLatestConfigurationRequest.filterSensitiveLog = (obj) => ({
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1StartConfigurationSessionCommand = exports.deserializeAws_restJson1GetLatestConfigurationCommand = exports.serializeAws_restJson1StartConfigurationSessionCommand = exports.serializeAws_restJson1GetLatestConfigurationCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const AppConfigDataServiceException_1 = require("../models/AppConfigDataServiceException");
7
+ const models_0_1 = require("../models/models_0");
6
8
  const serializeAws_restJson1GetLatestConfigurationCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {};
@@ -91,51 +93,25 @@ const deserializeAws_restJson1GetLatestConfigurationCommandError = async (output
91
93
  switch (errorCode) {
92
94
  case "BadRequestException":
93
95
  case "com.amazonaws.appconfigdata#BadRequestException":
94
- response = {
95
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
96
- name: errorCode,
97
- $metadata: deserializeMetadata(output),
98
- };
99
- break;
96
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
100
97
  case "InternalServerException":
101
98
  case "com.amazonaws.appconfigdata#InternalServerException":
102
- response = {
103
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
104
- name: errorCode,
105
- $metadata: deserializeMetadata(output),
106
- };
107
- break;
99
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
108
100
  case "ResourceNotFoundException":
109
101
  case "com.amazonaws.appconfigdata#ResourceNotFoundException":
110
- response = {
111
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
112
- name: errorCode,
113
- $metadata: deserializeMetadata(output),
114
- };
115
- break;
102
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
116
103
  case "ThrottlingException":
117
104
  case "com.amazonaws.appconfigdata#ThrottlingException":
118
- response = {
119
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
120
- name: errorCode,
121
- $metadata: deserializeMetadata(output),
122
- };
123
- break;
105
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
124
106
  default:
125
107
  const parsedBody = parsedOutput.body;
126
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
127
- response = {
128
- ...parsedBody,
129
- name: `${errorCode}`,
130
- message: parsedBody.message || parsedBody.Message || errorCode,
108
+ response = new AppConfigDataServiceException_1.AppConfigDataServiceException({
109
+ name: parsedBody.code || parsedBody.Code || errorCode,
131
110
  $fault: "client",
132
111
  $metadata: deserializeMetadata(output),
133
- };
112
+ });
113
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
134
114
  }
135
- const message = response.message || response.Message || errorCode;
136
- response.message = message;
137
- delete response.Message;
138
- return Promise.reject(Object.assign(new Error(message), response));
139
115
  };
140
116
  const deserializeAws_restJson1StartConfigurationSessionCommand = async (output, context) => {
141
117
  if (output.statusCode !== 201 && output.statusCode >= 300) {
@@ -163,61 +139,28 @@ const deserializeAws_restJson1StartConfigurationSessionCommandError = async (out
163
139
  switch (errorCode) {
164
140
  case "BadRequestException":
165
141
  case "com.amazonaws.appconfigdata#BadRequestException":
166
- response = {
167
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
168
- name: errorCode,
169
- $metadata: deserializeMetadata(output),
170
- };
171
- break;
142
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
172
143
  case "InternalServerException":
173
144
  case "com.amazonaws.appconfigdata#InternalServerException":
174
- response = {
175
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
176
- name: errorCode,
177
- $metadata: deserializeMetadata(output),
178
- };
179
- break;
145
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
180
146
  case "ResourceNotFoundException":
181
147
  case "com.amazonaws.appconfigdata#ResourceNotFoundException":
182
- response = {
183
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
184
- name: errorCode,
185
- $metadata: deserializeMetadata(output),
186
- };
187
- break;
148
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
188
149
  case "ThrottlingException":
189
150
  case "com.amazonaws.appconfigdata#ThrottlingException":
190
- response = {
191
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
192
- name: errorCode,
193
- $metadata: deserializeMetadata(output),
194
- };
195
- break;
151
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
196
152
  default:
197
153
  const parsedBody = parsedOutput.body;
198
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
199
- response = {
200
- ...parsedBody,
201
- name: `${errorCode}`,
202
- message: parsedBody.message || parsedBody.Message || errorCode,
154
+ response = new AppConfigDataServiceException_1.AppConfigDataServiceException({
155
+ name: parsedBody.code || parsedBody.Code || errorCode,
203
156
  $fault: "client",
204
157
  $metadata: deserializeMetadata(output),
205
- };
158
+ });
159
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
206
160
  }
207
- const message = response.message || response.Message || errorCode;
208
- response.message = message;
209
- delete response.Message;
210
- return Promise.reject(Object.assign(new Error(message), response));
211
161
  };
212
162
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
213
- const contents = {
214
- name: "BadRequestException",
215
- $fault: "client",
216
- $metadata: deserializeMetadata(parsedOutput),
217
- Details: undefined,
218
- Message: undefined,
219
- Reason: undefined,
220
- };
163
+ const contents = {};
221
164
  const data = parsedOutput.body;
222
165
  if (data.Details !== undefined && data.Details !== null) {
223
166
  contents.Details = deserializeAws_restJson1BadRequestDetails(smithy_client_1.expectUnion(data.Details), context);
@@ -228,30 +171,26 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
228
171
  if (data.Reason !== undefined && data.Reason !== null) {
229
172
  contents.Reason = smithy_client_1.expectString(data.Reason);
230
173
  }
231
- return contents;
174
+ const exception = new models_0_1.BadRequestException({
175
+ $metadata: deserializeMetadata(parsedOutput),
176
+ ...contents,
177
+ });
178
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
232
179
  };
233
180
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
234
- const contents = {
235
- name: "InternalServerException",
236
- $fault: "server",
237
- $metadata: deserializeMetadata(parsedOutput),
238
- Message: undefined,
239
- };
181
+ const contents = {};
240
182
  const data = parsedOutput.body;
241
183
  if (data.Message !== undefined && data.Message !== null) {
242
184
  contents.Message = smithy_client_1.expectString(data.Message);
243
185
  }
244
- return contents;
186
+ const exception = new models_0_1.InternalServerException({
187
+ $metadata: deserializeMetadata(parsedOutput),
188
+ ...contents,
189
+ });
190
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
245
191
  };
246
192
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
247
- const contents = {
248
- name: "ResourceNotFoundException",
249
- $fault: "client",
250
- $metadata: deserializeMetadata(parsedOutput),
251
- Message: undefined,
252
- ReferencedBy: undefined,
253
- ResourceType: undefined,
254
- };
193
+ const contents = {};
255
194
  const data = parsedOutput.body;
256
195
  if (data.Message !== undefined && data.Message !== null) {
257
196
  contents.Message = smithy_client_1.expectString(data.Message);
@@ -262,20 +201,23 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
262
201
  if (data.ResourceType !== undefined && data.ResourceType !== null) {
263
202
  contents.ResourceType = smithy_client_1.expectString(data.ResourceType);
264
203
  }
265
- return contents;
204
+ const exception = new models_0_1.ResourceNotFoundException({
205
+ $metadata: deserializeMetadata(parsedOutput),
206
+ ...contents,
207
+ });
208
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
266
209
  };
267
210
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
268
- const contents = {
269
- name: "ThrottlingException",
270
- $fault: "client",
271
- $metadata: deserializeMetadata(parsedOutput),
272
- Message: undefined,
273
- };
211
+ const contents = {};
274
212
  const data = parsedOutput.body;
275
213
  if (data.Message !== undefined && data.Message !== null) {
276
214
  contents.Message = smithy_client_1.expectString(data.Message);
277
215
  }
278
- return contents;
216
+ const exception = new models_0_1.ThrottlingException({
217
+ $metadata: deserializeMetadata(parsedOutput),
218
+ ...contents,
219
+ });
220
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
279
221
  };
280
222
  const deserializeAws_restJson1BadRequestDetails = (output, context) => {
281
223
  if (output.InvalidParameters !== undefined && output.InvalidParameters !== null) {
package/dist-es/index.js CHANGED
@@ -2,3 +2,4 @@ export * from "./AppConfigData";
2
2
  export * from "./AppConfigDataClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
+ export { AppConfigDataServiceException } from "./models/AppConfigDataServiceException";
@@ -0,0 +1,12 @@
1
+ import { __extends } from "tslib";
2
+ import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
3
+ var AppConfigDataServiceException = (function (_super) {
4
+ __extends(AppConfigDataServiceException, _super);
5
+ function AppConfigDataServiceException(options) {
6
+ var _this = _super.call(this, options) || this;
7
+ Object.setPrototypeOf(_this, AppConfigDataServiceException.prototype);
8
+ return _this;
9
+ }
10
+ return AppConfigDataServiceException;
11
+ }(__ServiceException));
12
+ export { AppConfigDataServiceException };
@@ -1,5 +1,6 @@
1
- import { __assign, __read } from "tslib";
1
+ import { __assign, __extends, __read } from "tslib";
2
2
  import { SENSITIVE_STRING } from "@aws-sdk/smithy-client";
3
+ import { AppConfigDataServiceException as __BaseException } from "./AppConfigDataServiceException";
3
4
  export var InvalidParameterProblem;
4
5
  (function (InvalidParameterProblem) {
5
6
  InvalidParameterProblem["CORRUPTED"] = "Corrupted";
@@ -35,6 +36,34 @@ export var BadRequestReason;
35
36
  (function (BadRequestReason) {
36
37
  BadRequestReason["INVALID_PARAMETERS"] = "InvalidParameters";
37
38
  })(BadRequestReason || (BadRequestReason = {}));
39
+ var BadRequestException = (function (_super) {
40
+ __extends(BadRequestException, _super);
41
+ function BadRequestException(opts) {
42
+ var _this = _super.call(this, __assign({ name: "BadRequestException", $fault: "client" }, opts)) || this;
43
+ _this.name = "BadRequestException";
44
+ _this.$fault = "client";
45
+ Object.setPrototypeOf(_this, BadRequestException.prototype);
46
+ _this.Message = opts.Message;
47
+ _this.Reason = opts.Reason;
48
+ _this.Details = opts.Details;
49
+ return _this;
50
+ }
51
+ return BadRequestException;
52
+ }(__BaseException));
53
+ export { BadRequestException };
54
+ var InternalServerException = (function (_super) {
55
+ __extends(InternalServerException, _super);
56
+ function InternalServerException(opts) {
57
+ var _this = _super.call(this, __assign({ name: "InternalServerException", $fault: "server" }, opts)) || this;
58
+ _this.name = "InternalServerException";
59
+ _this.$fault = "server";
60
+ Object.setPrototypeOf(_this, InternalServerException.prototype);
61
+ _this.Message = opts.Message;
62
+ return _this;
63
+ }
64
+ return InternalServerException;
65
+ }(__BaseException));
66
+ export { InternalServerException };
38
67
  export var ResourceType;
39
68
  (function (ResourceType) {
40
69
  ResourceType["APPLICATION"] = "Application";
@@ -43,6 +72,21 @@ export var ResourceType;
43
72
  ResourceType["DEPLOYMENT"] = "Deployment";
44
73
  ResourceType["ENVIRONMENT"] = "Environment";
45
74
  })(ResourceType || (ResourceType = {}));
75
+ var ResourceNotFoundException = (function (_super) {
76
+ __extends(ResourceNotFoundException, _super);
77
+ function ResourceNotFoundException(opts) {
78
+ var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
79
+ _this.name = "ResourceNotFoundException";
80
+ _this.$fault = "client";
81
+ Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
82
+ _this.Message = opts.Message;
83
+ _this.ResourceType = opts.ResourceType;
84
+ _this.ReferencedBy = opts.ReferencedBy;
85
+ return _this;
86
+ }
87
+ return ResourceNotFoundException;
88
+ }(__BaseException));
89
+ export { ResourceNotFoundException };
46
90
  export var StartConfigurationSessionRequest;
47
91
  (function (StartConfigurationSessionRequest) {
48
92
  StartConfigurationSessionRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -51,6 +95,19 @@ export var StartConfigurationSessionResponse;
51
95
  (function (StartConfigurationSessionResponse) {
52
96
  StartConfigurationSessionResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
53
97
  })(StartConfigurationSessionResponse || (StartConfigurationSessionResponse = {}));
98
+ var ThrottlingException = (function (_super) {
99
+ __extends(ThrottlingException, _super);
100
+ function ThrottlingException(opts) {
101
+ var _this = _super.call(this, __assign({ name: "ThrottlingException", $fault: "client" }, opts)) || this;
102
+ _this.name = "ThrottlingException";
103
+ _this.$fault = "client";
104
+ Object.setPrototypeOf(_this, ThrottlingException.prototype);
105
+ _this.Message = opts.Message;
106
+ return _this;
107
+ }
108
+ return ThrottlingException;
109
+ }(__BaseException));
110
+ export { ThrottlingException };
54
111
  export var GetLatestConfigurationRequest;
55
112
  (function (GetLatestConfigurationRequest) {
56
113
  GetLatestConfigurationRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };