2222
2323from box_sdk_gen .schemas .legal_hold_policy_assignment import LegalHoldPolicyAssignment
2424
25+ from box_sdk_gen .schemas .legal_hold_policy_assignment_filter_field import (
26+ LegalHoldPolicyAssignmentFilterField ,
27+ )
28+
2529from box_sdk_gen .schemas .files_on_hold import FilesOnHold
2630
2731from box_sdk_gen .box .errors import BoxSDKError
@@ -52,6 +56,7 @@ class GetLegalHoldPolicyAssignmentsAssignToType(str, Enum):
5256 USER = 'user'
5357 OWNERSHIP = 'ownership'
5458 INTERACTIONS = 'interactions'
59+ METADATA_TEMPLATE = 'metadata_template'
5560
5661
5762class CreateLegalHoldPolicyAssignmentAssignToTypeField (str , Enum ):
@@ -61,6 +66,7 @@ class CreateLegalHoldPolicyAssignmentAssignToTypeField(str, Enum):
6166 USER = 'user'
6267 OWNERSHIP = 'ownership'
6368 INTERACTIONS = 'interactions'
69+ METADATA_TEMPLATE = 'metadata_template'
6470
6571
6672class CreateLegalHoldPolicyAssignmentAssignTo (BaseObject ):
@@ -71,6 +77,7 @@ class CreateLegalHoldPolicyAssignmentAssignTo(BaseObject):
7177 'user' ,
7278 'ownership' ,
7379 'interactions' ,
80+ 'metadata_template' ,
7481 }
7582
7683 def __init__ (
@@ -176,20 +183,27 @@ def create_legal_hold_policy_assignment(
176183 policy_id : str ,
177184 assign_to : CreateLegalHoldPolicyAssignmentAssignTo ,
178185 * ,
186+ filter_fields : Optional [List [LegalHoldPolicyAssignmentFilterField ]] = None ,
179187 extra_headers : Optional [Dict [str , Optional [str ]]] = None
180188 ) -> LegalHoldPolicyAssignment :
181189 """
182- Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions .
190+ Assign a legal hold to an item type of: file, file version, folder, user, ownership, interactions, or metadata template .
183191 :param policy_id: The ID of the policy to assign.
184192 :type policy_id: str
185193 :param assign_to: The item to assign the policy to.
186194 :type assign_to: CreateLegalHoldPolicyAssignmentAssignTo
195+ :param filter_fields: List of metadata template field filters. Only required when `assign_to.type` is `metadata_template`., defaults to None
196+ :type filter_fields: Optional[List[LegalHoldPolicyAssignmentFilterField]], optional
187197 :param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
188198 :type extra_headers: Optional[Dict[str, Optional[str]]], optional
189199 """
190200 if extra_headers is None :
191201 extra_headers = {}
192- request_body : Dict = {'policy_id' : policy_id , 'assign_to' : assign_to }
202+ request_body : Dict = {
203+ 'policy_id' : policy_id ,
204+ 'assign_to' : assign_to ,
205+ 'filter_fields' : filter_fields ,
206+ }
193207 headers_map : Dict [str , str ] = prepare_params ({** extra_headers })
194208 response : FetchResponse = self .network_session .network_client .fetch (
195209 FetchOptions (
0 commit comments