DownloadCopilotMetrics downloads a Copilot metrics report from the provided download link and decodes it as a []*CopilotMetrics. Deprecated: Use DownloadDailyMetrics, DownloadPeriodicMetrics, DownloadUserDailyMetrics, DownloadUserPeriodicMetrics instead. The payloads served at the download links re
(ctx context.Context, url string)
| 890 | // This method is retained |
| 891 | // for GitHub Enterprise Server installations that may still serve the legacy shape. |
| 892 | func (s *CopilotService) DownloadCopilotMetrics(ctx context.Context, url string) ([]*CopilotMetrics, *Response, error) { |
| 893 | req, err := http.NewRequestWithContext(ctx, "GET", url, nil) |
| 894 | if err != nil { |
| 895 | return nil, nil, err |
| 896 | } |
| 897 | |
| 898 | resp, err := s.client.BareDo(req) |
| 899 | if err != nil { |
| 900 | return nil, nil, err |
| 901 | } |
| 902 | defer resp.Body.Close() |
| 903 | |
| 904 | var metrics []*CopilotMetrics |
| 905 | if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { |
| 906 | return nil, resp, err |
| 907 | } |
| 908 | |
| 909 | return metrics, resp, nil |
| 910 | } |
| 911 | |
| 912 | // CopilotMetricsPullRequests represents pull request totals in a Copilot metrics report. |
| 913 | type CopilotMetricsPullRequests struct { |