Skip to content

Commit

Permalink
Updated audit logs API (#151)
Browse files Browse the repository at this point in the history
* COR-29935: Updated audit logs API

* COR-29935: Updated paginated audit logs API
  • Loading branch information
dean-ab authored Jan 7, 2024
1 parent f49043f commit e4da969
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion fireblocks_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ def get_off_exchanges(self):

return self._get_request(url)

def get_audit_logs(self, time_period: TimePeriod):
def get_audit_logs(self, time_period: TimePeriod = TimePeriod.DAY):
"""
Get audit logs
:param time_period: The last time period to fetch audit logs
Expand All @@ -2298,6 +2298,23 @@ def get_audit_logs(self, time_period: TimePeriod):
url = "/v1/audits"

return self._get_request(url, query_params={"timePeriod": time_period.value})

def get_paginated_audit_logs(self, time_period: TimePeriod = TimePeriod.DAY, cursor = None):
"""
Get paginated audit logs
:param time_period: The last time period to fetch audit logs
:param cursor: The next id to fetch audit logs from
"""
url = "/v1/management/audit_logs"
params = {}

if cursor:
params["cursor"] = cursor

if time_period:
params["timePeriod"] = time_period.value

return self._get_request(url, query_params=params)

def get_off_exchange_by_id(self, off_exchange_id):
"""
Expand Down

0 comments on commit e4da969

Please sign in to comment.