anaplan-sdk 0.3.1b1__py3-none-any.whl → 0.4.0a2__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.
- anaplan_sdk/_async_clients/__init__.py +8 -1
- anaplan_sdk/_async_clients/_alm.py +1 -22
- anaplan_sdk/_async_clients/_audit.py +18 -3
- anaplan_sdk/_async_clients/_bulk.py +75 -28
- anaplan_sdk/_async_clients/_cloud_works.py +344 -0
- anaplan_sdk/_async_clients/_cw_flow.py +80 -0
- anaplan_sdk/_async_clients/_transactional.py +0 -26
- anaplan_sdk/_auth.py +170 -57
- anaplan_sdk/_base.py +116 -27
- anaplan_sdk/_clients/_alm.py +1 -22
- anaplan_sdk/_clients/_audit.py +16 -3
- anaplan_sdk/_clients/_bulk.py +72 -30
- anaplan_sdk/_clients/_cloud_works.py +342 -0
- anaplan_sdk/_clients/_cw_flow.py +78 -0
- anaplan_sdk/_clients/_transactional.py +0 -22
- anaplan_sdk/models/__init__.py +49 -0
- anaplan_sdk/models/_alm.py +55 -0
- anaplan_sdk/models/_base.py +17 -0
- anaplan_sdk/models/_bulk.py +176 -0
- anaplan_sdk/models/_transactional.py +94 -0
- anaplan_sdk/models/cloud_works.py +478 -0
- anaplan_sdk/models/flows.py +86 -0
- anaplan_sdk-0.4.0a2.dist-info/METADATA +87 -0
- anaplan_sdk-0.4.0a2.dist-info/RECORD +29 -0
- anaplan_sdk/models.py +0 -329
- anaplan_sdk-0.3.1b1.dist-info/METADATA +0 -109
- anaplan_sdk-0.3.1b1.dist-info/RECORD +0 -19
- {anaplan_sdk-0.3.1b1.dist-info → anaplan_sdk-0.4.0a2.dist-info}/WHEEL +0 -0
- {anaplan_sdk-0.3.1b1.dist-info → anaplan_sdk-0.4.0a2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,478 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
from typing import Literal
|
3
|
+
|
4
|
+
from pydantic import Field, field_validator
|
5
|
+
|
6
|
+
from ._base import AnaplanModel
|
7
|
+
from ._bulk import TaskResultDetail
|
8
|
+
|
9
|
+
ConnectionType = Literal["AmazonS3", "AzureBlob", "GoogleBigQuery"]
|
10
|
+
IntegrationType = Literal[
|
11
|
+
"AmazonS3ToAnaplan",
|
12
|
+
"AzureBlobToAnaplan",
|
13
|
+
"GoogleBigQueryToAnaplan",
|
14
|
+
"AnaplanToAmazonS3",
|
15
|
+
"AnaplanToAzureBlob",
|
16
|
+
"AnaplanToGoogleBigQuery",
|
17
|
+
]
|
18
|
+
|
19
|
+
Timezone = Literal[
|
20
|
+
"Etc/GMT+12",
|
21
|
+
"US/Samoa",
|
22
|
+
"Pacific/Honolulu",
|
23
|
+
"Pacific/Marquesas",
|
24
|
+
"US/Aleutian",
|
25
|
+
"America/Anchorage",
|
26
|
+
"America/Los_Angeles",
|
27
|
+
"America/Denver",
|
28
|
+
"America/Chicago",
|
29
|
+
"America/New_York",
|
30
|
+
"America/Sao_Paulo",
|
31
|
+
"Canada/Newfoundland",
|
32
|
+
"America/Nuuk",
|
33
|
+
"Atlantic/Cape_Verde",
|
34
|
+
"Greenwich",
|
35
|
+
"Europe/London",
|
36
|
+
"Europe/Paris",
|
37
|
+
"Asia/Tel_Aviv",
|
38
|
+
"Europe/Moscow",
|
39
|
+
"Asia/Dubai",
|
40
|
+
"Asia/Kabul",
|
41
|
+
"Asia/Karachi",
|
42
|
+
"Asia/Kolkata",
|
43
|
+
"Asia/Kathmandu",
|
44
|
+
"Asia/Dhaka",
|
45
|
+
"Asia/Rangoon",
|
46
|
+
"Asia/Jakarta",
|
47
|
+
"Asia/Hong_Kong",
|
48
|
+
"Australia/Eucla",
|
49
|
+
"Asia/Tokyo",
|
50
|
+
"Australia/Adelaide",
|
51
|
+
"Australia/Brisbane",
|
52
|
+
"Australia/Melbourne",
|
53
|
+
"Australia/Perth",
|
54
|
+
"Australia/Lord_Howe",
|
55
|
+
"Pacific/Norfolk",
|
56
|
+
"Pacific/Auckland",
|
57
|
+
"Pacific/Chatham",
|
58
|
+
]
|
59
|
+
|
60
|
+
|
61
|
+
class _VersionedBaseModel(AnaplanModel):
|
62
|
+
creation_date: datetime = Field(description="The initial creation date.")
|
63
|
+
modification_date: datetime = Field(
|
64
|
+
description=(
|
65
|
+
"The last modification date. If never modified, this is equal to creation_date."
|
66
|
+
)
|
67
|
+
)
|
68
|
+
created_by: str = Field(description="The user who created this.")
|
69
|
+
modified_by: str | None = Field(description="The user who last modified this.")
|
70
|
+
|
71
|
+
|
72
|
+
class BaseConnectionInput(AnaplanModel):
|
73
|
+
workspace_id: str | None = Field(
|
74
|
+
default=None,
|
75
|
+
description=(
|
76
|
+
"If you are a restricted integration user, add the Workspace ID to which you have "
|
77
|
+
"access in the payload."
|
78
|
+
),
|
79
|
+
)
|
80
|
+
|
81
|
+
|
82
|
+
class AzureBlobConnectionInfo(AnaplanModel):
|
83
|
+
name: str = Field(description="The name of the Azure Blob connection.")
|
84
|
+
storage_account_name: str = Field(description="The name of the Azure Storage account.")
|
85
|
+
container_name: str = Field(description="The name of the Azure Blob container.")
|
86
|
+
|
87
|
+
|
88
|
+
class AzureBlobConnectionInput(AzureBlobConnectionInfo, BaseConnectionInput):
|
89
|
+
sas_token: str = Field(
|
90
|
+
description=(
|
91
|
+
"The SAS token for the Azure Blob connection. Must be created on the container "
|
92
|
+
"directly and not on any child blobs and have at least 'Read' and 'List' permissions."
|
93
|
+
)
|
94
|
+
)
|
95
|
+
|
96
|
+
|
97
|
+
class AmazonS3ConnectionInfo(AnaplanModel):
|
98
|
+
name: str = Field(description="The name of the Amazon S3 connection.")
|
99
|
+
bucket_name: str = Field(description="The name of the Amazon S3 bucket.")
|
100
|
+
|
101
|
+
|
102
|
+
class AmazonS3ConnectionInput(AmazonS3ConnectionInfo, BaseConnectionInput):
|
103
|
+
access_key_id: str = Field(description="The access key ID for the Amazon S3 connection.")
|
104
|
+
secret_access_key: str = Field(
|
105
|
+
description="The secret access key for the Amazon S3 connection."
|
106
|
+
)
|
107
|
+
|
108
|
+
|
109
|
+
class GoogleBigQueryConnectionInfo(AnaplanModel):
|
110
|
+
name: str = Field(description="The name of the Google BigQuery connection.")
|
111
|
+
dataset: str = Field(description="The ID of the Google BigQuery dataset.")
|
112
|
+
|
113
|
+
|
114
|
+
class GoogleServiceAccountJson(AnaplanModel):
|
115
|
+
type: str = Field(description="The type of the service account.")
|
116
|
+
project_id: str = Field(description="The project ID of the service account.")
|
117
|
+
private_key_id: str = Field(description="The private key ID of the service account.")
|
118
|
+
private_key: str = Field(description="The private key of the service account.")
|
119
|
+
client_email: str = Field(description="The client email of the service account.")
|
120
|
+
client_id: str = Field(description="The client ID of the service account.")
|
121
|
+
auth_uri: str = Field(description="The authentication URI of the service account.")
|
122
|
+
token_uri: str = Field(description="The token URI of the service account.")
|
123
|
+
auth_provider_x509_cert_url: str = Field(
|
124
|
+
description="The authentication provider's X.509 certificate URL."
|
125
|
+
)
|
126
|
+
client_x509_cert_url: str = Field(description="The client's X.509 certificate URL.")
|
127
|
+
|
128
|
+
|
129
|
+
class GoogleBigQueryConnectionInput(GoogleBigQueryConnectionInfo, BaseConnectionInput):
|
130
|
+
serviceAccountKey: GoogleServiceAccountJson = Field(
|
131
|
+
description="The service account JSON for the Google BigQuery connection."
|
132
|
+
)
|
133
|
+
|
134
|
+
|
135
|
+
ConnectionBody = AzureBlobConnectionInput | AmazonS3ConnectionInput | GoogleBigQueryConnectionInput
|
136
|
+
|
137
|
+
|
138
|
+
class ConnectionInput(AnaplanModel):
|
139
|
+
type: ConnectionType = Field(description="The type of this connection.")
|
140
|
+
body: ConnectionBody = Field(description="Connection information.")
|
141
|
+
|
142
|
+
|
143
|
+
class Connection(_VersionedBaseModel):
|
144
|
+
connection_id: str = Field(description="The unique identifier of this connection.")
|
145
|
+
connection_type: ConnectionType = Field(description="The type of this connection.")
|
146
|
+
body: AzureBlobConnectionInfo | AmazonS3ConnectionInfo | GoogleBigQueryConnectionInfo = Field(
|
147
|
+
description="Connection information."
|
148
|
+
)
|
149
|
+
status: int = Field(
|
150
|
+
description=(
|
151
|
+
"The status of this connection. 1 indicates a valid connection, 0 indicates an invalid "
|
152
|
+
"connection."
|
153
|
+
)
|
154
|
+
)
|
155
|
+
integration_error_code: str | None = Field(
|
156
|
+
description="The error code of the connection, if any."
|
157
|
+
)
|
158
|
+
workspace_id: str | None = Field(
|
159
|
+
description="The workspace that was given when creating this connection."
|
160
|
+
)
|
161
|
+
|
162
|
+
|
163
|
+
class LatestRun(AnaplanModel):
|
164
|
+
triggered_by: str = Field(description="The user who triggered this run.")
|
165
|
+
start_date: datetime = Field(description="The start timestamp of this run.")
|
166
|
+
end_date: datetime | None = Field(
|
167
|
+
default=None,
|
168
|
+
description=(
|
169
|
+
"The end timestamp of this run. This can be None, if the integration is currently "
|
170
|
+
"running."
|
171
|
+
),
|
172
|
+
)
|
173
|
+
success: bool = Field(description="Whether this run was successful.")
|
174
|
+
message: str = Field(description="Result message of this run.")
|
175
|
+
execution_error_code: int | None = Field(default=None, description="Error code if run failed.")
|
176
|
+
trigger_source: str | None = Field(default=None, description="Source that triggered the run.")
|
177
|
+
|
178
|
+
|
179
|
+
class ScheduleBase(AnaplanModel):
|
180
|
+
name: str = Field(description="Name of the schedule.")
|
181
|
+
type: Literal[
|
182
|
+
"hourly", "daily", "weekly", "monthly_specific_day", "monthly_relative_weekday"
|
183
|
+
] = Field(description="Trigger Frequency")
|
184
|
+
timezone: Timezone = Field(description="Timezone for the schedule.")
|
185
|
+
|
186
|
+
|
187
|
+
class ScheduleInput(ScheduleBase):
|
188
|
+
time: str | None = Field(default=None, description="Time for scheduled runs in HH:mm format.")
|
189
|
+
from_time: str | None = Field(
|
190
|
+
default=None, description="Time for scheduled runs in HH:mm format, if type is hourly."
|
191
|
+
)
|
192
|
+
to_time: str | None = Field(
|
193
|
+
default=None, description="Time for scheduled runs in HH:mm format, if type is hourly."
|
194
|
+
)
|
195
|
+
days_of_week: list[int] = Field(description="Days of week when schedule is active.")
|
196
|
+
start_date: str = Field(
|
197
|
+
description=(
|
198
|
+
"Start date for the schedule in YYYY-MM-DD format. Must be in the Future, i.e. current "
|
199
|
+
"day, if the `time` is greater than the current time or any future date. "
|
200
|
+
)
|
201
|
+
)
|
202
|
+
end_date: str | None = Field(
|
203
|
+
default=None,
|
204
|
+
description=(
|
205
|
+
"End date for the schedule in YYYY-MM-DD format. Must be in the Future, i.e. current "
|
206
|
+
"day, if the `time` is greater than the current time or any future date. Can also be "
|
207
|
+
"omitted to create a schedule that runs indefinitely."
|
208
|
+
),
|
209
|
+
)
|
210
|
+
|
211
|
+
|
212
|
+
class Schedule(ScheduleBase):
|
213
|
+
time: str | None = Field(default=None, description="Time for scheduled runs in HH:mm format.")
|
214
|
+
to_time: str | None = Field(default=None, description="End time for scheduled runs.")
|
215
|
+
from_time: str | None = Field(default=None, description="Start time for scheduled runs.")
|
216
|
+
start_date: datetime = Field(description="Start date of the schedule.")
|
217
|
+
end_date: datetime | None = Field(default=None, description="End date of the schedule, if set.")
|
218
|
+
days_of_week: list[int] = Field(default=[], description="Days of week when schedule is active.")
|
219
|
+
repeat_every: int | None = Field(default=None, description="Frequency of repetition.")
|
220
|
+
status: str = Field(description="Current status of the schedule.")
|
221
|
+
|
222
|
+
|
223
|
+
class _BaseIntegration(_VersionedBaseModel):
|
224
|
+
name: str = Field(description="The name of this integration.")
|
225
|
+
created_by: str = Field(description="The user who created this integration.")
|
226
|
+
notification_id: str | None = Field(
|
227
|
+
default=None, description="The ID of the associated notification configuration, if any."
|
228
|
+
)
|
229
|
+
latest_run: LatestRun | None = Field(
|
230
|
+
default=None, description="Details about the latest execution, if any."
|
231
|
+
)
|
232
|
+
|
233
|
+
@field_validator("latest_run", mode="before")
|
234
|
+
@classmethod
|
235
|
+
def _empty_source_is_none(cls, inp: dict):
|
236
|
+
return inp if inp else None
|
237
|
+
|
238
|
+
|
239
|
+
class Integration(_BaseIntegration):
|
240
|
+
integration_id: str = Field(description="The unique identifier of this integration.")
|
241
|
+
integration_type: Literal["Import", "Export", "Process"] = Field(
|
242
|
+
description="The type of this integration."
|
243
|
+
)
|
244
|
+
model_id: str = Field(description="The ID of the model this integration belongs to.")
|
245
|
+
workspace_id: str = Field(description="The ID of the workspace this integration belongs to.")
|
246
|
+
nux_visible: bool = Field(description="Whether this integration is visible in the UI.")
|
247
|
+
process_id: str | None = Field(None, description="The ID of the process (for Process type).")
|
248
|
+
schedule: Schedule | None = Field(
|
249
|
+
default=None, description="Schedule configuration if defined."
|
250
|
+
)
|
251
|
+
|
252
|
+
|
253
|
+
class SingleIntegration(Integration):
|
254
|
+
integration_type: None = Field(
|
255
|
+
default=None,
|
256
|
+
description=(
|
257
|
+
"Sentinel for erroneous implementation of the Anaplan API. This field is not provided "
|
258
|
+
"when getting an individual integration by Id."
|
259
|
+
),
|
260
|
+
)
|
261
|
+
|
262
|
+
|
263
|
+
class AnaplanSource(AnaplanModel):
|
264
|
+
type: Literal["Anaplan"] = Field(
|
265
|
+
default="Anaplan",
|
266
|
+
description="Literal signifying this is an Anaplan source.",
|
267
|
+
)
|
268
|
+
action_id: int = Field(
|
269
|
+
description=(
|
270
|
+
"The ID of the action to be used as a source. This can be a process, or export."
|
271
|
+
)
|
272
|
+
)
|
273
|
+
|
274
|
+
|
275
|
+
class FileSource(AnaplanModel):
|
276
|
+
connection_id: str = Field(description="The unique identifier of the connection.")
|
277
|
+
type: Literal["AmazonS3", "AzureBlob"] = Field(description="The type of this connection.")
|
278
|
+
file: str = Field(description="The file path relative to the root of the connection.")
|
279
|
+
|
280
|
+
|
281
|
+
class FileTarget(FileSource):
|
282
|
+
connection_id: str = Field(description="The unique identifier of the connection.")
|
283
|
+
type: Literal["AmazonS3", "AzureBlob"] = Field(description="The type of this connection.")
|
284
|
+
overwrite: bool = Field(default=True, description="Whether to overwrite the file if it exists.")
|
285
|
+
|
286
|
+
|
287
|
+
class TableSource(AnaplanModel):
|
288
|
+
type: Literal["GoogleBigQuery"] = Field(
|
289
|
+
default="GoogleBigQuery", description="The type of this connection."
|
290
|
+
)
|
291
|
+
connection_id: str = Field(description="The unique identifier of the connection.")
|
292
|
+
table: str = Field(description="The table name in the BigQuery dataset in the connection.")
|
293
|
+
|
294
|
+
|
295
|
+
class TableTarget(TableSource):
|
296
|
+
overwrite: bool = Field(
|
297
|
+
default=False,
|
298
|
+
description="Whether to overwrite the table if it exists.",
|
299
|
+
)
|
300
|
+
|
301
|
+
|
302
|
+
class AnaplanTarget(AnaplanModel):
|
303
|
+
type: Literal["Anaplan"] = Field(
|
304
|
+
default="Anaplan",
|
305
|
+
description="Literal signifying this is an Anaplan target.",
|
306
|
+
)
|
307
|
+
action_id: int = Field(
|
308
|
+
description=(
|
309
|
+
"The ID of the action to be used as a target. This can be a process, or import."
|
310
|
+
),
|
311
|
+
)
|
312
|
+
file_id: int = Field(description="The ID of the file to be used as a target.")
|
313
|
+
|
314
|
+
|
315
|
+
class IntegrationJobInput(AnaplanModel):
|
316
|
+
type: IntegrationType = Field(description="The type of this integration.")
|
317
|
+
sources: list[AnaplanSource | FileSource | TableSource] = Field(
|
318
|
+
description="The sources of this integration."
|
319
|
+
)
|
320
|
+
targets: list[AnaplanTarget | FileTarget | TableTarget] = Field(
|
321
|
+
description="The targets of this integration."
|
322
|
+
)
|
323
|
+
|
324
|
+
|
325
|
+
class IntegrationProcessInput(AnaplanModel):
|
326
|
+
name: str = Field(description="The name of this integration process.")
|
327
|
+
version: Literal["2.0"] = Field(default="2.0", description="The version of this integration.")
|
328
|
+
workspace_id: str = Field(description="The ID of the workspace this integration belongs to.")
|
329
|
+
model_id: str = Field(description="The ID of the model this integration belongs to.")
|
330
|
+
process_id: int = Field(description="The ID of the process this integration belongs to.")
|
331
|
+
|
332
|
+
|
333
|
+
class IntegrationInput(AnaplanModel):
|
334
|
+
name: str = Field(description="The name of this integration.")
|
335
|
+
version: Literal["2.0"] = Field(default="2.0", description="The version of this integration.")
|
336
|
+
workspace_id: str = Field(description="The ID of the workspace this integration belongs to.")
|
337
|
+
model_id: str = Field(description="The ID of the model this integration belongs to.")
|
338
|
+
process_id: int | None = Field(
|
339
|
+
default=None,
|
340
|
+
description=(
|
341
|
+
"If given, an integration process will be created, instead of an Import or Export"
|
342
|
+
),
|
343
|
+
)
|
344
|
+
nux_visible: bool = Field(
|
345
|
+
default=False,
|
346
|
+
description="Whether this integration is visible in the UI.",
|
347
|
+
)
|
348
|
+
jobs: list[IntegrationJobInput] = Field(
|
349
|
+
description="The jobs in this integration.", min_length=1
|
350
|
+
)
|
351
|
+
|
352
|
+
|
353
|
+
class RunSummary(AnaplanModel):
|
354
|
+
id: str = Field(description="The unique identifier of this run.")
|
355
|
+
triggered_by: str
|
356
|
+
last_run: datetime = Field(description="Last Run timestamp.")
|
357
|
+
start_date: datetime = Field(description="Start timestamp.")
|
358
|
+
end_date: datetime | None = Field(
|
359
|
+
default=None,
|
360
|
+
description=(
|
361
|
+
"The end timestamp of this run. This can be None, if the integration is currently "
|
362
|
+
"running."
|
363
|
+
),
|
364
|
+
)
|
365
|
+
success: bool = Field(description="Whether this run was successful.")
|
366
|
+
message: str = Field(description="Result message of this run.")
|
367
|
+
execution_error_code: int | None = Field(default=None, description="Error code if run failed.")
|
368
|
+
trace_id: str = Field(description="The trace ID for this run.")
|
369
|
+
trigger_source: Literal["manual", "scheduled"] = Field(
|
370
|
+
description="Source that triggered the run."
|
371
|
+
)
|
372
|
+
|
373
|
+
|
374
|
+
class RunStatus(AnaplanModel):
|
375
|
+
id: str = Field(description="The unique identifier of this run.")
|
376
|
+
integration_id: str = Field(description="The ID of the integration this run belongs to.")
|
377
|
+
trace_id: str = Field(description="The trace ID for this run.")
|
378
|
+
start_date: datetime = Field(description="The start timestamp of this run.")
|
379
|
+
end_date: datetime | None = Field(
|
380
|
+
default=None,
|
381
|
+
description=(
|
382
|
+
"The end timestamp of this run. This can be None, if the integration is currently "
|
383
|
+
"running."
|
384
|
+
),
|
385
|
+
)
|
386
|
+
success: bool = Field(description="Whether this run was successful.")
|
387
|
+
message: str = Field(description="Result message of this run.")
|
388
|
+
execution_error_code: int | None = Field(default=None, description="Error code if run failed.")
|
389
|
+
flow_group_id: str | None = Field(default=None, description="The ID of the flow group, if any.")
|
390
|
+
trigger_source: Literal["manual", "scheduled"] = Field(
|
391
|
+
description="Source that triggered the run."
|
392
|
+
)
|
393
|
+
|
394
|
+
|
395
|
+
class ErrorSummary(AnaplanModel):
|
396
|
+
local_message_text: str = Field(description="Error message text.")
|
397
|
+
|
398
|
+
|
399
|
+
class ErrorMessage(AnaplanModel):
|
400
|
+
error_message: list[TaskResultDetail | ErrorSummary]
|
401
|
+
action_id: str = Field(description="The ID of the action that failed.")
|
402
|
+
action_name: str = Field(description="The name of the action that failed.")
|
403
|
+
failure_dump_generated: bool = Field(description="Whether a failure dump was generated.")
|
404
|
+
|
405
|
+
|
406
|
+
class RunError(AnaplanModel):
|
407
|
+
task_id: str = Field(description="The Task ID of the invoked Anaplan Action.")
|
408
|
+
error_messages: list[ErrorMessage] = Field(description="The error messages of the run.")
|
409
|
+
|
410
|
+
|
411
|
+
class NotificationUser(AnaplanModel):
|
412
|
+
user_guid: str = Field(description="The unique identifier of the user.")
|
413
|
+
first_name: str = Field(description="The user's first name.")
|
414
|
+
last_name: str = Field(description="The user's last name.")
|
415
|
+
|
416
|
+
|
417
|
+
class NotificationItem(AnaplanModel):
|
418
|
+
type: Literal["success", "partial_failure", "full_failure"] = Field(
|
419
|
+
description="The type of notification event that triggers notifications."
|
420
|
+
)
|
421
|
+
users: list[NotificationUser] = Field(
|
422
|
+
description="The list of users who will receive this notification."
|
423
|
+
)
|
424
|
+
|
425
|
+
|
426
|
+
class Notification(AnaplanModel):
|
427
|
+
config: list[NotificationItem] = Field(
|
428
|
+
description="The configuration for different notification types."
|
429
|
+
)
|
430
|
+
|
431
|
+
|
432
|
+
class NotificationConfig(AnaplanModel):
|
433
|
+
notification_id: str = Field(
|
434
|
+
description="The unique identifier of this notification configuration."
|
435
|
+
)
|
436
|
+
integration_ids: list[str] = Field(
|
437
|
+
description="The IDs of the integrations associated with this notification."
|
438
|
+
)
|
439
|
+
channels: list[Literal["email", "in_app"]] = Field(
|
440
|
+
description="The channels through which notifications will be sent."
|
441
|
+
)
|
442
|
+
notifications: Notification = Field(
|
443
|
+
description="The detailed notification configuration settings."
|
444
|
+
)
|
445
|
+
|
446
|
+
|
447
|
+
class NotificationItemInput(AnaplanModel):
|
448
|
+
type: Literal["success", "partial_failure", "full_failure"] = Field(
|
449
|
+
description="The type of notification event that triggers notifications."
|
450
|
+
)
|
451
|
+
users: list[str] = Field(
|
452
|
+
description=(
|
453
|
+
"The list of user IDs who will receive this notification. Must not be empty. If you "
|
454
|
+
"want nobody to receive notifications for this type, omit the entire config item. If "
|
455
|
+
"you want to override an existing list of users with an empty one, you must delete the "
|
456
|
+
"notification configuration and create a new one."
|
457
|
+
),
|
458
|
+
min_length=1,
|
459
|
+
max_length=5,
|
460
|
+
)
|
461
|
+
|
462
|
+
|
463
|
+
class NotificationConfigInput(AnaplanModel):
|
464
|
+
config: list[NotificationItemInput] = Field(
|
465
|
+
description="The configuration for different notification types."
|
466
|
+
)
|
467
|
+
|
468
|
+
|
469
|
+
class NotificationInput(AnaplanModel):
|
470
|
+
integration_ids: list[str] = Field(
|
471
|
+
description="The IDs of the integrations associated with this notification."
|
472
|
+
)
|
473
|
+
channels: list[Literal["email", "in_app"]] = Field(
|
474
|
+
description="The channels through which notifications will be sent."
|
475
|
+
)
|
476
|
+
notifications: NotificationConfigInput = Field(
|
477
|
+
description="The detailed notification configuration settings."
|
478
|
+
)
|
@@ -0,0 +1,86 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
from typing import Literal
|
3
|
+
|
4
|
+
from pydantic import Field
|
5
|
+
|
6
|
+
from ._base import AnaplanModel
|
7
|
+
from .cloud_works import _BaseIntegration
|
8
|
+
|
9
|
+
|
10
|
+
class FlowSummary(_BaseIntegration):
|
11
|
+
id: str = Field(description="The unique identifier of this flow.")
|
12
|
+
steps_count: int = Field(description="The number of steps in this flow.")
|
13
|
+
|
14
|
+
|
15
|
+
class ExceptionBehavior(AnaplanModel):
|
16
|
+
type: Literal["failure", "partial_success"] = Field(
|
17
|
+
description="The type of exception that this behavior applies to."
|
18
|
+
)
|
19
|
+
strategy: Literal["stop", "continue"] = Field(
|
20
|
+
description="The strategy to handle the exception."
|
21
|
+
)
|
22
|
+
|
23
|
+
|
24
|
+
class FlowStep(AnaplanModel):
|
25
|
+
referrer: str = Field(
|
26
|
+
description="The unique identifier of the referenced step or integration."
|
27
|
+
)
|
28
|
+
name: str = Field(description="The name of this flow step.")
|
29
|
+
type: Literal["Process", "Import", "Export"] = Field(description="The type of this flow step.")
|
30
|
+
created_by: str = Field(description="The user who created this step.")
|
31
|
+
created_date: datetime = Field(description="The initial creation date of this step.")
|
32
|
+
modified_date: datetime = Field(description="The last modification date of this step.")
|
33
|
+
modified_by: str | None = Field(
|
34
|
+
default=None, description="The user who last modified this step."
|
35
|
+
)
|
36
|
+
model_id: str = Field(description="The ID of the model this step belongs to.")
|
37
|
+
workspace_id: str = Field(description="The ID of the workspace this step belongs to.")
|
38
|
+
depends_on: list[str] | None = Field(
|
39
|
+
default=[], description="The IDs of steps that this step depends on."
|
40
|
+
)
|
41
|
+
is_skipped: bool = Field(description="Whether this step is skipped during execution.")
|
42
|
+
exception_behavior: list[ExceptionBehavior] = Field(
|
43
|
+
description="Configuration for handling exceptions during step execution."
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
class Flow(FlowSummary):
|
48
|
+
version: Literal["2.0"] = Field(default="2.0", description="The version of this flow.")
|
49
|
+
nux_visible: bool = Field(description="Whether this integration is visible in the UI.")
|
50
|
+
steps: list[FlowStep] = Field(default=[], description="The steps in this flow.")
|
51
|
+
|
52
|
+
|
53
|
+
class FlowStepInput(AnaplanModel):
|
54
|
+
type: Literal["Integration"] = Field(
|
55
|
+
default="Integration", description="The type of this flow step."
|
56
|
+
)
|
57
|
+
referrer: str = Field(
|
58
|
+
description="The unique identifier of the referenced step or integration."
|
59
|
+
)
|
60
|
+
depends_on: list[str] | None = Field(
|
61
|
+
default=None, description="The IDs of steps that this step depends on."
|
62
|
+
)
|
63
|
+
is_skipped: bool = Field(
|
64
|
+
default=False, description="Whether this step is skipped during execution."
|
65
|
+
)
|
66
|
+
exception_behavior: list[ExceptionBehavior] = Field(
|
67
|
+
default=[
|
68
|
+
ExceptionBehavior(type="failure", strategy="stop"),
|
69
|
+
ExceptionBehavior(type="partial_success", strategy="continue"),
|
70
|
+
],
|
71
|
+
description=(
|
72
|
+
"Configuration for handling exceptions during step execution. Defaults to stopping on "
|
73
|
+
"Failure and continuing on Partial Success."
|
74
|
+
),
|
75
|
+
)
|
76
|
+
|
77
|
+
|
78
|
+
class FlowInput(AnaplanModel):
|
79
|
+
name: str = Field(description="The name of this flow.")
|
80
|
+
version: Literal["2.0"] = Field(default="2.0", description="The version of this flow.")
|
81
|
+
type: Literal["IntegrationFlow"] = Field(
|
82
|
+
default="IntegrationFlow", description="The type of this flow."
|
83
|
+
)
|
84
|
+
steps: list[FlowStepInput] = Field(
|
85
|
+
description="The steps in this flow.", min_length=2, max_length=100
|
86
|
+
)
|
@@ -0,0 +1,87 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: anaplan-sdk
|
3
|
+
Version: 0.4.0a2
|
4
|
+
Summary: Provides pythonic access to the Anaplan API
|
5
|
+
Project-URL: Homepage, https://vinzenzklass.github.io/anaplan-sdk/
|
6
|
+
Project-URL: Repository, https://github.com/VinzenzKlass/anaplan-sdk
|
7
|
+
Project-URL: Documentation, https://vinzenzklass.github.io/anaplan-sdk/
|
8
|
+
Author-email: Vinzenz Klass <vinzenz.klass@valantic.com>
|
9
|
+
License-Expression: Apache-2.0
|
10
|
+
License-File: LICENSE
|
11
|
+
Keywords: anaplan,anaplan alm api,anaplan api,anaplan audit api,anaplan bulk api,anaplan integration
|
12
|
+
Requires-Python: >=3.10.4
|
13
|
+
Requires-Dist: httpx<1.0.0,>=0.27.0
|
14
|
+
Requires-Dist: pydantic<3.0.0,>=2.7.2
|
15
|
+
Provides-Extra: cert
|
16
|
+
Requires-Dist: cryptography<45.0.0,>=42.0.7; extra == 'cert'
|
17
|
+
Provides-Extra: oauth
|
18
|
+
Requires-Dist: oauthlib<4.0.0,>=3.0.0; extra == 'oauth'
|
19
|
+
Description-Content-Type: text/markdown
|
20
|
+
|
21
|
+
<p align="center">
|
22
|
+
<img width="160" height="160" src="https://vinzenzklass.github.io/anaplan-sdk/img/anaplan-sdk.webp" alt='Python' style="border-radius: 15px">
|
23
|
+
</p>
|
24
|
+
|
25
|
+
<h3 align="center" style="font-size: 3rem; font-weight: 600;">
|
26
|
+
Anaplan SDK
|
27
|
+
</h3>
|
28
|
+
|
29
|
+
<p align="center" style="font-size: 1.2rem; font-weight: 300; margin: 15px 0">
|
30
|
+
Streamlined Python Interface for Anaplan
|
31
|
+
</p>
|
32
|
+
|
33
|
+
<div align="center">
|
34
|
+
<a href="https://pepy.tech/projects/anaplan-sdk">
|
35
|
+
<img src="https://static.pepy.tech/badge/anaplan-sdk" alt="">
|
36
|
+
</a>
|
37
|
+
<a href="https://pypi.org/project/anaplan-sdk/">
|
38
|
+
<img src="https://img.shields.io/pypi/v/anaplan-sdk.svg" alt="PyPi Latest Release"/>
|
39
|
+
</a>
|
40
|
+
<a href="https://pepy.tech/projects/anaplan-sdk">
|
41
|
+
<img src="https://static.pepy.tech/badge/anaplan-sdk/month" alt="PyPI Downloads">
|
42
|
+
</a>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
---
|
46
|
+
|
47
|
+
Anaplan SDK is an independent, unofficial project providing pythonic access to Anaplan. It delivers high-level
|
48
|
+
abstractions over all Anaplan APIs, allowing you to focus on business requirements rather than implementation details.
|
49
|
+
|
50
|
+
## Key Features
|
51
|
+
|
52
|
+
- **Pythonic Interface**: Clean, intuitive access to Anaplan functionality
|
53
|
+
- **Simplified API Interactions**: Automatic handling of authentication, error handling, and data formatting
|
54
|
+
- **Performance Optimizations**: Built-in chunking and compression techniques
|
55
|
+
- **Multiple API Support**: Compatible with all major Anaplan API endpoints
|
56
|
+
- **Flexible Client Options**: Both synchronous and asynchronous implementations
|
57
|
+
- **Developer-Friendly**: Designed to reduce boilerplate code and accelerate development
|
58
|
+
|
59
|
+
## Getting Started
|
60
|
+
|
61
|
+
Head over to the [Quick Start](quickstart.md) for basic usage instructions and examples.
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Pull Requests are welcome. For major changes,
|
66
|
+
please [open an issue](https://github.com/VinzenzKlass/anaplan-sdk/issues/new) first to discuss what you would like to
|
67
|
+
change. To submit a pull request, please follow the
|
68
|
+
standard [Fork & Pull Request workflow](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
|
69
|
+
|
70
|
+
Before submitting your pull request, please ensure that all the files pass linting and formatting checks. You can do
|
71
|
+
this by running the following command:
|
72
|
+
|
73
|
+
```shell
|
74
|
+
uv sync --dev
|
75
|
+
|
76
|
+
ruff check
|
77
|
+
ruff format
|
78
|
+
```
|
79
|
+
|
80
|
+
You can also enable [pre-commit](https://pre-commit.com/) hooks to automatically format and lint your code before
|
81
|
+
committing:
|
82
|
+
|
83
|
+
```shell
|
84
|
+
pre-commit install
|
85
|
+
```
|
86
|
+
|
87
|
+
If your PR goes beyond a simple bug fix or small changes, please add tests to cover your changes.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
anaplan_sdk/__init__.py,sha256=5fr-SZSsH6f3vkRUTDoK6xdAN31cCpe9Mwz2VNu47Uw,134
|
2
|
+
anaplan_sdk/_auth.py,sha256=wqlyrZwaJSEXW5J2-GV4UIw7KxDkfQ-loWdePVy2lWg,10231
|
3
|
+
anaplan_sdk/_base.py,sha256=lKwtDSi1KRGDxd60Vv0prS_XhB7fsJkvtNWxI23njOA,12319
|
4
|
+
anaplan_sdk/exceptions.py,sha256=ALkA9fBF0NQ7dufFxV6AivjmHyuJk9DOQ9jtJV2n7f0,1809
|
5
|
+
anaplan_sdk/_async_clients/__init__.py,sha256=pZXgMMg4S9Aj_pxQCaSiPuNG-sePVGBtNJ0133VjqW4,364
|
6
|
+
anaplan_sdk/_async_clients/_alm.py,sha256=O1_r-O1tNDq7vXRwE2UEFE5S2bPmPh4IAQPQ8bmZfQE,3297
|
7
|
+
anaplan_sdk/_async_clients/_audit.py,sha256=a92RY0B3bWxp2CCAWjzqKfvBjG1LJGlai0Hn5qmwgF8,2312
|
8
|
+
anaplan_sdk/_async_clients/_bulk.py,sha256=pvx0ux5tAAtCsNJrJorC_SDRxvDUSWu5aKPolE1_nuo,25297
|
9
|
+
anaplan_sdk/_async_clients/_cloud_works.py,sha256=KPX9W55SF6h8fJd4Rx-HLq6eaRA-Vo3rFu343UiiaGQ,16642
|
10
|
+
anaplan_sdk/_async_clients/_cw_flow.py,sha256=ZTNAbKDwb59Wg3u68hbtt1kpd-LNz9K0sftT-gvYzJQ,3651
|
11
|
+
anaplan_sdk/_async_clients/_transactional.py,sha256=zEM-wWxX-mCkk9H_nIl3WDZ6X3bo6LQxWLpfLCG5BDw,6524
|
12
|
+
anaplan_sdk/_clients/__init__.py,sha256=FsbwvZC1FHrxuRXwbPxUzbhz_lO1DpXIxEOjx6-3QuA,219
|
13
|
+
anaplan_sdk/_clients/_alm.py,sha256=UAdQxgHfax-VquC0YtbqrRBku2Rn35tVgwJdxYFScps,3202
|
14
|
+
anaplan_sdk/_clients/_audit.py,sha256=xQQiwWIb4QQefolPvxNwBFE-pkRzzi8fYPyewjF63lc,2181
|
15
|
+
anaplan_sdk/_clients/_bulk.py,sha256=CaDFD5j5nZtvCPKwyVYBBpf1qr-OWMuPFXojF-fEM1k,25119
|
16
|
+
anaplan_sdk/_clients/_cloud_works.py,sha256=KAMnLoeMJ2iwMXlDSbKynCE57BtkCfOgM5O8wT1kkSs,16291
|
17
|
+
anaplan_sdk/_clients/_cw_flow.py,sha256=5IFWFT-qbyGvaSOOtaFOjHnOlyYbj4Rj3xiavfTlm8c,3527
|
18
|
+
anaplan_sdk/_clients/_transactional.py,sha256=o1wcAgVyIn2EdJL8Ivw6cW7KZ9OEFwv-PpbhvQAqCfo,6465
|
19
|
+
anaplan_sdk/models/__init__.py,sha256=nSplwPG_74CG9CKbv1PzP9bsA9v5-daS4azpTCvCQTI,925
|
20
|
+
anaplan_sdk/models/_alm.py,sha256=IqsTPvkx_ujLpaqZgIrTcr44KHJyKc4dyeRs9rkDjms,2307
|
21
|
+
anaplan_sdk/models/_base.py,sha256=k2hGE0NmnNwLNJsPUuSjSYSUG9W2orZmMiCGYer7Zuk,554
|
22
|
+
anaplan_sdk/models/_bulk.py,sha256=dHP3kMvsKONCZS6mHB271-wp2S4P3rM874Ita8TzABU,8256
|
23
|
+
anaplan_sdk/models/_transactional.py,sha256=_0UbVR9D5QABI29yloYrJTSgL-K0EU7PzPeJu5LdhnY,4854
|
24
|
+
anaplan_sdk/models/cloud_works.py,sha256=AWSwyVhAqOGYgWTbCTrfVQuqEY0_LW3ct5zxSZ7UKWs,19466
|
25
|
+
anaplan_sdk/models/flows.py,sha256=SuLgNj5-2SeE3U1i8iY8cq2IkjuUgd_3M1n2ENructk,3625
|
26
|
+
anaplan_sdk-0.4.0a2.dist-info/METADATA,sha256=-hZsuCu5si1jen5pTxo307hfKXMTGYulIxFrsg_tsUw,3463
|
27
|
+
anaplan_sdk-0.4.0a2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
28
|
+
anaplan_sdk-0.4.0a2.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
29
|
+
anaplan_sdk-0.4.0a2.dist-info/RECORD,,
|