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