Skip to content

Commit

Permalink
Fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 committed Feb 28, 2023
1 parent d1320ae commit ede1aa1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion boxsdk/object/retention_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ def get_url(self, *args: Any) -> str:
def assign(
self,
assignee: Union['Folder', 'Enterprise', 'MetadataTemplate'],
fields: Iterable[str] = None
fields: Iterable[str] = None,
start_date_field: Optional[str] = None,
) -> 'RetentionPolicyAssignment':
"""Assign a retention policy to a Box item
:param assignee:
The item to assign the retention policy on.
:param fields:
List of fields to request.
:param start_date_field:
The date the retention policy assignment begins.
If the assigned_to type is metadata_template, this field can be a date field's metadata attribute key id.
:returns:
A :class:`RetentionPolicyAssignment` object.
"""
Expand All @@ -48,6 +52,8 @@ def assign(
params = {}
if fields is not None:
params['fields'] = ','.join(fields)
if start_date_field is not None:
body['start_date_field'] = start_date_field
response = self._session.post(url, data=json.dumps(body), params=params).json()
return self.translator.translate(
session=self._session,
Expand Down

0 comments on commit ede1aa1

Please sign in to comment.