@sparkrewards/sra-sdk 0.0.1

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 (106) hide show
  1. package/LICENSE +201 -0
  2. package/dist-cjs/index.js +8 -0
  3. package/dist-cjs/models/index.js +4 -0
  4. package/dist-cjs/models/models_0.js +1901 -0
  5. package/dist-cjs/openapi.js +7 -0
  6. package/dist-cjs/openapi.json +2864 -0
  7. package/dist-cjs/protocols/Aws_restJson1.js +2939 -0
  8. package/dist-cjs/server/AppAPIService.js +371 -0
  9. package/dist-cjs/server/index.js +5 -0
  10. package/dist-cjs/server/operations/DeleteUser.js +121 -0
  11. package/dist-cjs/server/operations/FavoritePlans.js +125 -0
  12. package/dist-cjs/server/operations/FavoriteShops.js +122 -0
  13. package/dist-cjs/server/operations/GetShop.js +126 -0
  14. package/dist-cjs/server/operations/GetShopPublic.js +127 -0
  15. package/dist-cjs/server/operations/GetUser.js +121 -0
  16. package/dist-cjs/server/operations/LikeOrg.js +124 -0
  17. package/dist-cjs/server/operations/NearbyShops.js +121 -0
  18. package/dist-cjs/server/operations/NearbyShopsPublic.js +122 -0
  19. package/dist-cjs/server/operations/NearestShop.js +126 -0
  20. package/dist-cjs/server/operations/OnboardUser.js +122 -0
  21. package/dist-cjs/server/operations/PinnedShop.js +126 -0
  22. package/dist-cjs/server/operations/PinnedShopPublic.js +127 -0
  23. package/dist-cjs/server/operations/Plan.js +123 -0
  24. package/dist-cjs/server/operations/PlanPublic.js +124 -0
  25. package/dist-cjs/server/operations/Plans.js +124 -0
  26. package/dist-cjs/server/operations/PopularShops.js +122 -0
  27. package/dist-cjs/server/operations/PopularShopsPublic.js +123 -0
  28. package/dist-cjs/server/operations/RadiusShops.js +123 -0
  29. package/dist-cjs/server/operations/RecordVisit.js +129 -0
  30. package/dist-cjs/server/operations/RedeemFirstTimeReward.js +125 -0
  31. package/dist-cjs/server/operations/RedeemPointReward.js +126 -0
  32. package/dist-cjs/server/operations/RedeemVisitReward.js +125 -0
  33. package/dist-cjs/server/operations/SearchShopsPublic.js +125 -0
  34. package/dist-cjs/server/operations/SearchSuggestion.js +126 -0
  35. package/dist-cjs/server/operations/UpdateUser.js +121 -0
  36. package/dist-cjs/server/operations/index.js +29 -0
  37. package/dist-es/index.js +4 -0
  38. package/dist-es/models/index.js +1 -0
  39. package/dist-es/models/models_0.js +1893 -0
  40. package/dist-es/openapi.js +3 -0
  41. package/dist-es/openapi.json +2864 -0
  42. package/dist-es/protocols/Aws_restJson1.js +2878 -0
  43. package/dist-es/server/AppAPIService.js +366 -0
  44. package/dist-es/server/index.js +2 -0
  45. package/dist-es/server/operations/DeleteUser.js +115 -0
  46. package/dist-es/server/operations/FavoritePlans.js +119 -0
  47. package/dist-es/server/operations/FavoriteShops.js +116 -0
  48. package/dist-es/server/operations/GetShop.js +120 -0
  49. package/dist-es/server/operations/GetShopPublic.js +121 -0
  50. package/dist-es/server/operations/GetUser.js +115 -0
  51. package/dist-es/server/operations/LikeOrg.js +118 -0
  52. package/dist-es/server/operations/NearbyShops.js +115 -0
  53. package/dist-es/server/operations/NearbyShopsPublic.js +116 -0
  54. package/dist-es/server/operations/NearestShop.js +120 -0
  55. package/dist-es/server/operations/OnboardUser.js +116 -0
  56. package/dist-es/server/operations/PinnedShop.js +120 -0
  57. package/dist-es/server/operations/PinnedShopPublic.js +121 -0
  58. package/dist-es/server/operations/Plan.js +117 -0
  59. package/dist-es/server/operations/PlanPublic.js +118 -0
  60. package/dist-es/server/operations/Plans.js +118 -0
  61. package/dist-es/server/operations/PopularShops.js +116 -0
  62. package/dist-es/server/operations/PopularShopsPublic.js +117 -0
  63. package/dist-es/server/operations/RadiusShops.js +117 -0
  64. package/dist-es/server/operations/RecordVisit.js +123 -0
  65. package/dist-es/server/operations/RedeemFirstTimeReward.js +119 -0
  66. package/dist-es/server/operations/RedeemPointReward.js +120 -0
  67. package/dist-es/server/operations/RedeemVisitReward.js +119 -0
  68. package/dist-es/server/operations/SearchShopsPublic.js +119 -0
  69. package/dist-es/server/operations/SearchSuggestion.js +120 -0
  70. package/dist-es/server/operations/UpdateUser.js +115 -0
  71. package/dist-es/server/operations/index.js +26 -0
  72. package/dist-types/index.d.ts +9 -0
  73. package/dist-types/models/index.d.ts +1 -0
  74. package/dist-types/models/models_0.d.ts +832 -0
  75. package/dist-types/openapi.d.ts +7 -0
  76. package/dist-types/protocols/Aws_restJson1.d.ts +87 -0
  77. package/dist-types/server/AppAPIService.d.ts +76 -0
  78. package/dist-types/server/index.d.ts +2 -0
  79. package/dist-types/server/operations/DeleteUser.d.ts +41 -0
  80. package/dist-types/server/operations/FavoritePlans.d.ts +41 -0
  81. package/dist-types/server/operations/FavoriteShops.d.ts +41 -0
  82. package/dist-types/server/operations/GetShop.d.ts +41 -0
  83. package/dist-types/server/operations/GetShopPublic.d.ts +41 -0
  84. package/dist-types/server/operations/GetUser.d.ts +41 -0
  85. package/dist-types/server/operations/LikeOrg.d.ts +41 -0
  86. package/dist-types/server/operations/NearbyShops.d.ts +41 -0
  87. package/dist-types/server/operations/NearbyShopsPublic.d.ts +41 -0
  88. package/dist-types/server/operations/NearestShop.d.ts +41 -0
  89. package/dist-types/server/operations/OnboardUser.d.ts +41 -0
  90. package/dist-types/server/operations/PinnedShop.d.ts +41 -0
  91. package/dist-types/server/operations/PinnedShopPublic.d.ts +41 -0
  92. package/dist-types/server/operations/Plan.d.ts +41 -0
  93. package/dist-types/server/operations/PlanPublic.d.ts +41 -0
  94. package/dist-types/server/operations/Plans.d.ts +41 -0
  95. package/dist-types/server/operations/PopularShops.d.ts +41 -0
  96. package/dist-types/server/operations/PopularShopsPublic.d.ts +41 -0
  97. package/dist-types/server/operations/RadiusShops.d.ts +41 -0
  98. package/dist-types/server/operations/RecordVisit.d.ts +41 -0
  99. package/dist-types/server/operations/RedeemFirstTimeReward.d.ts +41 -0
  100. package/dist-types/server/operations/RedeemPointReward.d.ts +41 -0
  101. package/dist-types/server/operations/RedeemVisitReward.d.ts +41 -0
  102. package/dist-types/server/operations/SearchShopsPublic.d.ts +41 -0
  103. package/dist-types/server/operations/SearchSuggestion.d.ts +41 -0
  104. package/dist-types/server/operations/UpdateUser.d.ts +41 -0
  105. package/dist-types/server/operations/index.d.ts +26 -0
  106. package/package.json +66 -0
