Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions dropbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4184,71 +4184,6 @@ def sharing_update_folder_policy(self,
)
return r

# ------------------------------------------
# Routes in team_log namespace

def team_log_get_events(self,
limit=1000,
account_id=None,
time=None,
category=None):
"""
Retrieves team events. Events have a lifespan of two years. Events older
than two years will not be returned. Many attributes note 'may be
missing due to historical data gap'. Note that the file_operations
category and & analogous paper events are not available on all Dropbox
Business `plans </business/plans-comparison>`_. Use `features/get_values
</developers/documentation/http/teams#team-features-get_values>`_ to
check for this feature. Permission : Team Auditing.

:param long limit: Number of results to return per call.
:param Nullable account_id: Filter the events by account ID. Return ony
events with this account_id as either Actor, Context, or
Participants.
:param Nullable time: Filter by time range.
:param Nullable category: Filter the returned events to a single
category.
:rtype: :class:`dropbox.team_log.GetTeamEventsResult`
:raises: :class:`.exceptions.ApiError`

If this raises, ApiError will contain:
:class:`dropbox.team_log.GetTeamEventsError`
"""
arg = team_log.GetTeamEventsArg(limit,
account_id,
time,
category)
r = self.request(
team_log.get_events,
'team_log',
arg,
None,
)
return r

def team_log_get_events_continue(self,
cursor):
"""
Once a cursor has been retrieved from :meth:`team_log_get_events`, use
this to paginate through all events. Permission : Team Auditing.

:param str cursor: Indicates from what point to get the next set of
events.
:rtype: :class:`dropbox.team_log.GetTeamEventsResult`
:raises: :class:`.exceptions.ApiError`

If this raises, ApiError will contain:
:class:`dropbox.team_log.GetTeamEventsContinueError`
"""
arg = team_log.GetTeamEventsContinueArg(cursor)
r = self.request(
team_log.get_events_continue,
'team_log',
arg,
None,
)
return r

# ------------------------------------------
# Routes in users namespace

Expand Down
65 changes: 65 additions & 0 deletions dropbox/base_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,3 +1686,68 @@ def team_token_get_authenticated_admin(self):
)
return r

# ------------------------------------------
# Routes in team_log namespace

def team_log_get_events(self,
limit=1000,
account_id=None,
time=None,
category=None):
"""
Retrieves team events. Events have a lifespan of two years. Events older
than two years will not be returned. Many attributes note 'may be
missing due to historical data gap'. Note that the file_operations
category and & analogous paper events are not available on all Dropbox
Business `plans </business/plans-comparison>`_. Use `features/get_values
</developers/documentation/http/teams#team-features-get_values>`_ to
check for this feature. Permission : Team Auditing.

:param long limit: Number of results to return per call.
:param Nullable account_id: Filter the events by account ID. Return ony
events with this account_id as either Actor, Context, or
Participants.
:param Nullable time: Filter by time range.
:param Nullable category: Filter the returned events to a single
category.
:rtype: :class:`dropbox.team_log.GetTeamEventsResult`
:raises: :class:`.exceptions.ApiError`

If this raises, ApiError will contain:
:class:`dropbox.team_log.GetTeamEventsError`
"""
arg = team_log.GetTeamEventsArg(limit,
account_id,
time,
category)
r = self.request(
team_log.get_events,
'team_log',
arg,
None,
)
return r

def team_log_get_events_continue(self,
cursor):
"""
Once a cursor has been retrieved from :meth:`team_log_get_events`, use
this to paginate through all events. Permission : Team Auditing.

:param str cursor: Indicates from what point to get the next set of
events.
:rtype: :class:`dropbox.team_log.GetTeamEventsResult`
:raises: :class:`.exceptions.ApiError`

If this raises, ApiError will contain:
:class:`dropbox.team_log.GetTeamEventsContinueError`
"""
arg = team_log.GetTeamEventsContinueArg(cursor)
r = self.request(
team_log.get_events_continue,
'team_log',
arg,
None,
)
return r

19 changes: 17 additions & 2 deletions generate_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
help='Path to clone of stone repository.',
)

# List of namespaces for business endpoints
TEAM_NAMESPACES = [
'team',
'team_common',
'team_log',
'team_policies',
]

def main():
"""The entry point for the program."""
Expand Down Expand Up @@ -66,16 +73,24 @@ def main():

if verbose:
print('Generating Python client')

blacklist_namespace_args = []
for namespace in TEAM_NAMESPACES:
blacklist_namespace_args.extend(('-b', namespace))
o = subprocess.check_output(
(['python', '-m', 'stone.cli', 'python_client', dropbox_pkg_path] +
specs + ['-a', 'host', '-a', 'style', '-b', 'team'] +
specs + ['-a', 'host', '-a', 'style'] + blacklist_namespace_args +
['--', '-m', 'base', '-c', 'DropboxBase', '-t', 'dropbox']),
cwd=stone_path)
if o:
print('Output:', o)

whitelist_namespace_args = []
for namespace in TEAM_NAMESPACES:
whitelist_namespace_args.extend(('-w', namespace))
o = subprocess.check_output(
(['python', '-m', 'stone.cli', 'python_client', dropbox_pkg_path] +
specs + ['-a', 'host', '-a', 'style', '-w', 'team'] +
specs + ['-a', 'host', '-a', 'style'] + whitelist_namespace_args +
['--', '-m', 'base_team', '-c', 'DropboxTeamBase', '-t', 'dropbox']),
cwd=stone_path)
if o:
Expand Down