-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement support for async activities export #43
Conversation
This pull request has been linked to Clubhouse Story #32313: Go async export. |
metrics_activities_exports.go
Outdated
} | ||
|
||
// NewMetricsActivitiesExport is the POST-ed to create a MetricsActivitiesExport . | ||
type NewMetricsActivitiesExport struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to avoid struct name starting with New
. You can use CreateMetricsActivitiesExportParam
.
metrics_activities_exports_test.go
Outdated
AccountToken: "token", | ||
AccessKey: "key", | ||
} | ||
activities_export, err := tested.MetricsCreateActivitiesExport(&NewMetricsActivitiesExport{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use underscores in Go names; var activities_export should be activitiesExport
@@ -0,0 +1,51 @@ | |||
package chartmogul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code does not pass gofmt in 1 place. Go fmt your code!
May be some whitespace issue. Try formatting with gofmt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, done!
metrics_activities_exports_test.go
Outdated
AccessKey: "key", | ||
} | ||
|
||
var activitiesExportId = "7f554dba-4a41-4cb2-9790-2045e4c3a5b1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var activitiesExportId = "7f554dba-4a41-4cb2-9790-2045e4c3a5b1" | |
var activitiesExportID = "7f554dba-4a41-4cb2-9790-2045e4c3a5b1" |
This PR provides support for a new async activities export with optional params for start date, end date and activity type.
Initially, the export will have the status
pending
and anil
file_url. After a period of time, the async job will complete and the status will update toprocessing
and thensucceeded
orfailed
. In the case ofsucceeded
, thefile_url
will be populated with the url with the zipped activities export.A user of the client library could schedule a job with the ID of the export, so they can periodically check it until it reaches
succeeded
orfailed
.If you have the uuid of the export, you can retrieve it via: