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.
Files changed (28) hide show
  1. fountain_life_service_clients/__init__.py +0 -0
  2. fountain_life_service_clients/_base_client.py +30 -0
  3. fountain_life_service_clients/account_service.py +116 -0
  4. fountain_life_service_clients/account_service_policy_attributes.py +46 -0
  5. fountain_life_service_clients/agents_api_service.py +197 -0
  6. fountain_life_service_clients/claimed_domains_service.py +70 -0
  7. fountain_life_service_clients/cohorts_service.py +184 -0
  8. fountain_life_service_clients/ehr_ingestion_wearables_api.py +169 -0
  9. fountain_life_service_clients/ehr_service.py +334 -0
  10. fountain_life_service_clients/email_service_email.py +81 -0
  11. fountain_life_service_clients/email_service_sms.py +33 -0
  12. fountain_life_service_clients/fhir_post_processor_service.py +55 -0
  13. fountain_life_service_clients/fhir_search_service.py +262 -0
  14. fountain_life_service_clients/file_service.py +124 -0
  15. fountain_life_service_clients/invitation_service.py +94 -0
  16. fountain_life_service_clients/medical_results_service_results.py +228 -0
  17. fountain_life_service_clients/member_notification_service.py +69 -0
  18. fountain_life_service_clients/member_operations_service_members.py +40 -0
  19. fountain_life_service_clients/member_scheduling_service_scheduling_prompts.py +62 -0
  20. fountain_life_service_clients/oauth_apps_service.py +253 -0
  21. fountain_life_service_clients/patient_service.py +157 -0
  22. fountain_life_service_clients/rules_service.py +249 -0
  23. fountain_life_service_clients/scheduler_service.py +146 -0
  24. fountain_life_service_clients/survey_service.py +404 -0
  25. fountain_life_service_clients/user_service.py +152 -0
  26. fountain_life_service_clients-3.28.2.dist-info/METADATA +53 -0
  27. fountain_life_service_clients-3.28.2.dist-info/RECORD +28 -0
  28. fountain_life_service_clients-3.28.2.dist-info/WHEEL +4 -0
@@ -0,0 +1,249 @@
1
+ # This file was generated automatically. Do not edit it directly.
2
+ # generated by datamodel-codegen:
3
+ # filename: rules-service.json
4
+ from typing import Any, Dict, 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 GetRulesParams(TypedDict):
15
+ datasetId: str
16
+ inputType: NotRequired[Literal["event", "questionnaireResponse"]]
17
+ eventType: NotRequired[Literal["PatientWriteEvent", "FileChangeEvent"]]
18
+ resourceType: NotRequired[str]
19
+ id: NotRequired[str]
20
+ status: NotRequired[str]
21
+
22
+
23
+ class Input(TypedDict):
24
+ """
25
+ The input definition that will cause this rule to be executed.
26
+ """
27
+
28
+ type: Literal["event", "questionnaireResponse"]
29
+ attributes: NotRequired[Any]
30
+
31
+
32
+ class GetRulesResponseItem(TypedDict):
33
+ id: str
34
+ account: str
35
+ datasetId: str
36
+ userId: str
37
+ name: str
38
+ description: NotRequired[str]
39
+ creationTime: str
40
+ updatedTime: str
41
+ input: Input
42
+ steps: List
43
+
44
+
45
+ GetRulesResponse = List[GetRulesResponseItem]
46
+
47
+
48
+ class CreateRuleRequest(TypedDict):
49
+ id: str
50
+ account: str
51
+ datasetId: str
52
+ userId: str
53
+ name: str
54
+ description: NotRequired[str]
55
+ creationTime: str
56
+ updatedTime: str
57
+ input: Input
58
+ steps: List
59
+
60
+
61
+ class CreateRuleResponse(TypedDict):
62
+ id: str
63
+ account: str
64
+ datasetId: str
65
+ userId: str
66
+ name: str
67
+ description: NotRequired[str]
68
+ creationTime: str
69
+ updatedTime: str
70
+ input: Input
71
+ steps: List
72
+
73
+
74
+ class GetRuleResponse(TypedDict):
75
+ id: str
76
+ account: str
77
+ datasetId: str
78
+ userId: str
79
+ name: str
80
+ description: NotRequired[str]
81
+ creationTime: str
82
+ updatedTime: str
83
+ input: Input
84
+ steps: List
85
+
86
+
87
+ class DeleteRuleResponse(TypedDict):
88
+ pass
89
+
90
+
91
+ class GetRuleJobsParams(TypedDict):
92
+ datasetId: str
93
+ state: Literal["RUNNING", "COMPLETE", "CANCELED"]
94
+ pageSize: NotRequired[float]
95
+ nextPageToken: NotRequired[str]
96
+
97
+
98
+ class GetRuleJobsResponseItem(TypedDict):
99
+ id: str
100
+ creationTime: str
101
+ userId: str
102
+ account: str
103
+ policy: Dict[str, Any]
104
+ accountGroups: List[str]
105
+ datasetId: str
106
+ state: Literal["RUNNING", "COMPLETE", "CANCELED"]
107
+ steps: List
108
+ resourceType: NotRequired[str]
109
+ execution: str
110
+ successes: float
111
+ failures: float
112
+ total: float
113
+
114
+
115
+ GetRuleJobsResponse = List[GetRuleJobsResponseItem]
116
+
117
+
118
+ class CreateRuleJobRequest(TypedDict):
119
+ datasetId: str
120
+ steps: List
121
+ resourceType: NotRequired[str]
122
+ resourceIds: List[str]
123
+
124
+
125
+ class CreateRuleJobResponse(TypedDict):
126
+ id: str
127
+ creationTime: str
128
+ userId: str
129
+ account: str
130
+ policy: Dict[str, Any]
131
+ accountGroups: List[str]
132
+ datasetId: str
133
+ state: Literal["RUNNING", "COMPLETE", "CANCELED"]
134
+ steps: List
135
+ resourceType: NotRequired[str]
136
+ execution: str
137
+ successes: float
138
+ failures: float
139
+ total: float
140
+
141
+
142
+ class GetRuleJobResponse(TypedDict):
143
+ id: str
144
+ creationTime: str
145
+ userId: str
146
+ account: str
147
+ policy: Dict[str, Any]
148
+ accountGroups: List[str]
149
+ datasetId: str
150
+ state: Literal["RUNNING", "COMPLETE", "CANCELED"]
151
+ steps: List
152
+ resourceType: NotRequired[str]
153
+ execution: str
154
+ successes: float
155
+ failures: float
156
+ total: float
157
+
158
+
159
+ class DeleteRuleJobResponse(TypedDict):
160
+ pass
161
+
162
+
163
+ class GetRuleJobItemsParams(TypedDict):
164
+ state: NotRequired[Literal["PENDING", "RUNNING", "SUCCESS", "FAILURE"]]
165
+ pageSize: NotRequired[float]
166
+ nextPageToken: NotRequired[str]
167
+
168
+
169
+ class GetRuleJobItemsResponseItem(TypedDict):
170
+ sequence: float
171
+ account: str
172
+ datasetId: str
173
+ jobId: str
174
+ state: str
175
+ resourceId: str
176
+
177
+
178
+ GetRuleJobItemsResponse = List[GetRuleJobItemsResponseItem]
179
+
180
+
181
+ class RulesServiceClient(BaseClient):
182
+ def __init__(self, **cfg: Unpack[AlphaConfig]):
183
+ kwargs = {"target": "lambda://rules-service:deployed", **(cfg or {})}
184
+ super().__init__(**kwargs)
185
+
186
+ async def get_rules(self, params: GetRulesParams):
187
+ """Returns a list of rules that the user has access to."""
188
+ res = await self.client.request(
189
+ path="/v1/rules", method="GET", params=cast(dict, params)
190
+ )
191
+ return cast(AlphaResponse[GetRulesResponse], res)
192
+
193
+ async def create_rule(self, body: CreateRuleRequest):
194
+ """Create a rule that will execute based on the given input, running each step in sequence until a step returns false, or all steps have completed. The input defines what causes the rule to fire."""
195
+ res = await self.client.request(
196
+ path="/v1/rules", method="POST", body=cast(dict, body)
197
+ )
198
+ return cast(AlphaResponse[CreateRuleResponse], res)
199
+
200
+ async def get_rule(self, rule_id: str):
201
+ """Returns a rule."""
202
+ res = await self.client.request(
203
+ path=f"/v1/rules/{quote(rule_id)}", method="GET"
204
+ )
205
+ return cast(AlphaResponse[GetRuleResponse], res)
206
+
207
+ async def delete_rule(self, rule_id: str):
208
+ """Deletes a rule."""
209
+ res = await self.client.request(
210
+ path=f"/v1/rules/{quote(rule_id)}", method="DELETE"
211
+ )
212
+ return cast(AlphaResponse[DeleteRuleResponse], res)
213
+
214
+ async def get_rule_jobs(self, params: GetRuleJobsParams):
215
+ """Returns a list of rule jobs that the user has access to."""
216
+ res = await self.client.request(
217
+ path="/v1/rules/jobs", method="GET", params=cast(dict, params)
218
+ )
219
+ return cast(AlphaResponse[GetRuleJobsResponse], res)
220
+
221
+ async def create_rule_job(self, body: CreateRuleJobRequest):
222
+ """Create a rule job that will execute the given steps for each of the given resource IDs. Rule jobs only support patient resources for now. The job will asynchronously execute the steps for each resource in batches, allowing it to handle large numbers of resources."""
223
+ res = await self.client.request(
224
+ path="/v1/rules/jobs", method="POST", body=cast(dict, body)
225
+ )
226
+ return cast(AlphaResponse[CreateRuleJobResponse], res)
227
+
228
+ async def get_rule_job(self, job_id: str):
229
+ """Returns a rule job."""
230
+ res = await self.client.request(
231
+ path=f"/v1/rules/jobs/{quote(job_id)}", method="GET"
232
+ )
233
+ return cast(AlphaResponse[GetRuleJobResponse], res)
234
+
235
+ async def delete_rule_job(self, job_id: str):
236
+ """Deletes a rule job."""
237
+ res = await self.client.request(
238
+ path=f"/v1/rules/jobs/{quote(job_id)}", method="DELETE"
239
+ )
240
+ return cast(AlphaResponse[DeleteRuleJobResponse], res)
241
+
242
+ async def get_rule_job_items(self, job_id: str, params: GetRuleJobItemsParams):
243
+ """Returns a a list of items for a rule job."""
244
+ res = await self.client.request(
245
+ path=f"/v1/rules/jobs/{quote(job_id)}/items",
246
+ method="GET",
247
+ params=cast(dict, params),
248
+ )
249
+ return cast(AlphaResponse[GetRuleJobItemsResponse], res)
@@ -0,0 +1,146 @@
1
+ # This file was generated automatically. Do not edit it directly.
2
+ # generated by datamodel-codegen:
3
+ # filename: scheduler-service.json
4
+ from typing import Any, Dict, List, NotRequired, Optional, 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 ScheduledJob(TypedDict):
15
+ id: NotRequired[str]
16
+ workerId: str
17
+ startTime: NotRequired[str]
18
+ endTime: NotRequired[str]
19
+ cronExpression: NotRequired[str]
20
+ cronZone: NotRequired[str]
21
+ targetDeliveryTime: NotRequired[str]
22
+ jobPayload: Dict[str, Any]
23
+ messageGroupId: NotRequired[str]
24
+
25
+
26
+ class CreateScheduledJobsRequest(TypedDict):
27
+ scheduledJobs: List[ScheduledJob]
28
+ jitterSourceField: NotRequired[str]
29
+ jitterMaxDuration: NotRequired[float]
30
+
31
+
32
+ class CreateScheduledJobsResponse(TypedDict):
33
+ scheduledJobs: List[ScheduledJob]
34
+
35
+
36
+ class GetScheduledJobResponse(TypedDict):
37
+ id: str
38
+ workerId: str
39
+ startTime: NotRequired[str]
40
+ endTime: NotRequired[str]
41
+ cronExpression: NotRequired[str]
42
+ cronZone: NotRequired[str]
43
+ targetDeliveryTime: NotRequired[str]
44
+ jobPayload: Dict[str, Any]
45
+ messageGroupId: NotRequired[str]
46
+
47
+
48
+ class UpsertScheduledJobRequest(TypedDict):
49
+ startTime: NotRequired[str]
50
+ endTime: NotRequired[str]
51
+ cronExpression: NotRequired[str]
52
+ cronZone: NotRequired[str]
53
+ targetDeliveryTime: NotRequired[str]
54
+ jobPayload: Dict[str, Any]
55
+ messageGroupId: NotRequired[str]
56
+
57
+
58
+ class UpsertScheduledJobResponse(TypedDict):
59
+ id: NotRequired[str]
60
+ workerId: str
61
+ startTime: NotRequired[str]
62
+ endTime: NotRequired[str]
63
+ cronExpression: NotRequired[str]
64
+ cronZone: NotRequired[str]
65
+ targetDeliveryTime: NotRequired[str]
66
+ jobPayload: Dict[str, Any]
67
+ messageGroupId: NotRequired[str]
68
+
69
+
70
+ class ListScheduledJobsParams(TypedDict):
71
+ targetDeliveryTimeStart: NotRequired[str]
72
+ targetDeliveryTimeEnd: NotRequired[str]
73
+ nextPageToken: NotRequired[str]
74
+ pageSize: NotRequired[float]
75
+
76
+
77
+ class Item(TypedDict):
78
+ id: str
79
+ workerId: str
80
+ startTime: NotRequired[str]
81
+ endTime: NotRequired[str]
82
+ cronExpression: NotRequired[str]
83
+ cronZone: NotRequired[str]
84
+ targetDeliveryTime: NotRequired[str]
85
+ jobPayload: Dict[str, Any]
86
+ messageGroupId: NotRequired[str]
87
+
88
+
89
+ class Links(TypedDict):
90
+ self: str
91
+ next: NotRequired[Optional[str]]
92
+
93
+
94
+ class ListScheduledJobsResponse(TypedDict):
95
+ items: List[Item]
96
+ links: Links
97
+
98
+
99
+ class SchedulerServiceClient(BaseClient):
100
+ def __init__(self, **cfg: Unpack[AlphaConfig]):
101
+ kwargs = {"target": "lambda://scheduler-service:deployed", **(cfg or {})}
102
+ super().__init__(**kwargs)
103
+
104
+ async def create_scheduled_jobs(self, body: CreateScheduledJobsRequest):
105
+ """Create one or more scheduled jobs"""
106
+ res = await self.client.request(
107
+ path="/v1/private/scheduled-jobs", method="POST", body=cast(dict, body)
108
+ )
109
+ return cast(AlphaResponse[CreateScheduledJobsResponse], res)
110
+
111
+ async def delete_scheduled_job(self, worker_id: str, id: str):
112
+ """Delete a scheduled job by worker and id"""
113
+ await self.client.request(
114
+ path=f"/v1/private/{quote(worker_id)}/scheduled-jobs/{quote(id)}",
115
+ method="DELETE",
116
+ )
117
+
118
+ async def get_scheduled_job(self, worker_id: str, id: str):
119
+ """Get a scheduled job by worker and id"""
120
+ res = await self.client.request(
121
+ path=f"/v1/private/{quote(worker_id)}/scheduled-jobs/{quote(id)}",
122
+ method="GET",
123
+ )
124
+ return cast(AlphaResponse[GetScheduledJobResponse], res)
125
+
126
+ async def upsert_scheduled_job(
127
+ self, worker_id: str, id: str, body: UpsertScheduledJobRequest
128
+ ):
129
+ """Upsert (create or update) a scheduled job"""
130
+ res = await self.client.request(
131
+ path=f"/v1/private/v2/{quote(worker_id)}/scheduled-jobs/{quote(id)}",
132
+ method="PUT",
133
+ body=cast(dict, body),
134
+ )
135
+ return cast(AlphaResponse[UpsertScheduledJobResponse], res)
136
+
137
+ async def list_scheduled_jobs(
138
+ self, worker_id: str, params: ListScheduledJobsParams
139
+ ):
140
+ """List all scheduled jobs for a worker"""
141
+ res = await self.client.request(
142
+ path=f"/v1/private/{quote(worker_id)}/scheduled-jobs",
143
+ method="GET",
144
+ params=cast(dict, params),
145
+ )
146
+ return cast(AlphaResponse[ListScheduledJobsResponse], res)