@sparkrewards/sra-client 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 (128) hide show
  1. package/LICENSE +201 -0
  2. package/dist-cjs/AppAPI.js +63 -0
  3. package/dist-cjs/AppAPIClient.js +43 -0
  4. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +35 -0
  5. package/dist-cjs/auth/httpAuthSchemeProvider.js +35 -0
  6. package/dist-cjs/commands/DeleteUserCommand.js +21 -0
  7. package/dist-cjs/commands/FavoritePlansCommand.js +21 -0
  8. package/dist-cjs/commands/FavoriteShopsCommand.js +21 -0
  9. package/dist-cjs/commands/GetShopCommand.js +21 -0
  10. package/dist-cjs/commands/GetShopPublicCommand.js +21 -0
  11. package/dist-cjs/commands/GetUserCommand.js +21 -0
  12. package/dist-cjs/commands/LikeOrgCommand.js +21 -0
  13. package/dist-cjs/commands/NearbyShopsCommand.js +21 -0
  14. package/dist-cjs/commands/NearbyShopsPublicCommand.js +21 -0
  15. package/dist-cjs/commands/NearestShopCommand.js +21 -0
  16. package/dist-cjs/commands/OnboardUserCommand.js +21 -0
  17. package/dist-cjs/commands/PinnedShopCommand.js +21 -0
  18. package/dist-cjs/commands/PinnedShopPublicCommand.js +21 -0
  19. package/dist-cjs/commands/PlanCommand.js +21 -0
  20. package/dist-cjs/commands/PlanPublicCommand.js +21 -0
  21. package/dist-cjs/commands/PlansCommand.js +21 -0
  22. package/dist-cjs/commands/PopularShopsCommand.js +21 -0
  23. package/dist-cjs/commands/PopularShopsPublicCommand.js +21 -0
  24. package/dist-cjs/commands/RadiusShopsCommand.js +21 -0
  25. package/dist-cjs/commands/RecordVisitCommand.js +21 -0
  26. package/dist-cjs/commands/RedeemFirstTimeRewardCommand.js +21 -0
  27. package/dist-cjs/commands/RedeemPointRewardCommand.js +21 -0
  28. package/dist-cjs/commands/RedeemVisitRewardCommand.js +21 -0
  29. package/dist-cjs/commands/SearchShopsPublicCommand.js +21 -0
  30. package/dist-cjs/commands/SearchSuggestionCommand.js +21 -0
  31. package/dist-cjs/commands/UpdateUserCommand.js +21 -0
  32. package/dist-cjs/commands/index.js +29 -0
  33. package/dist-cjs/extensionConfiguration.js +2 -0
  34. package/dist-cjs/index.js +10 -0
  35. package/dist-cjs/models/AppAPIServiceException.js +12 -0
  36. package/dist-cjs/models/index.js +4 -0
  37. package/dist-cjs/models/models_0.js +57 -0
  38. package/dist-cjs/protocols/Aws_restJson1.js +1073 -0
  39. package/dist-cjs/runtimeConfig.browser.js +32 -0
  40. package/dist-cjs/runtimeConfig.js +36 -0
  41. package/dist-cjs/runtimeConfig.native.js +15 -0
  42. package/dist-cjs/runtimeConfig.shared.js +23 -0
  43. package/dist-cjs/runtimeExtensions.js +22 -0
  44. package/dist-es/AppAPI.js +59 -0
  45. package/dist-es/AppAPIClient.js +39 -0
  46. package/dist-es/auth/httpAuthExtensionConfiguration.js +30 -0
  47. package/dist-es/auth/httpAuthSchemeProvider.js +29 -0
  48. package/dist-es/commands/DeleteUserCommand.js +17 -0
  49. package/dist-es/commands/FavoritePlansCommand.js +17 -0
  50. package/dist-es/commands/FavoriteShopsCommand.js +17 -0
  51. package/dist-es/commands/GetShopCommand.js +17 -0
  52. package/dist-es/commands/GetShopPublicCommand.js +17 -0
  53. package/dist-es/commands/GetUserCommand.js +17 -0
  54. package/dist-es/commands/LikeOrgCommand.js +17 -0
  55. package/dist-es/commands/NearbyShopsCommand.js +17 -0
  56. package/dist-es/commands/NearbyShopsPublicCommand.js +17 -0
  57. package/dist-es/commands/NearestShopCommand.js +17 -0
  58. package/dist-es/commands/OnboardUserCommand.js +17 -0
  59. package/dist-es/commands/PinnedShopCommand.js +17 -0
  60. package/dist-es/commands/PinnedShopPublicCommand.js +17 -0
  61. package/dist-es/commands/PlanCommand.js +17 -0
  62. package/dist-es/commands/PlanPublicCommand.js +17 -0
  63. package/dist-es/commands/PlansCommand.js +17 -0
  64. package/dist-es/commands/PopularShopsCommand.js +17 -0
  65. package/dist-es/commands/PopularShopsPublicCommand.js +17 -0
  66. package/dist-es/commands/RadiusShopsCommand.js +17 -0
  67. package/dist-es/commands/RecordVisitCommand.js +17 -0
  68. package/dist-es/commands/RedeemFirstTimeRewardCommand.js +17 -0
  69. package/dist-es/commands/RedeemPointRewardCommand.js +17 -0
  70. package/dist-es/commands/RedeemVisitRewardCommand.js +17 -0
  71. package/dist-es/commands/SearchShopsPublicCommand.js +17 -0
  72. package/dist-es/commands/SearchSuggestionCommand.js +17 -0
  73. package/dist-es/commands/UpdateUserCommand.js +17 -0
  74. package/dist-es/commands/index.js +26 -0
  75. package/dist-es/extensionConfiguration.js +1 -0
  76. package/dist-es/index.js +5 -0
  77. package/dist-es/models/AppAPIServiceException.js +8 -0
  78. package/dist-es/models/index.js +1 -0
  79. package/dist-es/models/models_0.js +50 -0
  80. package/dist-es/protocols/Aws_restJson1.js +1017 -0
  81. package/dist-es/runtimeConfig.browser.js +27 -0
  82. package/dist-es/runtimeConfig.js +31 -0
  83. package/dist-es/runtimeConfig.native.js +11 -0
  84. package/dist-es/runtimeConfig.shared.js +19 -0
  85. package/dist-es/runtimeExtensions.js +18 -0
  86. package/dist-types/AppAPI.d.ts +202 -0
  87. package/dist-types/AppAPIClient.d.ts +170 -0
  88. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +26 -0
  89. package/dist-types/auth/httpAuthSchemeProvider.d.ts +59 -0
  90. package/dist-types/commands/DeleteUserCommand.d.ts +65 -0
  91. package/dist-types/commands/FavoritePlansCommand.d.ts +119 -0
  92. package/dist-types/commands/FavoriteShopsCommand.d.ts +104 -0
  93. package/dist-types/commands/GetShopCommand.d.ts +100 -0
  94. package/dist-types/commands/GetShopPublicCommand.d.ts +100 -0
  95. package/dist-types/commands/GetUserCommand.d.ts +84 -0
  96. package/dist-types/commands/LikeOrgCommand.d.ts +68 -0
  97. package/dist-types/commands/NearbyShopsCommand.d.ts +104 -0
  98. package/dist-types/commands/NearbyShopsPublicCommand.d.ts +104 -0
  99. package/dist-types/commands/NearestShopCommand.d.ts +91 -0
  100. package/dist-types/commands/OnboardUserCommand.d.ts +84 -0
  101. package/dist-types/commands/PinnedShopCommand.d.ts +91 -0
  102. package/dist-types/commands/PinnedShopPublicCommand.d.ts +91 -0
  103. package/dist-types/commands/PlanCommand.d.ts +107 -0
  104. package/dist-types/commands/PlanPublicCommand.d.ts +107 -0
  105. package/dist-types/commands/PlansCommand.d.ts +119 -0
  106. package/dist-types/commands/PopularShopsCommand.d.ts +104 -0
  107. package/dist-types/commands/PopularShopsPublicCommand.d.ts +104 -0
  108. package/dist-types/commands/RadiusShopsCommand.d.ts +78 -0
  109. package/dist-types/commands/RecordVisitCommand.d.ts +75 -0
  110. package/dist-types/commands/RedeemFirstTimeRewardCommand.d.ts +68 -0
  111. package/dist-types/commands/RedeemPointRewardCommand.d.ts +71 -0
  112. package/dist-types/commands/RedeemVisitRewardCommand.d.ts +68 -0
  113. package/dist-types/commands/SearchShopsPublicCommand.d.ts +106 -0
  114. package/dist-types/commands/SearchSuggestionCommand.d.ts +78 -0
  115. package/dist-types/commands/UpdateUserCommand.d.ts +89 -0
  116. package/dist-types/commands/index.d.ts +26 -0
  117. package/dist-types/extensionConfiguration.d.ts +8 -0
  118. package/dist-types/index.d.ts +12 -0
  119. package/dist-types/models/AppAPIServiceException.d.ts +14 -0
  120. package/dist-types/models/index.d.ts +1 -0
  121. package/dist-types/models/models_0.d.ts +550 -0
  122. package/dist-types/protocols/Aws_restJson1.d.ts +236 -0
  123. package/dist-types/runtimeConfig.browser.d.ts +33 -0
  124. package/dist-types/runtimeConfig.d.ts +33 -0
  125. package/dist-types/runtimeConfig.native.d.ts +32 -0
  126. package/dist-types/runtimeConfig.shared.d.ts +16 -0
  127. package/dist-types/runtimeExtensions.d.ts +17 -0
  128. package/package.json +81 -0