@@ -0,0 +1,2939 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeSearchShopsPublicResponse = exports.serializeRedeemVisitRewardResponse = exports.serializeRedeemPointRewardResponse = exports.serializeRedeemFirstTimeRewardResponse = exports.serializeRecordVisitResponse = exports.serializeRadiusShopsResponse = exports.serializePopularShopsPublicResponse = exports.serializePopularShopsResponse = exports.serializePlansResponse = exports.serializePlanPublicResponse = exports.serializePlanResponse = exports.serializePinnedShopPublicResponse = exports.serializePinnedShopResponse = exports.serializeOnboardUserResponse = exports.serializeNearestShopResponse = exports.serializeNearbyShopsPublicResponse = exports.serializeNearbyShopsResponse = exports.serializeLikeOrgResponse = exports.serializeGetUserResponse = exports.serializeGetShopPublicResponse = exports.serializeGetShopResponse = exports.serializeFavoriteShopsResponse = exports.serializeFavoritePlansResponse = exports.serializeDeleteUserResponse = exports.deserializeUpdateUserRequest = exports.deserializeSearchSuggestionRequest = exports.deserializeSearchShopsPublicRequest = exports.deserializeRedeemVisitRewardRequest = exports.deserializeRedeemPointRewardRequest = exports.deserializeRedeemFirstTimeRewardRequest = exports.deserializeRecordVisitRequest = exports.deserializeRadiusShopsRequest = exports.deserializePopularShopsPublicRequest = exports.deserializePopularShopsRequest = exports.deserializePlansRequest = exports.deserializePlanPublicRequest = exports.deserializePlanRequest = exports.deserializePinnedShopPublicRequest = exports.deserializePinnedShopRequest = exports.deserializeOnboardUserRequest = exports.deserializeNearestShopRequest = exports.deserializeNearbyShopsPublicRequest = exports.deserializeNearbyShopsRequest = exports.deserializeLikeOrgRequest = exports.deserializeGetUserRequest = exports.deserializeGetShopPublicRequest = exports.deserializeGetShopRequest = exports.deserializeFavoriteShopsRequest = exports.deserializeFavoritePlansRequest = exports.deserializeDeleteUserRequest = void 0;
4
+ exports.serializeRuntimeErrorError = exports.serializeNotFoundErrorError = exports.serializeInvalidOperationErrorError = exports.serializeValidationExceptionError = exports.serializeFrameworkException = exports.serializeUpdateUserResponse = exports.serializeSearchSuggestionResponse = void 0;
5
+ const core_1 = require("@aws-sdk/core");
6
+ const server_common_1 = require("@aws-smithy/server-common");
7
+ const protocol_http_1 = require("@smithy/protocol-http");
8
+ const smithy_client_1 = require("@smithy/smithy-client");
9
+ const util_body_length_node_1 = require("@smithy/util-body-length-node");
10
+ const deserializeDeleteUserRequest = async (output, context) => {
11
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
12
+ if (contentTypeHeaderKey != null) {
13
+ const contentType = output.headers[contentTypeHeaderKey];
14
+ if (contentType !== undefined && contentType !== "application/json") {
15
+ throw new server_common_1.UnsupportedMediaTypeException();
16
+ }
17
+ ;
18
+ }
19
+ ;
20
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
21
+ if (acceptHeaderKey != null) {
22
+ const accept = output.headers[acceptHeaderKey];
23
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
24
+ throw new server_common_1.NotAcceptableException();
25
+ }
26
+ ;
27
+ }
28
+ ;
29
+ const contents = (0, smithy_client_1.map)({});
30
+ await (0, smithy_client_1.collectBody)(output.body, context);
31
+ return contents;
32
+ };
33
+ exports.deserializeDeleteUserRequest = deserializeDeleteUserRequest;
34
+ const deserializeFavoritePlansRequest = async (output, context) => {
35
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
36
+ if (contentTypeHeaderKey != null) {
37
+ const contentType = output.headers[contentTypeHeaderKey];
38
+ if (contentType !== undefined && contentType !== "application/json") {
39
+ throw new server_common_1.UnsupportedMediaTypeException();
40
+ }
41
+ ;
42
+ }
43
+ ;
44
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
45
+ if (acceptHeaderKey != null) {
46
+ const accept = output.headers[acceptHeaderKey];
47
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
48
+ throw new server_common_1.NotAcceptableException();
49
+ }
50
+ ;
51
+ }
52
+ ;
53
+ const contents = (0, smithy_client_1.map)({});
54
+ const query = output.query;
55
+ if (query != null) {
56
+ if (query["page"] !== undefined) {
57
+ let queryValue;
58
+ if (Array.isArray(query["page"])) {
59
+ if (query["page"].length === 1) {
60
+ queryValue = query["page"][0];
61
+ }
62
+ else {
63
+ throw new server_common_1.SerializationException();
64
+ }
65
+ }
66
+ else {
67
+ queryValue = query["page"];
68
+ }
69
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
70
+ }
71
+ if (query["limit"] !== undefined) {
72
+ let queryValue;
73
+ if (Array.isArray(query["limit"])) {
74
+ if (query["limit"].length === 1) {
75
+ queryValue = query["limit"][0];
76
+ }
77
+ else {
78
+ throw new server_common_1.SerializationException();
79
+ }
80
+ }
81
+ else {
82
+ queryValue = query["limit"];
83
+ }
84
+ contents.limit = (0, smithy_client_1.strictParseInt32)(queryValue);
85
+ }
86
+ if (query["lat"] !== undefined) {
87
+ let queryValue;
88
+ if (Array.isArray(query["lat"])) {
89
+ if (query["lat"].length === 1) {
90
+ queryValue = query["lat"][0];
91
+ }
92
+ else {
93
+ throw new server_common_1.SerializationException();
94
+ }
95
+ }
96
+ else {
97
+ queryValue = query["lat"];
98
+ }
99
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
100
+ }
101
+ if (query["lon"] !== undefined) {
102
+ let queryValue;
103
+ if (Array.isArray(query["lon"])) {
104
+ if (query["lon"].length === 1) {
105
+ queryValue = query["lon"][0];
106
+ }
107
+ else {
108
+ throw new server_common_1.SerializationException();
109
+ }
110
+ }
111
+ else {
112
+ queryValue = query["lon"];
113
+ }
114
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
115
+ }
116
+ }
117
+ await (0, smithy_client_1.collectBody)(output.body, context);
118
+ return contents;
119
+ };
120
+ exports.deserializeFavoritePlansRequest = deserializeFavoritePlansRequest;
121
+ const deserializeFavoriteShopsRequest = async (output, context) => {
122
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
123
+ if (contentTypeHeaderKey != null) {
124
+ const contentType = output.headers[contentTypeHeaderKey];
125
+ if (contentType !== undefined && contentType !== "application/json") {
126
+ throw new server_common_1.UnsupportedMediaTypeException();
127
+ }
128
+ ;
129
+ }
130
+ ;
131
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
132
+ if (acceptHeaderKey != null) {
133
+ const accept = output.headers[acceptHeaderKey];
134
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
135
+ throw new server_common_1.NotAcceptableException();
136
+ }
137
+ ;
138
+ }
139
+ ;
140
+ const contents = (0, smithy_client_1.map)({});
141
+ const query = output.query;
142
+ if (query != null) {
143
+ if (query["lat"] !== undefined) {
144
+ let queryValue;
145
+ if (Array.isArray(query["lat"])) {
146
+ if (query["lat"].length === 1) {
147
+ queryValue = query["lat"][0];
148
+ }
149
+ else {
150
+ throw new server_common_1.SerializationException();
151
+ }
152
+ }
153
+ else {
154
+ queryValue = query["lat"];
155
+ }
156
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
157
+ }
158
+ if (query["lon"] !== undefined) {
159
+ let queryValue;
160
+ if (Array.isArray(query["lon"])) {
161
+ if (query["lon"].length === 1) {
162
+ queryValue = query["lon"][0];
163
+ }
164
+ else {
165
+ throw new server_common_1.SerializationException();
166
+ }
167
+ }
168
+ else {
169
+ queryValue = query["lon"];
170
+ }
171
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
172
+ }
173
+ if (query["page"] !== undefined) {
174
+ let queryValue;
175
+ if (Array.isArray(query["page"])) {
176
+ if (query["page"].length === 1) {
177
+ queryValue = query["page"][0];
178
+ }
179
+ else {
180
+ throw new server_common_1.SerializationException();
181
+ }
182
+ }
183
+ else {
184
+ queryValue = query["page"];
185
+ }
186
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
187
+ }
188
+ if (query["filters"] !== undefined) {
189
+ let queryValue;
190
+ if (Array.isArray(query["filters"])) {
191
+ if (query["filters"].length === 1) {
192
+ queryValue = query["filters"][0];
193
+ }
194
+ else {
195
+ throw new server_common_1.SerializationException();
196
+ }
197
+ }
198
+ else {
199
+ queryValue = query["filters"];
200
+ }
201
+ contents.filters = queryValue;
202
+ }
203
+ }
204
+ await (0, smithy_client_1.collectBody)(output.body, context);
205
+ return contents;
206
+ };
207
+ exports.deserializeFavoriteShopsRequest = deserializeFavoriteShopsRequest;
208
+ const deserializeGetShopRequest = async (output, context) => {
209
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
210
+ if (contentTypeHeaderKey != null) {
211
+ const contentType = output.headers[contentTypeHeaderKey];
212
+ if (contentType !== undefined && contentType !== "application/json") {
213
+ throw new server_common_1.UnsupportedMediaTypeException();
214
+ }
215
+ ;
216
+ }
217
+ ;
218
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
219
+ if (acceptHeaderKey != null) {
220
+ const accept = output.headers[acceptHeaderKey];
221
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
222
+ throw new server_common_1.NotAcceptableException();
223
+ }
224
+ ;
225
+ }
226
+ ;
227
+ const contents = (0, smithy_client_1.map)({});
228
+ const pathRegex = new RegExp("/shops/shop/(?<shop_id>[^/]+)");
229
+ const parsedPath = output.path.match(pathRegex);
230
+ if (parsedPath?.groups !== undefined) {
231
+ contents.shop_id = decodeURIComponent(parsedPath.groups.shop_id);
232
+ }
233
+ await (0, smithy_client_1.collectBody)(output.body, context);
234
+ return contents;
235
+ };
236
+ exports.deserializeGetShopRequest = deserializeGetShopRequest;
237
+ const deserializeGetShopPublicRequest = async (output, context) => {
238
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
239
+ if (contentTypeHeaderKey != null) {
240
+ const contentType = output.headers[contentTypeHeaderKey];
241
+ if (contentType !== undefined && contentType !== "application/json") {
242
+ throw new server_common_1.UnsupportedMediaTypeException();
243
+ }
244
+ ;
245
+ }
246
+ ;
247
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
248
+ if (acceptHeaderKey != null) {
249
+ const accept = output.headers[acceptHeaderKey];
250
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
251
+ throw new server_common_1.NotAcceptableException();
252
+ }
253
+ ;
254
+ }
255
+ ;
256
+ const contents = (0, smithy_client_1.map)({});
257
+ const pathRegex = new RegExp("/public/shops/shop/(?<shop_id>[^/]+)");
258
+ const parsedPath = output.path.match(pathRegex);
259
+ if (parsedPath?.groups !== undefined) {
260
+ contents.shop_id = decodeURIComponent(parsedPath.groups.shop_id);
261
+ }
262
+ await (0, smithy_client_1.collectBody)(output.body, context);
263
+ return contents;
264
+ };
265
+ exports.deserializeGetShopPublicRequest = deserializeGetShopPublicRequest;
266
+ const deserializeGetUserRequest = async (output, context) => {
267
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
268
+ if (contentTypeHeaderKey != null) {
269
+ const contentType = output.headers[contentTypeHeaderKey];
270
+ if (contentType !== undefined && contentType !== "application/json") {
271
+ throw new server_common_1.UnsupportedMediaTypeException();
272
+ }
273
+ ;
274
+ }
275
+ ;
276
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
277
+ if (acceptHeaderKey != null) {
278
+ const accept = output.headers[acceptHeaderKey];
279
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
280
+ throw new server_common_1.NotAcceptableException();
281
+ }
282
+ ;
283
+ }
284
+ ;
285
+ const contents = (0, smithy_client_1.map)({});
286
+ await (0, smithy_client_1.collectBody)(output.body, context);
287
+ return contents;
288
+ };
289
+ exports.deserializeGetUserRequest = deserializeGetUserRequest;
290
+ const deserializeLikeOrgRequest = async (output, context) => {
291
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
292
+ if (contentTypeHeaderKey != null) {
293
+ const contentType = output.headers[contentTypeHeaderKey];
294
+ if (contentType !== undefined && contentType !== "application/json") {
295
+ throw new server_common_1.UnsupportedMediaTypeException();
296
+ }
297
+ ;
298
+ }
299
+ ;
300
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
301
+ if (acceptHeaderKey != null) {
302
+ const accept = output.headers[acceptHeaderKey];
303
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
304
+ throw new server_common_1.NotAcceptableException();
305
+ }
306
+ ;
307
+ }
308
+ ;
309
+ const contents = (0, smithy_client_1.map)({});
310
+ const query = output.query;
311
+ if (query != null) {
312
+ if (query["org_id"] !== undefined) {
313
+ let queryValue;
314
+ if (Array.isArray(query["org_id"])) {
315
+ if (query["org_id"].length === 1) {
316
+ queryValue = query["org_id"][0];
317
+ }
318
+ else {
319
+ throw new server_common_1.SerializationException();
320
+ }
321
+ }
322
+ else {
323
+ queryValue = query["org_id"];
324
+ }
325
+ contents.org_id = queryValue;
326
+ }
327
+ }
328
+ await (0, smithy_client_1.collectBody)(output.body, context);
329
+ return contents;
330
+ };
331
+ exports.deserializeLikeOrgRequest = deserializeLikeOrgRequest;
332
+ const deserializeNearbyShopsRequest = async (output, context) => {
333
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
334
+ if (contentTypeHeaderKey != null) {
335
+ const contentType = output.headers[contentTypeHeaderKey];
336
+ if (contentType !== undefined && contentType !== "application/json") {
337
+ throw new server_common_1.UnsupportedMediaTypeException();
338
+ }
339
+ ;
340
+ }
341
+ ;
342
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
343
+ if (acceptHeaderKey != null) {
344
+ const accept = output.headers[acceptHeaderKey];
345
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
346
+ throw new server_common_1.NotAcceptableException();
347
+ }
348
+ ;
349
+ }
350
+ ;
351
+ const contents = (0, smithy_client_1.map)({});
352
+ const query = output.query;
353
+ if (query != null) {
354
+ if (query["lat"] !== undefined) {
355
+ let queryValue;
356
+ if (Array.isArray(query["lat"])) {
357
+ if (query["lat"].length === 1) {
358
+ queryValue = query["lat"][0];
359
+ }
360
+ else {
361
+ throw new server_common_1.SerializationException();
362
+ }
363
+ }
364
+ else {
365
+ queryValue = query["lat"];
366
+ }
367
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
368
+ }
369
+ if (query["lon"] !== undefined) {
370
+ let queryValue;
371
+ if (Array.isArray(query["lon"])) {
372
+ if (query["lon"].length === 1) {
373
+ queryValue = query["lon"][0];
374
+ }
375
+ else {
376
+ throw new server_common_1.SerializationException();
377
+ }
378
+ }
379
+ else {
380
+ queryValue = query["lon"];
381
+ }
382
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
383
+ }
384
+ if (query["page"] !== undefined) {
385
+ let queryValue;
386
+ if (Array.isArray(query["page"])) {
387
+ if (query["page"].length === 1) {
388
+ queryValue = query["page"][0];
389
+ }
390
+ else {
391
+ throw new server_common_1.SerializationException();
392
+ }
393
+ }
394
+ else {
395
+ queryValue = query["page"];
396
+ }
397
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
398
+ }
399
+ if (query["filters"] !== undefined) {
400
+ let queryValue;
401
+ if (Array.isArray(query["filters"])) {
402
+ if (query["filters"].length === 1) {
403
+ queryValue = query["filters"][0];
404
+ }
405
+ else {
406
+ throw new server_common_1.SerializationException();
407
+ }
408
+ }
409
+ else {
410
+ queryValue = query["filters"];
411
+ }
412
+ contents.filters = queryValue;
413
+ }
414
+ }
415
+ await (0, smithy_client_1.collectBody)(output.body, context);
416
+ return contents;
417
+ };
418
+ exports.deserializeNearbyShopsRequest = deserializeNearbyShopsRequest;
419
+ const deserializeNearbyShopsPublicRequest = async (output, context) => {
420
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
421
+ if (contentTypeHeaderKey != null) {
422
+ const contentType = output.headers[contentTypeHeaderKey];
423
+ if (contentType !== undefined && contentType !== "application/json") {
424
+ throw new server_common_1.UnsupportedMediaTypeException();
425
+ }
426
+ ;
427
+ }
428
+ ;
429
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
430
+ if (acceptHeaderKey != null) {
431
+ const accept = output.headers[acceptHeaderKey];
432
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
433
+ throw new server_common_1.NotAcceptableException();
434
+ }
435
+ ;
436
+ }
437
+ ;
438
+ const contents = (0, smithy_client_1.map)({});
439
+ const query = output.query;
440
+ if (query != null) {
441
+ if (query["lat"] !== undefined) {
442
+ let queryValue;
443
+ if (Array.isArray(query["lat"])) {
444
+ if (query["lat"].length === 1) {
445
+ queryValue = query["lat"][0];
446
+ }
447
+ else {
448
+ throw new server_common_1.SerializationException();
449
+ }
450
+ }
451
+ else {
452
+ queryValue = query["lat"];
453
+ }
454
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
455
+ }
456
+ if (query["lon"] !== undefined) {
457
+ let queryValue;
458
+ if (Array.isArray(query["lon"])) {
459
+ if (query["lon"].length === 1) {
460
+ queryValue = query["lon"][0];
461
+ }
462
+ else {
463
+ throw new server_common_1.SerializationException();
464
+ }
465
+ }
466
+ else {
467
+ queryValue = query["lon"];
468
+ }
469
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
470
+ }
471
+ if (query["page"] !== undefined) {
472
+ let queryValue;
473
+ if (Array.isArray(query["page"])) {
474
+ if (query["page"].length === 1) {
475
+ queryValue = query["page"][0];
476
+ }
477
+ else {
478
+ throw new server_common_1.SerializationException();
479
+ }
480
+ }
481
+ else {
482
+ queryValue = query["page"];
483
+ }
484
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
485
+ }
486
+ if (query["filters"] !== undefined) {
487
+ let queryValue;
488
+ if (Array.isArray(query["filters"])) {
489
+ if (query["filters"].length === 1) {
490
+ queryValue = query["filters"][0];
491
+ }
492
+ else {
493
+ throw new server_common_1.SerializationException();
494
+ }
495
+ }
496
+ else {
497
+ queryValue = query["filters"];
498
+ }
499
+ contents.filters = queryValue;
500
+ }
501
+ }
502
+ await (0, smithy_client_1.collectBody)(output.body, context);
503
+ return contents;
504
+ };
505
+ exports.deserializeNearbyShopsPublicRequest = deserializeNearbyShopsPublicRequest;
506
+ const deserializeNearestShopRequest = async (output, context) => {
507
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
508
+ if (contentTypeHeaderKey != null) {
509
+ const contentType = output.headers[contentTypeHeaderKey];
510
+ if (contentType !== undefined && contentType !== "application/json") {
511
+ throw new server_common_1.UnsupportedMediaTypeException();
512
+ }
513
+ ;
514
+ }
515
+ ;
516
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
517
+ if (acceptHeaderKey != null) {
518
+ const accept = output.headers[acceptHeaderKey];
519
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
520
+ throw new server_common_1.NotAcceptableException();
521
+ }
522
+ ;
523
+ }
524
+ ;
525
+ const contents = (0, smithy_client_1.map)({});
526
+ const query = output.query;
527
+ if (query != null) {
528
+ if (query["shop_name"] !== undefined) {
529
+ let queryValue;
530
+ if (Array.isArray(query["shop_name"])) {
531
+ if (query["shop_name"].length === 1) {
532
+ queryValue = query["shop_name"][0];
533
+ }
534
+ else {
535
+ throw new server_common_1.SerializationException();
536
+ }
537
+ }
538
+ else {
539
+ queryValue = query["shop_name"];
540
+ }
541
+ contents.shop_name = queryValue;
542
+ }
543
+ if (query["lat"] !== undefined) {
544
+ let queryValue;
545
+ if (Array.isArray(query["lat"])) {
546
+ if (query["lat"].length === 1) {
547
+ queryValue = query["lat"][0];
548
+ }
549
+ else {
550
+ throw new server_common_1.SerializationException();
551
+ }
552
+ }
553
+ else {
554
+ queryValue = query["lat"];
555
+ }
556
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
557
+ }
558
+ if (query["lon"] !== undefined) {
559
+ let queryValue;
560
+ if (Array.isArray(query["lon"])) {
561
+ if (query["lon"].length === 1) {
562
+ queryValue = query["lon"][0];
563
+ }
564
+ else {
565
+ throw new server_common_1.SerializationException();
566
+ }
567
+ }
568
+ else {
569
+ queryValue = query["lon"];
570
+ }
571
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
572
+ }
573
+ }
574
+ await (0, smithy_client_1.collectBody)(output.body, context);
575
+ return contents;
576
+ };
577
+ exports.deserializeNearestShopRequest = deserializeNearestShopRequest;
578
+ const deserializeOnboardUserRequest = async (output, context) => {
579
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
580
+ if (contentTypeHeaderKey != null) {
581
+ const contentType = output.headers[contentTypeHeaderKey];
582
+ if (contentType !== undefined && contentType !== "application/json") {
583
+ throw new server_common_1.UnsupportedMediaTypeException();
584
+ }
585
+ ;
586
+ }
587
+ ;
588
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
589
+ if (acceptHeaderKey != null) {
590
+ const accept = output.headers[acceptHeaderKey];
591
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
592
+ throw new server_common_1.NotAcceptableException();
593
+ }
594
+ ;
595
+ }
596
+ ;
597
+ const contents = (0, smithy_client_1.map)({});
598
+ await (0, smithy_client_1.collectBody)(output.body, context);
599
+ return contents;
600
+ };
601
+ exports.deserializeOnboardUserRequest = deserializeOnboardUserRequest;
602
+ const deserializePinnedShopRequest = async (output, context) => {
603
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
604
+ if (contentTypeHeaderKey != null) {
605
+ const contentType = output.headers[contentTypeHeaderKey];
606
+ if (contentType !== undefined && contentType !== "application/json") {
607
+ throw new server_common_1.UnsupportedMediaTypeException();
608
+ }
609
+ ;
610
+ }
611
+ ;
612
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
613
+ if (acceptHeaderKey != null) {
614
+ const accept = output.headers[acceptHeaderKey];
615
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
616
+ throw new server_common_1.NotAcceptableException();
617
+ }
618
+ ;
619
+ }
620
+ ;
621
+ const contents = (0, smithy_client_1.map)({});
622
+ const query = output.query;
623
+ if (query != null) {
624
+ if (query["shop_id"] !== undefined) {
625
+ let queryValue;
626
+ if (Array.isArray(query["shop_id"])) {
627
+ if (query["shop_id"].length === 1) {
628
+ queryValue = query["shop_id"][0];
629
+ }
630
+ else {
631
+ throw new server_common_1.SerializationException();
632
+ }
633
+ }
634
+ else {
635
+ queryValue = query["shop_id"];
636
+ }
637
+ contents.shop_id = queryValue;
638
+ }
639
+ if (query["lat"] !== undefined) {
640
+ let queryValue;
641
+ if (Array.isArray(query["lat"])) {
642
+ if (query["lat"].length === 1) {
643
+ queryValue = query["lat"][0];
644
+ }
645
+ else {
646
+ throw new server_common_1.SerializationException();
647
+ }
648
+ }
649
+ else {
650
+ queryValue = query["lat"];
651
+ }
652
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
653
+ }
654
+ if (query["lon"] !== undefined) {
655
+ let queryValue;
656
+ if (Array.isArray(query["lon"])) {
657
+ if (query["lon"].length === 1) {
658
+ queryValue = query["lon"][0];
659
+ }
660
+ else {
661
+ throw new server_common_1.SerializationException();
662
+ }
663
+ }
664
+ else {
665
+ queryValue = query["lon"];
666
+ }
667
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
668
+ }
669
+ }
670
+ await (0, smithy_client_1.collectBody)(output.body, context);
671
+ return contents;
672
+ };
673
+ exports.deserializePinnedShopRequest = deserializePinnedShopRequest;
674
+ const deserializePinnedShopPublicRequest = async (output, context) => {
675
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
676
+ if (contentTypeHeaderKey != null) {
677
+ const contentType = output.headers[contentTypeHeaderKey];
678
+ if (contentType !== undefined && contentType !== "application/json") {
679
+ throw new server_common_1.UnsupportedMediaTypeException();
680
+ }
681
+ ;
682
+ }
683
+ ;
684
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
685
+ if (acceptHeaderKey != null) {
686
+ const accept = output.headers[acceptHeaderKey];
687
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
688
+ throw new server_common_1.NotAcceptableException();
689
+ }
690
+ ;
691
+ }
692
+ ;
693
+ const contents = (0, smithy_client_1.map)({});
694
+ const query = output.query;
695
+ if (query != null) {
696
+ if (query["shop_id"] !== undefined) {
697
+ let queryValue;
698
+ if (Array.isArray(query["shop_id"])) {
699
+ if (query["shop_id"].length === 1) {
700
+ queryValue = query["shop_id"][0];
701
+ }
702
+ else {
703
+ throw new server_common_1.SerializationException();
704
+ }
705
+ }
706
+ else {
707
+ queryValue = query["shop_id"];
708
+ }
709
+ contents.shop_id = queryValue;
710
+ }
711
+ if (query["lat"] !== undefined) {
712
+ let queryValue;
713
+ if (Array.isArray(query["lat"])) {
714
+ if (query["lat"].length === 1) {
715
+ queryValue = query["lat"][0];
716
+ }
717
+ else {
718
+ throw new server_common_1.SerializationException();
719
+ }
720
+ }
721
+ else {
722
+ queryValue = query["lat"];
723
+ }
724
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
725
+ }
726
+ if (query["lon"] !== undefined) {
727
+ let queryValue;
728
+ if (Array.isArray(query["lon"])) {
729
+ if (query["lon"].length === 1) {
730
+ queryValue = query["lon"][0];
731
+ }
732
+ else {
733
+ throw new server_common_1.SerializationException();
734
+ }
735
+ }
736
+ else {
737
+ queryValue = query["lon"];
738
+ }
739
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
740
+ }
741
+ }
742
+ await (0, smithy_client_1.collectBody)(output.body, context);
743
+ return contents;
744
+ };
745
+ exports.deserializePinnedShopPublicRequest = deserializePinnedShopPublicRequest;
746
+ const deserializePlanRequest = async (output, context) => {
747
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
748
+ if (contentTypeHeaderKey != null) {
749
+ const contentType = output.headers[contentTypeHeaderKey];
750
+ if (contentType !== undefined && contentType !== "application/json") {
751
+ throw new server_common_1.UnsupportedMediaTypeException();
752
+ }
753
+ ;
754
+ }
755
+ ;
756
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
757
+ if (acceptHeaderKey != null) {
758
+ const accept = output.headers[acceptHeaderKey];
759
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
760
+ throw new server_common_1.NotAcceptableException();
761
+ }
762
+ ;
763
+ }
764
+ ;
765
+ const contents = (0, smithy_client_1.map)({});
766
+ const query = output.query;
767
+ if (query != null) {
768
+ if (query["org_id"] !== undefined) {
769
+ let queryValue;
770
+ if (Array.isArray(query["org_id"])) {
771
+ if (query["org_id"].length === 1) {
772
+ queryValue = query["org_id"][0];
773
+ }
774
+ else {
775
+ throw new server_common_1.SerializationException();
776
+ }
777
+ }
778
+ else {
779
+ queryValue = query["org_id"];
780
+ }
781
+ contents.org_id = queryValue;
782
+ }
783
+ }
784
+ await (0, smithy_client_1.collectBody)(output.body, context);
785
+ return contents;
786
+ };
787
+ exports.deserializePlanRequest = deserializePlanRequest;
788
+ const deserializePlanPublicRequest = async (output, context) => {
789
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
790
+ if (contentTypeHeaderKey != null) {
791
+ const contentType = output.headers[contentTypeHeaderKey];
792
+ if (contentType !== undefined && contentType !== "application/json") {
793
+ throw new server_common_1.UnsupportedMediaTypeException();
794
+ }
795
+ ;
796
+ }
797
+ ;
798
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
799
+ if (acceptHeaderKey != null) {
800
+ const accept = output.headers[acceptHeaderKey];
801
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
802
+ throw new server_common_1.NotAcceptableException();
803
+ }
804
+ ;
805
+ }
806
+ ;
807
+ const contents = (0, smithy_client_1.map)({});
808
+ const query = output.query;
809
+ if (query != null) {
810
+ if (query["org_id"] !== undefined) {
811
+ let queryValue;
812
+ if (Array.isArray(query["org_id"])) {
813
+ if (query["org_id"].length === 1) {
814
+ queryValue = query["org_id"][0];
815
+ }
816
+ else {
817
+ throw new server_common_1.SerializationException();
818
+ }
819
+ }
820
+ else {
821
+ queryValue = query["org_id"];
822
+ }
823
+ contents.org_id = queryValue;
824
+ }
825
+ }
826
+ await (0, smithy_client_1.collectBody)(output.body, context);
827
+ return contents;
828
+ };
829
+ exports.deserializePlanPublicRequest = deserializePlanPublicRequest;
830
+ const deserializePlansRequest = async (output, context) => {
831
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
832
+ if (contentTypeHeaderKey != null) {
833
+ const contentType = output.headers[contentTypeHeaderKey];
834
+ if (contentType !== undefined && contentType !== "application/json") {
835
+ throw new server_common_1.UnsupportedMediaTypeException();
836
+ }
837
+ ;
838
+ }
839
+ ;
840
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
841
+ if (acceptHeaderKey != null) {
842
+ const accept = output.headers[acceptHeaderKey];
843
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
844
+ throw new server_common_1.NotAcceptableException();
845
+ }
846
+ ;
847
+ }
848
+ ;
849
+ const contents = (0, smithy_client_1.map)({});
850
+ const query = output.query;
851
+ if (query != null) {
852
+ if (query["page"] !== undefined) {
853
+ let queryValue;
854
+ if (Array.isArray(query["page"])) {
855
+ if (query["page"].length === 1) {
856
+ queryValue = query["page"][0];
857
+ }
858
+ else {
859
+ throw new server_common_1.SerializationException();
860
+ }
861
+ }
862
+ else {
863
+ queryValue = query["page"];
864
+ }
865
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
866
+ }
867
+ if (query["limit"] !== undefined) {
868
+ let queryValue;
869
+ if (Array.isArray(query["limit"])) {
870
+ if (query["limit"].length === 1) {
871
+ queryValue = query["limit"][0];
872
+ }
873
+ else {
874
+ throw new server_common_1.SerializationException();
875
+ }
876
+ }
877
+ else {
878
+ queryValue = query["limit"];
879
+ }
880
+ contents.limit = (0, smithy_client_1.strictParseInt32)(queryValue);
881
+ }
882
+ if (query["lat"] !== undefined) {
883
+ let queryValue;
884
+ if (Array.isArray(query["lat"])) {
885
+ if (query["lat"].length === 1) {
886
+ queryValue = query["lat"][0];
887
+ }
888
+ else {
889
+ throw new server_common_1.SerializationException();
890
+ }
891
+ }
892
+ else {
893
+ queryValue = query["lat"];
894
+ }
895
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
896
+ }
897
+ if (query["lon"] !== undefined) {
898
+ let queryValue;
899
+ if (Array.isArray(query["lon"])) {
900
+ if (query["lon"].length === 1) {
901
+ queryValue = query["lon"][0];
902
+ }
903
+ else {
904
+ throw new server_common_1.SerializationException();
905
+ }
906
+ }
907
+ else {
908
+ queryValue = query["lon"];
909
+ }
910
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
911
+ }
912
+ }
913
+ await (0, smithy_client_1.collectBody)(output.body, context);
914
+ return contents;
915
+ };
916
+ exports.deserializePlansRequest = deserializePlansRequest;
917
+ const deserializePopularShopsRequest = async (output, context) => {
918
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
919
+ if (contentTypeHeaderKey != null) {
920
+ const contentType = output.headers[contentTypeHeaderKey];
921
+ if (contentType !== undefined && contentType !== "application/json") {
922
+ throw new server_common_1.UnsupportedMediaTypeException();
923
+ }
924
+ ;
925
+ }
926
+ ;
927
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
928
+ if (acceptHeaderKey != null) {
929
+ const accept = output.headers[acceptHeaderKey];
930
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
931
+ throw new server_common_1.NotAcceptableException();
932
+ }
933
+ ;
934
+ }
935
+ ;
936
+ const contents = (0, smithy_client_1.map)({});
937
+ const query = output.query;
938
+ if (query != null) {
939
+ if (query["lat"] !== undefined) {
940
+ let queryValue;
941
+ if (Array.isArray(query["lat"])) {
942
+ if (query["lat"].length === 1) {
943
+ queryValue = query["lat"][0];
944
+ }
945
+ else {
946
+ throw new server_common_1.SerializationException();
947
+ }
948
+ }
949
+ else {
950
+ queryValue = query["lat"];
951
+ }
952
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
953
+ }
954
+ if (query["lon"] !== undefined) {
955
+ let queryValue;
956
+ if (Array.isArray(query["lon"])) {
957
+ if (query["lon"].length === 1) {
958
+ queryValue = query["lon"][0];
959
+ }
960
+ else {
961
+ throw new server_common_1.SerializationException();
962
+ }
963
+ }
964
+ else {
965
+ queryValue = query["lon"];
966
+ }
967
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
968
+ }
969
+ if (query["page"] !== undefined) {
970
+ let queryValue;
971
+ if (Array.isArray(query["page"])) {
972
+ if (query["page"].length === 1) {
973
+ queryValue = query["page"][0];
974
+ }
975
+ else {
976
+ throw new server_common_1.SerializationException();
977
+ }
978
+ }
979
+ else {
980
+ queryValue = query["page"];
981
+ }
982
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
983
+ }
984
+ if (query["filters"] !== undefined) {
985
+ let queryValue;
986
+ if (Array.isArray(query["filters"])) {
987
+ if (query["filters"].length === 1) {
988
+ queryValue = query["filters"][0];
989
+ }
990
+ else {
991
+ throw new server_common_1.SerializationException();
992
+ }
993
+ }
994
+ else {
995
+ queryValue = query["filters"];
996
+ }
997
+ contents.filters = queryValue;
998
+ }
999
+ }
1000
+ await (0, smithy_client_1.collectBody)(output.body, context);
1001
+ return contents;
1002
+ };
1003
+ exports.deserializePopularShopsRequest = deserializePopularShopsRequest;
1004
+ const deserializePopularShopsPublicRequest = async (output, context) => {
1005
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1006
+ if (contentTypeHeaderKey != null) {
1007
+ const contentType = output.headers[contentTypeHeaderKey];
1008
+ if (contentType !== undefined && contentType !== "application/json") {
1009
+ throw new server_common_1.UnsupportedMediaTypeException();
1010
+ }
1011
+ ;
1012
+ }
1013
+ ;
1014
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1015
+ if (acceptHeaderKey != null) {
1016
+ const accept = output.headers[acceptHeaderKey];
1017
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1018
+ throw new server_common_1.NotAcceptableException();
1019
+ }
1020
+ ;
1021
+ }
1022
+ ;
1023
+ const contents = (0, smithy_client_1.map)({});
1024
+ const query = output.query;
1025
+ if (query != null) {
1026
+ if (query["lat"] !== undefined) {
1027
+ let queryValue;
1028
+ if (Array.isArray(query["lat"])) {
1029
+ if (query["lat"].length === 1) {
1030
+ queryValue = query["lat"][0];
1031
+ }
1032
+ else {
1033
+ throw new server_common_1.SerializationException();
1034
+ }
1035
+ }
1036
+ else {
1037
+ queryValue = query["lat"];
1038
+ }
1039
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
1040
+ }
1041
+ if (query["lon"] !== undefined) {
1042
+ let queryValue;
1043
+ if (Array.isArray(query["lon"])) {
1044
+ if (query["lon"].length === 1) {
1045
+ queryValue = query["lon"][0];
1046
+ }
1047
+ else {
1048
+ throw new server_common_1.SerializationException();
1049
+ }
1050
+ }
1051
+ else {
1052
+ queryValue = query["lon"];
1053
+ }
1054
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
1055
+ }
1056
+ if (query["page"] !== undefined) {
1057
+ let queryValue;
1058
+ if (Array.isArray(query["page"])) {
1059
+ if (query["page"].length === 1) {
1060
+ queryValue = query["page"][0];
1061
+ }
1062
+ else {
1063
+ throw new server_common_1.SerializationException();
1064
+ }
1065
+ }
1066
+ else {
1067
+ queryValue = query["page"];
1068
+ }
1069
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
1070
+ }
1071
+ if (query["filters"] !== undefined) {
1072
+ let queryValue;
1073
+ if (Array.isArray(query["filters"])) {
1074
+ if (query["filters"].length === 1) {
1075
+ queryValue = query["filters"][0];
1076
+ }
1077
+ else {
1078
+ throw new server_common_1.SerializationException();
1079
+ }
1080
+ }
1081
+ else {
1082
+ queryValue = query["filters"];
1083
+ }
1084
+ contents.filters = queryValue;
1085
+ }
1086
+ }
1087
+ await (0, smithy_client_1.collectBody)(output.body, context);
1088
+ return contents;
1089
+ };
1090
+ exports.deserializePopularShopsPublicRequest = deserializePopularShopsPublicRequest;
1091
+ const deserializeRadiusShopsRequest = async (output, context) => {
1092
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1093
+ if (contentTypeHeaderKey != null) {
1094
+ const contentType = output.headers[contentTypeHeaderKey];
1095
+ if (contentType !== undefined && contentType !== "application/json") {
1096
+ throw new server_common_1.UnsupportedMediaTypeException();
1097
+ }
1098
+ ;
1099
+ }
1100
+ ;
1101
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1102
+ if (acceptHeaderKey != null) {
1103
+ const accept = output.headers[acceptHeaderKey];
1104
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1105
+ throw new server_common_1.NotAcceptableException();
1106
+ }
1107
+ ;
1108
+ }
1109
+ ;
1110
+ const contents = (0, smithy_client_1.map)({});
1111
+ const query = output.query;
1112
+ if (query != null) {
1113
+ if (query["lat"] !== undefined) {
1114
+ let queryValue;
1115
+ if (Array.isArray(query["lat"])) {
1116
+ if (query["lat"].length === 1) {
1117
+ queryValue = query["lat"][0];
1118
+ }
1119
+ else {
1120
+ throw new server_common_1.SerializationException();
1121
+ }
1122
+ }
1123
+ else {
1124
+ queryValue = query["lat"];
1125
+ }
1126
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
1127
+ }
1128
+ if (query["lon"] !== undefined) {
1129
+ let queryValue;
1130
+ if (Array.isArray(query["lon"])) {
1131
+ if (query["lon"].length === 1) {
1132
+ queryValue = query["lon"][0];
1133
+ }
1134
+ else {
1135
+ throw new server_common_1.SerializationException();
1136
+ }
1137
+ }
1138
+ else {
1139
+ queryValue = query["lon"];
1140
+ }
1141
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
1142
+ }
1143
+ if (query["page"] !== undefined) {
1144
+ let queryValue;
1145
+ if (Array.isArray(query["page"])) {
1146
+ if (query["page"].length === 1) {
1147
+ queryValue = query["page"][0];
1148
+ }
1149
+ else {
1150
+ throw new server_common_1.SerializationException();
1151
+ }
1152
+ }
1153
+ else {
1154
+ queryValue = query["page"];
1155
+ }
1156
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
1157
+ }
1158
+ if (query["filters"] !== undefined) {
1159
+ let queryValue;
1160
+ if (Array.isArray(query["filters"])) {
1161
+ if (query["filters"].length === 1) {
1162
+ queryValue = query["filters"][0];
1163
+ }
1164
+ else {
1165
+ throw new server_common_1.SerializationException();
1166
+ }
1167
+ }
1168
+ else {
1169
+ queryValue = query["filters"];
1170
+ }
1171
+ contents.filters = queryValue;
1172
+ }
1173
+ }
1174
+ await (0, smithy_client_1.collectBody)(output.body, context);
1175
+ return contents;
1176
+ };
1177
+ exports.deserializeRadiusShopsRequest = deserializeRadiusShopsRequest;
1178
+ const deserializeRecordVisitRequest = async (output, context) => {
1179
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1180
+ if (contentTypeHeaderKey != null) {
1181
+ const contentType = output.headers[contentTypeHeaderKey];
1182
+ if (contentType !== undefined && contentType !== "application/json") {
1183
+ throw new server_common_1.UnsupportedMediaTypeException();
1184
+ }
1185
+ ;
1186
+ }
1187
+ ;
1188
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1189
+ if (acceptHeaderKey != null) {
1190
+ const accept = output.headers[acceptHeaderKey];
1191
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1192
+ throw new server_common_1.NotAcceptableException();
1193
+ }
1194
+ ;
1195
+ }
1196
+ ;
1197
+ const contents = (0, smithy_client_1.map)({});
1198
+ const query = output.query;
1199
+ if (query != null) {
1200
+ if (query["shop_id"] !== undefined) {
1201
+ let queryValue;
1202
+ if (Array.isArray(query["shop_id"])) {
1203
+ if (query["shop_id"].length === 1) {
1204
+ queryValue = query["shop_id"][0];
1205
+ }
1206
+ else {
1207
+ throw new server_common_1.SerializationException();
1208
+ }
1209
+ }
1210
+ else {
1211
+ queryValue = query["shop_id"];
1212
+ }
1213
+ contents.shop_id = queryValue;
1214
+ }
1215
+ if (query["timestamp"] !== undefined) {
1216
+ let queryValue;
1217
+ if (Array.isArray(query["timestamp"])) {
1218
+ if (query["timestamp"].length === 1) {
1219
+ queryValue = query["timestamp"][0];
1220
+ }
1221
+ else {
1222
+ throw new server_common_1.SerializationException();
1223
+ }
1224
+ }
1225
+ else {
1226
+ queryValue = query["timestamp"];
1227
+ }
1228
+ contents.timestamp = queryValue;
1229
+ }
1230
+ if (query["lat"] !== undefined) {
1231
+ let queryValue;
1232
+ if (Array.isArray(query["lat"])) {
1233
+ if (query["lat"].length === 1) {
1234
+ queryValue = query["lat"][0];
1235
+ }
1236
+ else {
1237
+ throw new server_common_1.SerializationException();
1238
+ }
1239
+ }
1240
+ else {
1241
+ queryValue = query["lat"];
1242
+ }
1243
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
1244
+ }
1245
+ if (query["lon"] !== undefined) {
1246
+ let queryValue;
1247
+ if (Array.isArray(query["lon"])) {
1248
+ if (query["lon"].length === 1) {
1249
+ queryValue = query["lon"][0];
1250
+ }
1251
+ else {
1252
+ throw new server_common_1.SerializationException();
1253
+ }
1254
+ }
1255
+ else {
1256
+ queryValue = query["lon"];
1257
+ }
1258
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
1259
+ }
1260
+ }
1261
+ await (0, smithy_client_1.collectBody)(output.body, context);
1262
+ return contents;
1263
+ };
1264
+ exports.deserializeRecordVisitRequest = deserializeRecordVisitRequest;
1265
+ const deserializeRedeemFirstTimeRewardRequest = async (output, context) => {
1266
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1267
+ if (contentTypeHeaderKey != null) {
1268
+ const contentType = output.headers[contentTypeHeaderKey];
1269
+ if (contentType !== undefined && contentType !== "application/json") {
1270
+ throw new server_common_1.UnsupportedMediaTypeException();
1271
+ }
1272
+ ;
1273
+ }
1274
+ ;
1275
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1276
+ if (acceptHeaderKey != null) {
1277
+ const accept = output.headers[acceptHeaderKey];
1278
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1279
+ throw new server_common_1.NotAcceptableException();
1280
+ }
1281
+ ;
1282
+ }
1283
+ ;
1284
+ const contents = (0, smithy_client_1.map)({});
1285
+ const query = output.query;
1286
+ if (query != null) {
1287
+ if (query["org_id"] !== undefined) {
1288
+ let queryValue;
1289
+ if (Array.isArray(query["org_id"])) {
1290
+ if (query["org_id"].length === 1) {
1291
+ queryValue = query["org_id"][0];
1292
+ }
1293
+ else {
1294
+ throw new server_common_1.SerializationException();
1295
+ }
1296
+ }
1297
+ else {
1298
+ queryValue = query["org_id"];
1299
+ }
1300
+ contents.org_id = queryValue;
1301
+ }
1302
+ }
1303
+ await (0, smithy_client_1.collectBody)(output.body, context);
1304
+ return contents;
1305
+ };
1306
+ exports.deserializeRedeemFirstTimeRewardRequest = deserializeRedeemFirstTimeRewardRequest;
1307
+ const deserializeRedeemPointRewardRequest = async (output, context) => {
1308
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1309
+ if (contentTypeHeaderKey != null) {
1310
+ const contentType = output.headers[contentTypeHeaderKey];
1311
+ if (contentType !== undefined && contentType !== "application/json") {
1312
+ throw new server_common_1.UnsupportedMediaTypeException();
1313
+ }
1314
+ ;
1315
+ }
1316
+ ;
1317
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1318
+ if (acceptHeaderKey != null) {
1319
+ const accept = output.headers[acceptHeaderKey];
1320
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1321
+ throw new server_common_1.NotAcceptableException();
1322
+ }
1323
+ ;
1324
+ }
1325
+ ;
1326
+ const contents = (0, smithy_client_1.map)({});
1327
+ const query = output.query;
1328
+ if (query != null) {
1329
+ if (query["org_id"] !== undefined) {
1330
+ let queryValue;
1331
+ if (Array.isArray(query["org_id"])) {
1332
+ if (query["org_id"].length === 1) {
1333
+ queryValue = query["org_id"][0];
1334
+ }
1335
+ else {
1336
+ throw new server_common_1.SerializationException();
1337
+ }
1338
+ }
1339
+ else {
1340
+ queryValue = query["org_id"];
1341
+ }
1342
+ contents.org_id = queryValue;
1343
+ }
1344
+ if (query["reward_id"] !== undefined) {
1345
+ let queryValue;
1346
+ if (Array.isArray(query["reward_id"])) {
1347
+ if (query["reward_id"].length === 1) {
1348
+ queryValue = query["reward_id"][0];
1349
+ }
1350
+ else {
1351
+ throw new server_common_1.SerializationException();
1352
+ }
1353
+ }
1354
+ else {
1355
+ queryValue = query["reward_id"];
1356
+ }
1357
+ contents.reward_id = queryValue;
1358
+ }
1359
+ }
1360
+ await (0, smithy_client_1.collectBody)(output.body, context);
1361
+ return contents;
1362
+ };
1363
+ exports.deserializeRedeemPointRewardRequest = deserializeRedeemPointRewardRequest;
1364
+ const deserializeRedeemVisitRewardRequest = async (output, context) => {
1365
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1366
+ if (contentTypeHeaderKey != null) {
1367
+ const contentType = output.headers[contentTypeHeaderKey];
1368
+ if (contentType !== undefined && contentType !== "application/json") {
1369
+ throw new server_common_1.UnsupportedMediaTypeException();
1370
+ }
1371
+ ;
1372
+ }
1373
+ ;
1374
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1375
+ if (acceptHeaderKey != null) {
1376
+ const accept = output.headers[acceptHeaderKey];
1377
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1378
+ throw new server_common_1.NotAcceptableException();
1379
+ }
1380
+ ;
1381
+ }
1382
+ ;
1383
+ const contents = (0, smithy_client_1.map)({});
1384
+ const query = output.query;
1385
+ if (query != null) {
1386
+ if (query["reward_id"] !== undefined) {
1387
+ let queryValue;
1388
+ if (Array.isArray(query["reward_id"])) {
1389
+ if (query["reward_id"].length === 1) {
1390
+ queryValue = query["reward_id"][0];
1391
+ }
1392
+ else {
1393
+ throw new server_common_1.SerializationException();
1394
+ }
1395
+ }
1396
+ else {
1397
+ queryValue = query["reward_id"];
1398
+ }
1399
+ contents.reward_id = queryValue;
1400
+ }
1401
+ }
1402
+ await (0, smithy_client_1.collectBody)(output.body, context);
1403
+ return contents;
1404
+ };
1405
+ exports.deserializeRedeemVisitRewardRequest = deserializeRedeemVisitRewardRequest;
1406
+ const deserializeSearchShopsPublicRequest = async (output, context) => {
1407
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1408
+ if (contentTypeHeaderKey != null) {
1409
+ const contentType = output.headers[contentTypeHeaderKey];
1410
+ if (contentType !== undefined && contentType !== "application/json") {
1411
+ throw new server_common_1.UnsupportedMediaTypeException();
1412
+ }
1413
+ ;
1414
+ }
1415
+ ;
1416
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1417
+ if (acceptHeaderKey != null) {
1418
+ const accept = output.headers[acceptHeaderKey];
1419
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1420
+ throw new server_common_1.NotAcceptableException();
1421
+ }
1422
+ ;
1423
+ }
1424
+ ;
1425
+ const contents = (0, smithy_client_1.map)({});
1426
+ const query = output.query;
1427
+ if (query != null) {
1428
+ if (query["q"] !== undefined) {
1429
+ let queryValue;
1430
+ if (Array.isArray(query["q"])) {
1431
+ if (query["q"].length === 1) {
1432
+ queryValue = query["q"][0];
1433
+ }
1434
+ else {
1435
+ throw new server_common_1.SerializationException();
1436
+ }
1437
+ }
1438
+ else {
1439
+ queryValue = query["q"];
1440
+ }
1441
+ contents.q = queryValue;
1442
+ }
1443
+ if (query["limit"] !== undefined) {
1444
+ let queryValue;
1445
+ if (Array.isArray(query["limit"])) {
1446
+ if (query["limit"].length === 1) {
1447
+ queryValue = query["limit"][0];
1448
+ }
1449
+ else {
1450
+ throw new server_common_1.SerializationException();
1451
+ }
1452
+ }
1453
+ else {
1454
+ queryValue = query["limit"];
1455
+ }
1456
+ contents.limit = (0, smithy_client_1.strictParseInt32)(queryValue);
1457
+ }
1458
+ if (query["lat"] !== undefined) {
1459
+ let queryValue;
1460
+ if (Array.isArray(query["lat"])) {
1461
+ if (query["lat"].length === 1) {
1462
+ queryValue = query["lat"][0];
1463
+ }
1464
+ else {
1465
+ throw new server_common_1.SerializationException();
1466
+ }
1467
+ }
1468
+ else {
1469
+ queryValue = query["lat"];
1470
+ }
1471
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
1472
+ }
1473
+ if (query["lon"] !== undefined) {
1474
+ let queryValue;
1475
+ if (Array.isArray(query["lon"])) {
1476
+ if (query["lon"].length === 1) {
1477
+ queryValue = query["lon"][0];
1478
+ }
1479
+ else {
1480
+ throw new server_common_1.SerializationException();
1481
+ }
1482
+ }
1483
+ else {
1484
+ queryValue = query["lon"];
1485
+ }
1486
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
1487
+ }
1488
+ if (query["page"] !== undefined) {
1489
+ let queryValue;
1490
+ if (Array.isArray(query["page"])) {
1491
+ if (query["page"].length === 1) {
1492
+ queryValue = query["page"][0];
1493
+ }
1494
+ else {
1495
+ throw new server_common_1.SerializationException();
1496
+ }
1497
+ }
1498
+ else {
1499
+ queryValue = query["page"];
1500
+ }
1501
+ contents.page = (0, smithy_client_1.strictParseInt32)(queryValue);
1502
+ }
1503
+ if (query["filters"] !== undefined) {
1504
+ let queryValue;
1505
+ if (Array.isArray(query["filters"])) {
1506
+ if (query["filters"].length === 1) {
1507
+ queryValue = query["filters"][0];
1508
+ }
1509
+ else {
1510
+ throw new server_common_1.SerializationException();
1511
+ }
1512
+ }
1513
+ else {
1514
+ queryValue = query["filters"];
1515
+ }
1516
+ contents.filters = queryValue;
1517
+ }
1518
+ }
1519
+ await (0, smithy_client_1.collectBody)(output.body, context);
1520
+ return contents;
1521
+ };
1522
+ exports.deserializeSearchShopsPublicRequest = deserializeSearchShopsPublicRequest;
1523
+ const deserializeSearchSuggestionRequest = async (output, context) => {
1524
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1525
+ if (contentTypeHeaderKey != null) {
1526
+ const contentType = output.headers[contentTypeHeaderKey];
1527
+ if (contentType !== undefined && contentType !== "application/json") {
1528
+ throw new server_common_1.UnsupportedMediaTypeException();
1529
+ }
1530
+ ;
1531
+ }
1532
+ ;
1533
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1534
+ if (acceptHeaderKey != null) {
1535
+ const accept = output.headers[acceptHeaderKey];
1536
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1537
+ throw new server_common_1.NotAcceptableException();
1538
+ }
1539
+ ;
1540
+ }
1541
+ ;
1542
+ const contents = (0, smithy_client_1.map)({});
1543
+ const query = output.query;
1544
+ if (query != null) {
1545
+ if (query["q"] !== undefined) {
1546
+ let queryValue;
1547
+ if (Array.isArray(query["q"])) {
1548
+ if (query["q"].length === 1) {
1549
+ queryValue = query["q"][0];
1550
+ }
1551
+ else {
1552
+ throw new server_common_1.SerializationException();
1553
+ }
1554
+ }
1555
+ else {
1556
+ queryValue = query["q"];
1557
+ }
1558
+ contents.q = queryValue;
1559
+ }
1560
+ if (query["limit"] !== undefined) {
1561
+ let queryValue;
1562
+ if (Array.isArray(query["limit"])) {
1563
+ if (query["limit"].length === 1) {
1564
+ queryValue = query["limit"][0];
1565
+ }
1566
+ else {
1567
+ throw new server_common_1.SerializationException();
1568
+ }
1569
+ }
1570
+ else {
1571
+ queryValue = query["limit"];
1572
+ }
1573
+ contents.limit = (0, smithy_client_1.strictParseInt32)(queryValue);
1574
+ }
1575
+ if (query["lat"] !== undefined) {
1576
+ let queryValue;
1577
+ if (Array.isArray(query["lat"])) {
1578
+ if (query["lat"].length === 1) {
1579
+ queryValue = query["lat"][0];
1580
+ }
1581
+ else {
1582
+ throw new server_common_1.SerializationException();
1583
+ }
1584
+ }
1585
+ else {
1586
+ queryValue = query["lat"];
1587
+ }
1588
+ contents.lat = (0, smithy_client_1.strictParseDouble)(queryValue);
1589
+ }
1590
+ if (query["lon"] !== undefined) {
1591
+ let queryValue;
1592
+ if (Array.isArray(query["lon"])) {
1593
+ if (query["lon"].length === 1) {
1594
+ queryValue = query["lon"][0];
1595
+ }
1596
+ else {
1597
+ throw new server_common_1.SerializationException();
1598
+ }
1599
+ }
1600
+ else {
1601
+ queryValue = query["lon"];
1602
+ }
1603
+ contents.lon = (0, smithy_client_1.strictParseDouble)(queryValue);
1604
+ }
1605
+ }
1606
+ await (0, smithy_client_1.collectBody)(output.body, context);
1607
+ return contents;
1608
+ };
1609
+ exports.deserializeSearchSuggestionRequest = deserializeSearchSuggestionRequest;
1610
+ const deserializeUpdateUserRequest = async (output, context) => {
1611
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
1612
+ if (contentTypeHeaderKey != null) {
1613
+ const contentType = output.headers[contentTypeHeaderKey];
1614
+ if (contentType !== undefined && contentType !== "application/json") {
1615
+ throw new server_common_1.UnsupportedMediaTypeException();
1616
+ }
1617
+ ;
1618
+ }
1619
+ ;
1620
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
1621
+ if (acceptHeaderKey != null) {
1622
+ const accept = output.headers[acceptHeaderKey];
1623
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
1624
+ throw new server_common_1.NotAcceptableException();
1625
+ }
1626
+ ;
1627
+ }
1628
+ ;
1629
+ const contents = (0, smithy_client_1.map)({});
1630
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
1631
+ const doc = (0, smithy_client_1.take)(data, {
1632
+ 'fullname': _ => de_UserFullnameUpdate(_, context),
1633
+ });
1634
+ Object.assign(contents, doc);
1635
+ return contents;
1636
+ };
1637
+ exports.deserializeUpdateUserRequest = deserializeUpdateUserRequest;
1638
+ const serializeDeleteUserResponse = async (input, ctx) => {
1639
+ const context = {
1640
+ ...ctx,
1641
+ endpoint: () => Promise.resolve({
1642
+ protocol: '',
1643
+ hostname: '',
1644
+ path: '',
1645
+ }),
1646
+ };
1647
+ let statusCode = 200;
1648
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1649
+ 'content-type': 'application/json',
1650
+ });
1651
+ let body;
1652
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1653
+ 'message': [],
1654
+ }));
1655
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1656
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1657
+ if (length !== undefined) {
1658
+ headers = { ...headers, 'content-length': String(length) };
1659
+ }
1660
+ }
1661
+ return new protocol_http_1.HttpResponse({
1662
+ headers,
1663
+ body,
1664
+ statusCode,
1665
+ });
1666
+ };
1667
+ exports.serializeDeleteUserResponse = serializeDeleteUserResponse;
1668
+ const serializeFavoritePlansResponse = async (input, ctx) => {
1669
+ const context = {
1670
+ ...ctx,
1671
+ endpoint: () => Promise.resolve({
1672
+ protocol: '',
1673
+ hostname: '',
1674
+ path: '',
1675
+ }),
1676
+ };
1677
+ let statusCode = 200;
1678
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1679
+ 'content-type': 'application/json',
1680
+ });
1681
+ let body;
1682
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1683
+ 'count': [],
1684
+ 'pagination': _ => se_PaginationInfo(_, context),
1685
+ 'value': _ => se_GroupedPlanList(_, context),
1686
+ }));
1687
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1688
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1689
+ if (length !== undefined) {
1690
+ headers = { ...headers, 'content-length': String(length) };
1691
+ }
1692
+ }
1693
+ return new protocol_http_1.HttpResponse({
1694
+ headers,
1695
+ body,
1696
+ statusCode,
1697
+ });
1698
+ };
1699
+ exports.serializeFavoritePlansResponse = serializeFavoritePlansResponse;
1700
+ const serializeFavoriteShopsResponse = async (input, ctx) => {
1701
+ const context = {
1702
+ ...ctx,
1703
+ endpoint: () => Promise.resolve({
1704
+ protocol: '',
1705
+ hostname: '',
1706
+ path: '',
1707
+ }),
1708
+ };
1709
+ let statusCode = 200;
1710
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1711
+ 'content-type': 'application/json',
1712
+ });
1713
+ let body;
1714
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1715
+ 'count': [],
1716
+ 'message': [],
1717
+ 'pagination': _ => se_PaginationInfo(_, context),
1718
+ 'value': _ => se_EnrichedShopList(_, context),
1719
+ }));
1720
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1721
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1722
+ if (length !== undefined) {
1723
+ headers = { ...headers, 'content-length': String(length) };
1724
+ }
1725
+ }
1726
+ return new protocol_http_1.HttpResponse({
1727
+ headers,
1728
+ body,
1729
+ statusCode,
1730
+ });
1731
+ };
1732
+ exports.serializeFavoriteShopsResponse = serializeFavoriteShopsResponse;
1733
+ const serializeGetShopResponse = async (input, ctx) => {
1734
+ const context = {
1735
+ ...ctx,
1736
+ endpoint: () => Promise.resolve({
1737
+ protocol: '',
1738
+ hostname: '',
1739
+ path: '',
1740
+ }),
1741
+ };
1742
+ let statusCode = 200;
1743
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1744
+ 'content-type': 'application/json',
1745
+ });
1746
+ let body;
1747
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1748
+ 'active': [],
1749
+ 'banner': [],
1750
+ 'country_code': [],
1751
+ 'description': [],
1752
+ 'id': [],
1753
+ 'latitude': _ => (0, smithy_client_1.serializeFloat)(_),
1754
+ 'location': _ => se_LocationDetails(_, context),
1755
+ 'logo': [],
1756
+ 'longitude': _ => (0, smithy_client_1.serializeFloat)(_),
1757
+ 'menu': [],
1758
+ 'org_id': [],
1759
+ 'org_name': [],
1760
+ 'phone_number': [],
1761
+ 'preview': [],
1762
+ 'sent_setup': [],
1763
+ 'setup': [],
1764
+ 'shop_hours': _ => se_ShopHoursList(_, context),
1765
+ 'shop_name': [],
1766
+ 'tags': _ => se_StringList(_, context),
1767
+ }));
1768
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1769
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1770
+ if (length !== undefined) {
1771
+ headers = { ...headers, 'content-length': String(length) };
1772
+ }
1773
+ }
1774
+ return new protocol_http_1.HttpResponse({
1775
+ headers,
1776
+ body,
1777
+ statusCode,
1778
+ });
1779
+ };
1780
+ exports.serializeGetShopResponse = serializeGetShopResponse;
1781
+ const serializeGetShopPublicResponse = async (input, ctx) => {
1782
+ const context = {
1783
+ ...ctx,
1784
+ endpoint: () => Promise.resolve({
1785
+ protocol: '',
1786
+ hostname: '',
1787
+ path: '',
1788
+ }),
1789
+ };
1790
+ let statusCode = 200;
1791
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1792
+ 'content-type': 'application/json',
1793
+ });
1794
+ let body;
1795
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1796
+ 'active': [],
1797
+ 'banner': [],
1798
+ 'country_code': [],
1799
+ 'description': [],
1800
+ 'id': [],
1801
+ 'latitude': _ => (0, smithy_client_1.serializeFloat)(_),
1802
+ 'location': _ => se_LocationDetails(_, context),
1803
+ 'logo': [],
1804
+ 'longitude': _ => (0, smithy_client_1.serializeFloat)(_),
1805
+ 'menu': [],
1806
+ 'org_id': [],
1807
+ 'org_name': [],
1808
+ 'phone_number': [],
1809
+ 'preview': [],
1810
+ 'sent_setup': [],
1811
+ 'setup': [],
1812
+ 'shop_hours': _ => se_ShopHoursList(_, context),
1813
+ 'shop_name': [],
1814
+ 'tags': _ => se_StringList(_, context),
1815
+ }));
1816
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1817
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1818
+ if (length !== undefined) {
1819
+ headers = { ...headers, 'content-length': String(length) };
1820
+ }
1821
+ }
1822
+ return new protocol_http_1.HttpResponse({
1823
+ headers,
1824
+ body,
1825
+ statusCode,
1826
+ });
1827
+ };
1828
+ exports.serializeGetShopPublicResponse = serializeGetShopPublicResponse;
1829
+ const serializeGetUserResponse = async (input, ctx) => {
1830
+ const context = {
1831
+ ...ctx,
1832
+ endpoint: () => Promise.resolve({
1833
+ protocol: '',
1834
+ hostname: '',
1835
+ path: '',
1836
+ }),
1837
+ };
1838
+ let statusCode = 200;
1839
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1840
+ 'content-type': 'application/json',
1841
+ });
1842
+ let body;
1843
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1844
+ 'message': [],
1845
+ 'user': _ => se_User(_, context),
1846
+ }));
1847
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1848
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1849
+ if (length !== undefined) {
1850
+ headers = { ...headers, 'content-length': String(length) };
1851
+ }
1852
+ }
1853
+ return new protocol_http_1.HttpResponse({
1854
+ headers,
1855
+ body,
1856
+ statusCode,
1857
+ });
1858
+ };
1859
+ exports.serializeGetUserResponse = serializeGetUserResponse;
1860
+ const serializeLikeOrgResponse = async (input, ctx) => {
1861
+ const context = {
1862
+ ...ctx,
1863
+ endpoint: () => Promise.resolve({
1864
+ protocol: '',
1865
+ hostname: '',
1866
+ path: '',
1867
+ }),
1868
+ };
1869
+ let statusCode = 200;
1870
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1871
+ 'content-type': 'application/json',
1872
+ });
1873
+ let body;
1874
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1875
+ 'liked': [],
1876
+ 'message': [],
1877
+ }));
1878
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1879
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1880
+ if (length !== undefined) {
1881
+ headers = { ...headers, 'content-length': String(length) };
1882
+ }
1883
+ }
1884
+ return new protocol_http_1.HttpResponse({
1885
+ headers,
1886
+ body,
1887
+ statusCode,
1888
+ });
1889
+ };
1890
+ exports.serializeLikeOrgResponse = serializeLikeOrgResponse;
1891
+ const serializeNearbyShopsResponse = async (input, ctx) => {
1892
+ const context = {
1893
+ ...ctx,
1894
+ endpoint: () => Promise.resolve({
1895
+ protocol: '',
1896
+ hostname: '',
1897
+ path: '',
1898
+ }),
1899
+ };
1900
+ let statusCode = 200;
1901
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1902
+ 'content-type': 'application/json',
1903
+ });
1904
+ let body;
1905
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1906
+ 'count': [],
1907
+ 'message': [],
1908
+ 'pagination': _ => se_PaginationInfo(_, context),
1909
+ 'value': _ => se_EnrichedShopList(_, context),
1910
+ }));
1911
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1912
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1913
+ if (length !== undefined) {
1914
+ headers = { ...headers, 'content-length': String(length) };
1915
+ }
1916
+ }
1917
+ return new protocol_http_1.HttpResponse({
1918
+ headers,
1919
+ body,
1920
+ statusCode,
1921
+ });
1922
+ };
1923
+ exports.serializeNearbyShopsResponse = serializeNearbyShopsResponse;
1924
+ const serializeNearbyShopsPublicResponse = async (input, ctx) => {
1925
+ const context = {
1926
+ ...ctx,
1927
+ endpoint: () => Promise.resolve({
1928
+ protocol: '',
1929
+ hostname: '',
1930
+ path: '',
1931
+ }),
1932
+ };
1933
+ let statusCode = 200;
1934
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1935
+ 'content-type': 'application/json',
1936
+ });
1937
+ let body;
1938
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1939
+ 'count': [],
1940
+ 'message': [],
1941
+ 'pagination': _ => se_PaginationInfo(_, context),
1942
+ 'value': _ => se_EnrichedShopList(_, context),
1943
+ }));
1944
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1945
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1946
+ if (length !== undefined) {
1947
+ headers = { ...headers, 'content-length': String(length) };
1948
+ }
1949
+ }
1950
+ return new protocol_http_1.HttpResponse({
1951
+ headers,
1952
+ body,
1953
+ statusCode,
1954
+ });
1955
+ };
1956
+ exports.serializeNearbyShopsPublicResponse = serializeNearbyShopsPublicResponse;
1957
+ const serializeNearestShopResponse = async (input, ctx) => {
1958
+ const context = {
1959
+ ...ctx,
1960
+ endpoint: () => Promise.resolve({
1961
+ protocol: '',
1962
+ hostname: '',
1963
+ path: '',
1964
+ }),
1965
+ };
1966
+ let statusCode = 200;
1967
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
1968
+ 'content-type': 'application/json',
1969
+ });
1970
+ let body;
1971
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1972
+ 'distance': [],
1973
+ 'favorite': [],
1974
+ 'location': _ => se_LocationDetails(_, context),
1975
+ 'logo': [],
1976
+ 'name': [],
1977
+ 'org_id': [],
1978
+ 'preview': [],
1979
+ 'shop_hours': _ => se_ShopHoursList(_, context),
1980
+ 'shop_id': [],
1981
+ 'tags': _ => se_StringList(_, context),
1982
+ }));
1983
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
1984
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
1985
+ if (length !== undefined) {
1986
+ headers = { ...headers, 'content-length': String(length) };
1987
+ }
1988
+ }
1989
+ return new protocol_http_1.HttpResponse({
1990
+ headers,
1991
+ body,
1992
+ statusCode,
1993
+ });
1994
+ };
1995
+ exports.serializeNearestShopResponse = serializeNearestShopResponse;
1996
+ const serializeOnboardUserResponse = async (input, ctx) => {
1997
+ const context = {
1998
+ ...ctx,
1999
+ endpoint: () => Promise.resolve({
2000
+ protocol: '',
2001
+ hostname: '',
2002
+ path: '',
2003
+ }),
2004
+ };
2005
+ let statusCode = 200;
2006
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2007
+ 'content-type': 'application/json',
2008
+ });
2009
+ let body;
2010
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2011
+ 'message': [],
2012
+ 'user': _ => se_User(_, context),
2013
+ }));
2014
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2015
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2016
+ if (length !== undefined) {
2017
+ headers = { ...headers, 'content-length': String(length) };
2018
+ }
2019
+ }
2020
+ return new protocol_http_1.HttpResponse({
2021
+ headers,
2022
+ body,
2023
+ statusCode,
2024
+ });
2025
+ };
2026
+ exports.serializeOnboardUserResponse = serializeOnboardUserResponse;
2027
+ const serializePinnedShopResponse = async (input, ctx) => {
2028
+ const context = {
2029
+ ...ctx,
2030
+ endpoint: () => Promise.resolve({
2031
+ protocol: '',
2032
+ hostname: '',
2033
+ path: '',
2034
+ }),
2035
+ };
2036
+ let statusCode = 200;
2037
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2038
+ 'content-type': 'application/json',
2039
+ });
2040
+ let body;
2041
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2042
+ 'distance': [],
2043
+ 'favorite': [],
2044
+ 'location': _ => se_LocationDetails(_, context),
2045
+ 'logo': [],
2046
+ 'name': [],
2047
+ 'org_id': [],
2048
+ 'preview': [],
2049
+ 'shop_hours': _ => se_ShopHoursList(_, context),
2050
+ 'shop_id': [],
2051
+ 'tags': _ => se_StringList(_, context),
2052
+ }));
2053
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2054
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2055
+ if (length !== undefined) {
2056
+ headers = { ...headers, 'content-length': String(length) };
2057
+ }
2058
+ }
2059
+ return new protocol_http_1.HttpResponse({
2060
+ headers,
2061
+ body,
2062
+ statusCode,
2063
+ });
2064
+ };
2065
+ exports.serializePinnedShopResponse = serializePinnedShopResponse;
2066
+ const serializePinnedShopPublicResponse = async (input, ctx) => {
2067
+ const context = {
2068
+ ...ctx,
2069
+ endpoint: () => Promise.resolve({
2070
+ protocol: '',
2071
+ hostname: '',
2072
+ path: '',
2073
+ }),
2074
+ };
2075
+ let statusCode = 200;
2076
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2077
+ 'content-type': 'application/json',
2078
+ });
2079
+ let body;
2080
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2081
+ 'distance': [],
2082
+ 'favorite': [],
2083
+ 'location': _ => se_LocationDetails(_, context),
2084
+ 'logo': [],
2085
+ 'name': [],
2086
+ 'org_id': [],
2087
+ 'preview': [],
2088
+ 'shop_hours': _ => se_ShopHoursList(_, context),
2089
+ 'shop_id': [],
2090
+ 'tags': _ => se_StringList(_, context),
2091
+ }));
2092
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2093
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2094
+ if (length !== undefined) {
2095
+ headers = { ...headers, 'content-length': String(length) };
2096
+ }
2097
+ }
2098
+ return new protocol_http_1.HttpResponse({
2099
+ headers,
2100
+ body,
2101
+ statusCode,
2102
+ });
2103
+ };
2104
+ exports.serializePinnedShopPublicResponse = serializePinnedShopPublicResponse;
2105
+ const serializePlanResponse = async (input, ctx) => {
2106
+ const context = {
2107
+ ...ctx,
2108
+ endpoint: () => Promise.resolve({
2109
+ protocol: '',
2110
+ hostname: '',
2111
+ path: '',
2112
+ }),
2113
+ };
2114
+ let statusCode = 200;
2115
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2116
+ 'content-type': 'application/json',
2117
+ });
2118
+ let body;
2119
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2120
+ 'active': [],
2121
+ 'favorite': [],
2122
+ 'firstPlan': [],
2123
+ 'first_time_reward': _ => se_FirstTimeReward(_, context),
2124
+ 'id': [],
2125
+ 'min_spend': [],
2126
+ 'name': [],
2127
+ 'organization_id': [],
2128
+ 'points': [],
2129
+ 'points_active': [],
2130
+ 'redeemableRewards': _ => se_RewardList(_, context),
2131
+ 'reward_plan': _ => se_RewardPlan(_, context),
2132
+ 'visits': [],
2133
+ 'visits_active': [],
2134
+ }));
2135
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2136
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2137
+ if (length !== undefined) {
2138
+ headers = { ...headers, 'content-length': String(length) };
2139
+ }
2140
+ }
2141
+ return new protocol_http_1.HttpResponse({
2142
+ headers,
2143
+ body,
2144
+ statusCode,
2145
+ });
2146
+ };
2147
+ exports.serializePlanResponse = serializePlanResponse;
2148
+ const serializePlanPublicResponse = async (input, ctx) => {
2149
+ const context = {
2150
+ ...ctx,
2151
+ endpoint: () => Promise.resolve({
2152
+ protocol: '',
2153
+ hostname: '',
2154
+ path: '',
2155
+ }),
2156
+ };
2157
+ let statusCode = 200;
2158
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2159
+ 'content-type': 'application/json',
2160
+ });
2161
+ let body;
2162
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2163
+ 'active': [],
2164
+ 'favorite': [],
2165
+ 'firstPlan': [],
2166
+ 'first_time_reward': _ => se_FirstTimeReward(_, context),
2167
+ 'id': [],
2168
+ 'min_spend': [],
2169
+ 'name': [],
2170
+ 'organization_id': [],
2171
+ 'points': [],
2172
+ 'points_active': [],
2173
+ 'redeemableRewards': _ => se_RewardList(_, context),
2174
+ 'reward_plan': _ => se_RewardPlan(_, context),
2175
+ 'visits': [],
2176
+ 'visits_active': [],
2177
+ }));
2178
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2179
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2180
+ if (length !== undefined) {
2181
+ headers = { ...headers, 'content-length': String(length) };
2182
+ }
2183
+ }
2184
+ return new protocol_http_1.HttpResponse({
2185
+ headers,
2186
+ body,
2187
+ statusCode,
2188
+ });
2189
+ };
2190
+ exports.serializePlanPublicResponse = serializePlanPublicResponse;
2191
+ const serializePlansResponse = async (input, ctx) => {
2192
+ const context = {
2193
+ ...ctx,
2194
+ endpoint: () => Promise.resolve({
2195
+ protocol: '',
2196
+ hostname: '',
2197
+ path: '',
2198
+ }),
2199
+ };
2200
+ let statusCode = 200;
2201
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2202
+ 'content-type': 'application/json',
2203
+ });
2204
+ let body;
2205
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2206
+ 'count': [],
2207
+ 'pagination': _ => se_PaginationInfo(_, context),
2208
+ 'value': _ => se_GroupedPlanList(_, context),
2209
+ }));
2210
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2211
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2212
+ if (length !== undefined) {
2213
+ headers = { ...headers, 'content-length': String(length) };
2214
+ }
2215
+ }
2216
+ return new protocol_http_1.HttpResponse({
2217
+ headers,
2218
+ body,
2219
+ statusCode,
2220
+ });
2221
+ };
2222
+ exports.serializePlansResponse = serializePlansResponse;
2223
+ const serializePopularShopsResponse = async (input, ctx) => {
2224
+ const context = {
2225
+ ...ctx,
2226
+ endpoint: () => Promise.resolve({
2227
+ protocol: '',
2228
+ hostname: '',
2229
+ path: '',
2230
+ }),
2231
+ };
2232
+ let statusCode = 200;
2233
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2234
+ 'content-type': 'application/json',
2235
+ });
2236
+ let body;
2237
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2238
+ 'count': [],
2239
+ 'message': [],
2240
+ 'pagination': _ => se_PaginationInfo(_, context),
2241
+ 'value': _ => se_EnrichedShopList(_, context),
2242
+ }));
2243
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2244
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2245
+ if (length !== undefined) {
2246
+ headers = { ...headers, 'content-length': String(length) };
2247
+ }
2248
+ }
2249
+ return new protocol_http_1.HttpResponse({
2250
+ headers,
2251
+ body,
2252
+ statusCode,
2253
+ });
2254
+ };
2255
+ exports.serializePopularShopsResponse = serializePopularShopsResponse;
2256
+ const serializePopularShopsPublicResponse = async (input, ctx) => {
2257
+ const context = {
2258
+ ...ctx,
2259
+ endpoint: () => Promise.resolve({
2260
+ protocol: '',
2261
+ hostname: '',
2262
+ path: '',
2263
+ }),
2264
+ };
2265
+ let statusCode = 200;
2266
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2267
+ 'content-type': 'application/json',
2268
+ });
2269
+ let body;
2270
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2271
+ 'count': [],
2272
+ 'message': [],
2273
+ 'pagination': _ => se_PaginationInfo(_, context),
2274
+ 'value': _ => se_EnrichedShopList(_, context),
2275
+ }));
2276
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2277
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2278
+ if (length !== undefined) {
2279
+ headers = { ...headers, 'content-length': String(length) };
2280
+ }
2281
+ }
2282
+ return new protocol_http_1.HttpResponse({
2283
+ headers,
2284
+ body,
2285
+ statusCode,
2286
+ });
2287
+ };
2288
+ exports.serializePopularShopsPublicResponse = serializePopularShopsPublicResponse;
2289
+ const serializeRadiusShopsResponse = async (input, ctx) => {
2290
+ const context = {
2291
+ ...ctx,
2292
+ endpoint: () => Promise.resolve({
2293
+ protocol: '',
2294
+ hostname: '',
2295
+ path: '',
2296
+ }),
2297
+ };
2298
+ let statusCode = 200;
2299
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2300
+ 'content-type': 'application/json',
2301
+ });
2302
+ let body;
2303
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2304
+ 'count': [],
2305
+ 'message': [],
2306
+ 'value': _ => se_ShopLocationList(_, context),
2307
+ }));
2308
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2309
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2310
+ if (length !== undefined) {
2311
+ headers = { ...headers, 'content-length': String(length) };
2312
+ }
2313
+ }
2314
+ return new protocol_http_1.HttpResponse({
2315
+ headers,
2316
+ body,
2317
+ statusCode,
2318
+ });
2319
+ };
2320
+ exports.serializeRadiusShopsResponse = serializeRadiusShopsResponse;
2321
+ const serializeRecordVisitResponse = async (input, ctx) => {
2322
+ const context = {
2323
+ ...ctx,
2324
+ endpoint: () => Promise.resolve({
2325
+ protocol: '',
2326
+ hostname: '',
2327
+ path: '',
2328
+ }),
2329
+ };
2330
+ let statusCode = 200;
2331
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2332
+ 'content-type': 'application/json',
2333
+ });
2334
+ let body;
2335
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2336
+ 'message': [],
2337
+ 'reason': [],
2338
+ 'success': [],
2339
+ 'visitId': [],
2340
+ }));
2341
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2342
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2343
+ if (length !== undefined) {
2344
+ headers = { ...headers, 'content-length': String(length) };
2345
+ }
2346
+ }
2347
+ return new protocol_http_1.HttpResponse({
2348
+ headers,
2349
+ body,
2350
+ statusCode,
2351
+ });
2352
+ };
2353
+ exports.serializeRecordVisitResponse = serializeRecordVisitResponse;
2354
+ const serializeRedeemFirstTimeRewardResponse = async (input, ctx) => {
2355
+ const context = {
2356
+ ...ctx,
2357
+ endpoint: () => Promise.resolve({
2358
+ protocol: '',
2359
+ hostname: '',
2360
+ path: '',
2361
+ }),
2362
+ };
2363
+ let statusCode = 200;
2364
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2365
+ 'content-type': 'application/json',
2366
+ });
2367
+ let body;
2368
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2369
+ 'message': [],
2370
+ 'redeemed': [],
2371
+ }));
2372
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2373
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2374
+ if (length !== undefined) {
2375
+ headers = { ...headers, 'content-length': String(length) };
2376
+ }
2377
+ }
2378
+ return new protocol_http_1.HttpResponse({
2379
+ headers,
2380
+ body,
2381
+ statusCode,
2382
+ });
2383
+ };
2384
+ exports.serializeRedeemFirstTimeRewardResponse = serializeRedeemFirstTimeRewardResponse;
2385
+ const serializeRedeemPointRewardResponse = async (input, ctx) => {
2386
+ const context = {
2387
+ ...ctx,
2388
+ endpoint: () => Promise.resolve({
2389
+ protocol: '',
2390
+ hostname: '',
2391
+ path: '',
2392
+ }),
2393
+ };
2394
+ let statusCode = 200;
2395
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2396
+ 'content-type': 'application/json',
2397
+ });
2398
+ let body;
2399
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2400
+ 'message': [],
2401
+ 'pointsUsed': [],
2402
+ 'redeemed': [],
2403
+ 'remainingPoints': [],
2404
+ }));
2405
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2406
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2407
+ if (length !== undefined) {
2408
+ headers = { ...headers, 'content-length': String(length) };
2409
+ }
2410
+ }
2411
+ return new protocol_http_1.HttpResponse({
2412
+ headers,
2413
+ body,
2414
+ statusCode,
2415
+ });
2416
+ };
2417
+ exports.serializeRedeemPointRewardResponse = serializeRedeemPointRewardResponse;
2418
+ const serializeRedeemVisitRewardResponse = async (input, ctx) => {
2419
+ const context = {
2420
+ ...ctx,
2421
+ endpoint: () => Promise.resolve({
2422
+ protocol: '',
2423
+ hostname: '',
2424
+ path: '',
2425
+ }),
2426
+ };
2427
+ let statusCode = 200;
2428
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2429
+ 'content-type': 'application/json',
2430
+ });
2431
+ let body;
2432
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2433
+ 'message': [],
2434
+ 'redeemed': [],
2435
+ }));
2436
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2437
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2438
+ if (length !== undefined) {
2439
+ headers = { ...headers, 'content-length': String(length) };
2440
+ }
2441
+ }
2442
+ return new protocol_http_1.HttpResponse({
2443
+ headers,
2444
+ body,
2445
+ statusCode,
2446
+ });
2447
+ };
2448
+ exports.serializeRedeemVisitRewardResponse = serializeRedeemVisitRewardResponse;
2449
+ const serializeSearchShopsPublicResponse = async (input, ctx) => {
2450
+ const context = {
2451
+ ...ctx,
2452
+ endpoint: () => Promise.resolve({
2453
+ protocol: '',
2454
+ hostname: '',
2455
+ path: '',
2456
+ }),
2457
+ };
2458
+ let statusCode = 200;
2459
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2460
+ 'content-type': 'application/json',
2461
+ });
2462
+ let body;
2463
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2464
+ 'count': [],
2465
+ 'message': [],
2466
+ 'pagination': _ => se_PaginationInfo(_, context),
2467
+ 'value': _ => se_EnrichedShopList(_, context),
2468
+ }));
2469
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2470
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2471
+ if (length !== undefined) {
2472
+ headers = { ...headers, 'content-length': String(length) };
2473
+ }
2474
+ }
2475
+ return new protocol_http_1.HttpResponse({
2476
+ headers,
2477
+ body,
2478
+ statusCode,
2479
+ });
2480
+ };
2481
+ exports.serializeSearchShopsPublicResponse = serializeSearchShopsPublicResponse;
2482
+ const serializeSearchSuggestionResponse = async (input, ctx) => {
2483
+ const context = {
2484
+ ...ctx,
2485
+ endpoint: () => Promise.resolve({
2486
+ protocol: '',
2487
+ hostname: '',
2488
+ path: '',
2489
+ }),
2490
+ };
2491
+ let statusCode = 200;
2492
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2493
+ 'content-type': 'application/json',
2494
+ });
2495
+ let body;
2496
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2497
+ 'value': _ => se_SearchSuggestionList(_, context),
2498
+ }));
2499
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2500
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2501
+ if (length !== undefined) {
2502
+ headers = { ...headers, 'content-length': String(length) };
2503
+ }
2504
+ }
2505
+ return new protocol_http_1.HttpResponse({
2506
+ headers,
2507
+ body,
2508
+ statusCode,
2509
+ });
2510
+ };
2511
+ exports.serializeSearchSuggestionResponse = serializeSearchSuggestionResponse;
2512
+ const serializeUpdateUserResponse = async (input, ctx) => {
2513
+ const context = {
2514
+ ...ctx,
2515
+ endpoint: () => Promise.resolve({
2516
+ protocol: '',
2517
+ hostname: '',
2518
+ path: '',
2519
+ }),
2520
+ };
2521
+ let statusCode = 200;
2522
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2523
+ 'content-type': 'application/json',
2524
+ });
2525
+ let body;
2526
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2527
+ 'message': [],
2528
+ 'user': _ => se_User(_, context),
2529
+ }));
2530
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
2531
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
2532
+ if (length !== undefined) {
2533
+ headers = { ...headers, 'content-length': String(length) };
2534
+ }
2535
+ }
2536
+ return new protocol_http_1.HttpResponse({
2537
+ headers,
2538
+ body,
2539
+ statusCode,
2540
+ });
2541
+ };
2542
+ exports.serializeUpdateUserResponse = serializeUpdateUserResponse;
2543
+ const serializeFrameworkException = async (input, ctx) => {
2544
+ const context = {
2545
+ ...ctx,
2546
+ endpoint: () => Promise.resolve({
2547
+ protocol: '',
2548
+ hostname: '',
2549
+ path: '',
2550
+ }),
2551
+ };
2552
+ switch (input.name) {
2553
+ case "InternalFailure": {
2554
+ const statusCode = 500;
2555
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2556
+ 'x-amzn-errortype': "InternalFailure",
2557
+ 'content-type': 'application/json',
2558
+ });
2559
+ let body;
2560
+ body = "{}";
2561
+ return new protocol_http_1.HttpResponse({
2562
+ headers,
2563
+ body,
2564
+ statusCode,
2565
+ });
2566
+ }
2567
+ case "NotAcceptableException": {
2568
+ const statusCode = 406;
2569
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2570
+ 'x-amzn-errortype': "NotAcceptableException",
2571
+ 'content-type': 'application/json',
2572
+ });
2573
+ let body;
2574
+ body = "{}";
2575
+ return new protocol_http_1.HttpResponse({
2576
+ headers,
2577
+ body,
2578
+ statusCode,
2579
+ });
2580
+ }
2581
+ case "SerializationException": {
2582
+ const statusCode = 400;
2583
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2584
+ 'x-amzn-errortype': "SerializationException",
2585
+ 'content-type': 'application/json',
2586
+ });
2587
+ let body;
2588
+ body = "{}";
2589
+ return new protocol_http_1.HttpResponse({
2590
+ headers,
2591
+ body,
2592
+ statusCode,
2593
+ });
2594
+ }
2595
+ case "UnknownOperationException": {
2596
+ const statusCode = 404;
2597
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2598
+ 'x-amzn-errortype': "UnknownOperationException",
2599
+ 'content-type': 'application/json',
2600
+ });
2601
+ let body;
2602
+ body = "{}";
2603
+ return new protocol_http_1.HttpResponse({
2604
+ headers,
2605
+ body,
2606
+ statusCode,
2607
+ });
2608
+ }
2609
+ case "UnsupportedMediaTypeException": {
2610
+ const statusCode = 415;
2611
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2612
+ 'x-amzn-errortype': "UnsupportedMediaTypeException",
2613
+ 'content-type': 'application/json',
2614
+ });
2615
+ let body;
2616
+ body = "{}";
2617
+ return new protocol_http_1.HttpResponse({
2618
+ headers,
2619
+ body,
2620
+ statusCode,
2621
+ });
2622
+ }
2623
+ }
2624
+ };
2625
+ exports.serializeFrameworkException = serializeFrameworkException;
2626
+ const serializeValidationExceptionError = async (input, ctx) => {
2627
+ const context = {
2628
+ ...ctx,
2629
+ endpoint: () => Promise.resolve({
2630
+ protocol: '',
2631
+ hostname: '',
2632
+ path: '',
2633
+ }),
2634
+ };
2635
+ const statusCode = 400;
2636
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2637
+ 'x-amzn-errortype': "ValidationException",
2638
+ 'content-type': 'application/json',
2639
+ });
2640
+ let body;
2641
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2642
+ 'fieldList': _ => se_ValidationExceptionFieldList(_, context),
2643
+ 'message': [],
2644
+ }));
2645
+ return new protocol_http_1.HttpResponse({
2646
+ headers,
2647
+ body,
2648
+ statusCode,
2649
+ });
2650
+ };
2651
+ exports.serializeValidationExceptionError = serializeValidationExceptionError;
2652
+ const serializeInvalidOperationErrorError = async (input, ctx) => {
2653
+ const context = {
2654
+ ...ctx,
2655
+ endpoint: () => Promise.resolve({
2656
+ protocol: '',
2657
+ hostname: '',
2658
+ path: '',
2659
+ }),
2660
+ };
2661
+ const statusCode = 400;
2662
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2663
+ 'x-amzn-errortype': "InvalidOperationError",
2664
+ 'content-type': 'application/json',
2665
+ });
2666
+ let body;
2667
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2668
+ 'message': [],
2669
+ }));
2670
+ return new protocol_http_1.HttpResponse({
2671
+ headers,
2672
+ body,
2673
+ statusCode,
2674
+ });
2675
+ };
2676
+ exports.serializeInvalidOperationErrorError = serializeInvalidOperationErrorError;
2677
+ const serializeNotFoundErrorError = async (input, ctx) => {
2678
+ const context = {
2679
+ ...ctx,
2680
+ endpoint: () => Promise.resolve({
2681
+ protocol: '',
2682
+ hostname: '',
2683
+ path: '',
2684
+ }),
2685
+ };
2686
+ const statusCode = 404;
2687
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2688
+ 'x-amzn-errortype': "NotFoundError",
2689
+ 'content-type': 'application/json',
2690
+ });
2691
+ let body;
2692
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2693
+ 'message': [],
2694
+ }));
2695
+ return new protocol_http_1.HttpResponse({
2696
+ headers,
2697
+ body,
2698
+ statusCode,
2699
+ });
2700
+ };
2701
+ exports.serializeNotFoundErrorError = serializeNotFoundErrorError;
2702
+ const serializeRuntimeErrorError = async (input, ctx) => {
2703
+ const context = {
2704
+ ...ctx,
2705
+ endpoint: () => Promise.resolve({
2706
+ protocol: '',
2707
+ hostname: '',
2708
+ path: '',
2709
+ }),
2710
+ };
2711
+ const statusCode = 500;
2712
+ let headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
2713
+ 'x-amzn-errortype': "RuntimeError",
2714
+ 'content-type': 'application/json',
2715
+ });
2716
+ let body;
2717
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
2718
+ 'message': [],
2719
+ }));
2720
+ return new protocol_http_1.HttpResponse({
2721
+ headers,
2722
+ body,
2723
+ statusCode,
2724
+ });
2725
+ };
2726
+ exports.serializeRuntimeErrorError = serializeRuntimeErrorError;
2727
+ const se_ValidationExceptionField = (input, context) => {
2728
+ return (0, smithy_client_1.take)(input, {
2729
+ 'message': [],
2730
+ 'path': [],
2731
+ });
2732
+ };
2733
+ const se_ValidationExceptionFieldList = (input, context) => {
2734
+ return input.filter((e) => e != null).map(entry => {
2735
+ return se_ValidationExceptionField(entry, context);
2736
+ });
2737
+ };
2738
+ const se_EnrichedShop = (input, context) => {
2739
+ return (0, smithy_client_1.take)(input, {
2740
+ 'distance': [],
2741
+ 'favorite': [],
2742
+ 'location': _ => se_LocationDetails(_, context),
2743
+ 'logo': [],
2744
+ 'name': [],
2745
+ 'org_id': [],
2746
+ 'preview': [],
2747
+ 'shop_hours': _ => se_ShopHoursList(_, context),
2748
+ 'shop_id': [],
2749
+ 'tags': _ => se_StringList(_, context),
2750
+ });
2751
+ };
2752
+ const se_EnrichedShopList = (input, context) => {
2753
+ return input.filter((e) => e != null).map(entry => {
2754
+ return se_EnrichedShop(entry, context);
2755
+ });
2756
+ };
2757
+ const se_FirstTimeReward = (input, context) => {
2758
+ return (0, smithy_client_1.take)(input, {
2759
+ 'active': [],
2760
+ 'description': [],
2761
+ });
2762
+ };
2763
+ const se_GroupedPlan = (input, context) => {
2764
+ return (0, smithy_client_1.take)(input, {
2765
+ 'active': [],
2766
+ 'banner': [],
2767
+ 'favorite': [],
2768
+ 'id': [],
2769
+ 'logo': [],
2770
+ 'name': [],
2771
+ 'num_redeemableRewards': [],
2772
+ 'org_id': [],
2773
+ 'points': [],
2774
+ 'points_active': [],
2775
+ 'redeemableRewards': _ => se_RewardList(_, context),
2776
+ 'reward_plan': _ => se_RewardPlan(_, context),
2777
+ 'shop_id': [],
2778
+ 'visits': [],
2779
+ 'visits_active': [],
2780
+ });
2781
+ };
2782
+ const se_GroupedPlanList = (input, context) => {
2783
+ return input.filter((e) => e != null).map(entry => {
2784
+ return se_GroupedPlan(entry, context);
2785
+ });
2786
+ };
2787
+ const se_LocationDetails = (input, context) => {
2788
+ return (0, smithy_client_1.take)(input, {
2789
+ 'address': [],
2790
+ 'city': [],
2791
+ 'state': [],
2792
+ 'zipcode': [],
2793
+ });
2794
+ };
2795
+ const se_PaginationInfo = (input, context) => {
2796
+ return (0, smithy_client_1.take)(input, {
2797
+ 'currentPage': [],
2798
+ 'hasMore': [],
2799
+ 'limit': [],
2800
+ 'nextPage': [],
2801
+ });
2802
+ };
2803
+ const se_PointsRewardOption = (input, context) => {
2804
+ return (0, smithy_client_1.take)(input, {
2805
+ 'id': [],
2806
+ 'points': [],
2807
+ 'reward': [],
2808
+ });
2809
+ };
2810
+ const se_PointsRewardOptionList = (input, context) => {
2811
+ return input.filter((e) => e != null).map(entry => {
2812
+ return se_PointsRewardOption(entry, context);
2813
+ });
2814
+ };
2815
+ const se_Reward = (input, context) => {
2816
+ return (0, smithy_client_1.take)(input, {
2817
+ 'id': [],
2818
+ 'reward_id': [],
2819
+ });
2820
+ };
2821
+ const se_RewardList = (input, context) => {
2822
+ return input.filter((e) => e != null).map(entry => {
2823
+ return se_Reward(entry, context);
2824
+ });
2825
+ };
2826
+ const se_RewardPlan = (input, context) => {
2827
+ return (0, smithy_client_1.take)(input, {
2828
+ 'points': _ => se_PointsRewardOptionList(_, context),
2829
+ 'visits': _ => se_VisitRewardProps(_, context),
2830
+ });
2831
+ };
2832
+ const se_SearchSuggestionItem = (input, context) => {
2833
+ return (0, smithy_client_1.take)(input, {
2834
+ 'distance': smithy_client_1.serializeFloat,
2835
+ 'favorite': [],
2836
+ 'organization_id': [],
2837
+ 'search_name': [],
2838
+ 'shop_id': [],
2839
+ });
2840
+ };
2841
+ const se_SearchSuggestionList = (input, context) => {
2842
+ return input.filter((e) => e != null).map(entry => {
2843
+ return se_SearchSuggestionItem(entry, context);
2844
+ });
2845
+ };
2846
+ const se_ShopHoursItem = (input, context) => {
2847
+ return (0, smithy_client_1.take)(input, {
2848
+ 'close': [],
2849
+ 'day': [],
2850
+ 'open': [],
2851
+ });
2852
+ };
2853
+ const se_ShopHoursList = (input, context) => {
2854
+ return input.filter((e) => e != null).map(entry => {
2855
+ return se_ShopHoursItem(entry, context);
2856
+ });
2857
+ };
2858
+ const se_ShopLocation = (input, context) => {
2859
+ return (0, smithy_client_1.take)(input, {
2860
+ 'id': [],
2861
+ 'latitude': smithy_client_1.serializeFloat,
2862
+ 'longitude': smithy_client_1.serializeFloat,
2863
+ });
2864
+ };
2865
+ const se_ShopLocationList = (input, context) => {
2866
+ return input.filter((e) => e != null).map(entry => {
2867
+ return se_ShopLocation(entry, context);
2868
+ });
2869
+ };
2870
+ const se_StringList = (input, context) => {
2871
+ return input.filter((e) => e != null);
2872
+ };
2873
+ const se_Tier = (input, context) => {
2874
+ return (0, smithy_client_1.take)(input, {
2875
+ 'id': [],
2876
+ 'rewards': _ => se_StringList(_, context),
2877
+ });
2878
+ };
2879
+ const se_TierMap = (input, context) => {
2880
+ return Object.entries(input).reduce((acc, [key, value]) => {
2881
+ if (value === null) {
2882
+ return acc;
2883
+ }
2884
+ acc[key] = se_Tier(value, context);
2885
+ return acc;
2886
+ }, {});
2887
+ };
2888
+ const se_User = (input, context) => {
2889
+ return (0, smithy_client_1.take)(input, {
2890
+ 'birthdate': [],
2891
+ 'date_created': [],
2892
+ 'email': [],
2893
+ 'fraud_count': [],
2894
+ 'fullname': _ => se_UserFullname(_, context),
2895
+ 'id': [],
2896
+ 'newAccount': [],
2897
+ 'num_redeemableRewards': [],
2898
+ 'preferences': _ => se_UserPreferences(_, context),
2899
+ 'total_points': [],
2900
+ 'total_rewards': [],
2901
+ 'total_visits': [],
2902
+ });
2903
+ };
2904
+ const se_UserFullname = (input, context) => {
2905
+ return (0, smithy_client_1.take)(input, {
2906
+ 'firstName': [],
2907
+ 'lastName': [],
2908
+ });
2909
+ };
2910
+ const se_UserPreferences = (input, context) => {
2911
+ return (0, smithy_client_1.take)(input, {
2912
+ 'lightMode': [],
2913
+ });
2914
+ };
2915
+ const se_VisitRewardProps = (input, context) => {
2916
+ return (0, smithy_client_1.take)(input, {
2917
+ 'min_spend': [],
2918
+ 'tiers': _ => se_TierMap(_, context),
2919
+ });
2920
+ };
2921
+ const de_UserFullnameUpdate = (output, context) => {
2922
+ return (0, smithy_client_1.take)(output, {
2923
+ 'firstName': smithy_client_1.expectString,
2924
+ 'lastName': smithy_client_1.expectString,
2925
+ });
2926
+ };
2927
+ const deserializeMetadata = (output) => ({
2928
+ httpStatusCode: output.statusCode,
2929
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2930
+ extendedRequestId: output.headers["x-amz-id-2"],
2931
+ cfId: output.headers["x-amz-cf-id"],
2932
+ });
2933
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
2934
+ const isSerializableHeaderValue = (value) => value !== undefined &&
2935
+ value !== null &&
2936
+ value !== "" &&
2937
+ (!Object.getOwnPropertyNames(value).includes("length") ||
2938
+ value.length != 0) &&
2939
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);