DownloadUserPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot user metrics report from a download link returned by GetEnterpriseUsersMetricsReport or GetOrganizationUsersMetricsReport. The response is newline-delimited JSON, with one CopilotUserPeriodicMetrics recor
(ctx context.Context, url string)
| 1237 | // The response is newline-delimited JSON, with one CopilotUserPeriodicMetrics record per |
| 1238 | // user-day in the reporting window. |
| 1239 | func (s *CopilotService) DownloadUserPeriodicMetrics(ctx context.Context, url string) ([]*CopilotUserPeriodicMetrics, *Response, error) { |
| 1240 | resp, r, err := s.fetchMetricsReport(ctx, url) |
| 1241 | if err != nil { |
| 1242 | return nil, r, err |
| 1243 | } |
| 1244 | defer resp.Body.Close() |
| 1245 | |
| 1246 | records, err := decodeNDJSONMetrics[CopilotUserPeriodicMetrics](resp.Body) |
| 1247 | if err != nil { |
| 1248 | return nil, r, err |
| 1249 | } |
| 1250 | return records, r, nil |
| 1251 | } |