class Logs:
    def __init__(self, client):
        self.client = client

    def list(self, limit=50, skip=0, action=None, resource=None, start_date=None, end_date=None, search=None):
        params = {"limit": limit, "skip": skip}
        if action:
            params["action"] = action
        if resource:
            params["resource"] = resource
        if start_date:
            params["startDate"] = start_date
        if end_date:
            params["endDate"] = end_date
        if search:
            params["search"] = search
        return self.client.request("GET", "/logs", params=params)

    def get_stats(self, days=7):
        return self.client.request("GET", "/logs/stats", params={"days": days})

    def export(self, start_date=None, end_date=None):
        params = {}
        if start_date:
            params["startDate"] = start_date
        if end_date:
            params["endDate"] = end_date
        return self.client.request("GET", "/logs/export", params=params)
