onehook-api-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/LICENSE +201 -0
  2. package/dist-cjs/OneHookService.js +83 -0
  3. package/dist-cjs/OneHookServiceClient.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/AuthSocialCommand.js +21 -0
  7. package/dist-cjs/commands/ClaimPreKeyBundleCommand.js +21 -0
  8. package/dist-cjs/commands/CompleteLivenessSessionCommand.js +21 -0
  9. package/dist-cjs/commands/CompleteOnboardingCommand.js +21 -0
  10. package/dist-cjs/commands/CreateLivenessSessionCommand.js +21 -0
  11. package/dist-cjs/commands/DeleteMatchMessagesCommand.js +21 -0
  12. package/dist-cjs/commands/DeleteProfileCommand.js +21 -0
  13. package/dist-cjs/commands/DiscoverCommand.js +21 -0
  14. package/dist-cjs/commands/GenerateInviteCommand.js +21 -0
  15. package/dist-cjs/commands/GenerateUploadUrlCommand.js +21 -0
  16. package/dist-cjs/commands/GetMatchCommand.js +21 -0
  17. package/dist-cjs/commands/GetMyProfileCommand.js +21 -0
  18. package/dist-cjs/commands/GetPreferencesCommand.js +21 -0
  19. package/dist-cjs/commands/GetProfileCommand.js +21 -0
  20. package/dist-cjs/commands/GetStateCommand.js +21 -0
  21. package/dist-cjs/commands/GetUserByEmailCommand.js +21 -0
  22. package/dist-cjs/commands/GetUserCommand.js +21 -0
  23. package/dist-cjs/commands/IndexLocationCommand.js +21 -0
  24. package/dist-cjs/commands/InitUserCommand.js +21 -0
  25. package/dist-cjs/commands/LinkEmailCommand.js +21 -0
  26. package/dist-cjs/commands/LinkSocialCommand.js +21 -0
  27. package/dist-cjs/commands/RegisterPhoneCommand.js +21 -0
  28. package/dist-cjs/commands/RemoveLocationCommand.js +21 -0
  29. package/dist-cjs/commands/RequestEmailOtpCommand.js +21 -0
  30. package/dist-cjs/commands/RequestPhoneOtpCommand.js +21 -0
  31. package/dist-cjs/commands/RequestPhoneUpdateOtpCommand.js +21 -0
  32. package/dist-cjs/commands/SwipeCommand.js +21 -0
  33. package/dist-cjs/commands/UnhookCommand.js +21 -0
  34. package/dist-cjs/commands/UnlinkSocialCommand.js +21 -0
  35. package/dist-cjs/commands/UpdateEntitlementsCommand.js +21 -0
  36. package/dist-cjs/commands/UpdatePhoneNumberCommand.js +21 -0
  37. package/dist-cjs/commands/UpdatePreferencesCommand.js +21 -0
  38. package/dist-cjs/commands/UpdateProfileCommand.js +21 -0
  39. package/dist-cjs/commands/UpgradeUserCommand.js +21 -0
  40. package/dist-cjs/commands/UploadPreKeysCommand.js +21 -0
  41. package/dist-cjs/commands/ValidateInviteCommand.js +21 -0
  42. package/dist-cjs/commands/index.js +39 -0
  43. package/dist-cjs/extensionConfiguration.js +2 -0
  44. package/dist-cjs/graphql/types.js +11 -0
  45. package/dist-cjs/index.js +10 -0
  46. package/dist-cjs/models/OneHookServiceServiceException.js +12 -0
  47. package/dist-cjs/models/index.js +4 -0
  48. package/dist-cjs/models/models_0.js +60 -0
  49. package/dist-cjs/protocols/Aws_restJson1.js +1349 -0
  50. package/dist-cjs/runtimeConfig.browser.js +32 -0
  51. package/dist-cjs/runtimeConfig.js +37 -0
  52. package/dist-cjs/runtimeConfig.native.js +15 -0
  53. package/dist-cjs/runtimeConfig.shared.js +29 -0
  54. package/dist-cjs/runtimeExtensions.js +22 -0
  55. package/dist-es/OneHookService.js +79 -0
  56. package/dist-es/OneHookServiceClient.js +39 -0
  57. package/dist-es/auth/httpAuthExtensionConfiguration.js +30 -0
  58. package/dist-es/auth/httpAuthSchemeProvider.js +29 -0
  59. package/dist-es/commands/AuthSocialCommand.js +17 -0
  60. package/dist-es/commands/ClaimPreKeyBundleCommand.js +17 -0
  61. package/dist-es/commands/CompleteLivenessSessionCommand.js +17 -0
  62. package/dist-es/commands/CompleteOnboardingCommand.js +17 -0
  63. package/dist-es/commands/CreateLivenessSessionCommand.js +17 -0
  64. package/dist-es/commands/DeleteMatchMessagesCommand.js +17 -0
  65. package/dist-es/commands/DeleteProfileCommand.js +17 -0
  66. package/dist-es/commands/DiscoverCommand.js +17 -0
  67. package/dist-es/commands/GenerateInviteCommand.js +17 -0
  68. package/dist-es/commands/GenerateUploadUrlCommand.js +17 -0
  69. package/dist-es/commands/GetMatchCommand.js +17 -0
  70. package/dist-es/commands/GetMyProfileCommand.js +17 -0
  71. package/dist-es/commands/GetPreferencesCommand.js +17 -0
  72. package/dist-es/commands/GetProfileCommand.js +17 -0
  73. package/dist-es/commands/GetStateCommand.js +17 -0
  74. package/dist-es/commands/GetUserByEmailCommand.js +17 -0
  75. package/dist-es/commands/GetUserCommand.js +17 -0
  76. package/dist-es/commands/IndexLocationCommand.js +17 -0
  77. package/dist-es/commands/InitUserCommand.js +17 -0
  78. package/dist-es/commands/LinkEmailCommand.js +17 -0
  79. package/dist-es/commands/LinkSocialCommand.js +17 -0
  80. package/dist-es/commands/RegisterPhoneCommand.js +17 -0
  81. package/dist-es/commands/RemoveLocationCommand.js +17 -0
  82. package/dist-es/commands/RequestEmailOtpCommand.js +17 -0
  83. package/dist-es/commands/RequestPhoneOtpCommand.js +17 -0
  84. package/dist-es/commands/RequestPhoneUpdateOtpCommand.js +17 -0
  85. package/dist-es/commands/SwipeCommand.js +17 -0
  86. package/dist-es/commands/UnhookCommand.js +17 -0
  87. package/dist-es/commands/UnlinkSocialCommand.js +17 -0
  88. package/dist-es/commands/UpdateEntitlementsCommand.js +17 -0
  89. package/dist-es/commands/UpdatePhoneNumberCommand.js +17 -0
  90. package/dist-es/commands/UpdatePreferencesCommand.js +17 -0
  91. package/dist-es/commands/UpdateProfileCommand.js +17 -0
  92. package/dist-es/commands/UpgradeUserCommand.js +17 -0
  93. package/dist-es/commands/UploadPreKeysCommand.js +17 -0
  94. package/dist-es/commands/ValidateInviteCommand.js +17 -0
  95. package/dist-es/commands/index.js +36 -0
  96. package/dist-es/extensionConfiguration.js +1 -0
  97. package/dist-es/graphql/types.js +8 -0
  98. package/dist-es/index.js +5 -0
  99. package/dist-es/models/OneHookServiceServiceException.js +8 -0
  100. package/dist-es/models/index.js +1 -0
  101. package/dist-es/models/models_0.js +53 -0
  102. package/dist-es/protocols/Aws_restJson1.js +1273 -0
  103. package/dist-es/runtimeConfig.browser.js +27 -0
  104. package/dist-es/runtimeConfig.js +32 -0
  105. package/dist-es/runtimeConfig.native.js +11 -0
  106. package/dist-es/runtimeConfig.shared.js +25 -0
  107. package/dist-es/runtimeExtensions.js +18 -0
  108. package/dist-types/OneHookService.d.ts +267 -0
  109. package/dist-types/OneHookServiceClient.d.ts +179 -0
  110. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +26 -0
  111. package/dist-types/auth/httpAuthSchemeProvider.d.ts +59 -0
  112. package/dist-types/commands/AuthSocialCommand.d.ts +78 -0
  113. package/dist-types/commands/ClaimPreKeyBundleCommand.d.ts +87 -0
  114. package/dist-types/commands/CompleteLivenessSessionCommand.d.ts +80 -0
  115. package/dist-types/commands/CompleteOnboardingCommand.d.ts +75 -0
  116. package/dist-types/commands/CreateLivenessSessionCommand.d.ts +75 -0
  117. package/dist-types/commands/DeleteMatchMessagesCommand.d.ts +77 -0
  118. package/dist-types/commands/DeleteProfileCommand.d.ts +77 -0
  119. package/dist-types/commands/DiscoverCommand.d.ts +84 -0
  120. package/dist-types/commands/GenerateInviteCommand.d.ts +78 -0
  121. package/dist-types/commands/GenerateUploadUrlCommand.d.ts +80 -0
  122. package/dist-types/commands/GetMatchCommand.d.ts +87 -0
  123. package/dist-types/commands/GetMyProfileCommand.d.ts +136 -0
  124. package/dist-types/commands/GetPreferencesCommand.d.ts +83 -0
  125. package/dist-types/commands/GetProfileCommand.d.ts +136 -0
  126. package/dist-types/commands/GetStateCommand.d.ts +83 -0
  127. package/dist-types/commands/GetUserByEmailCommand.d.ts +83 -0
  128. package/dist-types/commands/GetUserCommand.d.ts +83 -0
  129. package/dist-types/commands/IndexLocationCommand.d.ts +76 -0
  130. package/dist-types/commands/InitUserCommand.d.ts +73 -0
  131. package/dist-types/commands/LinkEmailCommand.d.ts +76 -0
  132. package/dist-types/commands/LinkSocialCommand.d.ts +76 -0
  133. package/dist-types/commands/RegisterPhoneCommand.d.ts +79 -0
  134. package/dist-types/commands/RemoveLocationCommand.d.ts +76 -0
  135. package/dist-types/commands/RequestEmailOtpCommand.d.ts +76 -0
  136. package/dist-types/commands/RequestPhoneOtpCommand.d.ts +75 -0
  137. package/dist-types/commands/RequestPhoneUpdateOtpCommand.d.ts +75 -0
  138. package/dist-types/commands/SwipeCommand.d.ts +79 -0
  139. package/dist-types/commands/UnhookCommand.d.ts +78 -0
  140. package/dist-types/commands/UnlinkSocialCommand.d.ts +75 -0
  141. package/dist-types/commands/UpdateEntitlementsCommand.d.ts +87 -0
  142. package/dist-types/commands/UpdatePhoneNumberCommand.d.ts +77 -0
  143. package/dist-types/commands/UpdatePreferencesCommand.d.ts +81 -0
  144. package/dist-types/commands/UpdateProfileCommand.d.ts +130 -0
  145. package/dist-types/commands/UpgradeUserCommand.d.ts +81 -0
  146. package/dist-types/commands/UploadPreKeysCommand.d.ts +81 -0
  147. package/dist-types/commands/ValidateInviteCommand.d.ts +78 -0
  148. package/dist-types/commands/index.d.ts +36 -0
  149. package/dist-types/extensionConfiguration.d.ts +8 -0
  150. package/dist-types/graphql/types.d.ts +110 -0
  151. package/dist-types/index.d.ts +7 -0
  152. package/dist-types/models/OneHookServiceServiceException.d.ts +14 -0
  153. package/dist-types/models/index.d.ts +1 -0
  154. package/dist-types/models/models_0.d.ts +614 -0
  155. package/dist-types/protocols/Aws_restJson1.d.ts +326 -0
  156. package/dist-types/runtimeConfig.browser.d.ts +38 -0
  157. package/dist-types/runtimeConfig.d.ts +38 -0
  158. package/dist-types/runtimeConfig.native.d.ts +37 -0
  159. package/dist-types/runtimeConfig.shared.d.ts +23 -0
  160. package/dist-types/runtimeExtensions.d.ts +17 -0
  161. package/package.json +95 -0
