Skip to content

Commit

Permalink
Add new properties to Audit Logs API response type
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Mar 2, 2022
1 parent d0db05a commit fde7bfd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions slack_sdk/audit_logs/v1/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ class Details:
who_can_post: Optional[ConversationPref]
can_thread: Optional[ConversationPref]
is_external_limited: Optional[bool]
exporting_team_id: Optional[int]
session_search_start: Optional[int]
deprecation_search_end: Optional[int]
is_error: Optional[bool]

def __init__(
self,
Expand Down Expand Up @@ -240,6 +244,10 @@ def __init__(
who_can_post: Optional[Union[Dict[str, List[str]], ConversationPref]] = None,
can_thread: Optional[Union[Dict[str, List[str]], ConversationPref]] = None,
is_external_limited: Optional[bool] = None,
exporting_team_id: Optional[int] = None,
session_search_start: Optional[int] = None,
deprecation_search_end: Optional[int] = None,
is_error: Optional[bool] = None,
**kwargs,
) -> None:
self.name = name
Expand Down Expand Up @@ -317,6 +325,10 @@ def __init__(
else ConversationPref(**can_thread)
)
self.is_external_limited = is_external_limited
self.exporting_team_id = exporting_team_id
self.session_search_start = session_search_start
self.deprecation_search_end = deprecation_search_end
self.is_error = is_error


class App:
Expand Down
4 changes: 3 additions & 1 deletion tests/slack_sdk/audit_logs/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def test_logs_complete(self):
self.assertEqual(entry.details.can_thread.type, ["admin", "org_admin"])
self.assertEqual(entry.details.can_thread.user, ["W222"])
self.assertEqual(entry.details.is_external_limited, True)
self.assertEqual(entry.details.exporting_team_id, 1134128598372)


logs_response_data = """{
Expand Down Expand Up @@ -359,7 +360,8 @@ def test_logs_complete(self):
"W222"
]
},
"is_external_limited": true
"is_external_limited": true,
"exporting_team_id": 1134128598372
}
}
]
Expand Down

0 comments on commit fde7bfd

Please sign in to comment.