DownloadPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot usage metrics report from a download link returned by GetEnterpriseMetricsReport or GetOrganizationMetricsReport.
(ctx context.Context, url string)
| 1197 | // usage metrics report from a download link returned by GetEnterpriseMetricsReport or |
| 1198 | // GetOrganizationMetricsReport. |
| 1199 | func (s *CopilotService) DownloadPeriodicMetrics(ctx context.Context, url string) (*CopilotPeriodicMetrics, *Response, error) { |
| 1200 | resp, r, err := s.fetchMetricsReport(ctx, url) |
| 1201 | if err != nil { |
| 1202 | return nil, r, err |
| 1203 | } |
| 1204 | defer resp.Body.Close() |
| 1205 | |
| 1206 | var metrics *CopilotPeriodicMetrics |
| 1207 | if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { |
| 1208 | return nil, r, err |
| 1209 | } |
| 1210 | |
| 1211 | return metrics, r, nil |
| 1212 | } |
| 1213 | |
| 1214 | // DownloadUserDailyMetrics downloads the payload of a 1-day Copilot user metrics report from a |
| 1215 | // download link returned by GetEnterpriseUsersDailyMetricsReport or |