DownloadDailyMetrics downloads the payload of a 1-day Copilot usage metrics report from a download link returned by GetEnterpriseDailyMetricsReport or GetOrganizationDailyMetricsReport.
(ctx context.Context, url string)
| 1179 | // DownloadDailyMetrics downloads the payload of a 1-day Copilot usage metrics report from a |
| 1180 | // download link returned by GetEnterpriseDailyMetricsReport or GetOrganizationDailyMetricsReport. |
| 1181 | func (s *CopilotService) DownloadDailyMetrics(ctx context.Context, url string) (*CopilotDailyMetrics, *Response, error) { |
| 1182 | resp, r, err := s.fetchMetricsReport(ctx, url) |
| 1183 | if err != nil { |
| 1184 | return nil, r, err |
| 1185 | } |
| 1186 | defer resp.Body.Close() |
| 1187 | |
| 1188 | var metrics *CopilotDailyMetrics |
| 1189 | if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { |
| 1190 | return nil, r, err |
| 1191 | } |
| 1192 | |
| 1193 | return metrics, r, nil |
| 1194 | } |
| 1195 | |
| 1196 | // DownloadPeriodicMetrics downloads the payload of a multi-day (e.g. 28-day rolling) Copilot |
| 1197 | // usage metrics report from a download link returned by GetEnterpriseMetricsReport or |