DownloadUserDailyMetrics downloads the payload of a 1-day Copilot user metrics report from a download link returned by GetEnterpriseUsersDailyMetricsReport or GetOrganizationUsersDailyMetricsReport. The response is newline-delimited JSON, with one CopilotUserDailyMetrics record per line.
(ctx context.Context, url string)
| 1217 | // |
| 1218 | // The response is newline-delimited JSON, with one CopilotUserDailyMetrics record per line. |
| 1219 | func (s *CopilotService) DownloadUserDailyMetrics(ctx context.Context, url string) ([]*CopilotUserDailyMetrics, *Response, error) { |
| 1220 | resp, r, err := s.fetchMetricsReport(ctx, url) |
| 1221 | if err != nil { |
| 1222 | return nil, r, err |
| 1223 | } |
| 1224 | defer resp.Body.Close() |
| 1225 | |
| 1226 | records, err := decodeNDJSONMetrics[CopilotUserDailyMetrics](resp.Body) |
| 1227 | if err != nil { |
| 1228 | return nil, r, err |
| 1229 | } |
| 1230 | return records, r, nil |
| 1231 | } |
| 1232 | |
| 1233 | // DownloadUserPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot |
| 1234 | // user metrics report from a download link returned by GetEnterpriseUsersMetricsReport or |