fountain-life-service-clients 3.28.2__py3-none-any.whl
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.
- fountain_life_service_clients/__init__.py +0 -0
- fountain_life_service_clients/_base_client.py +30 -0
- fountain_life_service_clients/account_service.py +116 -0
- fountain_life_service_clients/account_service_policy_attributes.py +46 -0
- fountain_life_service_clients/agents_api_service.py +197 -0
- fountain_life_service_clients/claimed_domains_service.py +70 -0
- fountain_life_service_clients/cohorts_service.py +184 -0
- fountain_life_service_clients/ehr_ingestion_wearables_api.py +169 -0
- fountain_life_service_clients/ehr_service.py +334 -0
- fountain_life_service_clients/email_service_email.py +81 -0
- fountain_life_service_clients/email_service_sms.py +33 -0
- fountain_life_service_clients/fhir_post_processor_service.py +55 -0
- fountain_life_service_clients/fhir_search_service.py +262 -0
- fountain_life_service_clients/file_service.py +124 -0
- fountain_life_service_clients/invitation_service.py +94 -0
- fountain_life_service_clients/medical_results_service_results.py +228 -0
- fountain_life_service_clients/member_notification_service.py +69 -0
- fountain_life_service_clients/member_operations_service_members.py +40 -0
- fountain_life_service_clients/member_scheduling_service_scheduling_prompts.py +62 -0
- fountain_life_service_clients/oauth_apps_service.py +253 -0
- fountain_life_service_clients/patient_service.py +157 -0
- fountain_life_service_clients/rules_service.py +249 -0
- fountain_life_service_clients/scheduler_service.py +146 -0
- fountain_life_service_clients/survey_service.py +404 -0
- fountain_life_service_clients/user_service.py +152 -0
- fountain_life_service_clients-3.28.2.dist-info/METADATA +53 -0
- fountain_life_service_clients-3.28.2.dist-info/RECORD +28 -0
- fountain_life_service_clients-3.28.2.dist-info/WHEEL +4 -0
@@ -0,0 +1,404 @@
|
|
1
|
+
# This file was generated automatically. Do not edit it directly.
|
2
|
+
# generated by datamodel-codegen:
|
3
|
+
# filename: survey-service.json
|
4
|
+
from typing import Any, List, Literal, NotRequired, TypedDict, Union, Unpack, cast
|
5
|
+
from urllib.parse import quote
|
6
|
+
|
7
|
+
from fountain_life_service_clients._base_client import (
|
8
|
+
AlphaConfig,
|
9
|
+
AlphaResponse,
|
10
|
+
BaseClient,
|
11
|
+
)
|
12
|
+
|
13
|
+
|
14
|
+
class SurveyInvitationAcceptRequest(TypedDict):
|
15
|
+
pass
|
16
|
+
|
17
|
+
|
18
|
+
class Invite(TypedDict):
|
19
|
+
group: str
|
20
|
+
|
21
|
+
|
22
|
+
class Subject(TypedDict):
|
23
|
+
id: str
|
24
|
+
email: str
|
25
|
+
|
26
|
+
|
27
|
+
class subject(TypedDict):
|
28
|
+
firstName: str
|
29
|
+
lastName: str
|
30
|
+
address: str
|
31
|
+
city: str
|
32
|
+
state: str
|
33
|
+
postalCode: str
|
34
|
+
country: str
|
35
|
+
email: str
|
36
|
+
|
37
|
+
|
38
|
+
class PostSurveyResponsesRequest(TypedDict):
|
39
|
+
invite: Invite
|
40
|
+
survey: str
|
41
|
+
current: bool
|
42
|
+
notificationType: NotRequired[Literal["EMAIL", "PUSH"]]
|
43
|
+
subject: Union[Subject, subject]
|
44
|
+
|
45
|
+
|
46
|
+
class GetSurveyResponseParams(TypedDict):
|
47
|
+
includeSurvey: NotRequired[bool]
|
48
|
+
|
49
|
+
|
50
|
+
class Subject2(TypedDict):
|
51
|
+
reference: str
|
52
|
+
display: str
|
53
|
+
|
54
|
+
|
55
|
+
class Questionnaire(TypedDict):
|
56
|
+
reference: str
|
57
|
+
display: str
|
58
|
+
|
59
|
+
|
60
|
+
class Author(TypedDict):
|
61
|
+
reference: str
|
62
|
+
|
63
|
+
|
64
|
+
class PutSurveyResponseRequest(TypedDict):
|
65
|
+
subject: Subject2
|
66
|
+
questionnaire: Questionnaire
|
67
|
+
resourceType: Literal["QuestionnaireResponse"]
|
68
|
+
authored: str
|
69
|
+
author: Author
|
70
|
+
status: Literal["in-progress", "completed"]
|
71
|
+
item: List
|
72
|
+
|
73
|
+
|
74
|
+
class PutSurveyResponseAttachmentLinkRequest(TypedDict):
|
75
|
+
fileName: str
|
76
|
+
contentType: str
|
77
|
+
|
78
|
+
|
79
|
+
class PostSurveyRequest(TypedDict):
|
80
|
+
resourceType: Literal["Questionnaire"]
|
81
|
+
title: str
|
82
|
+
status: Literal["draft", "active", "retried"]
|
83
|
+
item: List
|
84
|
+
|
85
|
+
|
86
|
+
class PutSurveyRequest(TypedDict):
|
87
|
+
resourceType: Literal["Questionnaire"]
|
88
|
+
title: str
|
89
|
+
status: Literal["draft", "active", "retried"]
|
90
|
+
item: List
|
91
|
+
|
92
|
+
|
93
|
+
class PostSurveyAdapterRequest(TypedDict):
|
94
|
+
pass
|
95
|
+
|
96
|
+
|
97
|
+
class PutSurveyAdapterByNameRequest(TypedDict):
|
98
|
+
pass
|
99
|
+
|
100
|
+
|
101
|
+
class NotificationPreferences(TypedDict):
|
102
|
+
email: bool
|
103
|
+
push: bool
|
104
|
+
|
105
|
+
|
106
|
+
class PutSurveyConfigRequest(TypedDict):
|
107
|
+
notificationPreferences: NotificationPreferences
|
108
|
+
|
109
|
+
|
110
|
+
class PostSurveyReminderRequest(TypedDict):
|
111
|
+
pass
|
112
|
+
|
113
|
+
|
114
|
+
class PutSurveyScheduleRequest(TypedDict):
|
115
|
+
recurrence: Literal["continuously", "daily", "weekly", "monthly", "yearly"]
|
116
|
+
stopAfter: NotRequired[float]
|
117
|
+
remind: NotRequired[bool]
|
118
|
+
expire: NotRequired[bool]
|
119
|
+
|
120
|
+
|
121
|
+
class PostSurveyVersionRequest(TypedDict):
|
122
|
+
resourceType: Literal["Questionnaire"]
|
123
|
+
title: str
|
124
|
+
status: Literal["draft", "active", "retried"]
|
125
|
+
item: List
|
126
|
+
|
127
|
+
|
128
|
+
class SurveyServiceClient(BaseClient):
|
129
|
+
def __init__(self, **cfg: Unpack[AlphaConfig]):
|
130
|
+
kwargs = {"target": "lambda://survey-service:deployed", **(cfg or {})}
|
131
|
+
super().__init__(**kwargs)
|
132
|
+
|
133
|
+
async def survey_invitation_accept(
|
134
|
+
self, id: str, body: SurveyInvitationAcceptRequest
|
135
|
+
):
|
136
|
+
"""Accept a survey invitation"""
|
137
|
+
res = await self.client.request(
|
138
|
+
path=f"/v1/survey-invitations/accept/{quote(id)}",
|
139
|
+
method="PATCH",
|
140
|
+
body=cast(dict, body),
|
141
|
+
)
|
142
|
+
return cast(AlphaResponse[Any], res)
|
143
|
+
|
144
|
+
async def get_survey_responses(self, project_id: str):
|
145
|
+
"""Fetch survey responses in a project"""
|
146
|
+
res = await self.client.request(
|
147
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses", method="GET"
|
148
|
+
)
|
149
|
+
return cast(AlphaResponse[Any], res)
|
150
|
+
|
151
|
+
async def post_survey_responses(
|
152
|
+
self, project_id: str, body: PostSurveyResponsesRequest
|
153
|
+
):
|
154
|
+
"""Send survey to existing subject"""
|
155
|
+
res = await self.client.request(
|
156
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses",
|
157
|
+
method="POST",
|
158
|
+
body=cast(dict, body),
|
159
|
+
)
|
160
|
+
return cast(AlphaResponse[Any], res)
|
161
|
+
|
162
|
+
async def delete_survey_response(self, project_id: str, response_id: str):
|
163
|
+
"""Delete a survey response"""
|
164
|
+
res = await self.client.request(
|
165
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses/{quote(response_id)}",
|
166
|
+
method="DELETE",
|
167
|
+
)
|
168
|
+
return cast(AlphaResponse[Any], res)
|
169
|
+
|
170
|
+
async def get_survey_response(
|
171
|
+
self, project_id: str, response_id: str, params: GetSurveyResponseParams
|
172
|
+
):
|
173
|
+
"""Fetch a survey response"""
|
174
|
+
res = await self.client.request(
|
175
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses/{quote(response_id)}",
|
176
|
+
method="GET",
|
177
|
+
params=cast(dict, params),
|
178
|
+
)
|
179
|
+
return cast(AlphaResponse[Any], res)
|
180
|
+
|
181
|
+
async def put_survey_response(
|
182
|
+
self, project_id: str, response_id: str, body: PutSurveyResponseRequest
|
183
|
+
):
|
184
|
+
"""Update a survey response"""
|
185
|
+
res = await self.client.request(
|
186
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses/{quote(response_id)}",
|
187
|
+
method="PUT",
|
188
|
+
body=cast(dict, body),
|
189
|
+
)
|
190
|
+
return cast(AlphaResponse[Any], res)
|
191
|
+
|
192
|
+
async def put_survey_response_attachment_link(
|
193
|
+
self,
|
194
|
+
project_id: str,
|
195
|
+
response_id: str,
|
196
|
+
link_id: str,
|
197
|
+
body: PutSurveyResponseAttachmentLinkRequest,
|
198
|
+
):
|
199
|
+
"""Update a survey attachment link"""
|
200
|
+
res = await self.client.request(
|
201
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses/{quote(response_id)}/attachments/{quote(link_id)}",
|
202
|
+
method="PUT",
|
203
|
+
body=cast(dict, body),
|
204
|
+
)
|
205
|
+
return cast(AlphaResponse[Any], res)
|
206
|
+
|
207
|
+
async def get_survey_response_attachment(
|
208
|
+
self, project_id: str, response_id: str, link_id: str, file_id: str
|
209
|
+
):
|
210
|
+
"""Fetch a survey attachment"""
|
211
|
+
res = await self.client.request(
|
212
|
+
path=f"/v1/survey/projects/{quote(project_id)}/responses/{quote(response_id)}/attachments/{quote(link_id)}/{quote(file_id)}",
|
213
|
+
method="GET",
|
214
|
+
)
|
215
|
+
return cast(AlphaResponse[Any], res)
|
216
|
+
|
217
|
+
async def get_surveys(self, project_id: str):
|
218
|
+
"""Fetch surveys for a project"""
|
219
|
+
res = await self.client.request(
|
220
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys", method="GET"
|
221
|
+
)
|
222
|
+
return cast(AlphaResponse[Any], res)
|
223
|
+
|
224
|
+
async def post_survey(self, project_id: str, body: PostSurveyRequest):
|
225
|
+
"""Create a survey for a project"""
|
226
|
+
res = await self.client.request(
|
227
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys",
|
228
|
+
method="POST",
|
229
|
+
body=cast(dict, body),
|
230
|
+
)
|
231
|
+
return cast(AlphaResponse[Any], res)
|
232
|
+
|
233
|
+
async def get_survey_versions(self, project_id: str, primary_survey_id: str):
|
234
|
+
"""Fetch a prior survey version for a survey"""
|
235
|
+
res = await self.client.request(
|
236
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(primary_survey_id)}/versions",
|
237
|
+
method="GET",
|
238
|
+
)
|
239
|
+
return cast(AlphaResponse[Any], res)
|
240
|
+
|
241
|
+
async def delete_survey(self, project_id: str, survey_id: str):
|
242
|
+
"""Delete a survey"""
|
243
|
+
res = await self.client.request(
|
244
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}",
|
245
|
+
method="DELETE",
|
246
|
+
)
|
247
|
+
return cast(AlphaResponse[Any], res)
|
248
|
+
|
249
|
+
async def get_survey(self, project_id: str, survey_id: str):
|
250
|
+
"""Fetch a survey by ID"""
|
251
|
+
res = await self.client.request(
|
252
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}",
|
253
|
+
method="GET",
|
254
|
+
)
|
255
|
+
return cast(AlphaResponse[Any], res)
|
256
|
+
|
257
|
+
async def put_survey(self, project_id: str, survey_id: str, body: PutSurveyRequest):
|
258
|
+
"""Update a survey by ID"""
|
259
|
+
res = await self.client.request(
|
260
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}",
|
261
|
+
method="PUT",
|
262
|
+
body=cast(dict, body),
|
263
|
+
)
|
264
|
+
return cast(AlphaResponse[Any], res)
|
265
|
+
|
266
|
+
async def get_survey_adapters(self, project_id: str, survey_id: str):
|
267
|
+
"""Fetch survey adapters configured for a survey"""
|
268
|
+
res = await self.client.request(
|
269
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters",
|
270
|
+
method="GET",
|
271
|
+
)
|
272
|
+
return cast(AlphaResponse[Any], res)
|
273
|
+
|
274
|
+
async def post_survey_adapter(
|
275
|
+
self, project_id: str, survey_id: str, body: PostSurveyAdapterRequest
|
276
|
+
):
|
277
|
+
"""Create a survey adapter for a survey"""
|
278
|
+
res = await self.client.request(
|
279
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters",
|
280
|
+
method="POST",
|
281
|
+
body=cast(dict, body),
|
282
|
+
)
|
283
|
+
return cast(AlphaResponse[Any], res)
|
284
|
+
|
285
|
+
async def get_global_survey_adapter(self, project_id: str, survey_id: str):
|
286
|
+
"""Fetch global survey adapter"""
|
287
|
+
res = await self.client.request(
|
288
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters/global",
|
289
|
+
method="GET",
|
290
|
+
)
|
291
|
+
return cast(AlphaResponse[Any], res)
|
292
|
+
|
293
|
+
async def delete_survey_adapter_by_name(
|
294
|
+
self, project_id: str, survey_id: str, name: str
|
295
|
+
):
|
296
|
+
"""Delete survey adapter by name"""
|
297
|
+
res = await self.client.request(
|
298
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters/{quote(name)}",
|
299
|
+
method="DELETE",
|
300
|
+
)
|
301
|
+
return cast(AlphaResponse[Any], res)
|
302
|
+
|
303
|
+
async def get_survey_adapter_by_name(
|
304
|
+
self, project_id: str, survey_id: str, name: str
|
305
|
+
):
|
306
|
+
"""Fetch survey adapter by name"""
|
307
|
+
res = await self.client.request(
|
308
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters/{quote(name)}",
|
309
|
+
method="GET",
|
310
|
+
)
|
311
|
+
return cast(AlphaResponse[Any], res)
|
312
|
+
|
313
|
+
async def put_survey_adapter_by_name(
|
314
|
+
self,
|
315
|
+
project_id: str,
|
316
|
+
survey_id: str,
|
317
|
+
name: str,
|
318
|
+
body: PutSurveyAdapterByNameRequest,
|
319
|
+
):
|
320
|
+
"""Update survey adapter by name"""
|
321
|
+
res = await self.client.request(
|
322
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters/{quote(name)}",
|
323
|
+
method="PUT",
|
324
|
+
body=cast(dict, body),
|
325
|
+
)
|
326
|
+
return cast(AlphaResponse[Any], res)
|
327
|
+
|
328
|
+
async def get_survey_adapter_evaluation_by_name(
|
329
|
+
self, project_id: str, survey_id: str, name: str
|
330
|
+
):
|
331
|
+
"""Evaluate (or test) a survey adapter by name"""
|
332
|
+
res = await self.client.request(
|
333
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/adapters/{quote(name)}/test",
|
334
|
+
method="GET",
|
335
|
+
)
|
336
|
+
return cast(AlphaResponse[Any], res)
|
337
|
+
|
338
|
+
async def get_survey_config(self, project_id: str, survey_id: str):
|
339
|
+
"""Get survey configuration for the survey ID"""
|
340
|
+
res = await self.client.request(
|
341
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/config",
|
342
|
+
method="GET",
|
343
|
+
)
|
344
|
+
return cast(AlphaResponse[Any], res)
|
345
|
+
|
346
|
+
async def put_survey_config(
|
347
|
+
self, project_id: str, survey_id: str, body: PutSurveyConfigRequest
|
348
|
+
):
|
349
|
+
"""Update survey configuration for the survey ID"""
|
350
|
+
res = await self.client.request(
|
351
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/config",
|
352
|
+
method="PUT",
|
353
|
+
body=cast(dict, body),
|
354
|
+
)
|
355
|
+
return cast(AlphaResponse[Any], res)
|
356
|
+
|
357
|
+
async def post_survey_reminder(
|
358
|
+
self, project_id: str, survey_id: str, body: PostSurveyReminderRequest
|
359
|
+
):
|
360
|
+
"""Create a survey reminder"""
|
361
|
+
res = await self.client.request(
|
362
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/reminder",
|
363
|
+
method="POST",
|
364
|
+
body=cast(dict, body),
|
365
|
+
)
|
366
|
+
return cast(AlphaResponse[Any], res)
|
367
|
+
|
368
|
+
async def delete_survey_schedule(self, project_id: str, survey_id: str):
|
369
|
+
"""Delete a survey schedule"""
|
370
|
+
res = await self.client.request(
|
371
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/schedule",
|
372
|
+
method="DELETE",
|
373
|
+
)
|
374
|
+
return cast(AlphaResponse[Any], res)
|
375
|
+
|
376
|
+
async def get_survey_schedule(self, project_id: str, survey_id: str):
|
377
|
+
"""Fetch a survey schedule"""
|
378
|
+
res = await self.client.request(
|
379
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/schedule",
|
380
|
+
method="GET",
|
381
|
+
)
|
382
|
+
return cast(AlphaResponse[Any], res)
|
383
|
+
|
384
|
+
async def put_survey_schedule(
|
385
|
+
self, project_id: str, survey_id: str, body: PutSurveyScheduleRequest
|
386
|
+
):
|
387
|
+
"""Update a survey schedule"""
|
388
|
+
res = await self.client.request(
|
389
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/schedule",
|
390
|
+
method="PUT",
|
391
|
+
body=cast(dict, body),
|
392
|
+
)
|
393
|
+
return cast(AlphaResponse[Any], res)
|
394
|
+
|
395
|
+
async def post_survey_version(
|
396
|
+
self, project_id: str, survey_id: str, body: PostSurveyVersionRequest
|
397
|
+
):
|
398
|
+
"""Create a new survey version for the existing survey by ID"""
|
399
|
+
res = await self.client.request(
|
400
|
+
path=f"/v1/survey/projects/{quote(project_id)}/surveys/{quote(survey_id)}/versions",
|
401
|
+
method="POST",
|
402
|
+
body=cast(dict, body),
|
403
|
+
)
|
404
|
+
return cast(AlphaResponse[Any], res)
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# This file was generated automatically. Do not edit it directly.
|
2
|
+
# generated by datamodel-codegen:
|
3
|
+
# filename: user-service.json
|
4
|
+
from typing import List, Literal, NotRequired, TypedDict, Unpack, cast
|
5
|
+
from urllib.parse import quote
|
6
|
+
|
7
|
+
from fountain_life_service_clients._base_client import (
|
8
|
+
AlphaConfig,
|
9
|
+
AlphaResponse,
|
10
|
+
BaseClient,
|
11
|
+
)
|
12
|
+
|
13
|
+
|
14
|
+
class Profile(TypedDict):
|
15
|
+
email: str
|
16
|
+
phoneNumber: NotRequired[str]
|
17
|
+
familyName: str
|
18
|
+
givenName: str
|
19
|
+
name: str
|
20
|
+
picture: str
|
21
|
+
preferredUsername: str
|
22
|
+
|
23
|
+
|
24
|
+
class RetrieveCurrentUserResponse(TypedDict):
|
25
|
+
id: str
|
26
|
+
type: str
|
27
|
+
profile: Profile
|
28
|
+
|
29
|
+
|
30
|
+
class profile(TypedDict):
|
31
|
+
email: str
|
32
|
+
familyName: str
|
33
|
+
givenName: str
|
34
|
+
name: str
|
35
|
+
picture: str
|
36
|
+
preferredUsername: str
|
37
|
+
|
38
|
+
|
39
|
+
class UpdateCurrentUserRequest(TypedDict):
|
40
|
+
profile: profile
|
41
|
+
|
42
|
+
|
43
|
+
class Profile2(TypedDict):
|
44
|
+
email: str
|
45
|
+
phoneNumber: NotRequired[str]
|
46
|
+
familyName: str
|
47
|
+
givenName: str
|
48
|
+
name: str
|
49
|
+
picture: str
|
50
|
+
preferredUsername: str
|
51
|
+
|
52
|
+
|
53
|
+
class UpdateCurrentUserResponse(TypedDict):
|
54
|
+
id: str
|
55
|
+
type: str
|
56
|
+
profile: Profile2
|
57
|
+
|
58
|
+
|
59
|
+
class RetrieveAUserResponse(TypedDict):
|
60
|
+
id: str
|
61
|
+
type: str
|
62
|
+
profile: Profile2
|
63
|
+
|
64
|
+
|
65
|
+
class RetrieveAUserPrivateResponse(TypedDict):
|
66
|
+
id: str
|
67
|
+
type: str
|
68
|
+
profile: Profile2
|
69
|
+
|
70
|
+
|
71
|
+
class Item(TypedDict):
|
72
|
+
account: str
|
73
|
+
description: str
|
74
|
+
id: str
|
75
|
+
type: Literal["closed", "open"]
|
76
|
+
|
77
|
+
|
78
|
+
class Links(TypedDict):
|
79
|
+
self: str
|
80
|
+
next: NotRequired[str]
|
81
|
+
|
82
|
+
|
83
|
+
class ListUserGroupsResponse(TypedDict):
|
84
|
+
items: List[Item]
|
85
|
+
links: Links
|
86
|
+
|
87
|
+
|
88
|
+
class RetrieveUserPictureResponse(TypedDict):
|
89
|
+
downloadUrl: str
|
90
|
+
|
91
|
+
|
92
|
+
class UpdateUserPictureRequest(TypedDict):
|
93
|
+
pass
|
94
|
+
|
95
|
+
|
96
|
+
class UpdateUserPictureResponse(TypedDict):
|
97
|
+
downloadUrl: str
|
98
|
+
|
99
|
+
|
100
|
+
class UserServiceClient(BaseClient):
|
101
|
+
def __init__(self, **cfg: Unpack[AlphaConfig]):
|
102
|
+
kwargs = {"target": "lambda://user-service:deployed", **(cfg or {})}
|
103
|
+
super().__init__(**kwargs)
|
104
|
+
|
105
|
+
async def retrieve_current_user(self):
|
106
|
+
"""Returns the full profile for the currently authenticated user"""
|
107
|
+
res = await self.client.request(path="/v1/user", method="GET")
|
108
|
+
return cast(AlphaResponse[RetrieveCurrentUserResponse], res)
|
109
|
+
|
110
|
+
async def update_current_user(self, body: UpdateCurrentUserRequest):
|
111
|
+
"""Updates the authenticated user's profile"""
|
112
|
+
res = await self.client.request(
|
113
|
+
path="/v1/user", method="PATCH", body=cast(dict, body)
|
114
|
+
)
|
115
|
+
return cast(AlphaResponse[UpdateCurrentUserResponse], res)
|
116
|
+
|
117
|
+
async def retrieve_a_user(self, username: str):
|
118
|
+
"""Returns a users profile. When requesting one's own profile the full profile is returned. Otherwise a limited profile is returned."""
|
119
|
+
res = await self.client.request(
|
120
|
+
path=f"/v1/users/{quote(username)}", method="GET"
|
121
|
+
)
|
122
|
+
return cast(AlphaResponse[RetrieveAUserResponse], res)
|
123
|
+
|
124
|
+
async def retrieve_a_user_private(self, username: str):
|
125
|
+
"""Returns a users profile. Not available via the public API."""
|
126
|
+
res = await self.client.request(
|
127
|
+
path=f"/v1/private/users/{quote(username)}", method="GET"
|
128
|
+
)
|
129
|
+
return cast(AlphaResponse[RetrieveAUserPrivateResponse], res)
|
130
|
+
|
131
|
+
async def list_user_groups(self, username: str):
|
132
|
+
"""Returns a list of groups that the user is a member of. This currently only succeeds if a user is asking for their own groups."""
|
133
|
+
res = await self.client.request(
|
134
|
+
path=f"/v1/users/{quote(username)}/groups", method="GET"
|
135
|
+
)
|
136
|
+
return cast(AlphaResponse[ListUserGroupsResponse], res)
|
137
|
+
|
138
|
+
async def retrieve_user_picture(self, username: str):
|
139
|
+
"""Returns profile picture metadata."""
|
140
|
+
res = await self.client.request(
|
141
|
+
path=f"/v1/users/{quote(username)}/picture", method="GET"
|
142
|
+
)
|
143
|
+
return cast(AlphaResponse[RetrieveUserPictureResponse], res)
|
144
|
+
|
145
|
+
async def update_user_picture(self, username: str, body: UpdateUserPictureRequest):
|
146
|
+
"""Update a user's profile picture. This only for the currently authorized user using a LifeOmic account."""
|
147
|
+
res = await self.client.request(
|
148
|
+
path=f"/v1/users/{quote(username)}/picture",
|
149
|
+
method="PUT",
|
150
|
+
body=cast(dict, body),
|
151
|
+
)
|
152
|
+
return cast(AlphaResponse[UpdateUserPictureResponse], res)
|
@@ -0,0 +1,53 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: fountain-life-service-clients
|
3
|
+
Version: 3.28.2
|
4
|
+
Summary:
|
5
|
+
License: UNLICENSED
|
6
|
+
Author: Fountain Life
|
7
|
+
Author-email: dev@fountainlife.com
|
8
|
+
Requires-Python: >=3.13,<4.0
|
9
|
+
Classifier: License :: Other/Proprietary License
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
13
|
+
Requires-Dist: lifeomic-chatbot-tools[aws] (>=9.0.1,<10.0.0)
|
14
|
+
Requires-Dist: pytest-mock (>=3.15.0,<4.0.0)
|
15
|
+
Description-Content-Type: text/markdown
|
16
|
+
|
17
|
+
# fountain_life_service_clients
|
18
|
+
|
19
|
+
Auto-generated fully-typed Python API clients for the Fountain Life ecosystem.
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
```shell
|
24
|
+
pip install fountain-life-service-clients
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
`fountain_life_service_clients` supports calling a service's API directly via
|
30
|
+
the service Lambda function.
|
31
|
+
|
32
|
+
```py
|
33
|
+
import json
|
34
|
+
from fountain_life_service_clients.file_service import FileServiceClient
|
35
|
+
|
36
|
+
# A well-typed service client that already knows which Lambda and
|
37
|
+
# path to call. Custom Alpha options can optionally be supplied as well.
|
38
|
+
file_service = FileServiceClient(
|
39
|
+
headers={
|
40
|
+
"LifeOmic-Account": "fountainlife",
|
41
|
+
"LifeOmic-Policy": json.dumps(
|
42
|
+
{"rules": {"readData": True}}
|
43
|
+
),
|
44
|
+
}
|
45
|
+
)
|
46
|
+
res = await file_service.list_files({})
|
47
|
+
print(res.status_code)
|
48
|
+
# `res.body` is well-typed.
|
49
|
+
items = res.body["items"]
|
50
|
+
```
|
51
|
+
|
52
|
+
## Migration Guide
|
53
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
fountain_life_service_clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
fountain_life_service_clients/_base_client.py,sha256=19AeJmz3H0d4tRdJ-fBcIXhw78hPniyGDfclfr4LC9g,781
|
3
|
+
fountain_life_service_clients/account_service.py,sha256=rqM_nuPmUuwMWudreF2kW42y57FL9u4YJ_T0sVEfNbY,3735
|
4
|
+
fountain_life_service_clients/account_service_policy_attributes.py,sha256=fgwgqzWGwoekc0yCr55qoPiuI2B5fd778rpTvZhmrN0,1611
|
5
|
+
fountain_life_service_clients/agents_api_service.py,sha256=wzZBzTpIrQafRjYL3gP5B9euHU0YS3NqgDhHV3QMoD8,5949
|
6
|
+
fountain_life_service_clients/claimed_domains_service.py,sha256=FMTyXZO_dm23jqYBXx-wE3bo1dwnJ4OwvcmkMyHWBok,1737
|
7
|
+
fountain_life_service_clients/cohorts_service.py,sha256=FPI_0Nn8BXhJfLwDJY2S3XIetSmGAYN0rjhESg4YYpI,4703
|
8
|
+
fountain_life_service_clients/ehr_ingestion_wearables_api.py,sha256=VnFd22BFqNhDzeRaDvaJU98xHiptfy0r1sE9pBrwI74,5673
|
9
|
+
fountain_life_service_clients/ehr_service.py,sha256=1lm8pKL_11aX11woGzlWyL_OJq-Hwj6ElD38O0Zxdgw,9588
|
10
|
+
fountain_life_service_clients/email_service_email.py,sha256=jNaLCZFaoNOdVzFKVrbLBAyxssVY9eH87SeQLyySxJM,2087
|
11
|
+
fountain_life_service_clients/email_service_sms.py,sha256=xJEGYCyXBSitvgQoQJBtMZAhimXbLl3HZSyq1ShSDH4,947
|
12
|
+
fountain_life_service_clients/fhir_post_processor_service.py,sha256=vSwBLVW9I67u6-yR-qsSJxSPJySYIvEs8VNT_77MGEc,1414
|
13
|
+
fountain_life_service_clients/fhir_search_service.py,sha256=vnrR2737U9PZPOPuqAYqXdpW9P0dw5vRkx5BXyBx-tw,5993
|
14
|
+
fountain_life_service_clients/file_service.py,sha256=VsGELX7ANAqt2ps0UxEIThR1PkU3_YpCPYm1EKT6_eA,4113
|
15
|
+
fountain_life_service_clients/invitation_service.py,sha256=ju1hTdfKJNH0oTljdSBTUd5hrs6PLyl-XnzG92i3onk,2669
|
16
|
+
fountain_life_service_clients/medical_results_service_results.py,sha256=6i4nCs_L0GaAbzGbI3E4IWMDfCyYDE-cciuAie5Bn0A,4917
|
17
|
+
fountain_life_service_clients/member_notification_service.py,sha256=-iuaWAFRLA4U1sSSm1vywO7fh4lmlfrFJXa2jdXioYw,1827
|
18
|
+
fountain_life_service_clients/member_operations_service_members.py,sha256=pQ8lv0JAUYequqsaGP00uSsNvszQaZmIqexN_4Jd-n8,1288
|
19
|
+
fountain_life_service_clients/member_scheduling_service_scheduling_prompts.py,sha256=3vQuqvUXpjaN5WhljamwyRwXdc4TS-rzzHY40ADYIW0,1679
|
20
|
+
fountain_life_service_clients/oauth_apps_service.py,sha256=A-rIzQ5pKkaTX6OAId6X5ssd2EA4HlddD8WKIpguvXI,7672
|
21
|
+
fountain_life_service_clients/patient_service.py,sha256=7oOI9v8JVOR1hzh2yA19X-qoAvCe27K0OiExb6tWWmo,4904
|
22
|
+
fountain_life_service_clients/rules_service.py,sha256=ncZWRy_C9mt-nkIqJnbV0cGyyqU2qFCt0hKQxRUuW8o,6972
|
23
|
+
fountain_life_service_clients/scheduler_service.py,sha256=iyDfesqgfLaRWUzESdIIp9-nlxdY4YWez57PqI3GVk4,4512
|
24
|
+
fountain_life_service_clients/survey_service.py,sha256=mN4NX7y5RShuofN1-VH3tqr-9g8pcppIuEo8Mxf6p5g,13412
|
25
|
+
fountain_life_service_clients/user_service.py,sha256=O8G80UyWGKEQEktwy4mBhO2Dh6MnMSewbSgcCHogQXw,4320
|
26
|
+
fountain_life_service_clients-3.28.2.dist-info/METADATA,sha256=ONiTtZVf8f-cXffOsnLGGDXW6era1f_qWvAeEw17xn8,1405
|
27
|
+
fountain_life_service_clients-3.28.2.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
|
28
|
+
fountain_life_service_clients-3.28.2.dist-info/RECORD,,
|