-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconstants.py
More file actions
43 lines (35 loc) · 1.77 KB
/
constants.py
File metadata and controls
43 lines (35 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import ipaddress
import re
PROPERTIES_FLAG = ["is_protected", "updated_at"]
PROPERTIES_OBJECT = ["source", "owner"]
# Attribute-level metadata object fields (in addition to PROPERTIES_OBJECT)
ATTRIBUTE_METADATA_OBJECT = ["updated_by"]
# Node metadata fields (for node_metadata in GraphQL response)
NODE_METADATA_FIELDS_FLAG = ["created_at", "updated_at"]
NODE_METADATA_FIELDS_OBJECT = ["created_by", "updated_by"]
# Relationship metadata fields (for relationship_metadata in GraphQL response)
RELATIONSHIP_METADATA_FIELDS_FLAG = ["updated_at"]
RELATIONSHIP_METADATA_FIELDS_OBJECT = ["updated_by"]
SAFE_VALUE = re.compile(r"(^[\. /:a-zA-Z0-9_-]+$)|(^$)")
IP_TYPES = ipaddress.IPv4Interface | ipaddress.IPv6Interface | ipaddress.IPv4Network | ipaddress.IPv6Network
ARTIFACT_FETCH_FEATURE_NOT_SUPPORTED_MESSAGE = (
"calling artifact_fetch is only supported for nodes that are Artifact Definition target"
)
ARTIFACT_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE = (
"calling artifact_generate is only supported for nodes that are Artifact Definition targets"
)
ARTIFACT_DEFINITION_GENERATE_FEATURE_NOT_SUPPORTED_MESSAGE = (
"calling generate is only supported for CoreArtifactDefinition nodes"
)
FILE_DOWNLOAD_FEATURE_NOT_SUPPORTED_MESSAGE = (
"calling download_file is only supported for nodes that inherit from CoreFileObject"
)
MATCHES_LOCAL_CHECKSUM_FEATURE_NOT_SUPPORTED_MESSAGE = (
"calling matches_local_checksum is only supported for nodes that inherit from CoreFileObject"
)
UPLOAD_IF_CHANGED_FEATURE_NOT_SUPPORTED_MESSAGE = (
"calling upload_if_changed is only supported for nodes that inherit from CoreFileObject"
)
HIERARCHY_FETCH_FEATURE_NOT_SUPPORTED_MESSAGE = "Hierarchical fields are not supported for this node."
HFID_STR_SEPARATOR = "__"
PROFILE_KIND_PREFIX = "Profile"