anaplan-sdk 0.5.0a5__py3-none-any.whl → 0.5.1__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.
@@ -0,0 +1,282 @@
1
+ from typing import Any, Literal
2
+
3
+ from pydantic import Field
4
+ from typing_extensions import Self
5
+
6
+ from anaplan_sdk.models import AnaplanModel
7
+
8
+ AnaplanFilterFields = Literal[
9
+ "id", "externalId", "userName", "name.familyName", "name.givenName", "active"
10
+ ]
11
+
12
+
13
+ class _FilterExpression:
14
+ def __init__(self, _field: AnaplanFilterFields) -> None:
15
+ self._field: AnaplanFilterFields = _field
16
+ self._exprs: list[str] = []
17
+ self._operators = []
18
+
19
+ def __str__(self) -> str:
20
+ if not self._exprs:
21
+ return "active eq true" if self._field == "active" else f"{self._field} pr"
22
+ parts = []
23
+ for i, expr in enumerate(self._exprs):
24
+ if i > 0:
25
+ parts.append(self._operators[i - 1])
26
+ parts.append(expr)
27
+ return " ".join(parts)
28
+
29
+ def __invert__(self) -> Self:
30
+ self._exprs.append(
31
+ "active eq false" if self._field == "active" else f"{self._field} eq null"
32
+ )
33
+ return self
34
+
35
+ def __and__(self, other: Self) -> Self:
36
+ return self._combine(other, "and")
37
+
38
+ def __or__(self, other: Self) -> Self:
39
+ return self._combine(other, "or")
40
+
41
+ def _combine(self, other: Self, operator: Literal["and", "or"]) -> Self:
42
+ if self._requires_grouping(operator):
43
+ self._exprs = [f"({str(self)})"]
44
+ self._operators = []
45
+ self._operators.append(operator)
46
+ if not self._exprs:
47
+ self._exprs.append(str(self))
48
+ self._exprs.append(f"({str(other)})" if other._requires_grouping(operator) else str(other))
49
+ return self
50
+
51
+ def _requires_grouping(self, operator: Literal["and", "or"]) -> bool:
52
+ return len(self._operators) > 0 and ("or" in self._operators or operator == "or")
53
+
54
+ def __eq__(self, other: Any) -> Self:
55
+ self._exprs.append(f'{self._field} eq "{other}"')
56
+ return self
57
+
58
+ def __ne__(self, other: Any) -> Self:
59
+ self._exprs.append(f'{self._field} ne "{other}"')
60
+ return self
61
+
62
+ def __gt__(self, other: Any) -> Self:
63
+ self._exprs.append(f'{self._field} gt "{other}"')
64
+ return self
65
+
66
+ def __ge__(self, other: Any) -> Self:
67
+ self._exprs.append(f'{self._field} ge "{other}"')
68
+ return self
69
+
70
+ def __lt__(self, other: Any) -> Self:
71
+ self._exprs.append(f'{self._field} lt "{other}"')
72
+ return self
73
+
74
+ def __le__(self, other: Any) -> Self:
75
+ self._exprs.append(f'{self._field} le "{other}"')
76
+ return self
77
+
78
+
79
+ field = _FilterExpression
80
+
81
+
82
+ class NameInput(AnaplanModel):
83
+ family_name: str = Field(
84
+ description="The family name of the User, or last name in most Western languages"
85
+ )
86
+ given_name: str = Field(
87
+ description="The given name of the User, or first name in most Western languages"
88
+ )
89
+
90
+
91
+ class Name(NameInput):
92
+ formatted: str = Field(
93
+ description=(
94
+ "The formatted full name, including given name and family name. Anaplan does as of now "
95
+ "not have other standard SCIM fields such as middle name or honorific pre- or suffixes."
96
+ )
97
+ )
98
+
99
+
100
+ class Email(AnaplanModel):
101
+ value: str = Field(description="Email address of the User")
102
+ type: Literal["work", "home", "other"] = Field(
103
+ default=None, description="A label indicating the emails's function, e.g., 'work' or 'home'"
104
+ )
105
+ primary: bool | None = Field(
106
+ default=None, description="Indicates if this is the primary or 'preferred' email"
107
+ )
108
+
109
+
110
+ class EntitlementInput(AnaplanModel):
111
+ value: str = Field(description="The value of an entitlement.")
112
+ type: Literal["WORKSPACE", "WORKSPACE_IDS", "WORKSPACE_NAMES"] = Field(
113
+ description="A label indicating the attribute's function."
114
+ )
115
+
116
+
117
+ class Entitlement(EntitlementInput):
118
+ display: str | None = Field(
119
+ default=None, description="A human-readable name, primarily used for display purposes."
120
+ )
121
+ primary: bool | None = Field(
122
+ default=None,
123
+ description="Indicating the 'primary' or preferred attribute value for this attribute.",
124
+ )
125
+
126
+
127
+ class _BaseUser(AnaplanModel):
128
+ schemas: list[str] = Field(default=["urn:ietf:params:scim:schemas:core:2.0:User"])
129
+ user_name: str = Field(description="Unique name for the User.")
130
+
131
+
132
+ class User(_BaseUser):
133
+ id: str = Field(description="The unique identifier for the User.")
134
+ name: Name = Field(description="The user's real name.")
135
+ active: bool = Field(description="Indicating the User's active status.")
136
+ emails: list[Email] = Field(default=[], description="Email addresses for the user.")
137
+ display_name: str = Field(description="Display Name for the User.")
138
+ entitlements: list[Entitlement] = Field(
139
+ default=[], description="A list of entitlements (Workspaces) the User has."
140
+ )
141
+
142
+
143
+ class ReplaceUserInput(_BaseUser):
144
+ id: str = Field(description="The unique identifier for the User.")
145
+ name: NameInput = Field(description="The user's real name.")
146
+ active: bool | None = Field(default=None, description="Indicating the User's active status.")
147
+ display_name: str | None = Field(default=None, description="Display Name for the User.")
148
+ entitlements: list[EntitlementInput] | None = Field(
149
+ default=None, description="A list of entitlements (Workspaces) the User has."
150
+ )
151
+
152
+
153
+ class UserInput(_BaseUser):
154
+ external_id: str = Field(
155
+ description="Your unique id for this user (as stored in your company systems)."
156
+ )
157
+ name: NameInput = Field(description="The user's real name.")
158
+
159
+
160
+ class Meta(AnaplanModel):
161
+ resource_type: str = Field(description="The type of the resource.")
162
+ location: str = Field(description="The URI of the resource.")
163
+
164
+
165
+ class MetaWithDates(Meta):
166
+ created: str = Field(description="The timestamp when the resource was created.")
167
+ last_modified: str = Field(description="The timestamp when the resource was last modified.")
168
+
169
+
170
+ class Supported(AnaplanModel):
171
+ supported: bool = Field(description="Indicates whether the Feature is supported.")
172
+
173
+
174
+ class BulkConfig(Supported):
175
+ max_operations: int = Field(
176
+ description="The maximum number of operations permitted in a single request."
177
+ )
178
+ max_payload_size: int = Field(description="The maximum payload size in bytes.")
179
+
180
+
181
+ class FilterConfig(Supported):
182
+ max_results: int = Field(
183
+ description="The maximum number of results returned from a filtered query."
184
+ )
185
+
186
+
187
+ class AuthenticationScheme(AnaplanModel):
188
+ name: str = Field(description="The name of the authentication scheme.")
189
+ type: str = Field(description="The type of the authentication scheme.")
190
+ description: str = Field(description="A description of the authentication scheme.")
191
+ spec_uri: str = Field(
192
+ description="The URI that points to the specification of the authentication scheme."
193
+ )
194
+ documentation_uri: str = Field(
195
+ description="The URI that points to the documentation of the authentication scheme."
196
+ )
197
+
198
+
199
+ class ServiceProviderConfig(AnaplanModel):
200
+ schemas: list[str] = Field(
201
+ default=["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"],
202
+ description="Schemas for this resource.",
203
+ )
204
+ meta: MetaWithDates = Field(description="Metadata about the resource.")
205
+ documentation_uri: str = Field(description="URI of the service provider's documentation.")
206
+ patch: Supported = Field(description="Configuration for PATCH operations.")
207
+ bulk: BulkConfig = Field(description="Configuration for bulk operations.")
208
+ filter: FilterConfig = Field(description="Configuration for filtering.")
209
+ change_password: Supported = Field(description="Configuration for password changes.")
210
+ sort: Supported = Field(description="Configuration for sorting.")
211
+ etag: Supported = Field(description="Configuration for ETags.")
212
+ authentication_schemes: list[AuthenticationScheme] = Field(
213
+ description="List of supported authentication schemes."
214
+ )
215
+
216
+
217
+ class Resource(AnaplanModel):
218
+ schemas: list[str] = Field(
219
+ default=["urn:ietf:params:scim:schemas:core:2.0:ResourceType"],
220
+ description="Schemas for this resource.",
221
+ )
222
+ meta: Meta = Field(description="Metadata about the resource.")
223
+ id: str = Field(description="The identifier of the resource type.")
224
+ name: str = Field(description="The name of the resource type.")
225
+ endpoint: str = Field(description="The endpoint where resources of this type may be accessed.")
226
+ description: str = Field(description="A description of the resource type.")
227
+
228
+
229
+ class Attribute(AnaplanModel):
230
+ name: str = Field(description="The name of the attribute.")
231
+ type: str = Field(description="The data type of the attribute.")
232
+ multi_valued: bool = Field(description="Indicates if the attribute can have multiple values.")
233
+ description: str = Field(description="A human-readable description of the attribute.")
234
+ required: bool = Field(description="Indicates if the attribute is required.")
235
+ case_exact: bool = Field(
236
+ description="Indicates if case sensitivity should be considered when comparing values."
237
+ )
238
+ mutability: str = Field(description="Indicates if and how the attribute can be modified.")
239
+ returned: str = Field(
240
+ description="Indicates when the attribute's values are returned in a response."
241
+ )
242
+ uniqueness: str = Field(
243
+ description="Indicates how uniqueness is enforced on the attribute value."
244
+ )
245
+ sub_attributes: list["Attribute"] | None = Field(
246
+ default=None, description="A list of sub-attributes if the attribute is complex."
247
+ )
248
+
249
+
250
+ class Schema(AnaplanModel):
251
+ meta: Meta = Field(description="Metadata about the schema resource.")
252
+ id: str = Field(description="The unique identifier for the schema.")
253
+ name: str = Field(description="The name of the schema.")
254
+ description: str = Field(description="A description of the schema.")
255
+ attributes: list[Attribute] = Field(description="A list of attributes that define the schema.")
256
+
257
+
258
+ class Operation(AnaplanModel):
259
+ op: Literal["add", "remove", "replace"] = Field(description="The operation to be performed.")
260
+ path: str = Field(
261
+ description=(
262
+ "A string containing a JSON-Pointer value that references a location within the target "
263
+ "resource."
264
+ )
265
+ )
266
+ value: Any | None = Field(default=None, description="The value to be used in the operation.")
267
+
268
+
269
+ class Replace(Operation):
270
+ op: Literal["replace"] = Field(
271
+ default="replace", description="Replace the value at path with the new given value."
272
+ )
273
+
274
+
275
+ class Add(Operation):
276
+ op: Literal["add"] = Field(
277
+ default="add", description="Add the given value to the attribute at path."
278
+ )
279
+
280
+
281
+ class Remove(Operation):
282
+ op: Literal["remove"] = Field(default="remove", description="Remove the value at path.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anaplan-sdk
3
- Version: 0.5.0a5
3
+ Version: 0.5.1
4
4
  Summary: Streamlined Python Interface for the Anaplan API.
5
5
  Project-URL: Homepage, https://vinzenzklass.github.io/anaplan-sdk/
6
6
  Project-URL: Repository, https://github.com/VinzenzKlass/anaplan-sdk
@@ -29,7 +29,7 @@ Description-Content-Type: text/markdown
29
29
  </h3>
30
30
 
31
31
  <p align="center" style="font-size: 1.2rem; font-weight: 300; margin: 15px 0">
32
- Streamlined Python Interface for Anaplan
32
+ Streamlined Python Interface for the Anaplan API.
33
33
  </p>
34
34
 
35
35
  <div align="center">
@@ -45,9 +45,11 @@ Description-Content-Type: text/markdown
45
45
  </div>
46
46
 
47
47
  ---
48
+ Streamlined Python Interface for the Anaplan API. Get up and running with the Anaplan API in minutes.
48
49
 
49
50
  Anaplan SDK is an independent, unofficial project providing pythonic access to Anaplan. It delivers high-level
50
- abstractions over all Anaplan APIs, allowing you to focus on business requirements rather than implementation details.
51
+ abstractions over all parts of the Anaplan API, allowing you to focus on business requirements rather than
52
+ implementation details.
51
53
 
52
54
  ## Key Features
53
55
 
@@ -0,0 +1,34 @@
1
+ anaplan_sdk/__init__.py,sha256=wkK6fPTp2-YiR9XVC-O1Iyf1FhVAcAxvJbX_YrF0p_c,397
2
+ anaplan_sdk/_auth.py,sha256=l5z2WCcfQ05OkuQ1dcmikp6dB87Rw1qy2zu8bbaAQTs,16620
3
+ anaplan_sdk/_oauth.py,sha256=AynlJDrGIinQT0jwxI2RSvtU4D7Wasyw3H1uicdlLVI,12672
4
+ anaplan_sdk/_services.py,sha256=zW0ePBQNyP759OvagDuM02SwkXxyE71IuJNz6wcWVsw,13027
5
+ anaplan_sdk/_utils.py,sha256=jsrhdfLpriMoANukVvXpjpEJ5hWDNx7ZJKAguLvKgJA,7517
6
+ anaplan_sdk/exceptions.py,sha256=ALkA9fBF0NQ7dufFxV6AivjmHyuJk9DOQ9jtJV2n7f0,1809
7
+ anaplan_sdk/_async_clients/__init__.py,sha256=oDYqtZIHWMA0iAfAv49htKaiS3sBBouqD_hEqaTWQL8,491
8
+ anaplan_sdk/_async_clients/_alm.py,sha256=_PTD9Eght879HAadjcsfdvS0KCN93jgwpPOF8r3_E14,13178
9
+ anaplan_sdk/_async_clients/_audit.py,sha256=6s6IceSyz1GXxigH1JAYarL9WMCxUdaCCAj4AjCgY_E,2897
10
+ anaplan_sdk/_async_clients/_bulk.py,sha256=v-nyyf68NTs0PbQ-_5tGKbyUJZhRwZ8k0Pop5Yfg2K8,30517
11
+ anaplan_sdk/_async_clients/_cloud_works.py,sha256=aSgmJQvE7dSJawwK0A7GEBWs7wokWk7eCwRiQuiVg6I,17701
12
+ anaplan_sdk/_async_clients/_cw_flow.py,sha256=qJJFfnwLR7zIdZ_ay4fVI9zr3eP5B-qMcs4GlC9vqQY,3966
13
+ anaplan_sdk/_async_clients/_scim.py,sha256=pBIrxP31n5YhFnDEu0eu8VpQas8SBy6JIdCBn_Z9oNM,7036
14
+ anaplan_sdk/_async_clients/_transactional.py,sha256=f-NlIjvRJ0NIKRcI6ZaO2YatLERwIaC0TY0fKvgUJ5Q,18050
15
+ anaplan_sdk/_clients/__init__.py,sha256=RB2ZYSW5vDrw8oAeDAkf7jmxu-Fr4yFLt3ebTtigE4Y,421
16
+ anaplan_sdk/_clients/_alm.py,sha256=oRHTjnCuwQYZDE2CBWA1u410jSImIroCsDOSeP9U9w8,12905
17
+ anaplan_sdk/_clients/_audit.py,sha256=Am6VviRw88_VC5i0N7TQTXEm6pJAHZb7xNaJTljD0fc,2850
18
+ anaplan_sdk/_clients/_bulk.py,sha256=e1yRHcskAALhG1JClLYknRo_kXZUQkmG_Zc6TXY6IUk,30659
19
+ anaplan_sdk/_clients/_cloud_works.py,sha256=1bbMYM_g8MSorxTI9Au_dFzbJZgKGJVBE6DYlbWBR0U,17492
20
+ anaplan_sdk/_clients/_cw_flow.py,sha256=x64Ua2FwCpt8vab6gaLV8tDwW_ugJrDfU5dv-TnmM2M,3855
21
+ anaplan_sdk/_clients/_scim.py,sha256=a5i7CNVNzF45YMbLY70ta_UumFumthZRmlfNm8rj2O0,6960
22
+ anaplan_sdk/_clients/_transactional.py,sha256=IgkvBaq1Ep5mB-uxu6QoE17cUCfsodvV8dppASQrIT4,17875
23
+ anaplan_sdk/models/__init__.py,sha256=zfwDQJQrXuLEXSpbJcm08a_YK1P7a7u-kMhwtJiJFmA,1783
24
+ anaplan_sdk/models/_alm.py,sha256=oeENd0YM7-LoIRBq2uATIQTxVgIP9rXx3UZE2UnQAp0,4670
25
+ anaplan_sdk/models/_base.py,sha256=6AZc9CfireUKgpZfMxYKu4MbwiyHQOsGLjKrxGXBLic,508
26
+ anaplan_sdk/models/_bulk.py,sha256=C0s6XdvHxuJHrPXU-pnZ1JXK1PJOl9FScHArpaox_mQ,8489
27
+ anaplan_sdk/models/_transactional.py,sha256=2bH10zvtMb5Lfh6DC7iQk72aEwq6tyLQ-XnH_0wYSqI,14172
28
+ anaplan_sdk/models/cloud_works.py,sha256=APUGDt_e-JshtXkba5cQh5rZkXOZBz0Aix0qVNdEWgw,19501
29
+ anaplan_sdk/models/flows.py,sha256=SuLgNj5-2SeE3U1i8iY8cq2IkjuUgd_3M1n2ENructk,3625
30
+ anaplan_sdk/models/scim.py,sha256=jxPrn-LgoZFYm5rtfCwmceD6i8rkJwAZUlgLx036gjg,11099
31
+ anaplan_sdk-0.5.1.dist-info/METADATA,sha256=Mmspki0fIDEGKOA4hjAmUdi6eGz1iOO8G9TM5lT1Rto,3799
32
+ anaplan_sdk-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
33
+ anaplan_sdk-0.5.1.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
34
+ anaplan_sdk-0.5.1.dist-info/RECORD,,
@@ -1,30 +0,0 @@
1
- anaplan_sdk/__init__.py,sha256=WScEKtXlnRLjCb-j3qW9W4kEACTyPsTLFs-L54et2TQ,351
2
- anaplan_sdk/_auth.py,sha256=l5z2WCcfQ05OkuQ1dcmikp6dB87Rw1qy2zu8bbaAQTs,16620
3
- anaplan_sdk/_oauth.py,sha256=AynlJDrGIinQT0jwxI2RSvtU4D7Wasyw3H1uicdlLVI,12672
4
- anaplan_sdk/_services.py,sha256=D54hGrzj1MSj7_6-WDZUZsoLcThI_neW4aIoDOqALjE,20869
5
- anaplan_sdk/exceptions.py,sha256=ALkA9fBF0NQ7dufFxV6AivjmHyuJk9DOQ9jtJV2n7f0,1809
6
- anaplan_sdk/_async_clients/__init__.py,sha256=pZXgMMg4S9Aj_pxQCaSiPuNG-sePVGBtNJ0133VjqW4,364
7
- anaplan_sdk/_async_clients/_alm.py,sha256=zvKEvXlxNkcQim_XvyZLCbDafFldljg8APHqhAAIfvw,13147
8
- anaplan_sdk/_async_clients/_audit.py,sha256=r3pJ4iHmXHyfDu19L80UTZzMReg6FKE7DlzyhXLhI8A,2896
9
- anaplan_sdk/_async_clients/_bulk.py,sha256=JkXZ6mtK04bATyVZA6yA8akjVerurRjgINCViXAwoWM,30069
10
- anaplan_sdk/_async_clients/_cloud_works.py,sha256=VB4l93426A0Xes5dZ6DsDu0go-BVNhs2RZn2zX5DSOc,17675
11
- anaplan_sdk/_async_clients/_cw_flow.py,sha256=_allKIOP-qb33wrOj6GV5VAOvrCXOVJ1QXvck-jsocQ,3935
12
- anaplan_sdk/_async_clients/_transactional.py,sha256=U6X5pW7By387JOgvHx-GmgVRi7MRJKALpx0lWI6xRMo,18024
13
- anaplan_sdk/_clients/__init__.py,sha256=FsbwvZC1FHrxuRXwbPxUzbhz_lO1DpXIxEOjx6-3QuA,219
14
- anaplan_sdk/_clients/_alm.py,sha256=3U7Cy5U5TsePF1YPogXvsOzNeQlQm_ezO5TlmD-Xbbs,12874
15
- anaplan_sdk/_clients/_audit.py,sha256=oF1-7rGfYWG6LfM-i0vJzgpx4NAsLczo4welJR14N-U,2819
16
- anaplan_sdk/_clients/_bulk.py,sha256=-I0e5yBHhQPIuS9pF_dRRi7OmY7H88P5mGPusGupKi4,30226
17
- anaplan_sdk/_clients/_cloud_works.py,sha256=FsCp2wPxIoArAN1vcIfOI6ANNkK2ZebQ4MWJZB-nFJU,17466
18
- anaplan_sdk/_clients/_cw_flow.py,sha256=O6t4utbDZdSVXGC0PXUcPpQ4oXrPohU9_8SUBCpxTXw,3824
19
- anaplan_sdk/_clients/_transactional.py,sha256=SaHAnaGLZrhXmM8d6JnWWkwf-sVCEDW0nL2a4_wvjfk,17849
20
- anaplan_sdk/models/__init__.py,sha256=zfwDQJQrXuLEXSpbJcm08a_YK1P7a7u-kMhwtJiJFmA,1783
21
- anaplan_sdk/models/_alm.py,sha256=oeENd0YM7-LoIRBq2uATIQTxVgIP9rXx3UZE2UnQAp0,4670
22
- anaplan_sdk/models/_base.py,sha256=6AZc9CfireUKgpZfMxYKu4MbwiyHQOsGLjKrxGXBLic,508
23
- anaplan_sdk/models/_bulk.py,sha256=C0s6XdvHxuJHrPXU-pnZ1JXK1PJOl9FScHArpaox_mQ,8489
24
- anaplan_sdk/models/_transactional.py,sha256=2bH10zvtMb5Lfh6DC7iQk72aEwq6tyLQ-XnH_0wYSqI,14172
25
- anaplan_sdk/models/cloud_works.py,sha256=APUGDt_e-JshtXkba5cQh5rZkXOZBz0Aix0qVNdEWgw,19501
26
- anaplan_sdk/models/flows.py,sha256=SuLgNj5-2SeE3U1i8iY8cq2IkjuUgd_3M1n2ENructk,3625
27
- anaplan_sdk-0.5.0a5.dist-info/METADATA,sha256=cPMNYurLnr08YAdhsgOUFlrcw-xehz2gd5MQF_TrFg8,3678
28
- anaplan_sdk-0.5.0a5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- anaplan_sdk-0.5.0a5.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
30
- anaplan_sdk-0.5.0a5.dist-info/RECORD,,