///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///
/// Auto-generated by Stone, do not modify.
///

/// Routes for the team_log namespace
open class TeamLogRoutes {
    open let client: DropboxTransportClient
    init(client: DropboxTransportClient) {
        self.client = client
    }

    /// 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.
    ///
    /// - parameter limit: Number of results to return per call.
    /// - parameter accountId: Filter the events by account ID. Return ony events with this account_id as either Actor,
    /// Context, or Participants.
    /// - parameter time: Filter by time range.
    /// - parameter category: Filter the returned events to a single category.
    ///
    ///  - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on
    /// success or a `TeamLog.GetTeamEventsError` object on failure.
    @discardableResult open func getEvents(limit: UInt32 = 1000, accountId: String? = nil, time: TeamCommon.TimeRange? = nil, category: TeamLog.EventCategory? = nil) -> RpcRequest<TeamLog.GetTeamEventsResultSerializer, TeamLog.GetTeamEventsErrorSerializer> {
        let route = TeamLog.getEvents
        let serverArgs = TeamLog.GetTeamEventsArg(limit: limit, accountId: accountId, time: time, category: category)
        return client.request(route, serverArgs: serverArgs)
    }

    /// Once a cursor has been retrieved from getEvents, use this to paginate through all events. Permission : Team
    /// Auditing.
    ///
    /// - parameter cursor: Indicates from what point to get the next set of events.
    ///
    ///  - returns: Through the response callback, the caller will receive a `TeamLog.GetTeamEventsResult` object on
    /// success or a `TeamLog.GetTeamEventsContinueError` object on failure.
    @discardableResult open func getEventsContinue(cursor: String) -> RpcRequest<TeamLog.GetTeamEventsResultSerializer, TeamLog.GetTeamEventsContinueErrorSerializer> {
        let route = TeamLog.getEventsContinue
        let serverArgs = TeamLog.GetTeamEventsContinueArg(cursor: cursor)
        return client.request(route, serverArgs: serverArgs)
    }

}
