harbor run -t openthoughts/tasktrove-mix-h8-original-tests-v2-mix-h8-original-3753harbor download openthoughts/tasktrove-mix-h8-original-tests-v2-mix-h8-original-3753Task: Implement a lightweight SparkPost client in /app/sparkpost.py
Goal: Create a Python module that provides a minimal SparkPost API client capable of fetching metric data for campaigns and domains, matching the behavior exercised by the provided tests.
What to implement
A top-level class SparkPost
Metrics grouping with two endpoints:
sp.metrics.campaigns.list() should perform a GET request to: https://api.sparkpost.com/api/v1/metrics/campaigns and return the list located at json["results"]["campaigns"].
sp.metrics.domains.list() should perform a GET request to: https://api.sparkpost.com/api/v1/metrics/domains and return the list located at json["results"]["domains"].
Implementation notes (to guide the agent)
Outcome A self-contained SparkPost client module located at /app/sparkpost.py that passes the provided pytest suite by correctly handling success and failure cases for campaigns and domains metrics.