@@ -21,8 +21,8 @@ class MetadataTemplateFieldsTypeField(str, Enum):
2121 DATE = 'date'
2222 ENUM = 'enum'
2323 MULTISELECT = 'multiSelect'
24- INTEGER = 'integer'
2524 TAXONOMY = 'taxonomy'
25+ INTEGER = 'integer'
2626
2727
2828class MetadataTemplateFieldsOptionsField (BaseObject ):
@@ -39,13 +39,50 @@ def __init__(self, key: str, *, id: Optional[str] = None, **kwargs):
3939 self .id = id
4040
4141
42+ class MetadataTemplateFieldsOptionsRulesField (BaseObject ):
43+ _fields_to_json_mapping : Dict [str , str ] = {
44+ 'multi_select' : 'multiSelect' ,
45+ 'selectable_levels' : 'selectableLevels' ,
46+ ** BaseObject ._fields_to_json_mapping ,
47+ }
48+ _json_to_fields_mapping : Dict [str , str ] = {
49+ 'multiSelect' : 'multi_select' ,
50+ 'selectableLevels' : 'selectable_levels' ,
51+ ** BaseObject ._json_to_fields_mapping ,
52+ }
53+
54+ def __init__ (
55+ self ,
56+ * ,
57+ multi_select : Optional [bool ] = None ,
58+ selectable_levels : Optional [List [int ]] = None ,
59+ ** kwargs
60+ ):
61+ """
62+ :param multi_select: Whether to allow users to select multiple values., defaults to None
63+ :type multi_select: Optional[bool], optional
64+ :param selectable_levels: An array of integers defining which levels of the taxonomy are
65+ selectable by users., defaults to None
66+ :type selectable_levels: Optional[List[int]], optional
67+ """
68+ super ().__init__ (** kwargs )
69+ self .multi_select = multi_select
70+ self .selectable_levels = selectable_levels
71+
72+
4273class MetadataTemplateFieldsField (BaseObject ):
4374 _fields_to_json_mapping : Dict [str , str ] = {
4475 'display_name' : 'displayName' ,
76+ 'taxonomy_key' : 'taxonomyKey' ,
77+ 'taxonomy_id' : 'taxonomyId' ,
78+ 'options_rules' : 'optionsRules' ,
4579 ** BaseObject ._fields_to_json_mapping ,
4680 }
4781 _json_to_fields_mapping : Dict [str , str ] = {
4882 'displayName' : 'display_name' ,
83+ 'taxonomyKey' : 'taxonomy_key' ,
84+ 'taxonomyId' : 'taxonomy_id' ,
85+ 'optionsRules' : 'options_rules' ,
4986 ** BaseObject ._json_to_fields_mapping ,
5087 }
5188 _discriminator = 'type' , {
@@ -54,8 +91,8 @@ class MetadataTemplateFieldsField(BaseObject):
5491 'date' ,
5592 'enum' ,
5693 'multiSelect' ,
57- 'integer' ,
5894 'taxonomy' ,
95+ 'integer' ,
5996 }
6097
6198 def __init__ (
@@ -67,6 +104,10 @@ def __init__(
67104 description : Optional [str ] = None ,
68105 hidden : Optional [bool ] = None ,
69106 options : Optional [List [MetadataTemplateFieldsOptionsField ]] = None ,
107+ taxonomy_key : Optional [str ] = None ,
108+ taxonomy_id : Optional [str ] = None ,
109+ namespace : Optional [str ] = None ,
110+ options_rules : Optional [MetadataTemplateFieldsOptionsRulesField ] = None ,
70111 id : Optional [str ] = None ,
71112 ** kwargs
72113 ):
@@ -76,9 +117,12 @@ def __init__(
76117 date-time picker.
77118
78119 Additionally, metadata templates support an `enum` field for a basic list
79- of items, and ` multiSelect` field for a similar list of items where the
120+ of items, and `multiSelect` field for a similar list of items where the
80121 user can select more than one value.
81122
123+ Metadata taxonomies are also supported as a `taxonomy` field type
124+ with a specific set of additional properties, which describe its structure.
125+
82126 **Note**: The `integer` value is deprecated.
83127 It is still present in the response,
84128 but cannot be used in the POST request.
@@ -97,6 +141,18 @@ def __init__(
97141 :param options: A list of options for this field. This is used in combination
98142 with the `enum` and `multiSelect` field types., defaults to None
99143 :type options: Optional[List[MetadataTemplateFieldsOptionsField]], optional
144+ :param taxonomy_key: The unique key of the metadata taxonomy to use for this taxonomy field.
145+ This property is required when the field `type` is set to `taxonomy`., defaults to None
146+ :type taxonomy_key: Optional[str], optional
147+ :param taxonomy_id: The unique ID of the metadata taxonomy to use for this taxonomy field.
148+ This property is required when the field `type` is set to `taxonomy`., defaults to None
149+ :type taxonomy_id: Optional[str], optional
150+ :param namespace: The namespace of the metadata taxonomy to use for this taxonomy field.
151+ This property is required when the field `type` is set to `taxonomy`., defaults to None
152+ :type namespace: Optional[str], optional
153+ :param options_rules: An object defining additional rules for the options of the taxonomy field.
154+ This property is required when the field `type` is set to `taxonomy`., defaults to None
155+ :type options_rules: Optional[MetadataTemplateFieldsOptionsRulesField], optional
100156 :param id: The unique ID of the metadata template field., defaults to None
101157 :type id: Optional[str], optional
102158 """
@@ -107,6 +163,10 @@ def __init__(
107163 self .description = description
108164 self .hidden = hidden
109165 self .options = options
166+ self .taxonomy_key = taxonomy_key
167+ self .taxonomy_id = taxonomy_id
168+ self .namespace = namespace
169+ self .options_rules = options_rules
110170 self .id = id
111171
112172
0 commit comments