CMS Types
cmstypes
PathBase
Bases: BaseModel
Base class for Path object
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
The path string |
site_id |
uuid
|
unique identifier of the site associated with it (optional) |
site_name |
str
|
name of the site associated with it (optional) |
Source code in cascade_cms/cmstypes.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
Path
Bases: PathBase
Represents a Path object that can be called directly. Substitution for TypeIdentifers with asset id Attributes: asset_type (AssetTypes): (Required) the type of the asset
Source code in cascade_cms/cmstypes.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
SimplePayload
Bases: BaseModel
Base class for Cascade CMS Payloads: Payloads are containers for specific Cascade operations that accept inputs
Source code in cascade_cms/cmstypes.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
format_builder()
Wraps proper headers around payload data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
handler
|
SerializerFunctionWrapHandler
|
Pydantic validation function |
required |
Returns:
| Type | Description |
|---|---|
dict
|
dict[str,object]: serialized wrapped inSerializerFunctionWrapHandler the inherit class name |
dict
|
```python |
dict
|
{ "searchInformation"{ ... } |
dict
|
} |
dict
|
``` |
Source code in cascade_cms/cmstypes.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
NewAsset
Bases: SimplePayload
Payload for the create operation.
Requires exactly one of site_name/site_id and exactly one of
parent_folder_path/parent_folder_id (enforced by
_check_required_alternatives). Extra fields are allowed and passed
through, since asset-type-specific properties vary per asset_type.
Source code in cascade_cms/cmstypes.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
serialize_as_asset(handler)
Cascade expects {"asset": {"
Source code in cascade_cms/cmstypes.py
365 366 367 368 369 370 371 | |
IdentifierType
Bases: BaseModel
Resolved reference to a Cascade asset: its UUID, type, and optional path info.
This is the "id-based" counterpart to Path (which references an
asset by site + path string instead); see resolve_identifier.
Source code in cascade_cms/cmstypes.py
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | |
AssetLogIdentifier
Bases: NamedTuple
Unvalidated (id, raw_type) pair used only to label an edit
request/chain for logging.
Not an IdentifierType substitute for URL-building: edit()'s request
has no type/id URL segment (see Chain._build_edit_requests), so this
only needs to satisfy the duck-typed get_id/get_type/get_path
surface that RequestExecutor.log_key and ChainLineBuilder.start
read for naming verbose-mode log files/lines.
Source code in cascade_cms/cmstypes.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
ReadOnlyPageConfigError
Bases: AttributeError
Raised on any attempt to modify a PageConfiguration or PageRegion.
Source code in cascade_cms/cmstypes.py
534 535 | |
PageRegion
Read-only snapshot of one region of a page configuration.
Cascade ignores region edits sent through a page's edit(); regions can
only be changed on the template asset. Any assignment or deletion raises
ReadOnlyPageConfigError, and nothing here is ever written back to the
asset.
Do not trust Cascade's noBlock/noFormat flags: they have been observed
as false on regions with no blockId/blockPath or formatId/
formatPath. Check the ids/paths themselves.
Source code in cascade_cms/cmstypes.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
PageConfiguration
Read-only snapshot of one page configuration (e.g. ASPX, XML).
Edit configurations on the pageConfigurationSet asset and regions on the
template asset. Any assignment or deletion raises
ReadOnlyPageConfigError. See PageRegion for why Cascade's own flags
must not be trusted.
Source code in cascade_cms/cmstypes.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | |
workflowInformation
Bases: BaseModel
Response from the readWorkflowInformation operation, describing an
asset's active workflow instance and its steps/actions.
Source code in cascade_cms/cmstypes.py
729 730 731 732 733 734 735 736 737 738 739 740 741 742 | |
Asset
Dynamic wrapper around a raw Cascade asset JSON payload.
Cascade asset payloads have the shape {"asset": {"<type>": {...}}}
with a structure that varies per asset type, so unlike the Pydantic
models above this is a thin dict-backed wrapper rather than a fixed
schema: _data holds the inner {...} dict by reference, and
__setattr__ only enforces that an existing field keeps its Python
type when reassigned (it does not validate against a schema).
pageConfigurations, if present, is parsed into PageConfiguration
models up front (failing fast on a malformed one) for access via
get_page_configuration. Those views are read-only snapshots: region
and configuration edits are not sent on edit().
Source code in cascade_cms/cmstypes.py
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | |
internal_type
property
The raw Cascade response wrapper key, lowercased.
Not a validated AssetTypes value — Cascade's wrapper key doesn't
always match the request-side type (e.g. "scriptformat" for a
format/format_SCRIPT asset). This is only ever round-tripped back
into a request body (see AssetAdapter.dump_json), which is why no
normalization happens here; callers that need a validated
AssetTypes must supply/derive one themselves.
get_data_structure(group, identifier, *, direct=False)
Find nodes matching identifier within all instances of a group. Returns first match per group instance as a list of node objects by reference. Raises KeyError if required fields (identifier, structuredDataNodes) are missing.
group is a str, which is exactly one group identifier (dots are part
of the identifier, e.g. "v1.0"), or a tuple of identifiers, a path
ending at the group (("accordion", "row")). A bare identifier matches
every group with that identifier, wherever it sits. A tuple matches
only groups whose chain of enclosing groups ends with those parts, so
("accordion", "row") skips a row under tabs. A list is rejected
(TypeError); an empty tuple or an empty/non-str part raises ValueError.
By default the search inside each matched group is depth-first and
descends into nested groups, so a group that lacks identifier
itself can match a field of a nested group. Returns None when nothing
matches.
With direct=True only the matched group's own leaf children are
checked and nested groups are never entered. A group instance without
the field directly is skipped, and the result is None when no
instance has it, as in the default mode.
Prefer direct=True with a tuple path. The default search can return
a nested group's field instead of the group's own (when the nested
group comes first, or the group lacks the field), and the result
count cannot reveal it.
Source code in cascade_cms/cmstypes.py
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 | |
get_page_configuration(configuration_name, page_region=None)
get_page_configuration(configuration_name: str, page_region: None = None) -> PageConfiguration | None
get_page_configuration(configuration_name: str, page_region: str) -> PageRegion | None
Find a page configuration and optionally a specific region within it.
The returned models are read-only snapshots of the asset's current
data, rebuilt on every call. Assigning to them (or to
pageConfigurations) raises ReadOnlyPageConfigError: Cascade ignores
region edits sent through edit(). Edit configurations on the
pageConfigurationSet asset and regions on the template asset.
Do not trust Cascade's noBlock/noFormat flags; they can read
false on regions with no block/format ids or paths. A misspelled
name returns None. Raises pydantic ValidationError if the raw data is
malformed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
configuration_name
|
str
|
The 'name' of the configuration e.g. 'ASPX', 'XML' |
required |
page_region
|
str | None
|
The 'name' of the page region e.g. 'DEFAULT', 'FOOTER' (optional) |
None
|
Returns:
| Type | Description |
|---|---|
PageConfiguration | PageRegion | None
|
|
PageConfiguration | PageRegion | None
|
|
PageConfiguration | PageRegion | None
|
|
Source code in cascade_cms/cmstypes.py
949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | |
root_container_id(asset_type)
Return the root container id for asset_type on this site asset.
self must be a site asset. Returns None if there's no known root
field for asset_type (see _ROOT_CONTAINER_FIELDS).
Source code in cascade_cms/cmstypes.py
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | |
Message
Bases: SimplePayload
A Cascade inbox message, also used as the payload for mark/delete-message operations.
Source code in cascade_cms/cmstypes.py
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 | |
CheckedOutAsset
Bases: BaseModel
Response from the checkOut operation, referencing the new working copy.
Source code in cascade_cms/cmstypes.py
1041 1042 1043 1044 1045 1046 | |
ListElements
Bases: BaseModel
Response container for list-shaped endpoints (search, listSites, listMessages,
readAudits, listSubscribers), whose JSON key varies by endpoint but is always
aliased into elements via AliasChoices.
Source code in cascade_cms/cmstypes.py
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | |
CascadeError
Bases: BaseModel
Represents a Cascade API-level failure response ({"success": false, "message": ...}).
Source code in cascade_cms/cmstypes.py
1071 1072 1073 1074 1075 1076 | |
CascadeSuccess
Bases: BaseModel
Represents a Cascade API-level success response with no further data ({"success": true}).
Source code in cascade_cms/cmstypes.py
1079 1080 1081 1082 1083 | |
SearchInformation
Bases: SimplePayload
Payload for the search operation.
Source code in cascade_cms/cmstypes.py
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 | |
preference
Bases: SimplePayload
Payload for the editPreference operation (a single user preference name/value).
Source code in cascade_cms/cmstypes.py
1104 1105 1106 1107 1108 | |
deleteParameters
Bases: SimplePayload
Payload for the delete operation.
Source code in cascade_cms/cmstypes.py
1111 1112 1113 1114 1115 1116 | |
copyParameters
Bases: SimplePayload
Payload for the copy operation.
Source code in cascade_cms/cmstypes.py
1119 1120 1121 1122 1123 1124 1125 1126 | |
moveParameters
Bases: SimplePayload
Payload for the move operation.
Source code in cascade_cms/cmstypes.py
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 | |
publishInformation
Bases: SimplePayload
Payload for the publish operation.
Source code in cascade_cms/cmstypes.py
1141 1142 1143 1144 | |
Comment
Bases: SimplePayload
Payload for the checkIn operation (a check-in comment).
Source code in cascade_cms/cmstypes.py
1147 1148 1149 1150 | |
SiteCopyParameter
Bases: SimplePayload
Payload for the siteCopy operation.
Source code in cascade_cms/cmstypes.py
1153 1154 1155 1156 1157 | |
workflowTransitionInformation
Bases: SimplePayload
Payload for the performWorkflowTransition operation.
Source code in cascade_cms/cmstypes.py
1160 1161 1162 1163 1164 1165 | |
auditParameters
Bases: SimplePayload
Payload for the readAudits operation.
Source code in cascade_cms/cmstypes.py
1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 | |
AssetAdapter
Drop-in counterpart to TypeAdapter for Asset objects.
Mirrors TypeAdapter's validate_json / dump_json interface so callers never need isinstance checks to decide how to serialize/deserialize.
Source code in cascade_cms/cmstypes.py
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 | |
ResponseParser
Bases: BaseModel
Parses a raw response body, trying CascadeError first and falling
back to serializer on the expected success shape.
_content holds the parsed result (either a CascadeError or a T).
Source code in cascade_cms/cmstypes.py
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 | |
reformat_name(class_name)
Lowercase the first letter of a class name (e.g. "NewAsset" -> "newAsset").
Source code in cascade_cms/cmstypes.py
181 182 183 184 185 | |
set_checkedout(key)
Toggle a checkout-segment key in the local checkout ledger.
Called once per checkIn/checkOut operation queued, so calling it twice for the same key (once on checkOut, once on the matching checkIn) flips it back out again rather than accumulating duplicates.
Source code in cascade_cms/cmstypes.py
188 189 190 191 192 193 194 195 196 197 198 | |
resolve_identifier(identifier)
Returns the URL path segments (after the operation name) identifying this asset.
IdentifierType resolves to (asset_type, id). Path resolves to
(asset_type, siteName, path), matching the REST endpoint shape
.../{operation_name}/{asset_type}/{siteName}/{path}.
Source code in cascade_cms/cmstypes.py
474 475 476 477 478 479 480 481 482 483 484 485 | |
edit_log_identifier_from_asset(asset)
Build the (id, raw_type) label edit() reports itself under in logs.
Uses Asset.internal_type (the raw response wrapper key) rather than a
validated AssetTypes value, since this is never used to build a
request URL — only to name/label verbose-mode logs.
Source code in cascade_cms/cmstypes.py
515 516 517 518 519 520 521 522 523 524 525 | |
serialize_payload(payload)
Serialize a request payload to JSON bytes, dispatching by payload type.
Source code in cascade_cms/cmstypes.py
1265 1266 1267 1268 1269 1270 1271 | |
parse_assets(raw)
Parse a read response body into an Asset.
Source code in cascade_cms/cmstypes.py
1305 1306 1307 1308 | |
parse_list_elements(raw)
Parse a list-shaped response body (search, listSites, etc.) into ListElements.
Source code in cascade_cms/cmstypes.py
1311 1312 1313 1314 | |
parse_payloads(raw)
Parse a generic response body into the appropriate SimplePayload subclass.
Source code in cascade_cms/cmstypes.py
1317 1318 1319 | |
parse_create_asset(raw, pass_type)
Parse a create response, rebuilding an IdentifierType from createdAssetId.
Cascade's create response only returns the new asset's id, not its
type, so pass_type (the asset_type from the original create
payload, bound via functools.partial in Operations.create) is
injected to reconstruct a full IdentifierType.
Source code in cascade_cms/cmstypes.py
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 | |
parse_access_rights(raw)
Parse a readAccessRights response body.
Source code in cascade_cms/cmstypes.py
1344 1345 1346 | |
parse_workflow_settings(raw)
Parse a readWorkflowSettings response body.
Source code in cascade_cms/cmstypes.py
1349 1350 1351 | |
parse_checked_out_asset(raw)
Parse a checkOut response body.
Source code in cascade_cms/cmstypes.py
1354 1355 1356 | |
parse_workflow_information(raw)
Parse a readWorkflowInformation response body.
Source code in cascade_cms/cmstypes.py
1359 1360 1361 | |
parse_success(raw)
Parse a bare {"success": true} response body from a write operation.
Source code in cascade_cms/cmstypes.py
1364 1365 1366 | |