@@ -0,0 +1,1073 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_SearchShopsPublicCommand = exports.de_RedeemVisitRewardCommand = exports.de_RedeemPointRewardCommand = exports.de_RedeemFirstTimeRewardCommand = exports.de_RecordVisitCommand = exports.de_RadiusShopsCommand = exports.de_PopularShopsPublicCommand = exports.de_PopularShopsCommand = exports.de_PlansCommand = exports.de_PlanPublicCommand = exports.de_PlanCommand = exports.de_PinnedShopPublicCommand = exports.de_PinnedShopCommand = exports.de_OnboardUserCommand = exports.de_NearestShopCommand = exports.de_NearbyShopsPublicCommand = exports.de_NearbyShopsCommand = exports.de_LikeOrgCommand = exports.de_GetUserCommand = exports.de_GetShopPublicCommand = exports.de_GetShopCommand = exports.de_FavoriteShopsCommand = exports.de_FavoritePlansCommand = exports.de_DeleteUserCommand = exports.se_UpdateUserCommand = exports.se_SearchSuggestionCommand = exports.se_SearchShopsPublicCommand = exports.se_RedeemVisitRewardCommand = exports.se_RedeemPointRewardCommand = exports.se_RedeemFirstTimeRewardCommand = exports.se_RecordVisitCommand = exports.se_RadiusShopsCommand = exports.se_PopularShopsPublicCommand = exports.se_PopularShopsCommand = exports.se_PlansCommand = exports.se_PlanPublicCommand = exports.se_PlanCommand = exports.se_PinnedShopPublicCommand = exports.se_PinnedShopCommand = exports.se_OnboardUserCommand = exports.se_NearestShopCommand = exports.se_NearbyShopsPublicCommand = exports.se_NearbyShopsCommand = exports.se_LikeOrgCommand = exports.se_GetUserCommand = exports.se_GetShopPublicCommand = exports.se_GetShopCommand = exports.se_FavoriteShopsCommand = exports.se_FavoritePlansCommand = exports.se_DeleteUserCommand = void 0;
4
+ exports.de_UpdateUserCommand = exports.de_SearchSuggestionCommand = void 0;
5
+ const AppAPIServiceException_1 = require("../models/AppAPIServiceException");
6
+ const models_0_1 = require("../models/models_0");
7
+ const core_1 = require("@aws-sdk/core");
8
+ const core_2 = require("@smithy/core");
9
+ const smithy_client_1 = require("@smithy/smithy-client");
10
+ const se_DeleteUserCommand = async (input, context) => {
11
+ const b = (0, core_2.requestBuilder)(input, context);
12
+ const headers = {};
13
+ b.bp("/user");
14
+ let body;
15
+ b.m("DELETE")
16
+ .h(headers)
17
+ .b(body);
18
+ return b.build();
19
+ };
20
+ exports.se_DeleteUserCommand = se_DeleteUserCommand;
21
+ const se_FavoritePlansCommand = async (input, context) => {
22
+ const b = (0, core_2.requestBuilder)(input, context);
23
+ const headers = {};
24
+ b.bp("/plans/favorite");
25
+ const query = (0, smithy_client_1.map)({
26
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
27
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
28
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
29
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
30
+ });
31
+ let body;
32
+ b.m("GET")
33
+ .h(headers)
34
+ .q(query)
35
+ .b(body);
36
+ return b.build();
37
+ };
38
+ exports.se_FavoritePlansCommand = se_FavoritePlansCommand;
39
+ const se_FavoriteShopsCommand = async (input, context) => {
40
+ const b = (0, core_2.requestBuilder)(input, context);
41
+ const headers = {};
42
+ b.bp("/shops/favorite");
43
+ const query = (0, smithy_client_1.map)({
44
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
45
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
46
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
47
+ [_f]: [, input[_f]],
48
+ });
49
+ let body;
50
+ b.m("GET")
51
+ .h(headers)
52
+ .q(query)
53
+ .b(body);
54
+ return b.build();
55
+ };
56
+ exports.se_FavoriteShopsCommand = se_FavoriteShopsCommand;
57
+ const se_GetShopCommand = async (input, context) => {
58
+ const b = (0, core_2.requestBuilder)(input, context);
59
+ const headers = {};
60
+ b.bp("/shops/shop/{shop_id}");
61
+ b.p('shop_id', () => input.shop_id, '{shop_id}', false);
62
+ let body;
63
+ b.m("GET")
64
+ .h(headers)
65
+ .b(body);
66
+ return b.build();
67
+ };
68
+ exports.se_GetShopCommand = se_GetShopCommand;
69
+ const se_GetShopPublicCommand = async (input, context) => {
70
+ const b = (0, core_2.requestBuilder)(input, context);
71
+ const headers = {};
72
+ b.bp("/public/shops/shop/{shop_id}");
73
+ b.p('shop_id', () => input.shop_id, '{shop_id}', false);
74
+ let body;
75
+ b.m("GET")
76
+ .h(headers)
77
+ .b(body);
78
+ return b.build();
79
+ };
80
+ exports.se_GetShopPublicCommand = se_GetShopPublicCommand;
81
+ const se_GetUserCommand = async (input, context) => {
82
+ const b = (0, core_2.requestBuilder)(input, context);
83
+ const headers = {};
84
+ b.bp("/user");
85
+ let body;
86
+ b.m("GET")
87
+ .h(headers)
88
+ .b(body);
89
+ return b.build();
90
+ };
91
+ exports.se_GetUserCommand = se_GetUserCommand;
92
+ const se_LikeOrgCommand = async (input, context) => {
93
+ const b = (0, core_2.requestBuilder)(input, context);
94
+ const headers = {};
95
+ b.bp("/user/like");
96
+ const query = (0, smithy_client_1.map)({
97
+ [_oi]: [, (0, smithy_client_1.expectNonNull)(input[_oi], `org_id`)],
98
+ });
99
+ let body;
100
+ b.m("PUT")
101
+ .h(headers)
102
+ .q(query)
103
+ .b(body);
104
+ return b.build();
105
+ };
106
+ exports.se_LikeOrgCommand = se_LikeOrgCommand;
107
+ const se_NearbyShopsCommand = async (input, context) => {
108
+ const b = (0, core_2.requestBuilder)(input, context);
109
+ const headers = {};
110
+ b.bp("/shops");
111
+ const query = (0, smithy_client_1.map)({
112
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
113
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
114
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
115
+ [_f]: [, input[_f]],
116
+ });
117
+ let body;
118
+ b.m("GET")
119
+ .h(headers)
120
+ .q(query)
121
+ .b(body);
122
+ return b.build();
123
+ };
124
+ exports.se_NearbyShopsCommand = se_NearbyShopsCommand;
125
+ const se_NearbyShopsPublicCommand = async (input, context) => {
126
+ const b = (0, core_2.requestBuilder)(input, context);
127
+ const headers = {};
128
+ b.bp("/public/shops");
129
+ const query = (0, smithy_client_1.map)({
130
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
131
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
132
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
133
+ [_f]: [, input[_f]],
134
+ });
135
+ let body;
136
+ b.m("GET")
137
+ .h(headers)
138
+ .q(query)
139
+ .b(body);
140
+ return b.build();
141
+ };
142
+ exports.se_NearbyShopsPublicCommand = se_NearbyShopsPublicCommand;
143
+ const se_NearestShopCommand = async (input, context) => {
144
+ const b = (0, core_2.requestBuilder)(input, context);
145
+ const headers = {};
146
+ b.bp("/shops/nearest");
147
+ const query = (0, smithy_client_1.map)({
148
+ [_sn]: [, (0, smithy_client_1.expectNonNull)(input[_sn], `shop_name`)],
149
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
150
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
151
+ });
152
+ let body;
153
+ b.m("GET")
154
+ .h(headers)
155
+ .q(query)
156
+ .b(body);
157
+ return b.build();
158
+ };
159
+ exports.se_NearestShopCommand = se_NearestShopCommand;
160
+ const se_OnboardUserCommand = async (input, context) => {
161
+ const b = (0, core_2.requestBuilder)(input, context);
162
+ const headers = {};
163
+ b.bp("/user/onboard");
164
+ let body;
165
+ b.m("PUT")
166
+ .h(headers)
167
+ .b(body);
168
+ return b.build();
169
+ };
170
+ exports.se_OnboardUserCommand = se_OnboardUserCommand;
171
+ const se_PinnedShopCommand = async (input, context) => {
172
+ const b = (0, core_2.requestBuilder)(input, context);
173
+ const headers = {};
174
+ b.bp("/shops/pinned");
175
+ const query = (0, smithy_client_1.map)({
176
+ [_si]: [, (0, smithy_client_1.expectNonNull)(input[_si], `shop_id`)],
177
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
178
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
179
+ });
180
+ let body;
181
+ b.m("GET")
182
+ .h(headers)
183
+ .q(query)
184
+ .b(body);
185
+ return b.build();
186
+ };
187
+ exports.se_PinnedShopCommand = se_PinnedShopCommand;
188
+ const se_PinnedShopPublicCommand = async (input, context) => {
189
+ const b = (0, core_2.requestBuilder)(input, context);
190
+ const headers = {};
191
+ b.bp("/public/shops/pinned");
192
+ const query = (0, smithy_client_1.map)({
193
+ [_si]: [, (0, smithy_client_1.expectNonNull)(input[_si], `shop_id`)],
194
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
195
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
196
+ });
197
+ let body;
198
+ b.m("GET")
199
+ .h(headers)
200
+ .q(query)
201
+ .b(body);
202
+ return b.build();
203
+ };
204
+ exports.se_PinnedShopPublicCommand = se_PinnedShopPublicCommand;
205
+ const se_PlanCommand = async (input, context) => {
206
+ const b = (0, core_2.requestBuilder)(input, context);
207
+ const headers = {};
208
+ b.bp("/plan");
209
+ const query = (0, smithy_client_1.map)({
210
+ [_oi]: [, (0, smithy_client_1.expectNonNull)(input[_oi], `org_id`)],
211
+ });
212
+ let body;
213
+ b.m("GET")
214
+ .h(headers)
215
+ .q(query)
216
+ .b(body);
217
+ return b.build();
218
+ };
219
+ exports.se_PlanCommand = se_PlanCommand;
220
+ const se_PlanPublicCommand = async (input, context) => {
221
+ const b = (0, core_2.requestBuilder)(input, context);
222
+ const headers = {};
223
+ b.bp("/public/plan");
224
+ const query = (0, smithy_client_1.map)({
225
+ [_oi]: [, (0, smithy_client_1.expectNonNull)(input[_oi], `org_id`)],
226
+ });
227
+ let body;
228
+ b.m("GET")
229
+ .h(headers)
230
+ .q(query)
231
+ .b(body);
232
+ return b.build();
233
+ };
234
+ exports.se_PlanPublicCommand = se_PlanPublicCommand;
235
+ const se_PlansCommand = async (input, context) => {
236
+ const b = (0, core_2.requestBuilder)(input, context);
237
+ const headers = {};
238
+ b.bp("/plans");
239
+ const query = (0, smithy_client_1.map)({
240
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
241
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
242
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
243
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
244
+ });
245
+ let body;
246
+ b.m("GET")
247
+ .h(headers)
248
+ .q(query)
249
+ .b(body);
250
+ return b.build();
251
+ };
252
+ exports.se_PlansCommand = se_PlansCommand;
253
+ const se_PopularShopsCommand = async (input, context) => {
254
+ const b = (0, core_2.requestBuilder)(input, context);
255
+ const headers = {};
256
+ b.bp("/shops/popular");
257
+ const query = (0, smithy_client_1.map)({
258
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
259
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
260
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
261
+ [_f]: [, input[_f]],
262
+ });
263
+ let body;
264
+ b.m("GET")
265
+ .h(headers)
266
+ .q(query)
267
+ .b(body);
268
+ return b.build();
269
+ };
270
+ exports.se_PopularShopsCommand = se_PopularShopsCommand;
271
+ const se_PopularShopsPublicCommand = async (input, context) => {
272
+ const b = (0, core_2.requestBuilder)(input, context);
273
+ const headers = {};
274
+ b.bp("/public/shops/popular");
275
+ const query = (0, smithy_client_1.map)({
276
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
277
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
278
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
279
+ [_f]: [, input[_f]],
280
+ });
281
+ let body;
282
+ b.m("GET")
283
+ .h(headers)
284
+ .q(query)
285
+ .b(body);
286
+ return b.build();
287
+ };
288
+ exports.se_PopularShopsPublicCommand = se_PopularShopsPublicCommand;
289
+ const se_RadiusShopsCommand = async (input, context) => {
290
+ const b = (0, core_2.requestBuilder)(input, context);
291
+ const headers = {};
292
+ b.bp("/public/shops/radius");
293
+ const query = (0, smithy_client_1.map)({
294
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
295
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
296
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
297
+ [_f]: [, input[_f]],
298
+ });
299
+ let body;
300
+ b.m("GET")
301
+ .h(headers)
302
+ .q(query)
303
+ .b(body);
304
+ return b.build();
305
+ };
306
+ exports.se_RadiusShopsCommand = se_RadiusShopsCommand;
307
+ const se_RecordVisitCommand = async (input, context) => {
308
+ const b = (0, core_2.requestBuilder)(input, context);
309
+ const headers = {};
310
+ b.bp("/visit");
311
+ const query = (0, smithy_client_1.map)({
312
+ [_si]: [, (0, smithy_client_1.expectNonNull)(input[_si], `shop_id`)],
313
+ [_t]: [, (0, smithy_client_1.expectNonNull)(input[_t], `timestamp`)],
314
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
315
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
316
+ });
317
+ let body;
318
+ b.m("POST")
319
+ .h(headers)
320
+ .q(query)
321
+ .b(body);
322
+ return b.build();
323
+ };
324
+ exports.se_RecordVisitCommand = se_RecordVisitCommand;
325
+ const se_RedeemFirstTimeRewardCommand = async (input, context) => {
326
+ const b = (0, core_2.requestBuilder)(input, context);
327
+ const headers = {};
328
+ b.bp("/rewards/redeem/first-time");
329
+ const query = (0, smithy_client_1.map)({
330
+ [_oi]: [, (0, smithy_client_1.expectNonNull)(input[_oi], `org_id`)],
331
+ });
332
+ let body;
333
+ b.m("PUT")
334
+ .h(headers)
335
+ .q(query)
336
+ .b(body);
337
+ return b.build();
338
+ };
339
+ exports.se_RedeemFirstTimeRewardCommand = se_RedeemFirstTimeRewardCommand;
340
+ const se_RedeemPointRewardCommand = async (input, context) => {
341
+ const b = (0, core_2.requestBuilder)(input, context);
342
+ const headers = {};
343
+ b.bp("/rewards/redeem/point");
344
+ const query = (0, smithy_client_1.map)({
345
+ [_oi]: [, (0, smithy_client_1.expectNonNull)(input[_oi], `org_id`)],
346
+ [_ri]: [, (0, smithy_client_1.expectNonNull)(input[_ri], `reward_id`)],
347
+ });
348
+ let body;
349
+ b.m("PUT")
350
+ .h(headers)
351
+ .q(query)
352
+ .b(body);
353
+ return b.build();
354
+ };
355
+ exports.se_RedeemPointRewardCommand = se_RedeemPointRewardCommand;
356
+ const se_RedeemVisitRewardCommand = async (input, context) => {
357
+ const b = (0, core_2.requestBuilder)(input, context);
358
+ const headers = {};
359
+ b.bp("/rewards/redeem/visit");
360
+ const query = (0, smithy_client_1.map)({
361
+ [_ri]: [, (0, smithy_client_1.expectNonNull)(input[_ri], `reward_id`)],
362
+ });
363
+ let body;
364
+ b.m("PUT")
365
+ .h(headers)
366
+ .q(query)
367
+ .b(body);
368
+ return b.build();
369
+ };
370
+ exports.se_RedeemVisitRewardCommand = se_RedeemVisitRewardCommand;
371
+ const se_SearchShopsPublicCommand = async (input, context) => {
372
+ const b = (0, core_2.requestBuilder)(input, context);
373
+ const headers = {};
374
+ b.bp("/public/shops/search");
375
+ const query = (0, smithy_client_1.map)({
376
+ [_q]: [, (0, smithy_client_1.expectNonNull)(input[_q], `q`)],
377
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
378
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
379
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
380
+ [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
381
+ [_f]: [, input[_f]],
382
+ });
383
+ let body;
384
+ b.m("GET")
385
+ .h(headers)
386
+ .q(query)
387
+ .b(body);
388
+ return b.build();
389
+ };
390
+ exports.se_SearchShopsPublicCommand = se_SearchShopsPublicCommand;
391
+ const se_SearchSuggestionCommand = async (input, context) => {
392
+ const b = (0, core_2.requestBuilder)(input, context);
393
+ const headers = {};
394
+ b.bp("/public/shops/search/suggestion");
395
+ const query = (0, smithy_client_1.map)({
396
+ [_q]: [, (0, smithy_client_1.expectNonNull)(input[_q], `q`)],
397
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
398
+ [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
399
+ [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
400
+ });
401
+ let body;
402
+ b.m("GET")
403
+ .h(headers)
404
+ .q(query)
405
+ .b(body);
406
+ return b.build();
407
+ };
408
+ exports.se_SearchSuggestionCommand = se_SearchSuggestionCommand;
409
+ const se_UpdateUserCommand = async (input, context) => {
410
+ const b = (0, core_2.requestBuilder)(input, context);
411
+ const headers = {
412
+ 'content-type': 'application/json',
413
+ };
414
+ b.bp("/user");
415
+ let body;
416
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
417
+ 'fullname': _ => (0, smithy_client_1._json)(_),
418
+ }));
419
+ b.m("PUT")
420
+ .h(headers)
421
+ .b(body);
422
+ return b.build();
423
+ };
424
+ exports.se_UpdateUserCommand = se_UpdateUserCommand;
425
+ const de_DeleteUserCommand = async (output, context) => {
426
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
427
+ return de_CommandError(output, context);
428
+ }
429
+ const contents = (0, smithy_client_1.map)({
430
+ $metadata: deserializeMetadata(output),
431
+ });
432
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
433
+ const doc = (0, smithy_client_1.take)(data, {
434
+ 'message': smithy_client_1.expectString,
435
+ });
436
+ Object.assign(contents, doc);
437
+ return contents;
438
+ };
439
+ exports.de_DeleteUserCommand = de_DeleteUserCommand;
440
+ const de_FavoritePlansCommand = async (output, context) => {
441
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
442
+ return de_CommandError(output, context);
443
+ }
444
+ const contents = (0, smithy_client_1.map)({
445
+ $metadata: deserializeMetadata(output),
446
+ });
447
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
448
+ const doc = (0, smithy_client_1.take)(data, {
449
+ 'count': smithy_client_1.expectInt32,
450
+ 'pagination': smithy_client_1._json,
451
+ 'value': smithy_client_1._json,
452
+ });
453
+ Object.assign(contents, doc);
454
+ return contents;
455
+ };
456
+ exports.de_FavoritePlansCommand = de_FavoritePlansCommand;
457
+ const de_FavoriteShopsCommand = async (output, context) => {
458
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
459
+ return de_CommandError(output, context);
460
+ }
461
+ const contents = (0, smithy_client_1.map)({
462
+ $metadata: deserializeMetadata(output),
463
+ });
464
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
465
+ const doc = (0, smithy_client_1.take)(data, {
466
+ 'count': smithy_client_1.expectInt32,
467
+ 'message': smithy_client_1.expectString,
468
+ 'pagination': smithy_client_1._json,
469
+ 'value': smithy_client_1._json,
470
+ });
471
+ Object.assign(contents, doc);
472
+ return contents;
473
+ };
474
+ exports.de_FavoriteShopsCommand = de_FavoriteShopsCommand;
475
+ const de_GetShopCommand = async (output, context) => {
476
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
477
+ return de_CommandError(output, context);
478
+ }
479
+ const contents = (0, smithy_client_1.map)({
480
+ $metadata: deserializeMetadata(output),
481
+ });
482
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
483
+ const doc = (0, smithy_client_1.take)(data, {
484
+ 'active': smithy_client_1.expectBoolean,
485
+ 'banner': smithy_client_1.expectString,
486
+ 'country_code': smithy_client_1.expectString,
487
+ 'description': smithy_client_1.expectString,
488
+ 'id': smithy_client_1.expectString,
489
+ 'latitude': smithy_client_1.limitedParseDouble,
490
+ 'location': smithy_client_1._json,
491
+ 'logo': smithy_client_1.expectString,
492
+ 'longitude': smithy_client_1.limitedParseDouble,
493
+ 'menu': smithy_client_1.expectString,
494
+ 'org_id': smithy_client_1.expectString,
495
+ 'org_name': smithy_client_1.expectString,
496
+ 'phone_number': smithy_client_1.expectString,
497
+ 'preview': smithy_client_1.expectString,
498
+ 'sent_setup': smithy_client_1.expectBoolean,
499
+ 'setup': smithy_client_1.expectBoolean,
500
+ 'shop_hours': smithy_client_1._json,
501
+ 'shop_name': smithy_client_1.expectString,
502
+ 'tags': smithy_client_1._json,
503
+ });
504
+ Object.assign(contents, doc);
505
+ return contents;
506
+ };
507
+ exports.de_GetShopCommand = de_GetShopCommand;
508
+ const de_GetShopPublicCommand = async (output, context) => {
509
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
510
+ return de_CommandError(output, context);
511
+ }
512
+ const contents = (0, smithy_client_1.map)({
513
+ $metadata: deserializeMetadata(output),
514
+ });
515
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
516
+ const doc = (0, smithy_client_1.take)(data, {
517
+ 'active': smithy_client_1.expectBoolean,
518
+ 'banner': smithy_client_1.expectString,
519
+ 'country_code': smithy_client_1.expectString,
520
+ 'description': smithy_client_1.expectString,
521
+ 'id': smithy_client_1.expectString,
522
+ 'latitude': smithy_client_1.limitedParseDouble,
523
+ 'location': smithy_client_1._json,
524
+ 'logo': smithy_client_1.expectString,
525
+ 'longitude': smithy_client_1.limitedParseDouble,
526
+ 'menu': smithy_client_1.expectString,
527
+ 'org_id': smithy_client_1.expectString,
528
+ 'org_name': smithy_client_1.expectString,
529
+ 'phone_number': smithy_client_1.expectString,
530
+ 'preview': smithy_client_1.expectString,
531
+ 'sent_setup': smithy_client_1.expectBoolean,
532
+ 'setup': smithy_client_1.expectBoolean,
533
+ 'shop_hours': smithy_client_1._json,
534
+ 'shop_name': smithy_client_1.expectString,
535
+ 'tags': smithy_client_1._json,
536
+ });
537
+ Object.assign(contents, doc);
538
+ return contents;
539
+ };
540
+ exports.de_GetShopPublicCommand = de_GetShopPublicCommand;
541
+ const de_GetUserCommand = async (output, context) => {
542
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
543
+ return de_CommandError(output, context);
544
+ }
545
+ const contents = (0, smithy_client_1.map)({
546
+ $metadata: deserializeMetadata(output),
547
+ });
548
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
549
+ const doc = (0, smithy_client_1.take)(data, {
550
+ 'message': smithy_client_1.expectString,
551
+ 'user': smithy_client_1._json,
552
+ });
553
+ Object.assign(contents, doc);
554
+ return contents;
555
+ };
556
+ exports.de_GetUserCommand = de_GetUserCommand;
557
+ const de_LikeOrgCommand = async (output, context) => {
558
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
559
+ return de_CommandError(output, context);
560
+ }
561
+ const contents = (0, smithy_client_1.map)({
562
+ $metadata: deserializeMetadata(output),
563
+ });
564
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
565
+ const doc = (0, smithy_client_1.take)(data, {
566
+ 'liked': smithy_client_1.expectBoolean,
567
+ 'message': smithy_client_1.expectString,
568
+ });
569
+ Object.assign(contents, doc);
570
+ return contents;
571
+ };
572
+ exports.de_LikeOrgCommand = de_LikeOrgCommand;
573
+ const de_NearbyShopsCommand = async (output, context) => {
574
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
575
+ return de_CommandError(output, context);
576
+ }
577
+ const contents = (0, smithy_client_1.map)({
578
+ $metadata: deserializeMetadata(output),
579
+ });
580
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
581
+ const doc = (0, smithy_client_1.take)(data, {
582
+ 'count': smithy_client_1.expectInt32,
583
+ 'message': smithy_client_1.expectString,
584
+ 'pagination': smithy_client_1._json,
585
+ 'value': smithy_client_1._json,
586
+ });
587
+ Object.assign(contents, doc);
588
+ return contents;
589
+ };
590
+ exports.de_NearbyShopsCommand = de_NearbyShopsCommand;
591
+ const de_NearbyShopsPublicCommand = async (output, context) => {
592
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
593
+ return de_CommandError(output, context);
594
+ }
595
+ const contents = (0, smithy_client_1.map)({
596
+ $metadata: deserializeMetadata(output),
597
+ });
598
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
599
+ const doc = (0, smithy_client_1.take)(data, {
600
+ 'count': smithy_client_1.expectInt32,
601
+ 'message': smithy_client_1.expectString,
602
+ 'pagination': smithy_client_1._json,
603
+ 'value': smithy_client_1._json,
604
+ });
605
+ Object.assign(contents, doc);
606
+ return contents;
607
+ };
608
+ exports.de_NearbyShopsPublicCommand = de_NearbyShopsPublicCommand;
609
+ const de_NearestShopCommand = async (output, context) => {
610
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
611
+ return de_CommandError(output, context);
612
+ }
613
+ const contents = (0, smithy_client_1.map)({
614
+ $metadata: deserializeMetadata(output),
615
+ });
616
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
617
+ const doc = (0, smithy_client_1.take)(data, {
618
+ 'distance': smithy_client_1.expectString,
619
+ 'favorite': smithy_client_1.expectBoolean,
620
+ 'location': smithy_client_1._json,
621
+ 'logo': smithy_client_1.expectString,
622
+ 'name': smithy_client_1.expectString,
623
+ 'org_id': smithy_client_1.expectString,
624
+ 'preview': smithy_client_1.expectString,
625
+ 'shop_hours': smithy_client_1._json,
626
+ 'shop_id': smithy_client_1.expectString,
627
+ 'tags': smithy_client_1._json,
628
+ });
629
+ Object.assign(contents, doc);
630
+ return contents;
631
+ };
632
+ exports.de_NearestShopCommand = de_NearestShopCommand;
633
+ const de_OnboardUserCommand = async (output, context) => {
634
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
635
+ return de_CommandError(output, context);
636
+ }
637
+ const contents = (0, smithy_client_1.map)({
638
+ $metadata: deserializeMetadata(output),
639
+ });
640
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
641
+ const doc = (0, smithy_client_1.take)(data, {
642
+ 'message': smithy_client_1.expectString,
643
+ 'user': smithy_client_1._json,
644
+ });
645
+ Object.assign(contents, doc);
646
+ return contents;
647
+ };
648
+ exports.de_OnboardUserCommand = de_OnboardUserCommand;
649
+ const de_PinnedShopCommand = async (output, context) => {
650
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
651
+ return de_CommandError(output, context);
652
+ }
653
+ const contents = (0, smithy_client_1.map)({
654
+ $metadata: deserializeMetadata(output),
655
+ });
656
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
657
+ const doc = (0, smithy_client_1.take)(data, {
658
+ 'distance': smithy_client_1.expectString,
659
+ 'favorite': smithy_client_1.expectBoolean,
660
+ 'location': smithy_client_1._json,
661
+ 'logo': smithy_client_1.expectString,
662
+ 'name': smithy_client_1.expectString,
663
+ 'org_id': smithy_client_1.expectString,
664
+ 'preview': smithy_client_1.expectString,
665
+ 'shop_hours': smithy_client_1._json,
666
+ 'shop_id': smithy_client_1.expectString,
667
+ 'tags': smithy_client_1._json,
668
+ });
669
+ Object.assign(contents, doc);
670
+ return contents;
671
+ };
672
+ exports.de_PinnedShopCommand = de_PinnedShopCommand;
673
+ const de_PinnedShopPublicCommand = async (output, context) => {
674
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
675
+ return de_CommandError(output, context);
676
+ }
677
+ const contents = (0, smithy_client_1.map)({
678
+ $metadata: deserializeMetadata(output),
679
+ });
680
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
681
+ const doc = (0, smithy_client_1.take)(data, {
682
+ 'distance': smithy_client_1.expectString,
683
+ 'favorite': smithy_client_1.expectBoolean,
684
+ 'location': smithy_client_1._json,
685
+ 'logo': smithy_client_1.expectString,
686
+ 'name': smithy_client_1.expectString,
687
+ 'org_id': smithy_client_1.expectString,
688
+ 'preview': smithy_client_1.expectString,
689
+ 'shop_hours': smithy_client_1._json,
690
+ 'shop_id': smithy_client_1.expectString,
691
+ 'tags': smithy_client_1._json,
692
+ });
693
+ Object.assign(contents, doc);
694
+ return contents;
695
+ };
696
+ exports.de_PinnedShopPublicCommand = de_PinnedShopPublicCommand;
697
+ const de_PlanCommand = async (output, context) => {
698
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
699
+ return de_CommandError(output, context);
700
+ }
701
+ const contents = (0, smithy_client_1.map)({
702
+ $metadata: deserializeMetadata(output),
703
+ });
704
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
705
+ const doc = (0, smithy_client_1.take)(data, {
706
+ 'active': smithy_client_1.expectBoolean,
707
+ 'favorite': smithy_client_1.expectBoolean,
708
+ 'firstPlan': smithy_client_1.expectBoolean,
709
+ 'first_time_reward': smithy_client_1._json,
710
+ 'id': smithy_client_1.expectString,
711
+ 'min_spend': smithy_client_1.expectInt32,
712
+ 'name': smithy_client_1.expectString,
713
+ 'organization_id': smithy_client_1.expectString,
714
+ 'points': smithy_client_1.expectInt32,
715
+ 'points_active': smithy_client_1.expectBoolean,
716
+ 'redeemableRewards': smithy_client_1._json,
717
+ 'reward_plan': smithy_client_1._json,
718
+ 'visits': smithy_client_1.expectInt32,
719
+ 'visits_active': smithy_client_1.expectBoolean,
720
+ });
721
+ Object.assign(contents, doc);
722
+ return contents;
723
+ };
724
+ exports.de_PlanCommand = de_PlanCommand;
725
+ const de_PlanPublicCommand = async (output, context) => {
726
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
727
+ return de_CommandError(output, context);
728
+ }
729
+ const contents = (0, smithy_client_1.map)({
730
+ $metadata: deserializeMetadata(output),
731
+ });
732
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
733
+ const doc = (0, smithy_client_1.take)(data, {
734
+ 'active': smithy_client_1.expectBoolean,
735
+ 'favorite': smithy_client_1.expectBoolean,
736
+ 'firstPlan': smithy_client_1.expectBoolean,
737
+ 'first_time_reward': smithy_client_1._json,
738
+ 'id': smithy_client_1.expectString,
739
+ 'min_spend': smithy_client_1.expectInt32,
740
+ 'name': smithy_client_1.expectString,
741
+ 'organization_id': smithy_client_1.expectString,
742
+ 'points': smithy_client_1.expectInt32,
743
+ 'points_active': smithy_client_1.expectBoolean,
744
+ 'redeemableRewards': smithy_client_1._json,
745
+ 'reward_plan': smithy_client_1._json,
746
+ 'visits': smithy_client_1.expectInt32,
747
+ 'visits_active': smithy_client_1.expectBoolean,
748
+ });
749
+ Object.assign(contents, doc);
750
+ return contents;
751
+ };
752
+ exports.de_PlanPublicCommand = de_PlanPublicCommand;
753
+ const de_PlansCommand = async (output, context) => {
754
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
755
+ return de_CommandError(output, context);
756
+ }
757
+ const contents = (0, smithy_client_1.map)({
758
+ $metadata: deserializeMetadata(output),
759
+ });
760
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
761
+ const doc = (0, smithy_client_1.take)(data, {
762
+ 'count': smithy_client_1.expectInt32,
763
+ 'pagination': smithy_client_1._json,
764
+ 'value': smithy_client_1._json,
765
+ });
766
+ Object.assign(contents, doc);
767
+ return contents;
768
+ };
769
+ exports.de_PlansCommand = de_PlansCommand;
770
+ const de_PopularShopsCommand = async (output, context) => {
771
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
772
+ return de_CommandError(output, context);
773
+ }
774
+ const contents = (0, smithy_client_1.map)({
775
+ $metadata: deserializeMetadata(output),
776
+ });
777
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
778
+ const doc = (0, smithy_client_1.take)(data, {
779
+ 'count': smithy_client_1.expectInt32,
780
+ 'message': smithy_client_1.expectString,
781
+ 'pagination': smithy_client_1._json,
782
+ 'value': smithy_client_1._json,
783
+ });
784
+ Object.assign(contents, doc);
785
+ return contents;
786
+ };
787
+ exports.de_PopularShopsCommand = de_PopularShopsCommand;
788
+ const de_PopularShopsPublicCommand = async (output, context) => {
789
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
790
+ return de_CommandError(output, context);
791
+ }
792
+ const contents = (0, smithy_client_1.map)({
793
+ $metadata: deserializeMetadata(output),
794
+ });
795
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
796
+ const doc = (0, smithy_client_1.take)(data, {
797
+ 'count': smithy_client_1.expectInt32,
798
+ 'message': smithy_client_1.expectString,
799
+ 'pagination': smithy_client_1._json,
800
+ 'value': smithy_client_1._json,
801
+ });
802
+ Object.assign(contents, doc);
803
+ return contents;
804
+ };
805
+ exports.de_PopularShopsPublicCommand = de_PopularShopsPublicCommand;
806
+ const de_RadiusShopsCommand = async (output, context) => {
807
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
808
+ return de_CommandError(output, context);
809
+ }
810
+ const contents = (0, smithy_client_1.map)({
811
+ $metadata: deserializeMetadata(output),
812
+ });
813
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
814
+ const doc = (0, smithy_client_1.take)(data, {
815
+ 'count': smithy_client_1.expectInt32,
816
+ 'message': smithy_client_1.expectString,
817
+ 'value': _ => de_ShopLocationList(_, context),
818
+ });
819
+ Object.assign(contents, doc);
820
+ return contents;
821
+ };
822
+ exports.de_RadiusShopsCommand = de_RadiusShopsCommand;
823
+ const de_RecordVisitCommand = async (output, context) => {
824
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
825
+ return de_CommandError(output, context);
826
+ }
827
+ const contents = (0, smithy_client_1.map)({
828
+ $metadata: deserializeMetadata(output),
829
+ });
830
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
831
+ const doc = (0, smithy_client_1.take)(data, {
832
+ 'message': smithy_client_1.expectString,
833
+ 'reason': smithy_client_1.expectString,
834
+ 'success': smithy_client_1.expectBoolean,
835
+ 'visitId': smithy_client_1.expectString,
836
+ });
837
+ Object.assign(contents, doc);
838
+ return contents;
839
+ };
840
+ exports.de_RecordVisitCommand = de_RecordVisitCommand;
841
+ const de_RedeemFirstTimeRewardCommand = async (output, context) => {
842
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
843
+ return de_CommandError(output, context);
844
+ }
845
+ const contents = (0, smithy_client_1.map)({
846
+ $metadata: deserializeMetadata(output),
847
+ });
848
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
849
+ const doc = (0, smithy_client_1.take)(data, {
850
+ 'message': smithy_client_1.expectString,
851
+ 'redeemed': smithy_client_1.expectBoolean,
852
+ });
853
+ Object.assign(contents, doc);
854
+ return contents;
855
+ };
856
+ exports.de_RedeemFirstTimeRewardCommand = de_RedeemFirstTimeRewardCommand;
857
+ const de_RedeemPointRewardCommand = async (output, context) => {
858
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
859
+ return de_CommandError(output, context);
860
+ }
861
+ const contents = (0, smithy_client_1.map)({
862
+ $metadata: deserializeMetadata(output),
863
+ });
864
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
865
+ const doc = (0, smithy_client_1.take)(data, {
866
+ 'message': smithy_client_1.expectString,
867
+ 'pointsUsed': smithy_client_1.expectInt32,
868
+ 'redeemed': smithy_client_1.expectBoolean,
869
+ 'remainingPoints': smithy_client_1.expectInt32,
870
+ });
871
+ Object.assign(contents, doc);
872
+ return contents;
873
+ };
874
+ exports.de_RedeemPointRewardCommand = de_RedeemPointRewardCommand;
875
+ const de_RedeemVisitRewardCommand = async (output, context) => {
876
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
877
+ return de_CommandError(output, context);
878
+ }
879
+ const contents = (0, smithy_client_1.map)({
880
+ $metadata: deserializeMetadata(output),
881
+ });
882
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
883
+ const doc = (0, smithy_client_1.take)(data, {
884
+ 'message': smithy_client_1.expectString,
885
+ 'redeemed': smithy_client_1.expectBoolean,
886
+ });
887
+ Object.assign(contents, doc);
888
+ return contents;
889
+ };
890
+ exports.de_RedeemVisitRewardCommand = de_RedeemVisitRewardCommand;
891
+ const de_SearchShopsPublicCommand = async (output, context) => {
892
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
893
+ return de_CommandError(output, context);
894
+ }
895
+ const contents = (0, smithy_client_1.map)({
896
+ $metadata: deserializeMetadata(output),
897
+ });
898
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
899
+ const doc = (0, smithy_client_1.take)(data, {
900
+ 'count': smithy_client_1.expectInt32,
901
+ 'message': smithy_client_1.expectString,
902
+ 'pagination': smithy_client_1._json,
903
+ 'value': smithy_client_1._json,
904
+ });
905
+ Object.assign(contents, doc);
906
+ return contents;
907
+ };
908
+ exports.de_SearchShopsPublicCommand = de_SearchShopsPublicCommand;
909
+ const de_SearchSuggestionCommand = async (output, context) => {
910
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
911
+ return de_CommandError(output, context);
912
+ }
913
+ const contents = (0, smithy_client_1.map)({
914
+ $metadata: deserializeMetadata(output),
915
+ });
916
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
917
+ const doc = (0, smithy_client_1.take)(data, {
918
+ 'value': _ => de_SearchSuggestionList(_, context),
919
+ });
920
+ Object.assign(contents, doc);
921
+ return contents;
922
+ };
923
+ exports.de_SearchSuggestionCommand = de_SearchSuggestionCommand;
924
+ const de_UpdateUserCommand = async (output, context) => {
925
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
926
+ return de_CommandError(output, context);
927
+ }
928
+ const contents = (0, smithy_client_1.map)({
929
+ $metadata: deserializeMetadata(output),
930
+ });
931
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
932
+ const doc = (0, smithy_client_1.take)(data, {
933
+ 'message': smithy_client_1.expectString,
934
+ 'user': smithy_client_1._json,
935
+ });
936
+ Object.assign(contents, doc);
937
+ return contents;
938
+ };
939
+ exports.de_UpdateUserCommand = de_UpdateUserCommand;
940
+ const de_CommandError = async (output, context) => {
941
+ const parsedOutput = {
942
+ ...output,
943
+ body: await (0, core_1.parseJsonErrorBody)(output.body, context)
944
+ };
945
+ const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
946
+ switch (errorCode) {
947
+ case "RuntimeError":
948
+ case "software.amazon.smithy.app#RuntimeError":
949
+ throw await de_RuntimeErrorRes(parsedOutput, context);
950
+ case "ValidationException":
951
+ case "smithy.framework#ValidationException":
952
+ throw await de_ValidationExceptionRes(parsedOutput, context);
953
+ case "NotFoundError":
954
+ case "software.amazon.smithy.app#NotFoundError":
955
+ throw await de_NotFoundErrorRes(parsedOutput, context);
956
+ case "InvalidOperationError":
957
+ case "software.amazon.smithy.app#InvalidOperationError":
958
+ throw await de_InvalidOperationErrorRes(parsedOutput, context);
959
+ default:
960
+ const parsedBody = parsedOutput.body;
961
+ return throwDefaultError({
962
+ output,
963
+ parsedBody,
964
+ errorCode
965
+ });
966
+ }
967
+ };
968
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(AppAPIServiceException_1.AppAPIServiceException);
969
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
970
+ const contents = (0, smithy_client_1.map)({});
971
+ const data = parsedOutput.body;
972
+ const doc = (0, smithy_client_1.take)(data, {
973
+ 'fieldList': smithy_client_1._json,
974
+ 'message': smithy_client_1.expectString,
975
+ });
976
+ Object.assign(contents, doc);
977
+ const exception = new models_0_1.ValidationException({
978
+ $metadata: deserializeMetadata(parsedOutput),
979
+ ...contents
980
+ });
981
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
982
+ };
983
+ const de_InvalidOperationErrorRes = async (parsedOutput, context) => {
984
+ const contents = (0, smithy_client_1.map)({});
985
+ const data = parsedOutput.body;
986
+ const doc = (0, smithy_client_1.take)(data, {
987
+ 'message': smithy_client_1.expectString,
988
+ });
989
+ Object.assign(contents, doc);
990
+ const exception = new models_0_1.InvalidOperationError({
991
+ $metadata: deserializeMetadata(parsedOutput),
992
+ ...contents
993
+ });
994
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
995
+ };
996
+ const de_NotFoundErrorRes = async (parsedOutput, context) => {
997
+ const contents = (0, smithy_client_1.map)({});
998
+ const data = parsedOutput.body;
999
+ const doc = (0, smithy_client_1.take)(data, {
1000
+ 'message': smithy_client_1.expectString,
1001
+ });
1002
+ Object.assign(contents, doc);
1003
+ const exception = new models_0_1.NotFoundError({
1004
+ $metadata: deserializeMetadata(parsedOutput),
1005
+ ...contents
1006
+ });
1007
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1008
+ };
1009
+ const de_RuntimeErrorRes = async (parsedOutput, context) => {
1010
+ const contents = (0, smithy_client_1.map)({});
1011
+ const data = parsedOutput.body;
1012
+ const doc = (0, smithy_client_1.take)(data, {
1013
+ 'message': smithy_client_1.expectString,
1014
+ });
1015
+ Object.assign(contents, doc);
1016
+ const exception = new models_0_1.RuntimeError({
1017
+ $metadata: deserializeMetadata(parsedOutput),
1018
+ ...contents
1019
+ });
1020
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1021
+ };
1022
+ const de_SearchSuggestionItem = (output, context) => {
1023
+ return (0, smithy_client_1.take)(output, {
1024
+ 'distance': smithy_client_1.limitedParseDouble,
1025
+ 'favorite': smithy_client_1.expectBoolean,
1026
+ 'organization_id': smithy_client_1.expectString,
1027
+ 'search_name': smithy_client_1.expectString,
1028
+ 'shop_id': smithy_client_1.expectString,
1029
+ });
1030
+ };
1031
+ const de_SearchSuggestionList = (output, context) => {
1032
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1033
+ return de_SearchSuggestionItem(entry, context);
1034
+ });
1035
+ return retVal;
1036
+ };
1037
+ const de_ShopLocation = (output, context) => {
1038
+ return (0, smithy_client_1.take)(output, {
1039
+ 'id': smithy_client_1.expectString,
1040
+ 'latitude': smithy_client_1.limitedParseDouble,
1041
+ 'longitude': smithy_client_1.limitedParseDouble,
1042
+ });
1043
+ };
1044
+ const de_ShopLocationList = (output, context) => {
1045
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1046
+ return de_ShopLocation(entry, context);
1047
+ });
1048
+ return retVal;
1049
+ };
1050
+ const deserializeMetadata = (output) => ({
1051
+ httpStatusCode: output.statusCode,
1052
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1053
+ extendedRequestId: output.headers["x-amz-id-2"],
1054
+ cfId: output.headers["x-amz-cf-id"],
1055
+ });
1056
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
1057
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1058
+ value !== null &&
1059
+ value !== "" &&
1060
+ (!Object.getOwnPropertyNames(value).includes("length") ||
1061
+ value.length != 0) &&
1062
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1063
+ const _f = "filters";
1064
+ const _l = "limit";
1065
+ const _la = "lat";
1066
+ const _lo = "lon";
1067
+ const _oi = "org_id";
1068
+ const _p = "page";
1069
+ const _q = "q";
1070
+ const _ri = "reward_id";
1071
+ const _si = "shop_id";
1072
+ const _sn = "shop_name";
1073
+ const _t = "timestamp";