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,49 @@
|
|
1
|
+
from ._alm import ModelRevision, Revision, SyncTask
|
2
|
+
from ._base import AnaplanModel
|
3
|
+
from ._bulk import (
|
4
|
+
Action,
|
5
|
+
Export,
|
6
|
+
ExportTypes,
|
7
|
+
File,
|
8
|
+
Import,
|
9
|
+
ImportTypes,
|
10
|
+
List,
|
11
|
+
ListMetadata,
|
12
|
+
Model,
|
13
|
+
Process,
|
14
|
+
TaskResult,
|
15
|
+
TaskResultDetail,
|
16
|
+
TaskStatus,
|
17
|
+
TaskSummary,
|
18
|
+
Workspace,
|
19
|
+
)
|
20
|
+
from ._transactional import Failure, InsertionResult, LineItem, ListItem, ModelStatus, Module, User
|
21
|
+
|
22
|
+
__all__ = [
|
23
|
+
"AnaplanModel",
|
24
|
+
"ExportTypes",
|
25
|
+
"ImportTypes",
|
26
|
+
"Workspace",
|
27
|
+
"Model",
|
28
|
+
"ModelStatus",
|
29
|
+
"ModelRevision",
|
30
|
+
"File",
|
31
|
+
"List",
|
32
|
+
"ListItem",
|
33
|
+
"ListMetadata",
|
34
|
+
"Action",
|
35
|
+
"Import",
|
36
|
+
"Export",
|
37
|
+
"Process",
|
38
|
+
"Module",
|
39
|
+
"LineItem",
|
40
|
+
"TaskSummary",
|
41
|
+
"TaskResult",
|
42
|
+
"TaskResultDetail",
|
43
|
+
"TaskStatus",
|
44
|
+
"SyncTask",
|
45
|
+
"User",
|
46
|
+
"Failure",
|
47
|
+
"InsertionResult",
|
48
|
+
"Revision",
|
49
|
+
]
|
@@ -0,0 +1,55 @@
|
|
1
|
+
from pydantic import Field
|
2
|
+
|
3
|
+
from ._base import AnaplanModel
|
4
|
+
|
5
|
+
|
6
|
+
class Revision(AnaplanModel):
|
7
|
+
id: str = Field(description="The unique identifier of this revision.")
|
8
|
+
name: str = Field(description="The name of this revision.")
|
9
|
+
description: str | None = Field(
|
10
|
+
None, description="The description of this revision. Not always present."
|
11
|
+
)
|
12
|
+
created_on: str = Field(description="The creation date of this revision in ISO format.")
|
13
|
+
created_by: str = Field(
|
14
|
+
description="The unique identifier of the user who created this revision."
|
15
|
+
)
|
16
|
+
creation_method: str = Field(description="The creation method of this revision.")
|
17
|
+
applied_on: str = Field(description="The application date of this revision in ISO format.")
|
18
|
+
applied_by: str = Field(
|
19
|
+
description="The unique identifier of the user who applied this revision."
|
20
|
+
)
|
21
|
+
|
22
|
+
|
23
|
+
class ModelRevision(AnaplanModel):
|
24
|
+
id: str = Field(
|
25
|
+
validation_alias="modelId",
|
26
|
+
description="The unique identifier of the model this revision belongs to.",
|
27
|
+
)
|
28
|
+
name: str = Field(
|
29
|
+
default="",
|
30
|
+
validation_alias="modelName",
|
31
|
+
description=(
|
32
|
+
"The name of the model this revision belongs to. This can be an empty string, when the "
|
33
|
+
"calling user does not have access to the model, but is workspace admin in the "
|
34
|
+
"workspace."
|
35
|
+
),
|
36
|
+
)
|
37
|
+
workspace_id: str = Field(
|
38
|
+
description="The unique identifier of the workspace this revision belongs to."
|
39
|
+
)
|
40
|
+
applied_by: str = Field(
|
41
|
+
description="The unique identifier of the user who applied this revision."
|
42
|
+
)
|
43
|
+
applied_on: str = Field(description="The application date of this revision in ISO format.")
|
44
|
+
applied_method: str = Field(description="The application method of this revision.")
|
45
|
+
deleted: bool | None = Field(
|
46
|
+
None,
|
47
|
+
validation_alias="modelDeleted",
|
48
|
+
description="Whether the model has been deleted or not.",
|
49
|
+
)
|
50
|
+
|
51
|
+
|
52
|
+
class SyncTask(AnaplanModel):
|
53
|
+
id: str = Field(validation_alias="taskId", description="The unique identifier of this task.")
|
54
|
+
task_state: str = Field(description="The state of this task.")
|
55
|
+
creation_time: int = Field(description="The creation time of this task.")
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from pydantic import BaseModel, ConfigDict, field_serializer
|
2
|
+
from pydantic.alias_generators import to_camel
|
3
|
+
|
4
|
+
|
5
|
+
class AnaplanModel(BaseModel):
|
6
|
+
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
7
|
+
|
8
|
+
@field_serializer(
|
9
|
+
"action_id",
|
10
|
+
"file_id",
|
11
|
+
"process_id",
|
12
|
+
"id",
|
13
|
+
when_used="unless-none",
|
14
|
+
check_fields=False,
|
15
|
+
) # While these are of type int, they are serialized as strings in the API payloads
|
16
|
+
def str_serializer(self, v: int) -> str:
|
17
|
+
return str(v)
|
@@ -0,0 +1,176 @@
|
|
1
|
+
from typing import Literal, TypeAlias
|
2
|
+
|
3
|
+
from pydantic import ConfigDict, Field, field_validator
|
4
|
+
from pydantic.alias_generators import to_camel
|
5
|
+
|
6
|
+
from ._base import AnaplanModel
|
7
|
+
|
8
|
+
ExportTypes: TypeAlias = Literal[
|
9
|
+
"TABULAR_MULTI_COLUMN",
|
10
|
+
"TABULAR_SINGLE_COLUMN",
|
11
|
+
"GRID_CURRENT_PAGE",
|
12
|
+
"AUDIT_LOG",
|
13
|
+
"TABULAR_ALL_LINE_ITEMS",
|
14
|
+
"TABULAR_CURRENT_LINE_ITEM",
|
15
|
+
]
|
16
|
+
|
17
|
+
ImportTypes: TypeAlias = Literal[
|
18
|
+
"MODULE_DATA", "HIERARCHY_DATA", "LINE_ITEM_DEFINITION", "USERS", "VERSIONS"
|
19
|
+
]
|
20
|
+
|
21
|
+
|
22
|
+
class Workspace(AnaplanModel):
|
23
|
+
id: str = Field(description="The unique identifier of this workspace.")
|
24
|
+
name: str = Field(description="The name of this workspace that is also displayed to the users.")
|
25
|
+
active: bool = Field(description="Whether this workspace is active or not.")
|
26
|
+
size_allowance: int = Field(description="The maximum allowed size of this workspace in bytes.")
|
27
|
+
current_size: int = Field(description="The current size of this workspace in bytes.")
|
28
|
+
|
29
|
+
|
30
|
+
class Model(AnaplanModel):
|
31
|
+
id: str = Field(description="The unique identifier of this model.")
|
32
|
+
name: str
|
33
|
+
active_state: Literal[
|
34
|
+
"ARCHIVED", "UNLOCKED", "ACTIVE", "PRODUCTION", "MAINTENANCE", "PRODUCTION_MAINTENANCE"
|
35
|
+
] = Field(description="The current state of this model.")
|
36
|
+
last_saved_serial_number: int = Field(
|
37
|
+
description="The serial number of the last save of this model."
|
38
|
+
)
|
39
|
+
last_modified_by_user_guid: str = Field(
|
40
|
+
description="The unique identifier of the user who last modified this model."
|
41
|
+
)
|
42
|
+
memory_usage: int = Field(0, description="The memory usage of this model in bytes.")
|
43
|
+
current_workspace_id: str = Field(
|
44
|
+
description="The unique identifier of the workspace that this model is currently in."
|
45
|
+
)
|
46
|
+
current_workspace_name: str = Field(
|
47
|
+
description="The name of the workspace that this model is currently in."
|
48
|
+
)
|
49
|
+
url: str = Field(validation_alias="modelUrl", description="The current URL of this model.")
|
50
|
+
category_values: list = Field(description="The category values of this model.")
|
51
|
+
iso_creation_date: str = Field(description="The creation date of this model in ISO format.")
|
52
|
+
last_modified: str = Field(description="The last modified date of this model.")
|
53
|
+
|
54
|
+
|
55
|
+
class File(AnaplanModel):
|
56
|
+
id: int = Field(description="The unique identifier of this file.")
|
57
|
+
name: str = Field(description="The name of this file.")
|
58
|
+
chunk_count: int = Field(description="The number of chunks this file is split into.")
|
59
|
+
delimiter: str | None = Field(None, description="The delimiter used in this file.")
|
60
|
+
encoding: str | None = Field(None, description="The encoding of this file.")
|
61
|
+
first_data_row: int = Field(description="The row number of the first data row in this file.")
|
62
|
+
format: str | None = Field(None, description="The format of this file.")
|
63
|
+
header_row: int = Field(description="The row number of the header row in this file.")
|
64
|
+
separator: str | None = Field(None, description="The separator used in this file.")
|
65
|
+
|
66
|
+
|
67
|
+
class List(AnaplanModel):
|
68
|
+
id: int = Field(description="The unique identifier of this list.")
|
69
|
+
name: str = Field(description="The name of this list.")
|
70
|
+
|
71
|
+
|
72
|
+
class ListMetadata(AnaplanModel):
|
73
|
+
id: int = Field(description="The unique identifier of this list.")
|
74
|
+
name: str = Field(description="The name of this list.")
|
75
|
+
has_selective_access: bool = Field(description="Whether this list has selective access or not.")
|
76
|
+
properties: list = Field([], description="The properties of this list.")
|
77
|
+
production_data: bool = Field(description="Whether this list is production data or not.")
|
78
|
+
managed_by: str = Field(description="The user who manages this list.")
|
79
|
+
numbered_list: bool = Field(description="Whether this list is a numbered list or not.")
|
80
|
+
use_top_level_as_page_default: bool = Field(
|
81
|
+
description="Whether the top level is used as the page default or not."
|
82
|
+
)
|
83
|
+
item_count: int = Field(description="The number of items in this list.")
|
84
|
+
next_item_index: int | None = Field(
|
85
|
+
None, description="The index of the next item in this list."
|
86
|
+
)
|
87
|
+
workflow_enabled: bool = Field(
|
88
|
+
description="Whether the workflow is enabled for this list or not."
|
89
|
+
)
|
90
|
+
permitted_items: int = Field(description="The number of permitted items in this list.")
|
91
|
+
used_in_applies_to: str | None = Field(None, description="The applies to value of this list.")
|
92
|
+
|
93
|
+
|
94
|
+
class Action(AnaplanModel):
|
95
|
+
id: int = Field(description="The unique identifier of this action.")
|
96
|
+
name: str = Field(
|
97
|
+
description="The name of this Action. This is the same as the one displayed in the Web UI."
|
98
|
+
)
|
99
|
+
type: str | None = Field(
|
100
|
+
None, validation_alias="actionType", description="The type of this action."
|
101
|
+
)
|
102
|
+
|
103
|
+
|
104
|
+
class Process(AnaplanModel):
|
105
|
+
id: int = Field(description="The unique identifier of this process.")
|
106
|
+
name: str = Field(description="The name of this process.")
|
107
|
+
|
108
|
+
|
109
|
+
class Import(AnaplanModel):
|
110
|
+
id: int = Field(description="The unique identifier of this import.")
|
111
|
+
name: str = Field(description="The name of this import.")
|
112
|
+
type: ImportTypes = Field(validation_alias="importType", description="The type of this import.")
|
113
|
+
file_id: int | None = Field(
|
114
|
+
None,
|
115
|
+
validation_alias="importDataSourceId",
|
116
|
+
description=(
|
117
|
+
"The unique identifier of the data source of this import. If it is absent, it means "
|
118
|
+
"that the import does not read from any file."
|
119
|
+
),
|
120
|
+
)
|
121
|
+
|
122
|
+
@field_validator("file_id", mode="before")
|
123
|
+
@classmethod
|
124
|
+
def _empty_source_is_none(cls, inp: str):
|
125
|
+
return inp if inp else None
|
126
|
+
|
127
|
+
|
128
|
+
class Export(AnaplanModel):
|
129
|
+
id: int = Field(description="The unique identifier of this export.")
|
130
|
+
name: str = Field(description="The name of this export.")
|
131
|
+
type: ExportTypes = Field(validation_alias="exportType", description="The type of this export.")
|
132
|
+
format: str = Field(validation_alias="exportFormat", description="The format of this export.")
|
133
|
+
encoding: str | None = Field(None, description="The encoding of this export.")
|
134
|
+
layout: ExportTypes = Field(
|
135
|
+
description="The layout of this export, representing the Anaplan Export Structure."
|
136
|
+
)
|
137
|
+
|
138
|
+
|
139
|
+
class TaskSummary(AnaplanModel):
|
140
|
+
id: str = Field(validation_alias="taskId", description="The unique identifier of this task.")
|
141
|
+
task_state: Literal["NOT_STARTED", "IN_PROGRESS", "COMPLETE"] = Field(
|
142
|
+
description="The state of this task."
|
143
|
+
)
|
144
|
+
creation_time: int = Field(description="Unix timestamp of when this task was created.")
|
145
|
+
|
146
|
+
|
147
|
+
class TaskResultDetail(AnaplanModel):
|
148
|
+
local_message_text: str = Field(description="Error message text.")
|
149
|
+
occurrences: int = Field(0, description="The number of occurrences of this error.")
|
150
|
+
type: str = Field(description="The type of this error.")
|
151
|
+
values: list[str] = Field([], description="Further error information if available.")
|
152
|
+
|
153
|
+
|
154
|
+
class TaskResult(AnaplanModel):
|
155
|
+
details: list[TaskResultDetail] = Field(
|
156
|
+
[], description="The details of this task result if available."
|
157
|
+
)
|
158
|
+
successful: bool = Field(description="Whether this task completed successfully or not.")
|
159
|
+
failure_dump_available: bool = Field(
|
160
|
+
description="Whether this task completed successfully or not."
|
161
|
+
)
|
162
|
+
nested_results: list["TaskResult"] = Field(
|
163
|
+
[], description="The nested results of this task, if available."
|
164
|
+
)
|
165
|
+
|
166
|
+
|
167
|
+
class TaskStatus(AnaplanModel):
|
168
|
+
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
169
|
+
id: str = Field(validation_alias="taskId", description="The unique identifier of this task.")
|
170
|
+
task_state: Literal["NOT_STARTED", "IN_PROGRESS", "COMPLETE"] = Field(
|
171
|
+
description="The state of this task."
|
172
|
+
)
|
173
|
+
creation_time: int = Field(description="Unix timestamp of when this task was created.")
|
174
|
+
progress: float = Field(description="The progress of this task as a float between 0 and 1.")
|
175
|
+
current_step: str | None = Field(None, description="The current step of this task.")
|
176
|
+
result: TaskResult | None = Field(None)
|
@@ -0,0 +1,94 @@
|
|
1
|
+
from pydantic import Field
|
2
|
+
|
3
|
+
from ._base import AnaplanModel
|
4
|
+
|
5
|
+
|
6
|
+
class User(AnaplanModel):
|
7
|
+
id: str = Field(description="The unique identifier of this user.")
|
8
|
+
active: bool = Field(description="Whether this user is active or not.")
|
9
|
+
email: str = Field(description="The email address of this user.")
|
10
|
+
email_opt_in: bool = Field(
|
11
|
+
description="Whether this user has opted in to receive emails or not."
|
12
|
+
)
|
13
|
+
first_name: str = Field(description="The first name of this user.")
|
14
|
+
last_name: str = Field(description="The last name of this user.")
|
15
|
+
last_login_date: str | None = Field(
|
16
|
+
None, description="The last login date of this user in ISO format."
|
17
|
+
)
|
18
|
+
|
19
|
+
|
20
|
+
class ListItem(AnaplanModel):
|
21
|
+
id: int = Field(description="The unique identifier of this list item.")
|
22
|
+
name: str = Field(description="The name of this list item.")
|
23
|
+
code: str | None = Field(None, description="The code of this list item.")
|
24
|
+
properties: dict = Field({}, description="The properties of this list item.")
|
25
|
+
subsets: dict = Field({}, description="The subsets of this list item.")
|
26
|
+
parent: str | None = Field(None, description="The parent of this list item.")
|
27
|
+
parent_id: str | None = Field(
|
28
|
+
None, description="The unique identifier of the parent of this list item."
|
29
|
+
)
|
30
|
+
|
31
|
+
|
32
|
+
class Module(AnaplanModel):
|
33
|
+
id: int = Field(description="The unique identifier of this module.")
|
34
|
+
name: str = Field(description="The name of this module.")
|
35
|
+
|
36
|
+
|
37
|
+
class LineItem(AnaplanModel):
|
38
|
+
id: int = Field(description="The unique identifier of this line item.")
|
39
|
+
name: str = Field(description="The name of this line item.")
|
40
|
+
module_id: int = Field(
|
41
|
+
description="The unique identifier of the module this line item belongs to."
|
42
|
+
)
|
43
|
+
module_name: str = Field(description="The name of the module this line item belongs to.")
|
44
|
+
format: str = Field(description="The format of this line item.")
|
45
|
+
format_metadata: dict = Field(description="The format metadata of this line item.")
|
46
|
+
summary: str = Field(description="The summary of this line item.")
|
47
|
+
applies_to: list[dict] = Field([], description="The applies to value of this line item.")
|
48
|
+
time_scale: str = Field(description="The time scale of this line item.")
|
49
|
+
time_range: str = Field(description="The time range of this line item.")
|
50
|
+
version: dict = Field(description="The version of this line item.")
|
51
|
+
style: str = Field(description="The style of this line item.")
|
52
|
+
cell_count: int | None = Field(None, description="The cell count of this line item.")
|
53
|
+
notes: str = Field(description="The notes of this line item.")
|
54
|
+
is_summary: bool = Field(description="Whether this line item is a summary or not.")
|
55
|
+
formula: str | None = Field(None, description="The formula of this line item.")
|
56
|
+
formula_scope: str = Field(description="The formula scope of this line item.")
|
57
|
+
use_switchover: bool = Field(description="Whether the switchover is used or not.")
|
58
|
+
breakback: bool = Field(description="Whether the breakback is enabled or not.")
|
59
|
+
brought_forward: bool = Field(description="Whether the brought forward is enabled or not.")
|
60
|
+
start_of_section: bool = Field(
|
61
|
+
description="Whether this line item is the start of a section or not."
|
62
|
+
)
|
63
|
+
|
64
|
+
|
65
|
+
class Failure(AnaplanModel):
|
66
|
+
index: int = Field(
|
67
|
+
validation_alias="requestIndex", description="The index of the item that failed."
|
68
|
+
)
|
69
|
+
reason: str = Field(validation_alias="failureType", description="The reason for the failure.")
|
70
|
+
details: str = Field(
|
71
|
+
validation_alias="failureMessageDetails", description="The details of the failure."
|
72
|
+
)
|
73
|
+
|
74
|
+
|
75
|
+
class ModelStatus(AnaplanModel):
|
76
|
+
peak_memory_usage_estimate: int | None = Field(
|
77
|
+
description="The peak memory usage estimate of this model."
|
78
|
+
)
|
79
|
+
peak_memory_usage_time: int | None = Field(
|
80
|
+
description="The peak memory usage time of this model."
|
81
|
+
)
|
82
|
+
progress: float = Field(description="The progress of this model.")
|
83
|
+
current_step: str = Field(description="The current step of this model.")
|
84
|
+
tooltip: str | None = Field(description="The tooltip of this model.")
|
85
|
+
task_id: str | None = Field(description="The unique identifier of the task of this model.")
|
86
|
+
creation_time: int = Field(description="The creation time of this model.")
|
87
|
+
export_task_type: str | None = Field(description="The export task type of this model.")
|
88
|
+
|
89
|
+
|
90
|
+
class InsertionResult(AnaplanModel):
|
91
|
+
added: int = Field(description="The number of items successfully added.")
|
92
|
+
ignored: int = Field(description="The number of items ignored, or items that failed.")
|
93
|
+
total: int = Field(description="The total number of items.")
|
94
|
+
failures: list[Failure] = Field([], description="The list of failures.")
|