@aws-sdk/client-cloudsearch-domain 3.131.0 → 3.142.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,39 @@
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.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * **clients:** update client endpoints as of 2022-08-01 ([aaf49f2](https://github.com/aws/aws-sdk-js-v3/commit/aaf49f21b371412e6ea7e00890b71a7b31991b66))
23
+
24
+
25
+
26
+
27
+
28
+ # [3.137.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.136.1...v3.137.0) (2022-07-26)
29
+
30
+
31
+ ### Features
32
+
33
+ * **namespaces:** remove namespaces with only a log filter ([#3823](https://github.com/aws/aws-sdk-js-v3/issues/3823)) ([33e6822](https://github.com/aws/aws-sdk-js-v3/commit/33e68228fb64c53dd8f89e6be76dd5f46edc3cfd))
34
+
35
+
36
+
37
+
38
+
6
39
  # [3.131.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.130.0...v3.131.0) (2022-07-15)
7
40
 
8
41
  **Note:** Version bump only for package @aws-sdk/client-cloudsearch-domain
package/README.md CHANGED
@@ -168,7 +168,7 @@ try {
168
168
  const data = await client.send(command);
169
169
  // process data.
170
170
  } catch (error) {
171
- const { requestId, cfId, extendedRequestId } = error.$metadata;
171
+ const { requestId, cfId, extendedRequestId } = error.$$metadata;
172
172
  console.log({ requestId, cfId, extendedRequestId });
173
173
  /**
174
174
  * The keys within exceptions are also parsed.
@@ -20,8 +20,8 @@ class SearchCommand extends smithy_client_1.Command {
20
20
  logger,
21
21
  clientName,
22
22
  commandName,
23
- inputFilterSensitiveLog: models_0_1.SearchRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: models_0_1.SearchResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: models_0_1.SearchRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.SearchResponseFilterSensitiveLog,
25
25
  };
26
26
  const { requestHandler } = configuration;
27
27
  return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
@@ -20,8 +20,8 @@ class SuggestCommand extends smithy_client_1.Command {
20
20
  logger,
21
21
  clientName,
22
22
  commandName,
23
- inputFilterSensitiveLog: models_0_1.SuggestRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: models_0_1.SuggestResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: models_0_1.SuggestRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.SuggestResponseFilterSensitiveLog,
25
25
  };
26
26
  const { requestHandler } = configuration;
27
27
  return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
@@ -20,8 +20,8 @@ class UploadDocumentsCommand extends smithy_client_1.Command {
20
20
  logger,
21
21
  clientName,
22
22
  commandName,
23
- inputFilterSensitiveLog: models_0_1.UploadDocumentsRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: models_0_1.UploadDocumentsResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: models_0_1.UploadDocumentsRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.UploadDocumentsResponseFilterSensitiveLog,
25
25
  };
26
26
  const { requestHandler } = configuration;
27
27
  return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UploadDocumentsResponse = exports.DocumentServiceWarning = exports.UploadDocumentsRequest = exports.DocumentServiceException = exports.SuggestResponse = exports.SuggestModel = exports.SuggestionMatch = exports.SuggestStatus = exports.SuggestRequest = exports.SearchResponse = exports.SearchStatus = exports.FieldStats = exports.Hits = exports.Hit = exports.BucketInfo = exports.Bucket = exports.SearchRequest = exports.SearchException = void 0;
3
+ exports.UploadDocumentsResponseFilterSensitiveLog = exports.DocumentServiceWarningFilterSensitiveLog = exports.UploadDocumentsRequestFilterSensitiveLog = exports.SuggestResponseFilterSensitiveLog = exports.SuggestModelFilterSensitiveLog = exports.SuggestionMatchFilterSensitiveLog = exports.SuggestStatusFilterSensitiveLog = exports.SuggestRequestFilterSensitiveLog = exports.SearchResponseFilterSensitiveLog = exports.SearchStatusFilterSensitiveLog = exports.FieldStatsFilterSensitiveLog = exports.HitsFilterSensitiveLog = exports.HitFilterSensitiveLog = exports.BucketInfoFilterSensitiveLog = exports.BucketFilterSensitiveLog = exports.SearchRequestFilterSensitiveLog = exports.DocumentServiceException = exports.SearchException = void 0;
4
4
  const CloudSearchDomainServiceException_1 = require("./CloudSearchDomainServiceException");
5
5
  class SearchException extends CloudSearchDomainServiceException_1.CloudSearchDomainServiceException {
6
6
  constructor(opts) {
@@ -15,84 +15,6 @@ class SearchException extends CloudSearchDomainServiceException_1.CloudSearchDom
15
15
  }
16
16
  }
17
17
  exports.SearchException = SearchException;
18
- var SearchRequest;
19
- (function (SearchRequest) {
20
- SearchRequest.filterSensitiveLog = (obj) => ({
21
- ...obj,
22
- });
23
- })(SearchRequest = exports.SearchRequest || (exports.SearchRequest = {}));
24
- var Bucket;
25
- (function (Bucket) {
26
- Bucket.filterSensitiveLog = (obj) => ({
27
- ...obj,
28
- });
29
- })(Bucket = exports.Bucket || (exports.Bucket = {}));
30
- var BucketInfo;
31
- (function (BucketInfo) {
32
- BucketInfo.filterSensitiveLog = (obj) => ({
33
- ...obj,
34
- });
35
- })(BucketInfo = exports.BucketInfo || (exports.BucketInfo = {}));
36
- var Hit;
37
- (function (Hit) {
38
- Hit.filterSensitiveLog = (obj) => ({
39
- ...obj,
40
- });
41
- })(Hit = exports.Hit || (exports.Hit = {}));
42
- var Hits;
43
- (function (Hits) {
44
- Hits.filterSensitiveLog = (obj) => ({
45
- ...obj,
46
- });
47
- })(Hits = exports.Hits || (exports.Hits = {}));
48
- var FieldStats;
49
- (function (FieldStats) {
50
- FieldStats.filterSensitiveLog = (obj) => ({
51
- ...obj,
52
- });
53
- })(FieldStats = exports.FieldStats || (exports.FieldStats = {}));
54
- var SearchStatus;
55
- (function (SearchStatus) {
56
- SearchStatus.filterSensitiveLog = (obj) => ({
57
- ...obj,
58
- });
59
- })(SearchStatus = exports.SearchStatus || (exports.SearchStatus = {}));
60
- var SearchResponse;
61
- (function (SearchResponse) {
62
- SearchResponse.filterSensitiveLog = (obj) => ({
63
- ...obj,
64
- });
65
- })(SearchResponse = exports.SearchResponse || (exports.SearchResponse = {}));
66
- var SuggestRequest;
67
- (function (SuggestRequest) {
68
- SuggestRequest.filterSensitiveLog = (obj) => ({
69
- ...obj,
70
- });
71
- })(SuggestRequest = exports.SuggestRequest || (exports.SuggestRequest = {}));
72
- var SuggestStatus;
73
- (function (SuggestStatus) {
74
- SuggestStatus.filterSensitiveLog = (obj) => ({
75
- ...obj,
76
- });
77
- })(SuggestStatus = exports.SuggestStatus || (exports.SuggestStatus = {}));
78
- var SuggestionMatch;
79
- (function (SuggestionMatch) {
80
- SuggestionMatch.filterSensitiveLog = (obj) => ({
81
- ...obj,
82
- });
83
- })(SuggestionMatch = exports.SuggestionMatch || (exports.SuggestionMatch = {}));
84
- var SuggestModel;
85
- (function (SuggestModel) {
86
- SuggestModel.filterSensitiveLog = (obj) => ({
87
- ...obj,
88
- });
89
- })(SuggestModel = exports.SuggestModel || (exports.SuggestModel = {}));
90
- var SuggestResponse;
91
- (function (SuggestResponse) {
92
- SuggestResponse.filterSensitiveLog = (obj) => ({
93
- ...obj,
94
- });
95
- })(SuggestResponse = exports.SuggestResponse || (exports.SuggestResponse = {}));
96
18
  class DocumentServiceException extends CloudSearchDomainServiceException_1.CloudSearchDomainServiceException {
97
19
  constructor(opts) {
98
20
  super({
@@ -107,21 +29,67 @@ class DocumentServiceException extends CloudSearchDomainServiceException_1.Cloud
107
29
  }
108
30
  }
109
31
  exports.DocumentServiceException = DocumentServiceException;
110
- var UploadDocumentsRequest;
111
- (function (UploadDocumentsRequest) {
112
- UploadDocumentsRequest.filterSensitiveLog = (obj) => ({
113
- ...obj,
114
- });
115
- })(UploadDocumentsRequest = exports.UploadDocumentsRequest || (exports.UploadDocumentsRequest = {}));
116
- var DocumentServiceWarning;
117
- (function (DocumentServiceWarning) {
118
- DocumentServiceWarning.filterSensitiveLog = (obj) => ({
119
- ...obj,
120
- });
121
- })(DocumentServiceWarning = exports.DocumentServiceWarning || (exports.DocumentServiceWarning = {}));
122
- var UploadDocumentsResponse;
123
- (function (UploadDocumentsResponse) {
124
- UploadDocumentsResponse.filterSensitiveLog = (obj) => ({
125
- ...obj,
126
- });
127
- })(UploadDocumentsResponse = exports.UploadDocumentsResponse || (exports.UploadDocumentsResponse = {}));
32
+ const SearchRequestFilterSensitiveLog = (obj) => ({
33
+ ...obj,
34
+ });
35
+ exports.SearchRequestFilterSensitiveLog = SearchRequestFilterSensitiveLog;
36
+ const BucketFilterSensitiveLog = (obj) => ({
37
+ ...obj,
38
+ });
39
+ exports.BucketFilterSensitiveLog = BucketFilterSensitiveLog;
40
+ const BucketInfoFilterSensitiveLog = (obj) => ({
41
+ ...obj,
42
+ });
43
+ exports.BucketInfoFilterSensitiveLog = BucketInfoFilterSensitiveLog;
44
+ const HitFilterSensitiveLog = (obj) => ({
45
+ ...obj,
46
+ });
47
+ exports.HitFilterSensitiveLog = HitFilterSensitiveLog;
48
+ const HitsFilterSensitiveLog = (obj) => ({
49
+ ...obj,
50
+ });
51
+ exports.HitsFilterSensitiveLog = HitsFilterSensitiveLog;
52
+ const FieldStatsFilterSensitiveLog = (obj) => ({
53
+ ...obj,
54
+ });
55
+ exports.FieldStatsFilterSensitiveLog = FieldStatsFilterSensitiveLog;
56
+ const SearchStatusFilterSensitiveLog = (obj) => ({
57
+ ...obj,
58
+ });
59
+ exports.SearchStatusFilterSensitiveLog = SearchStatusFilterSensitiveLog;
60
+ const SearchResponseFilterSensitiveLog = (obj) => ({
61
+ ...obj,
62
+ });
63
+ exports.SearchResponseFilterSensitiveLog = SearchResponseFilterSensitiveLog;
64
+ const SuggestRequestFilterSensitiveLog = (obj) => ({
65
+ ...obj,
66
+ });
67
+ exports.SuggestRequestFilterSensitiveLog = SuggestRequestFilterSensitiveLog;
68
+ const SuggestStatusFilterSensitiveLog = (obj) => ({
69
+ ...obj,
70
+ });
71
+ exports.SuggestStatusFilterSensitiveLog = SuggestStatusFilterSensitiveLog;
72
+ const SuggestionMatchFilterSensitiveLog = (obj) => ({
73
+ ...obj,
74
+ });
75
+ exports.SuggestionMatchFilterSensitiveLog = SuggestionMatchFilterSensitiveLog;
76
+ const SuggestModelFilterSensitiveLog = (obj) => ({
77
+ ...obj,
78
+ });
79
+ exports.SuggestModelFilterSensitiveLog = SuggestModelFilterSensitiveLog;
80
+ const SuggestResponseFilterSensitiveLog = (obj) => ({
81
+ ...obj,
82
+ });
83
+ exports.SuggestResponseFilterSensitiveLog = SuggestResponseFilterSensitiveLog;
84
+ const UploadDocumentsRequestFilterSensitiveLog = (obj) => ({
85
+ ...obj,
86
+ });
87
+ exports.UploadDocumentsRequestFilterSensitiveLog = UploadDocumentsRequestFilterSensitiveLog;
88
+ const DocumentServiceWarningFilterSensitiveLog = (obj) => ({
89
+ ...obj,
90
+ });
91
+ exports.DocumentServiceWarningFilterSensitiveLog = DocumentServiceWarningFilterSensitiveLog;
92
+ const UploadDocumentsResponseFilterSensitiveLog = (obj) => ({
93
+ ...obj,
94
+ });
95
+ exports.UploadDocumentsResponseFilterSensitiveLog = UploadDocumentsResponseFilterSensitiveLog;
@@ -9,24 +9,24 @@ const serializeAws_restJson1SearchCommand = async (input, context) => {
9
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
10
  const headers = {};
11
11
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/search";
12
- const query = {
13
- format: "sdk",
14
- pretty: "true",
15
- ...(input.cursor !== undefined && { cursor: input.cursor }),
16
- ...(input.expr !== undefined && { expr: input.expr }),
17
- ...(input.facet !== undefined && { facet: input.facet }),
18
- ...(input.filterQuery !== undefined && { fq: input.filterQuery }),
19
- ...(input.highlight !== undefined && { highlight: input.highlight }),
20
- ...(input.partial !== undefined && { partial: input.partial.toString() }),
21
- ...(input.query !== undefined && { q: input.query }),
22
- ...(input.queryOptions !== undefined && { "q.options": input.queryOptions }),
23
- ...(input.queryParser !== undefined && { "q.parser": input.queryParser }),
24
- ...(input.return !== undefined && { return: input.return }),
25
- ...(input.size !== undefined && { size: input.size.toString() }),
26
- ...(input.sort !== undefined && { sort: input.sort }),
27
- ...(input.start !== undefined && { start: input.start.toString() }),
28
- ...(input.stats !== undefined && { stats: input.stats }),
29
- };
12
+ const query = map({
13
+ format: [, "sdk"],
14
+ pretty: [, "true"],
15
+ cursor: [, input.cursor],
16
+ expr: [, input.expr],
17
+ facet: [, input.facet],
18
+ fq: [, input.filterQuery],
19
+ highlight: [, input.highlight],
20
+ partial: [() => input.partial !== void 0, () => input.partial.toString()],
21
+ q: [, input.query],
22
+ "q.options": [, input.queryOptions],
23
+ "q.parser": [, input.queryParser],
24
+ return: [, input.return],
25
+ size: [() => input.size !== void 0, () => input.size.toString()],
26
+ sort: [, input.sort],
27
+ start: [() => input.start !== void 0, () => input.start.toString()],
28
+ stats: [, input.stats],
29
+ });
30
30
  let body;
31
31
  return new protocol_http_1.HttpRequest({
32
32
  protocol,
@@ -44,13 +44,13 @@ const serializeAws_restJson1SuggestCommand = async (input, context) => {
44
44
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
45
45
  const headers = {};
46
46
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/suggest";
47
- const query = {
48
- format: "sdk",
49
- pretty: "true",
50
- ...(input.query !== undefined && { q: input.query }),
51
- ...(input.suggester !== undefined && { suggester: input.suggester }),
52
- ...(input.size !== undefined && { size: input.size.toString() }),
53
- };
47
+ const query = map({
48
+ format: [, "sdk"],
49
+ pretty: [, "true"],
50
+ q: [, input.query],
51
+ suggester: [, input.suggester],
52
+ size: [() => input.size !== void 0, () => input.size.toString()],
53
+ });
54
54
  let body;
55
55
  return new protocol_http_1.HttpRequest({
56
56
  protocol,
@@ -66,14 +66,13 @@ const serializeAws_restJson1SuggestCommand = async (input, context) => {
66
66
  exports.serializeAws_restJson1SuggestCommand = serializeAws_restJson1SuggestCommand;
67
67
  const serializeAws_restJson1UploadDocumentsCommand = async (input, context) => {
68
68
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
69
- const headers = {
70
- "content-type": "application/octet-stream",
71
- ...(isSerializableHeaderValue(input.contentType) && { "content-type": input.contentType }),
72
- };
69
+ const headers = map({}, isSerializableHeaderValue, {
70
+ "content-type": input.contentType || "application/octet-stream",
71
+ });
73
72
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/documents/batch";
74
- const query = {
75
- format: "sdk",
76
- };
73
+ const query = map({
74
+ format: [, "sdk"],
75
+ });
77
76
  let body;
78
77
  if (input.documents !== undefined) {
79
78
  body = input.documents;
@@ -94,27 +93,23 @@ const deserializeAws_restJson1SearchCommand = async (output, context) => {
94
93
  if (output.statusCode !== 200 && output.statusCode >= 300) {
95
94
  return deserializeAws_restJson1SearchCommandError(output, context);
96
95
  }
97
- const contents = {
96
+ const contents = map({
98
97
  $metadata: deserializeMetadata(output),
99
- facets: undefined,
100
- hits: undefined,
101
- stats: undefined,
102
- status: undefined,
103
- };
98
+ });
104
99
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
105
- if (data.facets !== undefined && data.facets !== null) {
100
+ if (data.facets != null) {
106
101
  contents.facets = deserializeAws_restJson1Facets(data.facets, context);
107
102
  }
108
- if (data.hits !== undefined && data.hits !== null) {
103
+ if (data.hits != null) {
109
104
  contents.hits = deserializeAws_restJson1Hits(data.hits, context);
110
105
  }
111
- if (data.stats !== undefined && data.stats !== null) {
106
+ if (data.stats != null) {
112
107
  contents.stats = deserializeAws_restJson1Stats(data.stats, context);
113
108
  }
114
- if (data.status !== undefined && data.status !== null) {
109
+ if (data.status != null) {
115
110
  contents.status = deserializeAws_restJson1SearchStatus(data.status, context);
116
111
  }
117
- return Promise.resolve(contents);
112
+ return contents;
118
113
  };
119
114
  exports.deserializeAws_restJson1SearchCommand = deserializeAws_restJson1SearchCommand;
120
115
  const deserializeAws_restJson1SearchCommandError = async (output, context) => {
@@ -122,7 +117,6 @@ const deserializeAws_restJson1SearchCommandError = async (output, context) => {
122
117
  ...output,
123
118
  body: await parseBody(output.body, context),
124
119
  };
125
- let response;
126
120
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
127
121
  switch (errorCode) {
128
122
  case "SearchException":
@@ -130,33 +124,29 @@ const deserializeAws_restJson1SearchCommandError = async (output, context) => {
130
124
  throw await deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context);
131
125
  default:
132
126
  const parsedBody = parsedOutput.body;
133
- const $metadata = deserializeMetadata(output);
134
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
135
- response = new CloudSearchDomainServiceException_1.CloudSearchDomainServiceException({
136
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
137
- $fault: "client",
138
- $metadata,
127
+ (0, smithy_client_1.throwDefaultError)({
128
+ output,
129
+ parsedBody,
130
+ exceptionCtor: CloudSearchDomainServiceException_1.CloudSearchDomainServiceException,
131
+ errorCode,
139
132
  });
140
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
141
133
  }
142
134
  };
143
135
  const deserializeAws_restJson1SuggestCommand = async (output, context) => {
144
136
  if (output.statusCode !== 200 && output.statusCode >= 300) {
145
137
  return deserializeAws_restJson1SuggestCommandError(output, context);
146
138
  }
147
- const contents = {
139
+ const contents = map({
148
140
  $metadata: deserializeMetadata(output),
149
- status: undefined,
150
- suggest: undefined,
151
- };
141
+ });
152
142
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
153
- if (data.status !== undefined && data.status !== null) {
143
+ if (data.status != null) {
154
144
  contents.status = deserializeAws_restJson1SuggestStatus(data.status, context);
155
145
  }
156
- if (data.suggest !== undefined && data.suggest !== null) {
146
+ if (data.suggest != null) {
157
147
  contents.suggest = deserializeAws_restJson1SuggestModel(data.suggest, context);
158
148
  }
159
- return Promise.resolve(contents);
149
+ return contents;
160
150
  };
161
151
  exports.deserializeAws_restJson1SuggestCommand = deserializeAws_restJson1SuggestCommand;
162
152
  const deserializeAws_restJson1SuggestCommandError = async (output, context) => {
@@ -164,7 +154,6 @@ const deserializeAws_restJson1SuggestCommandError = async (output, context) => {
164
154
  ...output,
165
155
  body: await parseBody(output.body, context),
166
156
  };
167
- let response;
168
157
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
169
158
  switch (errorCode) {
170
159
  case "SearchException":
@@ -172,41 +161,35 @@ const deserializeAws_restJson1SuggestCommandError = async (output, context) => {
172
161
  throw await deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context);
173
162
  default:
174
163
  const parsedBody = parsedOutput.body;
175
- const $metadata = deserializeMetadata(output);
176
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
177
- response = new CloudSearchDomainServiceException_1.CloudSearchDomainServiceException({
178
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
179
- $fault: "client",
180
- $metadata,
164
+ (0, smithy_client_1.throwDefaultError)({
165
+ output,
166
+ parsedBody,
167
+ exceptionCtor: CloudSearchDomainServiceException_1.CloudSearchDomainServiceException,
168
+ errorCode,
181
169
  });
182
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
183
170
  }
184
171
  };
185
172
  const deserializeAws_restJson1UploadDocumentsCommand = async (output, context) => {
186
173
  if (output.statusCode !== 200 && output.statusCode >= 300) {
187
174
  return deserializeAws_restJson1UploadDocumentsCommandError(output, context);
188
175
  }
189
- const contents = {
176
+ const contents = map({
190
177
  $metadata: deserializeMetadata(output),
191
- adds: undefined,
192
- deletes: undefined,
193
- status: undefined,
194
- warnings: undefined,
195
- };
178
+ });
196
179
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
197
- if (data.adds !== undefined && data.adds !== null) {
180
+ if (data.adds != null) {
198
181
  contents.adds = (0, smithy_client_1.expectLong)(data.adds);
199
182
  }
200
- if (data.deletes !== undefined && data.deletes !== null) {
183
+ if (data.deletes != null) {
201
184
  contents.deletes = (0, smithy_client_1.expectLong)(data.deletes);
202
185
  }
203
- if (data.status !== undefined && data.status !== null) {
186
+ if (data.status != null) {
204
187
  contents.status = (0, smithy_client_1.expectString)(data.status);
205
188
  }
206
- if (data.warnings !== undefined && data.warnings !== null) {
189
+ if (data.warnings != null) {
207
190
  contents.warnings = deserializeAws_restJson1DocumentServiceWarnings(data.warnings, context);
208
191
  }
209
- return Promise.resolve(contents);
192
+ return contents;
210
193
  };
211
194
  exports.deserializeAws_restJson1UploadDocumentsCommand = deserializeAws_restJson1UploadDocumentsCommand;
212
195
  const deserializeAws_restJson1UploadDocumentsCommandError = async (output, context) => {
@@ -214,7 +197,6 @@ const deserializeAws_restJson1UploadDocumentsCommandError = async (output, conte
214
197
  ...output,
215
198
  body: await parseBody(output.body, context),
216
199
  };
217
- let response;
218
200
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
219
201
  switch (errorCode) {
220
202
  case "DocumentServiceException":
@@ -222,23 +204,22 @@ const deserializeAws_restJson1UploadDocumentsCommandError = async (output, conte
222
204
  throw await deserializeAws_restJson1DocumentServiceExceptionResponse(parsedOutput, context);
223
205
  default:
224
206
  const parsedBody = parsedOutput.body;
225
- const $metadata = deserializeMetadata(output);
226
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
227
- response = new CloudSearchDomainServiceException_1.CloudSearchDomainServiceException({
228
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
229
- $fault: "client",
230
- $metadata,
207
+ (0, smithy_client_1.throwDefaultError)({
208
+ output,
209
+ parsedBody,
210
+ exceptionCtor: CloudSearchDomainServiceException_1.CloudSearchDomainServiceException,
211
+ errorCode,
231
212
  });
232
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
233
213
  }
234
214
  };
215
+ const map = smithy_client_1.map;
235
216
  const deserializeAws_restJson1DocumentServiceExceptionResponse = async (parsedOutput, context) => {
236
- const contents = {};
217
+ const contents = map({});
237
218
  const data = parsedOutput.body;
238
- if (data.message !== undefined && data.message !== null) {
219
+ if (data.message != null) {
239
220
  contents.message = (0, smithy_client_1.expectString)(data.message);
240
221
  }
241
- if (data.status !== undefined && data.status !== null) {
222
+ if (data.status != null) {
242
223
  contents.status = (0, smithy_client_1.expectString)(data.status);
243
224
  }
244
225
  const exception = new models_0_1.DocumentServiceException({
@@ -248,9 +229,9 @@ const deserializeAws_restJson1DocumentServiceExceptionResponse = async (parsedOu
248
229
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
249
230
  };
250
231
  const deserializeAws_restJson1SearchExceptionResponse = async (parsedOutput, context) => {
251
- const contents = {};
232
+ const contents = map({});
252
233
  const data = parsedOutput.body;
253
- if (data.message !== undefined && data.message !== null) {
234
+ if (data.message != null) {
254
235
  contents.message = (0, smithy_client_1.expectString)(data.message);
255
236
  }
256
237
  const exception = new models_0_1.SearchException({
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { SearchRequest, SearchResponse } from "../models/models_0";
4
+ import { SearchRequestFilterSensitiveLog, SearchResponseFilterSensitiveLog, } from "../models/models_0";
5
5
  import { deserializeAws_restJson1SearchCommand, serializeAws_restJson1SearchCommand } from "../protocols/Aws_restJson1";
6
6
  var SearchCommand = (function (_super) {
7
7
  __extends(SearchCommand, _super);
@@ -20,8 +20,8 @@ var SearchCommand = (function (_super) {
20
20
  logger: logger,
21
21
  clientName: clientName,
22
22
  commandName: commandName,
23
- inputFilterSensitiveLog: SearchRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: SearchResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: SearchRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: SearchResponseFilterSensitiveLog,
25
25
  };
26
26
  var requestHandler = configuration.requestHandler;
27
27
  return stack.resolve(function (request) {
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { SuggestRequest, SuggestResponse } from "../models/models_0";
4
+ import { SuggestRequestFilterSensitiveLog, SuggestResponseFilterSensitiveLog, } from "../models/models_0";
5
5
  import { deserializeAws_restJson1SuggestCommand, serializeAws_restJson1SuggestCommand, } from "../protocols/Aws_restJson1";
6
6
  var SuggestCommand = (function (_super) {
7
7
  __extends(SuggestCommand, _super);
@@ -20,8 +20,8 @@ var SuggestCommand = (function (_super) {
20
20
  logger: logger,
21
21
  clientName: clientName,
22
22
  commandName: commandName,
23
- inputFilterSensitiveLog: SuggestRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: SuggestResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: SuggestRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: SuggestResponseFilterSensitiveLog,
25
25
  };
26
26
  var requestHandler = configuration.requestHandler;
27
27
  return stack.resolve(function (request) {
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { UploadDocumentsRequest, UploadDocumentsResponse } from "../models/models_0";
4
+ import { UploadDocumentsRequestFilterSensitiveLog, UploadDocumentsResponseFilterSensitiveLog, } from "../models/models_0";
5
5
  import { deserializeAws_restJson1UploadDocumentsCommand, serializeAws_restJson1UploadDocumentsCommand, } from "../protocols/Aws_restJson1";
6
6
  var UploadDocumentsCommand = (function (_super) {
7
7
  __extends(UploadDocumentsCommand, _super);
@@ -20,8 +20,8 @@ var UploadDocumentsCommand = (function (_super) {
20
20
  logger: logger,
21
21
  clientName: clientName,
22
22
  commandName: commandName,
23
- inputFilterSensitiveLog: UploadDocumentsRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: UploadDocumentsResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: UploadDocumentsRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: UploadDocumentsResponseFilterSensitiveLog,
25
25
  };
26
26
  var requestHandler = configuration.requestHandler;
27
27
  return stack.resolve(function (request) {