@@ -0,0 +1,1273 @@
1
+ import { OneHookServiceServiceException as __BaseException } from "../models/OneHookServiceServiceException";
2
+ import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, } from "../models/models_0";
3
+ import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
4
+ import { requestBuilder as rb } from "@smithy/core";
5
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
6
+ export const se_ClaimPreKeyBundleCommand = async (input, context) => {
7
+ const b = rb(input, context);
8
+ const headers = {};
9
+ b.bp("/chat/prekeys/{userId}");
10
+ b.p('userId', () => input.userId, '{userId}', false);
11
+ const query = map({
12
+ [_mI]: [, __expectNonNull(input[_mI], `matchId`)],
13
+ });
14
+ let body;
15
+ b.m("POST")
16
+ .h(headers)
17
+ .q(query)
18
+ .b(body);
19
+ return b.build();
20
+ };
21
+ export const se_DeleteMatchMessagesCommand = async (input, context) => {
22
+ const b = rb(input, context);
23
+ const headers = {};
24
+ b.bp("/chat/match/{matchId}");
25
+ b.p('matchId', () => input.matchId, '{matchId}', false);
26
+ let body;
27
+ b.m("DELETE")
28
+ .h(headers)
29
+ .b(body);
30
+ return b.build();
31
+ };
32
+ export const se_UploadPreKeysCommand = async (input, context) => {
33
+ const b = rb(input, context);
34
+ const headers = {
35
+ 'content-type': 'application/json',
36
+ };
37
+ b.bp("/chat/prekeys");
38
+ let body;
39
+ body = JSON.stringify(take(input, {
40
+ 'identityKey': [],
41
+ 'oneTimePreKeys': _ => _json(_),
42
+ 'signedPreKey': [],
43
+ }));
44
+ b.m("POST")
45
+ .h(headers)
46
+ .b(body);
47
+ return b.build();
48
+ };
49
+ export const se_AuthSocialCommand = async (input, context) => {
50
+ const b = rb(input, context);
51
+ const headers = {
52
+ 'content-type': 'application/json',
53
+ };
54
+ b.bp("/identity/auth/social");
55
+ let body;
56
+ body = JSON.stringify(take(input, {
57
+ 'provider': [],
58
+ 'token': [],
59
+ }));
60
+ b.m("POST")
61
+ .h(headers)
62
+ .b(body);
63
+ return b.build();
64
+ };
65
+ export const se_GenerateInviteCommand = async (input, context) => {
66
+ const b = rb(input, context);
67
+ const headers = {
68
+ 'content-type': 'application/json',
69
+ };
70
+ b.bp("/identity/invite/generate");
71
+ let body;
72
+ body = JSON.stringify(take(input, {
73
+ 'maxUses': [],
74
+ 'referrerId': [],
75
+ }));
76
+ b.m("POST")
77
+ .h(headers)
78
+ .b(body);
79
+ return b.build();
80
+ };
81
+ export const se_GetUserCommand = async (input, context) => {
82
+ const b = rb(input, context);
83
+ const headers = {};
84
+ b.bp("/identity/user/{userId}");
85
+ b.p('userId', () => input.userId, '{userId}', false);
86
+ let body;
87
+ b.m("GET")
88
+ .h(headers)
89
+ .b(body);
90
+ return b.build();
91
+ };
92
+ export const se_GetUserByEmailCommand = async (input, context) => {
93
+ const b = rb(input, context);
94
+ const headers = {};
95
+ b.bp("/identity/user/email/{email}");
96
+ b.p('email', () => input.email, '{email}', false);
97
+ let body;
98
+ b.m("GET")
99
+ .h(headers)
100
+ .b(body);
101
+ return b.build();
102
+ };
103
+ export const se_LinkEmailCommand = async (input, context) => {
104
+ const b = rb(input, context);
105
+ const headers = {
106
+ 'content-type': 'application/json',
107
+ };
108
+ b.bp("/identity/user/email/link");
109
+ let body;
110
+ body = JSON.stringify(take(input, {
111
+ 'email': [],
112
+ 'otp': [],
113
+ }));
114
+ b.m("POST")
115
+ .h(headers)
116
+ .b(body);
117
+ return b.build();
118
+ };
119
+ export const se_LinkSocialCommand = async (input, context) => {
120
+ const b = rb(input, context);
121
+ const headers = {
122
+ 'content-type': 'application/json',
123
+ };
124
+ b.bp("/identity/user/social/link");
125
+ let body;
126
+ body = JSON.stringify(take(input, {
127
+ 'identityToken': [],
128
+ 'provider': [],
129
+ }));
130
+ b.m("POST")
131
+ .h(headers)
132
+ .b(body);
133
+ return b.build();
134
+ };
135
+ export const se_RegisterPhoneCommand = async (input, context) => {
136
+ const b = rb(input, context);
137
+ const headers = {
138
+ 'content-type': 'application/json',
139
+ };
140
+ b.bp("/identity/auth/register/phone");
141
+ let body;
142
+ body = JSON.stringify(take(input, {
143
+ 'displayName': [],
144
+ 'inviteCode': [],
145
+ 'otp': [],
146
+ 'phoneNumber': [],
147
+ }));
148
+ b.m("POST")
149
+ .h(headers)
150
+ .b(body);
151
+ return b.build();
152
+ };
153
+ export const se_RequestEmailOtpCommand = async (input, context) => {
154
+ const b = rb(input, context);
155
+ const headers = {
156
+ 'content-type': 'application/json',
157
+ };
158
+ b.bp("/identity/user/email/link/request-otp");
159
+ let body;
160
+ body = JSON.stringify(take(input, {
161
+ 'email': [],
162
+ 'password': [],
163
+ }));
164
+ b.m("POST")
165
+ .h(headers)
166
+ .b(body);
167
+ return b.build();
168
+ };
169
+ export const se_RequestPhoneOtpCommand = async (input, context) => {
170
+ const b = rb(input, context);
171
+ const headers = {
172
+ 'content-type': 'application/json',
173
+ };
174
+ b.bp("/identity/auth/register/phone/request-otp");
175
+ let body;
176
+ body = JSON.stringify(take(input, {
177
+ 'phoneNumber': [],
178
+ }));
179
+ b.m("POST")
180
+ .h(headers)
181
+ .b(body);
182
+ return b.build();
183
+ };
184
+ export const se_RequestPhoneUpdateOtpCommand = async (input, context) => {
185
+ const b = rb(input, context);
186
+ const headers = {
187
+ 'content-type': 'application/json',
188
+ };
189
+ b.bp("/identity/user/phone/request-otp");
190
+ let body;
191
+ body = JSON.stringify(take(input, {
192
+ 'phoneNumber': [],
193
+ }));
194
+ b.m("POST")
195
+ .h(headers)
196
+ .b(body);
197
+ return b.build();
198
+ };
199
+ export const se_UnlinkSocialCommand = async (input, context) => {
200
+ const b = rb(input, context);
201
+ const headers = {};
202
+ b.bp("/identity/user/social/{provider}");
203
+ b.p('provider', () => input.provider, '{provider}', false);
204
+ let body;
205
+ b.m("DELETE")
206
+ .h(headers)
207
+ .b(body);
208
+ return b.build();
209
+ };
210
+ export const se_UpdateEntitlementsCommand = async (input, context) => {
211
+ const b = rb(input, context);
212
+ const headers = {
213
+ 'content-type': 'application/json',
214
+ };
215
+ b.bp("/identity/users/{userId}/entitlements");
216
+ b.p('userId', () => input.userId, '{userId}', false);
217
+ let body;
218
+ body = JSON.stringify(take(input, {
219
+ 'effectiveAt': [],
220
+ 'purchaseRef': [],
221
+ 'source': [],
222
+ 'subscriptionTier': [],
223
+ }));
224
+ b.m("POST")
225
+ .h(headers)
226
+ .b(body);
227
+ return b.build();
228
+ };
229
+ export const se_UpdatePhoneNumberCommand = async (input, context) => {
230
+ const b = rb(input, context);
231
+ const headers = {
232
+ 'content-type': 'application/json',
233
+ };
234
+ b.bp("/identity/user/phone");
235
+ let body;
236
+ body = JSON.stringify(take(input, {
237
+ 'otp': [],
238
+ 'phoneNumber': [],
239
+ }));
240
+ b.m("PUT")
241
+ .h(headers)
242
+ .b(body);
243
+ return b.build();
244
+ };
245
+ export const se_ValidateInviteCommand = async (input, context) => {
246
+ const b = rb(input, context);
247
+ const headers = {};
248
+ b.bp("/identity/invite/validate/{inviteCode}");
249
+ b.p('inviteCode', () => input.inviteCode, '{inviteCode}', false);
250
+ let body;
251
+ b.m("GET")
252
+ .h(headers)
253
+ .b(body);
254
+ return b.build();
255
+ };
256
+ export const se_DiscoverCommand = async (input, context) => {
257
+ const b = rb(input, context);
258
+ const headers = {};
259
+ b.bp("/matching/discover");
260
+ const query = map({
261
+ [_l]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_l] % 1 == 0) ? input[_l] + ".0" : input[_l].toString())],
262
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
263
+ });
264
+ let body;
265
+ b.m("GET")
266
+ .h(headers)
267
+ .q(query)
268
+ .b(body);
269
+ return b.build();
270
+ };
271
+ export const se_GetPreferencesCommand = async (input, context) => {
272
+ const b = rb(input, context);
273
+ const headers = {};
274
+ b.bp("/matching/{userId}/preferences");
275
+ b.p('userId', () => input.userId, '{userId}', false);
276
+ let body;
277
+ b.m("GET")
278
+ .h(headers)
279
+ .b(body);
280
+ return b.build();
281
+ };
282
+ export const se_IndexLocationCommand = async (input, context) => {
283
+ const b = rb(input, context);
284
+ const headers = {
285
+ 'content-type': 'application/json',
286
+ };
287
+ b.bp("/matching/location");
288
+ let body;
289
+ body = JSON.stringify(take(input, {
290
+ 'lat': _ => __serializeFloat(_),
291
+ 'lon': _ => __serializeFloat(_),
292
+ }));
293
+ b.m("POST")
294
+ .h(headers)
295
+ .b(body);
296
+ return b.build();
297
+ };
298
+ export const se_RemoveLocationCommand = async (input, context) => {
299
+ const b = rb(input, context);
300
+ const headers = {
301
+ 'content-type': 'application/json',
302
+ };
303
+ b.bp("/matching/location");
304
+ let body;
305
+ body = JSON.stringify(take(input, {
306
+ 'lat': _ => __serializeFloat(_),
307
+ 'lon': _ => __serializeFloat(_),
308
+ }));
309
+ b.m("DELETE")
310
+ .h(headers)
311
+ .b(body);
312
+ return b.build();
313
+ };
314
+ export const se_SwipeCommand = async (input, context) => {
315
+ const b = rb(input, context);
316
+ const headers = {
317
+ 'content-type': 'application/json',
318
+ };
319
+ b.bp("/matching/swipe");
320
+ let body;
321
+ body = JSON.stringify(take(input, {
322
+ 'direction': [],
323
+ 'targetId': [],
324
+ 'viewedSection': [],
325
+ }));
326
+ b.m("POST")
327
+ .h(headers)
328
+ .b(body);
329
+ return b.build();
330
+ };
331
+ export const se_UpdatePreferencesCommand = async (input, context) => {
332
+ const b = rb(input, context);
333
+ const headers = {
334
+ 'content-type': 'application/json',
335
+ };
336
+ b.bp("/matching/{userId}/preferences");
337
+ b.p('userId', () => input.userId, '{userId}', false);
338
+ let body;
339
+ body = JSON.stringify(take(input, {
340
+ 'genders': _ => _json(_),
341
+ 'maxAge': [],
342
+ 'maxDistanceKm': [],
343
+ 'minAge': [],
344
+ }));
345
+ b.m("PUT")
346
+ .h(headers)
347
+ .b(body);
348
+ return b.build();
349
+ };
350
+ export const se_CompleteLivenessSessionCommand = async (input, context) => {
351
+ const b = rb(input, context);
352
+ const headers = {
353
+ 'content-type': 'application/json',
354
+ };
355
+ b.bp("/profile/liveness/result");
356
+ let body;
357
+ body = JSON.stringify(take(input, {
358
+ 'sessionId': [],
359
+ }));
360
+ b.m("POST")
361
+ .h(headers)
362
+ .b(body);
363
+ return b.build();
364
+ };
365
+ export const se_CreateLivenessSessionCommand = async (input, context) => {
366
+ const b = rb(input, context);
367
+ const headers = {};
368
+ b.bp("/profile/liveness/session");
369
+ let body;
370
+ b.m("POST")
371
+ .h(headers)
372
+ .b(body);
373
+ return b.build();
374
+ };
375
+ export const se_DeleteProfileCommand = async (input, context) => {
376
+ const b = rb(input, context);
377
+ const headers = {};
378
+ b.bp("/profile/{userId}");
379
+ b.p('userId', () => input.userId, '{userId}', false);
380
+ let body;
381
+ b.m("DELETE")
382
+ .h(headers)
383
+ .b(body);
384
+ return b.build();
385
+ };
386
+ export const se_GenerateUploadUrlCommand = async (input, context) => {
387
+ const b = rb(input, context);
388
+ const headers = {
389
+ 'content-type': 'application/json',
390
+ };
391
+ b.bp("/profile/media/upload-url");
392
+ let body;
393
+ body = JSON.stringify(take(input, {
394
+ 'contentLength': [],
395
+ 'contentType': [],
396
+ }));
397
+ b.m("POST")
398
+ .h(headers)
399
+ .b(body);
400
+ return b.build();
401
+ };
402
+ export const se_GetMyProfileCommand = async (input, context) => {
403
+ const b = rb(input, context);
404
+ const headers = {};
405
+ b.bp("/profile");
406
+ let body;
407
+ b.m("GET")
408
+ .h(headers)
409
+ .b(body);
410
+ return b.build();
411
+ };
412
+ export const se_GetProfileCommand = async (input, context) => {
413
+ const b = rb(input, context);
414
+ const headers = {};
415
+ b.bp("/profile/{userId}");
416
+ b.p('userId', () => input.userId, '{userId}', false);
417
+ let body;
418
+ b.m("GET")
419
+ .h(headers)
420
+ .b(body);
421
+ return b.build();
422
+ };
423
+ export const se_UpdateProfileCommand = async (input, context) => {
424
+ const b = rb(input, context);
425
+ const headers = {
426
+ 'content-type': 'application/json',
427
+ };
428
+ b.bp("/profile");
429
+ let body;
430
+ body = JSON.stringify(take(input, {
431
+ 'age': [],
432
+ 'audioPrompt': [],
433
+ 'bio': [],
434
+ 'cannabisStatus': [],
435
+ 'causes': _ => _json(_),
436
+ 'communities': _ => _json(_),
437
+ 'currentLocation': [],
438
+ 'displayName': [],
439
+ 'drinkingStatus': [],
440
+ 'drugsStatus': [],
441
+ 'education': [],
442
+ 'educationLevel': [],
443
+ 'exercise': [],
444
+ 'familyPlans': [],
445
+ 'gender': [],
446
+ 'height': [],
447
+ 'hometown': [],
448
+ 'interestedIn': _ => _json(_),
449
+ 'interests': _ => _json(_),
450
+ 'languages': _ => _json(_),
451
+ 'openers': _ => _json(_),
452
+ 'pictures': _ => _json(_),
453
+ 'politicalView': [],
454
+ 'prompts': _ => _json(_),
455
+ 'qualities': _ => _json(_),
456
+ 'relationshipType': [],
457
+ 'religion': [],
458
+ 'smokingStatus': [],
459
+ 'socialLinks': _ => _json(_),
460
+ 'starSign': [],
461
+ 'videos': _ => _json(_),
462
+ 'wantsKids': [],
463
+ 'work': [],
464
+ }));
465
+ b.m("PUT")
466
+ .h(headers)
467
+ .b(body);
468
+ return b.build();
469
+ };
470
+ export const se_CompleteOnboardingCommand = async (input, context) => {
471
+ const b = rb(input, context);
472
+ const headers = {};
473
+ b.bp("/state/complete-onboarding");
474
+ let body;
475
+ b.m("POST")
476
+ .h(headers)
477
+ .b(body);
478
+ return b.build();
479
+ };
480
+ export const se_GetMatchCommand = async (input, context) => {
481
+ const b = rb(input, context);
482
+ const headers = {};
483
+ b.bp("/state/match/{matchId}");
484
+ b.p('matchId', () => input.matchId, '{matchId}', false);
485
+ let body;
486
+ b.m("GET")
487
+ .h(headers)
488
+ .b(body);
489
+ return b.build();
490
+ };
491
+ export const se_GetStateCommand = async (input, context) => {
492
+ const b = rb(input, context);
493
+ const headers = {};
494
+ b.bp("/state/{userId}");
495
+ b.p('userId', () => input.userId, '{userId}', false);
496
+ let body;
497
+ b.m("GET")
498
+ .h(headers)
499
+ .b(body);
500
+ return b.build();
501
+ };
502
+ export const se_InitUserCommand = async (input, context) => {
503
+ const b = rb(input, context);
504
+ const headers = {};
505
+ b.bp("/state/init");
506
+ let body;
507
+ b.m("POST")
508
+ .h(headers)
509
+ .b(body);
510
+ return b.build();
511
+ };
512
+ export const se_UnhookCommand = async (input, context) => {
513
+ const b = rb(input, context);
514
+ const headers = {
515
+ 'content-type': 'application/json',
516
+ };
517
+ b.bp("/state/unhook");
518
+ let body;
519
+ body = JSON.stringify(take(input, {
520
+ 'matchId': [],
521
+ 'reason': [],
522
+ }));
523
+ b.m("POST")
524
+ .h(headers)
525
+ .b(body);
526
+ return b.build();
527
+ };
528
+ export const se_UpgradeUserCommand = async (input, context) => {
529
+ const b = rb(input, context);
530
+ const headers = {};
531
+ b.bp("/state/upgrade");
532
+ let body;
533
+ b.m("POST")
534
+ .h(headers)
535
+ .b(body);
536
+ return b.build();
537
+ };
538
+ export const de_ClaimPreKeyBundleCommand = async (output, context) => {
539
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
540
+ return de_CommandError(output, context);
541
+ }
542
+ const contents = map({
543
+ $metadata: deserializeMetadata(output),
544
+ });
545
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
546
+ const doc = take(data, {
547
+ 'identityKey': __expectString,
548
+ 'oneTimePreKey': __expectString,
549
+ 'signedPreKey': __expectString,
550
+ });
551
+ Object.assign(contents, doc);
552
+ return contents;
553
+ };
554
+ export const de_DeleteMatchMessagesCommand = async (output, context) => {
555
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
556
+ return de_CommandError(output, context);
557
+ }
558
+ const contents = map({
559
+ $metadata: deserializeMetadata(output),
560
+ });
561
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
562
+ const doc = take(data, {
563
+ 'deleted': __expectInt32,
564
+ });
565
+ Object.assign(contents, doc);
566
+ return contents;
567
+ };
568
+ export const de_UploadPreKeysCommand = async (output, context) => {
569
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
570
+ return de_CommandError(output, context);
571
+ }
572
+ const contents = map({
573
+ $metadata: deserializeMetadata(output),
574
+ });
575
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
576
+ const doc = take(data, {
577
+ 'status': __expectString,
578
+ });
579
+ Object.assign(contents, doc);
580
+ return contents;
581
+ };
582
+ export const de_AuthSocialCommand = async (output, context) => {
583
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
584
+ return de_CommandError(output, context);
585
+ }
586
+ const contents = map({
587
+ $metadata: deserializeMetadata(output),
588
+ });
589
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
590
+ const doc = take(data, {
591
+ 'isNewUser': __expectBoolean,
592
+ 'status': __expectString,
593
+ 'userId': __expectString,
594
+ });
595
+ Object.assign(contents, doc);
596
+ return contents;
597
+ };
598
+ export const de_GenerateInviteCommand = async (output, context) => {
599
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
600
+ return de_CommandError(output, context);
601
+ }
602
+ const contents = map({
603
+ $metadata: deserializeMetadata(output),
604
+ });
605
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
606
+ const doc = take(data, {
607
+ 'expiresAt': __expectLong,
608
+ 'inviteCode': __expectString,
609
+ 'maxUses': __expectInt32,
610
+ });
611
+ Object.assign(contents, doc);
612
+ return contents;
613
+ };
614
+ export const de_GetUserCommand = async (output, context) => {
615
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
616
+ return de_CommandError(output, context);
617
+ }
618
+ const contents = map({
619
+ $metadata: deserializeMetadata(output),
620
+ });
621
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
622
+ const doc = take(data, {
623
+ 'appleEmail': __expectString,
624
+ 'appleId': __expectString,
625
+ 'displayName': __expectString,
626
+ 'email': __expectString,
627
+ 'googleEmail': __expectString,
628
+ 'googleId': __expectString,
629
+ 'phoneNumber': __expectString,
630
+ 'userId': __expectString,
631
+ 'userState': __expectString,
632
+ });
633
+ Object.assign(contents, doc);
634
+ return contents;
635
+ };
636
+ export const de_GetUserByEmailCommand = async (output, context) => {
637
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
638
+ return de_CommandError(output, context);
639
+ }
640
+ const contents = map({
641
+ $metadata: deserializeMetadata(output),
642
+ });
643
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
644
+ const doc = take(data, {
645
+ 'appleEmail': __expectString,
646
+ 'appleId': __expectString,
647
+ 'displayName': __expectString,
648
+ 'email': __expectString,
649
+ 'googleEmail': __expectString,
650
+ 'googleId': __expectString,
651
+ 'phoneNumber': __expectString,
652
+ 'userId': __expectString,
653
+ 'userState': __expectString,
654
+ });
655
+ Object.assign(contents, doc);
656
+ return contents;
657
+ };
658
+ export const de_LinkEmailCommand = async (output, context) => {
659
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
660
+ return de_CommandError(output, context);
661
+ }
662
+ const contents = map({
663
+ $metadata: deserializeMetadata(output),
664
+ });
665
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
666
+ const doc = take(data, {
667
+ 'status': __expectString,
668
+ });
669
+ Object.assign(contents, doc);
670
+ return contents;
671
+ };
672
+ export const de_LinkSocialCommand = async (output, context) => {
673
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
674
+ return de_CommandError(output, context);
675
+ }
676
+ const contents = map({
677
+ $metadata: deserializeMetadata(output),
678
+ });
679
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
680
+ const doc = take(data, {
681
+ 'status': __expectString,
682
+ });
683
+ Object.assign(contents, doc);
684
+ return contents;
685
+ };
686
+ export const de_RegisterPhoneCommand = async (output, context) => {
687
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
688
+ return de_CommandError(output, context);
689
+ }
690
+ const contents = map({
691
+ $metadata: deserializeMetadata(output),
692
+ });
693
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
694
+ const doc = take(data, {
695
+ 'status': __expectString,
696
+ 'userId': __expectString,
697
+ });
698
+ Object.assign(contents, doc);
699
+ return contents;
700
+ };
701
+ export const de_RequestEmailOtpCommand = async (output, context) => {
702
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
703
+ return de_CommandError(output, context);
704
+ }
705
+ const contents = map({
706
+ $metadata: deserializeMetadata(output),
707
+ });
708
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
709
+ const doc = take(data, {
710
+ 'status': __expectString,
711
+ });
712
+ Object.assign(contents, doc);
713
+ return contents;
714
+ };
715
+ export const de_RequestPhoneOtpCommand = async (output, context) => {
716
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
717
+ return de_CommandError(output, context);
718
+ }
719
+ const contents = map({
720
+ $metadata: deserializeMetadata(output),
721
+ });
722
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
723
+ const doc = take(data, {
724
+ 'status': __expectString,
725
+ });
726
+ Object.assign(contents, doc);
727
+ return contents;
728
+ };
729
+ export const de_RequestPhoneUpdateOtpCommand = async (output, context) => {
730
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
731
+ return de_CommandError(output, context);
732
+ }
733
+ const contents = map({
734
+ $metadata: deserializeMetadata(output),
735
+ });
736
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
737
+ const doc = take(data, {
738
+ 'status': __expectString,
739
+ });
740
+ Object.assign(contents, doc);
741
+ return contents;
742
+ };
743
+ export const de_UnlinkSocialCommand = async (output, context) => {
744
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
745
+ return de_CommandError(output, context);
746
+ }
747
+ const contents = map({
748
+ $metadata: deserializeMetadata(output),
749
+ });
750
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
751
+ const doc = take(data, {
752
+ 'status': __expectString,
753
+ });
754
+ Object.assign(contents, doc);
755
+ return contents;
756
+ };
757
+ export const de_UpdateEntitlementsCommand = async (output, context) => {
758
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
759
+ return de_CommandError(output, context);
760
+ }
761
+ const contents = map({
762
+ $metadata: deserializeMetadata(output),
763
+ });
764
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
765
+ const doc = take(data, {
766
+ 'status': __expectString,
767
+ 'subscriptionTier': __expectString,
768
+ });
769
+ Object.assign(contents, doc);
770
+ return contents;
771
+ };
772
+ export const de_UpdatePhoneNumberCommand = async (output, context) => {
773
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
774
+ return de_CommandError(output, context);
775
+ }
776
+ const contents = map({
777
+ $metadata: deserializeMetadata(output),
778
+ });
779
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
780
+ const doc = take(data, {
781
+ 'phoneNumber': __expectString,
782
+ 'status': __expectString,
783
+ });
784
+ Object.assign(contents, doc);
785
+ return contents;
786
+ };
787
+ export const de_ValidateInviteCommand = async (output, context) => {
788
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
789
+ return de_CommandError(output, context);
790
+ }
791
+ const contents = map({
792
+ $metadata: deserializeMetadata(output),
793
+ });
794
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
795
+ const doc = take(data, {
796
+ 'maxUses': __expectInt32,
797
+ 'referrerId': __expectString,
798
+ 'status': __expectString,
799
+ 'usedCount': __expectInt32,
800
+ });
801
+ Object.assign(contents, doc);
802
+ return contents;
803
+ };
804
+ export const de_DiscoverCommand = async (output, context) => {
805
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
806
+ return de_CommandError(output, context);
807
+ }
808
+ const contents = map({
809
+ $metadata: deserializeMetadata(output),
810
+ });
811
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
812
+ const doc = take(data, {
813
+ 'algorithm': __expectString,
814
+ 'candidates': _ => de_CandidateList(_, context),
815
+ 'count': __expectInt32,
816
+ });
817
+ Object.assign(contents, doc);
818
+ return contents;
819
+ };
820
+ export const de_GetPreferencesCommand = async (output, context) => {
821
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
822
+ return de_CommandError(output, context);
823
+ }
824
+ const contents = map({
825
+ $metadata: deserializeMetadata(output),
826
+ });
827
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
828
+ const doc = take(data, {
829
+ 'genders': _json,
830
+ 'maxAge': __expectInt32,
831
+ 'maxDistanceKm': __expectInt32,
832
+ 'minAge': __expectInt32,
833
+ 'userId': __expectString,
834
+ });
835
+ Object.assign(contents, doc);
836
+ return contents;
837
+ };
838
+ export const de_IndexLocationCommand = async (output, context) => {
839
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
840
+ return de_CommandError(output, context);
841
+ }
842
+ const contents = map({
843
+ $metadata: deserializeMetadata(output),
844
+ });
845
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
846
+ const doc = take(data, {
847
+ 'status': __expectString,
848
+ });
849
+ Object.assign(contents, doc);
850
+ return contents;
851
+ };
852
+ export const de_RemoveLocationCommand = async (output, context) => {
853
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
854
+ return de_CommandError(output, context);
855
+ }
856
+ const contents = map({
857
+ $metadata: deserializeMetadata(output),
858
+ });
859
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
860
+ const doc = take(data, {
861
+ 'status': __expectString,
862
+ });
863
+ Object.assign(contents, doc);
864
+ return contents;
865
+ };
866
+ export const de_SwipeCommand = async (output, context) => {
867
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
868
+ return de_CommandError(output, context);
869
+ }
870
+ const contents = map({
871
+ $metadata: deserializeMetadata(output),
872
+ });
873
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
874
+ const doc = take(data, {
875
+ 'matchId': __expectString,
876
+ 'matched': __expectBoolean,
877
+ 'status': __expectString,
878
+ });
879
+ Object.assign(contents, doc);
880
+ return contents;
881
+ };
882
+ export const de_UpdatePreferencesCommand = async (output, context) => {
883
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
884
+ return de_CommandError(output, context);
885
+ }
886
+ const contents = map({
887
+ $metadata: deserializeMetadata(output),
888
+ });
889
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
890
+ const doc = take(data, {
891
+ 'status': __expectString,
892
+ });
893
+ Object.assign(contents, doc);
894
+ return contents;
895
+ };
896
+ export const de_CompleteLivenessSessionCommand = async (output, context) => {
897
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
898
+ return de_CommandError(output, context);
899
+ }
900
+ const contents = map({
901
+ $metadata: deserializeMetadata(output),
902
+ });
903
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
904
+ const doc = take(data, {
905
+ 'status': __expectString,
906
+ });
907
+ Object.assign(contents, doc);
908
+ return contents;
909
+ };
910
+ export const de_CreateLivenessSessionCommand = async (output, context) => {
911
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
912
+ return de_CommandError(output, context);
913
+ }
914
+ const contents = map({
915
+ $metadata: deserializeMetadata(output),
916
+ });
917
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
918
+ const doc = take(data, {
919
+ 'sessionId': __expectString,
920
+ });
921
+ Object.assign(contents, doc);
922
+ return contents;
923
+ };
924
+ export const de_DeleteProfileCommand = async (output, context) => {
925
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
926
+ return de_CommandError(output, context);
927
+ }
928
+ const contents = map({
929
+ $metadata: deserializeMetadata(output),
930
+ });
931
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
932
+ const doc = take(data, {
933
+ 'status': __expectString,
934
+ });
935
+ Object.assign(contents, doc);
936
+ return contents;
937
+ };
938
+ export const de_GenerateUploadUrlCommand = async (output, context) => {
939
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
940
+ return de_CommandError(output, context);
941
+ }
942
+ const contents = map({
943
+ $metadata: deserializeMetadata(output),
944
+ });
945
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
946
+ const doc = take(data, {
947
+ 'formData': _json,
948
+ 'objectKey': __expectString,
949
+ 'uploadUrl': __expectString,
950
+ });
951
+ Object.assign(contents, doc);
952
+ return contents;
953
+ };
954
+ export const de_GetMyProfileCommand = async (output, context) => {
955
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
956
+ return de_CommandError(output, context);
957
+ }
958
+ const contents = map({
959
+ $metadata: deserializeMetadata(output),
960
+ });
961
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
962
+ const doc = take(data, {
963
+ 'age': __expectInt32,
964
+ 'audioPrompt': __expectString,
965
+ 'bio': __expectString,
966
+ 'cannabisStatus': __expectString,
967
+ 'causes': _json,
968
+ 'communities': _json,
969
+ 'currentLocation': __expectString,
970
+ 'displayName': __expectString,
971
+ 'drinkingStatus': __expectString,
972
+ 'drugsStatus': __expectString,
973
+ 'education': __expectString,
974
+ 'educationLevel': __expectString,
975
+ 'exercise': __expectString,
976
+ 'familyPlans': __expectString,
977
+ 'gender': __expectString,
978
+ 'height': __expectInt32,
979
+ 'hometown': __expectString,
980
+ 'interestedIn': _json,
981
+ 'interests': _json,
982
+ 'languages': _json,
983
+ 'moderationStatus': __expectString,
984
+ 'openers': _json,
985
+ 'pictures': _json,
986
+ 'politicalView': __expectString,
987
+ 'prompts': _json,
988
+ 'qualities': _json,
989
+ 'relationshipType': __expectString,
990
+ 'religion': __expectString,
991
+ 'smokingStatus': __expectString,
992
+ 'socialLinks': _json,
993
+ 'starSign': __expectString,
994
+ 'subscriptionTier': __expectString,
995
+ 'userId': __expectString,
996
+ 'verified': __expectBoolean,
997
+ 'videos': _json,
998
+ 'wantsKids': __expectString,
999
+ 'work': __expectString,
1000
+ });
1001
+ Object.assign(contents, doc);
1002
+ return contents;
1003
+ };
1004
+ export const de_GetProfileCommand = async (output, context) => {
1005
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1006
+ return de_CommandError(output, context);
1007
+ }
1008
+ const contents = map({
1009
+ $metadata: deserializeMetadata(output),
1010
+ });
1011
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1012
+ const doc = take(data, {
1013
+ 'age': __expectInt32,
1014
+ 'audioPrompt': __expectString,
1015
+ 'bio': __expectString,
1016
+ 'cannabisStatus': __expectString,
1017
+ 'causes': _json,
1018
+ 'communities': _json,
1019
+ 'currentLocation': __expectString,
1020
+ 'displayName': __expectString,
1021
+ 'drinkingStatus': __expectString,
1022
+ 'drugsStatus': __expectString,
1023
+ 'education': __expectString,
1024
+ 'educationLevel': __expectString,
1025
+ 'exercise': __expectString,
1026
+ 'familyPlans': __expectString,
1027
+ 'gender': __expectString,
1028
+ 'height': __expectInt32,
1029
+ 'hometown': __expectString,
1030
+ 'interestedIn': _json,
1031
+ 'interests': _json,
1032
+ 'languages': _json,
1033
+ 'moderationStatus': __expectString,
1034
+ 'openers': _json,
1035
+ 'pictures': _json,
1036
+ 'politicalView': __expectString,
1037
+ 'prompts': _json,
1038
+ 'qualities': _json,
1039
+ 'relationshipType': __expectString,
1040
+ 'religion': __expectString,
1041
+ 'smokingStatus': __expectString,
1042
+ 'socialLinks': _json,
1043
+ 'starSign': __expectString,
1044
+ 'subscriptionTier': __expectString,
1045
+ 'userId': __expectString,
1046
+ 'verified': __expectBoolean,
1047
+ 'videos': _json,
1048
+ 'wantsKids': __expectString,
1049
+ 'work': __expectString,
1050
+ });
1051
+ Object.assign(contents, doc);
1052
+ return contents;
1053
+ };
1054
+ export const de_UpdateProfileCommand = async (output, context) => {
1055
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1056
+ return de_CommandError(output, context);
1057
+ }
1058
+ const contents = map({
1059
+ $metadata: deserializeMetadata(output),
1060
+ });
1061
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1062
+ const doc = take(data, {
1063
+ 'status': __expectString,
1064
+ });
1065
+ Object.assign(contents, doc);
1066
+ return contents;
1067
+ };
1068
+ export const de_CompleteOnboardingCommand = async (output, context) => {
1069
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1070
+ return de_CommandError(output, context);
1071
+ }
1072
+ const contents = map({
1073
+ $metadata: deserializeMetadata(output),
1074
+ });
1075
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1076
+ const doc = take(data, {
1077
+ 'status': __expectString,
1078
+ });
1079
+ Object.assign(contents, doc);
1080
+ return contents;
1081
+ };
1082
+ export const de_GetMatchCommand = async (output, context) => {
1083
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1084
+ return de_CommandError(output, context);
1085
+ }
1086
+ const contents = map({
1087
+ $metadata: deserializeMetadata(output),
1088
+ });
1089
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1090
+ const doc = take(data, {
1091
+ 'createdAt': __expectLong,
1092
+ 'endReason': __expectString,
1093
+ 'endedAt': __expectLong,
1094
+ 'endedBy': __expectString,
1095
+ 'latestMessageSenderId': __expectString,
1096
+ 'latestMessageTimestamp': __expectLong,
1097
+ 'matchId': __expectString,
1098
+ 'status': __expectString,
1099
+ 'updatedAt': __expectLong,
1100
+ 'userA': __expectString,
1101
+ 'userB': __expectString,
1102
+ });
1103
+ Object.assign(contents, doc);
1104
+ return contents;
1105
+ };
1106
+ export const de_GetStateCommand = async (output, context) => {
1107
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1108
+ return de_CommandError(output, context);
1109
+ }
1110
+ const contents = map({
1111
+ $metadata: deserializeMetadata(output),
1112
+ });
1113
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1114
+ const doc = take(data, {
1115
+ 'activeConnections': __expectInt32,
1116
+ 'matchIds': _json,
1117
+ 'state': __expectString,
1118
+ 'subscriptionTier': __expectString,
1119
+ 'userId': __expectString,
1120
+ });
1121
+ Object.assign(contents, doc);
1122
+ return contents;
1123
+ };
1124
+ export const de_InitUserCommand = async (output, context) => {
1125
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1126
+ return de_CommandError(output, context);
1127
+ }
1128
+ const contents = map({
1129
+ $metadata: deserializeMetadata(output),
1130
+ });
1131
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1132
+ const doc = take(data, {
1133
+ 'status': __expectString,
1134
+ });
1135
+ Object.assign(contents, doc);
1136
+ return contents;
1137
+ };
1138
+ export const de_UnhookCommand = async (output, context) => {
1139
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1140
+ return de_CommandError(output, context);
1141
+ }
1142
+ const contents = map({
1143
+ $metadata: deserializeMetadata(output),
1144
+ });
1145
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1146
+ const doc = take(data, {
1147
+ 'status': __expectString,
1148
+ });
1149
+ Object.assign(contents, doc);
1150
+ return contents;
1151
+ };
1152
+ export const de_UpgradeUserCommand = async (output, context) => {
1153
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1154
+ return de_CommandError(output, context);
1155
+ }
1156
+ const contents = map({
1157
+ $metadata: deserializeMetadata(output),
1158
+ });
1159
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
1160
+ const doc = take(data, {
1161
+ 'activeConnections': __expectInt32,
1162
+ 'matchIds': _json,
1163
+ 'state': __expectString,
1164
+ 'subscriptionTier': __expectString,
1165
+ 'userId': __expectString,
1166
+ });
1167
+ Object.assign(contents, doc);
1168
+ return contents;
1169
+ };
1170
+ const de_CommandError = async (output, context) => {
1171
+ const parsedOutput = {
1172
+ ...output,
1173
+ body: await parseErrorBody(output.body, context)
1174
+ };
1175
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1176
+ switch (errorCode) {
1177
+ case "BadRequestError":
1178
+ case "club.onehook.identity#BadRequestError":
1179
+ throw await de_BadRequestErrorRes(parsedOutput, context);
1180
+ case "ForbiddenError":
1181
+ case "club.onehook.chat#ForbiddenError":
1182
+ throw await de_ForbiddenErrorRes(parsedOutput, context);
1183
+ case "InternalServerError":
1184
+ case "club.onehook.identity#InternalServerError":
1185
+ throw await de_InternalServerErrorRes(parsedOutput, context);
1186
+ case "NotFoundError":
1187
+ case "club.onehook.identity#NotFoundError":
1188
+ throw await de_NotFoundErrorRes(parsedOutput, context);
1189
+ default:
1190
+ const parsedBody = parsedOutput.body;
1191
+ return throwDefaultError({
1192
+ output,
1193
+ parsedBody,
1194
+ errorCode
1195
+ });
1196
+ }
1197
+ };
1198
+ const throwDefaultError = withBaseException(__BaseException);
1199
+ const de_ForbiddenErrorRes = async (parsedOutput, context) => {
1200
+ const contents = map({});
1201
+ const data = parsedOutput.body;
1202
+ const doc = take(data, {
1203
+ 'error': __expectString,
1204
+ });
1205
+ Object.assign(contents, doc);
1206
+ const exception = new ForbiddenError({
1207
+ $metadata: deserializeMetadata(parsedOutput),
1208
+ ...contents
1209
+ });
1210
+ return __decorateServiceException(exception, parsedOutput.body);
1211
+ };
1212
+ const de_BadRequestErrorRes = async (parsedOutput, context) => {
1213
+ const contents = map({});
1214
+ const data = parsedOutput.body;
1215
+ const doc = take(data, {
1216
+ 'error': __expectString,
1217
+ });
1218
+ Object.assign(contents, doc);
1219
+ const exception = new BadRequestError({
1220
+ $metadata: deserializeMetadata(parsedOutput),
1221
+ ...contents
1222
+ });
1223
+ return __decorateServiceException(exception, parsedOutput.body);
1224
+ };
1225
+ const de_InternalServerErrorRes = async (parsedOutput, context) => {
1226
+ const contents = map({});
1227
+ const data = parsedOutput.body;
1228
+ const doc = take(data, {
1229
+ 'error': __expectString,
1230
+ });
1231
+ Object.assign(contents, doc);
1232
+ const exception = new InternalServerError({
1233
+ $metadata: deserializeMetadata(parsedOutput),
1234
+ ...contents
1235
+ });
1236
+ return __decorateServiceException(exception, parsedOutput.body);
1237
+ };
1238
+ const de_NotFoundErrorRes = async (parsedOutput, context) => {
1239
+ const contents = map({});
1240
+ const data = parsedOutput.body;
1241
+ const doc = take(data, {
1242
+ 'error': __expectString,
1243
+ });
1244
+ Object.assign(contents, doc);
1245
+ const exception = new NotFoundError({
1246
+ $metadata: deserializeMetadata(parsedOutput),
1247
+ ...contents
1248
+ });
1249
+ return __decorateServiceException(exception, parsedOutput.body);
1250
+ };
1251
+ const de_CandidateDto = (output, context) => {
1252
+ return take(output, {
1253
+ 'distanceKm': __limitedParseDouble,
1254
+ 'score': __limitedParseDouble,
1255
+ 'userId': __expectString,
1256
+ });
1257
+ };
1258
+ const de_CandidateList = (output, context) => {
1259
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1260
+ return de_CandidateDto(entry, context);
1261
+ });
1262
+ return retVal;
1263
+ };
1264
+ const deserializeMetadata = (output) => ({
1265
+ httpStatusCode: output.statusCode,
1266
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1267
+ extendedRequestId: output.headers["x-amz-id-2"],
1268
+ cfId: output.headers["x-amz-cf-id"],
1269
+ });
1270
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
1271
+ const _l = "lat";
1272
+ const _lo = "lon";
1273
+ const _mI = "matchId";