diff --git a/github/copilot.go b/github/copilot.go index dc29d52dbc4..d225642cf71 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -10,6 +10,7 @@ import ( "encoding/json" "errors" "fmt" + "io" "net/http" "time" ) @@ -612,6 +613,8 @@ func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, te // GetEnterpriseDailyMetricsReport gets a report containing Copilot metrics for a single day for an enterprise. // +// Use DownloadDailyMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics-for-a-specific-day // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day @@ -638,6 +641,8 @@ func (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, en // GetEnterpriseMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an enterprise. // +// Use DownloadPeriodicMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-enterprise-usage-metrics // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest @@ -660,6 +665,8 @@ func (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterpr // GetEnterpriseUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an enterprise. // +// Use DownloadUserDailyMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics-for-a-specific-day // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day @@ -686,6 +693,8 @@ func (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Contex // GetEnterpriseUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an enterprise. // +// Use DownloadUserPeriodicMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-users-usage-metrics // //meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest @@ -708,6 +717,8 @@ func (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, en // GetOrganizationDailyMetricsReport gets a report containing Copilot metrics for a single day for an organization. // +// Use DownloadDailyMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics-for-a-specific-day // //meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-1-day @@ -734,6 +745,8 @@ func (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, // GetOrganizationMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an organization. // +// Use DownloadPeriodicMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-usage-metrics // //meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest @@ -756,6 +769,8 @@ func (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org s // GetOrganizationUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an organization. // +// Use DownloadUserDailyMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics-for-a-specific-day // //meta:operation GET /orgs/{org}/copilot/metrics/reports/users-1-day @@ -782,6 +797,8 @@ func (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Cont // GetOrganizationUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an organization. // +// Use DownloadUserPeriodicMetrics to decode the payloads served at the returned download links. +// // GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage-metrics?apiVersion=2022-11-28#get-copilot-organization-users-usage-metrics // //meta:operation GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest @@ -803,10 +820,15 @@ func (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, } // DownloadCopilotMetrics downloads a Copilot metrics report from the provided download link -// and returns the metric data. This can be used to download metrics from a link returned by -// GetEnterpriseDailyMetricsReport, GetEnterpriseMetricsReport, GetEnterpriseUsersDailyMetricsReport, -// GetEnterpriseUsersMetricsReport, GetOrganizationDailyMetricsReport, GetOrganizationMetricsReport, -// GetOrganizationUsersDailyMetricsReport, GetOrganizationUsersMetricsReport. +// and decodes it as a []*CopilotMetrics. +// +// Deprecated: Use DownloadDailyMetrics, +// DownloadPeriodicMetrics, DownloadUserDailyMetrics, DownloadUserPeriodicMetrics instead. +// The payloads served at the download links returned by the new +// Get*MetricsReport endpoints on GitHub.com do not match the CopilotMetrics shape +// (see https://github.com/google/go-github/issues/4136). +// This method is retained +// for GitHub Enterprise Server installations that may still serve the legacy shape. func (s *CopilotService) DownloadCopilotMetrics(ctx context.Context, url string) ([]*CopilotMetrics, *Response, error) { req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { @@ -830,3 +852,344 @@ func (s *CopilotService) DownloadCopilotMetrics(ctx context.Context, url string) return metrics, newResponse(resp), nil } + +// CopilotMetricsPullRequests represents pull request totals in a Copilot metrics report. +type CopilotMetricsPullRequests struct { + TotalReviewed *int `json:"total_reviewed,omitempty"` + TotalCreated *int `json:"total_created,omitempty"` + TotalCreatedByCopilot *int `json:"total_created_by_copilot,omitempty"` + TotalReviewedByCopilot *int `json:"total_reviewed_by_copilot,omitempty"` + TotalMerged *int `json:"total_merged,omitempty"` + MedianMinutesToMerge *float64 `json:"median_minutes_to_merge,omitempty"` + TotalSuggestions *int `json:"total_suggestions,omitempty"` + TotalAppliedSuggestions *int `json:"total_applied_suggestions,omitempty"` + TotalMergedCreatedByCopilot *int `json:"total_merged_created_by_copilot,omitempty"` + MedianMinutesToMergeCopilotAuthored *float64 `json:"median_minutes_to_merge_copilot_authored,omitempty"` + TotalCopilotSuggestions *int `json:"total_copilot_suggestions,omitempty"` + TotalCopilotAppliedSuggestions *int `json:"total_copilot_applied_suggestions,omitempty"` + MedianMinutesToMergeCopilotReviewed *float64 `json:"median_minutes_to_merge_copilot_reviewed,omitempty"` + TotalMergedReviewedByCopilot *int `json:"total_merged_reviewed_by_copilot,omitempty"` +} + +// CopilotMetricsCodeActivity captures the code-generation activity counts and lines-of-code (LOC) +// suggestion totals shared across the per-IDE, per-feature, per-language, and per-model breakdowns +// in a Copilot metrics report. +type CopilotMetricsCodeActivity struct { + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` +} + +// CopilotMetricsChatPanel captures per-mode chat panel interaction counts shared across daily, +// periodic, and user metrics reports. Each field is a subset of user_initiated_interaction_count +// attributed to that chat panel mode. +type CopilotMetricsChatPanel struct { + ChatPanelAgentMode *int `json:"chat_panel_agent_mode,omitempty"` + ChatPanelAskMode *int `json:"chat_panel_ask_mode,omitempty"` + ChatPanelCustomMode *int `json:"chat_panel_custom_mode,omitempty"` + ChatPanelEditMode *int `json:"chat_panel_edit_mode,omitempty"` + ChatPanelUnknownMode *int `json:"chat_panel_unknown_mode,omitempty"` +} + +// CopilotMetricsIDE represents per-IDE aggregate totals in a Copilot metrics report. +type CopilotMetricsIDE struct { + IDE string `json:"ide"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsFeature represents per-feature aggregate totals in a Copilot metrics report. +type CopilotMetricsFeature struct { + Feature string `json:"feature"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsLanguageFeature represents per-language-feature totals in a Copilot metrics report. +type CopilotMetricsLanguageFeature struct { + Language string `json:"language"` + Feature string `json:"feature"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsLanguageModel represents per-language-model totals in a Copilot metrics report. +type CopilotMetricsLanguageModel struct { + Language string `json:"language"` + Model string `json:"model"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsModelFeature represents per-model-feature totals in a Copilot metrics report. +type CopilotMetricsModelFeature struct { + Model string `json:"model"` + Feature string `json:"feature"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity +} + +// CopilotMetricsCLIVersion represents the last known Copilot CLI version seen in a metrics report. +type CopilotMetricsCLIVersion struct { + SampledAt *Timestamp `json:"sampled_at,omitempty"` + CLIVersion string `json:"cli_version"` +} + +// CopilotMetricsCLITokenUsage represents Copilot CLI token totals in a metrics report. +type CopilotMetricsCLITokenUsage struct { + AvgTokensPerRequest *float64 `json:"avg_tokens_per_request,omitempty"` + OutputTokensSum *int `json:"output_tokens_sum,omitempty"` + PromptTokensSum *int `json:"prompt_tokens_sum,omitempty"` +} + +// CopilotMetricsCLI represents Copilot CLI totals in a metrics report. +type CopilotMetricsCLI struct { + SessionCount *int `json:"session_count,omitempty"` + RequestCount *int `json:"request_count,omitempty"` + PromptCount *int `json:"prompt_count,omitempty"` + TokenUsage *CopilotMetricsCLITokenUsage `json:"token_usage,omitempty"` + LastKnownCLIVersion *CopilotMetricsCLIVersion `json:"last_known_cli_version,omitempty"` +} + +// CopilotDailyMetrics represents the payload downloaded from a 1-day Copilot usage metrics report. +type CopilotDailyMetrics struct { + Day string `json:"day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + DailyActiveCLIUsers *int `json:"daily_active_cli_users,omitempty"` + DailyActiveUsers *int `json:"daily_active_users,omitempty"` + DailyActiveCopilotCloudAgentUsers *int `json:"daily_active_copilot_cloud_agent_users,omitempty"` + WeeklyActiveUsers *int `json:"weekly_active_users,omitempty"` + WeeklyActiveCopilotCloudAgentUsers *int `json:"weekly_active_copilot_cloud_agent_users,omitempty"` + MonthlyActiveUsers *int `json:"monthly_active_users,omitempty"` + MonthlyActiveChatUsers *int `json:"monthly_active_chat_users,omitempty"` + MonthlyActiveAgentUsers *int `json:"monthly_active_agent_users,omitempty"` + MonthlyActiveCopilotCloudAgentUsers *int `json:"monthly_active_copilot_cloud_agent_users,omitempty"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsChatPanel + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + TotalsByIDE []*CopilotMetricsIDE `json:"totals_by_ide,omitempty"` + TotalsByFeature []*CopilotMetricsFeature `json:"totals_by_feature,omitempty"` + TotalsByLanguageFeature []*CopilotMetricsLanguageFeature `json:"totals_by_language_feature,omitempty"` + TotalsByLanguageModel []*CopilotMetricsLanguageModel `json:"totals_by_language_model,omitempty"` + TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` + TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` + PullRequests *CopilotMetricsPullRequests `json:"pull_requests,omitempty"` +} + +// CopilotPeriodicMetrics represents the payload downloaded from a multi-day (e.g. 28-day rolling) +// Copilot usage metrics report. The DayTotals field contains one CopilotDailyMetrics entry per day +// in the reporting window. Window-level metadata (ReportStartDay, ReportEndDay, CreatedAt) lives on +// this parent struct; each DayTotals entry only populates fields scoped to that day. +type CopilotPeriodicMetrics struct { + ReportStartDay string `json:"report_start_day"` + ReportEndDay string `json:"report_end_day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + DayTotals []*CopilotDailyMetrics `json:"day_totals,omitempty"` +} + +// CopilotUserMetricsPluginVersion represents the last known plugin version used in an IDE by a Copilot user. +type CopilotUserMetricsPluginVersion struct { + SampledAt *Timestamp `json:"sampled_at,omitempty"` + Plugin string `json:"plugin"` + PluginVersion string `json:"plugin_version"` +} + +// CopilotUserMetricsIDEVersion represents the last known IDE version used by a Copilot user. +type CopilotUserMetricsIDEVersion struct { + SampledAt *Timestamp `json:"sampled_at,omitempty"` + IDEVersion string `json:"ide_version"` +} + +// CopilotUserMetricsIDE represents per-IDE totals for a single Copilot user in a user metrics report. +type CopilotUserMetricsIDE struct { + IDE string `json:"ide"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsCodeActivity + LastKnownPluginVersion *CopilotUserMetricsPluginVersion `json:"last_known_plugin_version,omitempty"` + LastKnownIDEVersion *CopilotUserMetricsIDEVersion `json:"last_known_ide_version,omitempty"` +} + +// CopilotUserDailyMetrics represents a single user's per-day Copilot usage metrics record from a +// 1-day user metrics report. User metrics reports are served as newline-delimited JSON. +type CopilotUserDailyMetrics struct { + UserID int `json:"user_id"` + UserLogin string `json:"user_login"` + Day string `json:"day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsChatPanel + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + TotalsByIDE []*CopilotUserMetricsIDE `json:"totals_by_ide,omitempty"` + TotalsByFeature []*CopilotMetricsFeature `json:"totals_by_feature,omitempty"` + TotalsByLanguageFeature []*CopilotMetricsLanguageFeature `json:"totals_by_language_feature,omitempty"` + TotalsByLanguageModel []*CopilotMetricsLanguageModel `json:"totals_by_language_model,omitempty"` + TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` + TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` + UsedAgent *bool `json:"used_agent,omitempty"` + UsedChat *bool `json:"used_chat,omitempty"` + UsedCLI *bool `json:"used_cli,omitempty"` + UsedCopilotCodeReviewActive *bool `json:"used_copilot_code_review_active,omitempty"` + UsedCopilotCodeReviewPassive *bool `json:"used_copilot_code_review_passive,omitempty"` + UsedCopilotCodingAgent *bool `json:"used_copilot_coding_agent,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` +} + +// CopilotUserPeriodicMetrics represents a single user's per-day Copilot usage metrics record from a +// multi-day (e.g. 28-day rolling) user metrics report. User metrics reports are served as +// newline-delimited JSON. +type CopilotUserPeriodicMetrics struct { + ReportStartDay string `json:"report_start_day"` + ReportEndDay string `json:"report_end_day"` + Day string `json:"day"` + OrganizationID *string `json:"organization_id,omitempty"` + EnterpriseID *string `json:"enterprise_id,omitempty"` + UserID int `json:"user_id"` + UserLogin string `json:"user_login"` + UserInitiatedInteractionCount *int `json:"user_initiated_interaction_count,omitempty"` + CopilotMetricsChatPanel + CodeGenerationActivityCount *int `json:"code_generation_activity_count,omitempty"` + CodeAcceptanceActivityCount *int `json:"code_acceptance_activity_count,omitempty"` + TotalsByIDE []*CopilotUserMetricsIDE `json:"totals_by_ide,omitempty"` + TotalsByFeature []*CopilotMetricsFeature `json:"totals_by_feature,omitempty"` + TotalsByLanguageFeature []*CopilotMetricsLanguageFeature `json:"totals_by_language_feature,omitempty"` + TotalsByLanguageModel []*CopilotMetricsLanguageModel `json:"totals_by_language_model,omitempty"` + TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` + TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` + UsedAgent *bool `json:"used_agent,omitempty"` + UsedChat *bool `json:"used_chat,omitempty"` + UsedCLI *bool `json:"used_cli,omitempty"` + UsedCopilotCodeReviewActive *bool `json:"used_copilot_code_review_active,omitempty"` + UsedCopilotCodeReviewPassive *bool `json:"used_copilot_code_review_passive,omitempty"` + UsedCopilotCodingAgent *bool `json:"used_copilot_coding_agent,omitempty"` + LOCSuggestedToAddSum *int `json:"loc_suggested_to_add_sum,omitempty"` + LOCSuggestedToDeleteSum *int `json:"loc_suggested_to_delete_sum,omitempty"` + LOCAddedSum *int `json:"loc_added_sum,omitempty"` + LOCDeletedSum *int `json:"loc_deleted_sum,omitempty"` +} + +// fetchMetricsReport performs a GET against the provided download URL and returns the raw +// http.Response. The caller is responsible for closing the body. +func (s *CopilotService) fetchMetricsReport(ctx context.Context, url string) (*http.Response, *Response, error) { + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, nil, err + } + + resp, err := s.client.client.Do(req) + if err != nil { + return nil, nil, err + } + + if err := CheckResponse(resp); err != nil { + resp.Body.Close() + return nil, newResponse(resp), err + } + + return resp, newResponse(resp), nil +} + +// decodeNDJSONMetrics streams a newline-delimited JSON response body into a slice of *T, +// returning a nil slice when the body is empty. +func decodeNDJSONMetrics[T any](r io.Reader) ([]*T, error) { + var records []*T + dec := json.NewDecoder(r) + for { + var rec *T + if err := dec.Decode(&rec); err != nil { + if errors.Is(err, io.EOF) { + break + } + return nil, err + } + records = append(records, rec) + } + return records, nil +} + +// DownloadDailyMetrics downloads the payload of a 1-day Copilot usage metrics report from a +// download link returned by GetEnterpriseDailyMetricsReport or GetOrganizationDailyMetricsReport. +func (s *CopilotService) DownloadDailyMetrics(ctx context.Context, url string) (*CopilotDailyMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + var metrics *CopilotDailyMetrics + if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { + return nil, r, err + } + + return metrics, r, nil +} + +// 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. +func (s *CopilotService) DownloadPeriodicMetrics(ctx context.Context, url string) (*CopilotPeriodicMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + var metrics *CopilotPeriodicMetrics + if err := json.NewDecoder(resp.Body).Decode(&metrics); err != nil { + return nil, r, err + } + + return metrics, r, nil +} + +// 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. +func (s *CopilotService) DownloadUserDailyMetrics(ctx context.Context, url string) ([]*CopilotUserDailyMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + records, err := decodeNDJSONMetrics[CopilotUserDailyMetrics](resp.Body) + if err != nil { + return nil, r, err + } + return records, r, nil +} + +// 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 record per +// user-day in the reporting window. +func (s *CopilotService) DownloadUserPeriodicMetrics(ctx context.Context, url string) ([]*CopilotUserPeriodicMetrics, *Response, error) { + resp, r, err := s.fetchMetricsReport(ctx, url) + if err != nil { + return nil, r, err + } + defer resp.Body.Close() + + records, err := decodeNDJSONMetrics[CopilotUserPeriodicMetrics](resp.Body) + if err != nil { + return nil, r, err + } + return records, r, nil +} diff --git a/github/copilot_test.go b/github/copilot_test.go index 90e13a110c3..45ad487cf6a 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -2914,3 +2914,440 @@ func TestCopilotService_DownloadCopilotMetrics(t *testing.T) { t.Error("Copilot.DownloadCopilotMetrics expected error for bad JSON, got none") } } + +func TestCopilotService_DownloadDailyMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/path/to/daily", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "day": "2026-04-01", + "organization_id": "123", + "daily_active_cli_users": 2, + "daily_active_users": 10, + "weekly_active_users": 20, + "monthly_active_users": 30, + "chat_panel_ask_mode": 4, + "totals_by_ide": [ + {"ide": "vscode", "user_initiated_interaction_count": 5, "loc_added_sum": 100} + ], + "totals_by_feature": [ + {"feature": "completion", "user_initiated_interaction_count": 5}, + {"feature": "agent_edit", "loc_added_sum": 7, "loc_deleted_sum": 2} + ], + "totals_by_language_feature": [ + {"language": "go", "feature": "completion", "code_generation_activity_count": 3} + ], + "totals_by_language_model": [ + {"language": "go", "model": "m1", "code_generation_activity_count": 3} + ], + "totals_by_model_feature": [ + {"model": "m1", "feature": "completion", "user_initiated_interaction_count": 5} + ], + "totals_by_cli": { + "session_count": 3, + "request_count": 4, + "prompt_count": 2, + "token_usage": { + "avg_tokens_per_request": 4123.5, + "output_tokens_sum": 7000, + "prompt_tokens_sum": 9494 + } + }, + "loc_added_sum": 100, + "pull_requests": { + "total_reviewed": 1, + "total_created": 2, + "median_minutes_to_merge": 12.5, + "median_minutes_to_merge_copilot_authored": 4.5, + "median_minutes_to_merge_copilot_reviewed": 6.5 + } + }`) + }) + + ctx := t.Context() + url := client.BaseURL.String() + "path/to/daily" + got, resp, err := client.Copilot.DownloadDailyMetrics(ctx, url) + if err != nil { + t.Errorf("Copilot.DownloadDailyMetrics returned error: %v", err) + } + if resp.StatusCode != http.StatusOK { + t.Errorf("Copilot.DownloadDailyMetrics returned status code: %v", resp.StatusCode) + } + + want := &CopilotDailyMetrics{ + Day: "2026-04-01", + OrganizationID: String("123"), + DailyActiveCLIUsers: Int(2), + DailyActiveUsers: Int(10), + WeeklyActiveUsers: Int(20), + MonthlyActiveUsers: Int(30), + CopilotMetricsChatPanel: CopilotMetricsChatPanel{ + ChatPanelAskMode: Int(4), + }, + TotalsByIDE: []*CopilotMetricsIDE{ + {IDE: "vscode", UserInitiatedInteractionCount: Int(5), CopilotMetricsCodeActivity: CopilotMetricsCodeActivity{LOCAddedSum: Int(100)}}, + }, + TotalsByFeature: []*CopilotMetricsFeature{ + {Feature: "completion", UserInitiatedInteractionCount: Int(5)}, + {Feature: "agent_edit", CopilotMetricsCodeActivity: CopilotMetricsCodeActivity{LOCAddedSum: Int(7), LOCDeletedSum: Int(2)}}, + }, + TotalsByLanguageFeature: []*CopilotMetricsLanguageFeature{ + {Language: "go", Feature: "completion", CopilotMetricsCodeActivity: CopilotMetricsCodeActivity{CodeGenerationActivityCount: Int(3)}}, + }, + TotalsByLanguageModel: []*CopilotMetricsLanguageModel{ + {Language: "go", Model: "m1", CopilotMetricsCodeActivity: CopilotMetricsCodeActivity{CodeGenerationActivityCount: Int(3)}}, + }, + TotalsByModelFeature: []*CopilotMetricsModelFeature{ + {Model: "m1", Feature: "completion", UserInitiatedInteractionCount: Int(5)}, + }, + TotalsByCLI: &CopilotMetricsCLI{ + SessionCount: Int(3), + RequestCount: Int(4), + PromptCount: Int(2), + TokenUsage: &CopilotMetricsCLITokenUsage{ + AvgTokensPerRequest: Ptr(4123.5), + OutputTokensSum: Int(7000), + PromptTokensSum: Int(9494), + }, + }, + LOCAddedSum: Int(100), + PullRequests: &CopilotMetricsPullRequests{ + TotalReviewed: Int(1), + TotalCreated: Int(2), + MedianMinutesToMerge: Ptr(12.5), + MedianMinutesToMergeCopilotAuthored: Ptr(4.5), + MedianMinutesToMergeCopilotReviewed: Ptr(6.5), + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.DownloadDailyMetrics returned %+v, want %+v", got, want) + } + + mux.HandleFunc("/path/to/daily/error", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + if _, _, err := client.Copilot.DownloadDailyMetrics(ctx, client.BaseURL.String()+"path/to/daily/error"); err == nil { + t.Error("Copilot.DownloadDailyMetrics expected error but got none") + } + if _, _, err := client.Copilot.DownloadDailyMetrics(ctx, "\n"); err == nil { + t.Error("Copilot.DownloadDailyMetrics expected error for invalid URL, got none") + } + if _, _, err := client.Copilot.DownloadDailyMetrics(ctx, "invalid-scheme://test"); err == nil { + t.Error("Copilot.DownloadDailyMetrics expected error for invalid scheme, got none") + } + + mux.HandleFunc("/path/to/daily/badjson", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{invalid`) + }) + if _, _, err := client.Copilot.DownloadDailyMetrics(ctx, client.BaseURL.String()+"path/to/daily/badjson"); err == nil { + t.Error("Copilot.DownloadDailyMetrics expected error for bad JSON, got none") + } +} + +func TestCopilotService_DownloadPeriodicMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/path/to/periodic", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{ + "report_start_day": "2026-03-05", + "report_end_day": "2026-04-01", + "organization_id": "123", + "created_at": "2026-04-02T00:00:00Z", + "day_totals": [ + { + "day": "2026-03-05", + "daily_active_cli_users": 2, + "daily_active_users": 5, + "totals_by_cli": { + "session_count": 1, + "request_count": 2, + "prompt_count": 1, + "token_usage": { + "avg_tokens_per_request": 4000.0, + "output_tokens_sum": 5000, + "prompt_tokens_sum": 3000 + } + }, + "pull_requests": { + "median_minutes_to_merge": 8.5, + "median_minutes_to_merge_copilot_authored": 5.0, + "median_minutes_to_merge_copilot_reviewed": 7.0 + } + }, + {"day": "2026-03-06", "daily_active_users": 7} + ] + }`) + }) + + ctx := t.Context() + url := client.BaseURL.String() + "path/to/periodic" + got, resp, err := client.Copilot.DownloadPeriodicMetrics(ctx, url) + if err != nil { + t.Errorf("Copilot.DownloadPeriodicMetrics returned error: %v", err) + } + if resp.StatusCode != http.StatusOK { + t.Errorf("Copilot.DownloadPeriodicMetrics returned status code: %v", resp.StatusCode) + } + + want := &CopilotPeriodicMetrics{ + ReportStartDay: "2026-03-05", + ReportEndDay: "2026-04-01", + OrganizationID: String("123"), + CreatedAt: &Timestamp{time.Date(2026, 4, 2, 0, 0, 0, 0, time.UTC)}, + DayTotals: []*CopilotDailyMetrics{ + { + Day: "2026-03-05", + DailyActiveCLIUsers: Int(2), + DailyActiveUsers: Int(5), + TotalsByCLI: &CopilotMetricsCLI{ + SessionCount: Int(1), + RequestCount: Int(2), + PromptCount: Int(1), + TokenUsage: &CopilotMetricsCLITokenUsage{ + AvgTokensPerRequest: Ptr(4000.0), + OutputTokensSum: Int(5000), + PromptTokensSum: Int(3000), + }, + }, + PullRequests: &CopilotMetricsPullRequests{ + MedianMinutesToMerge: Ptr(8.5), + MedianMinutesToMergeCopilotAuthored: Ptr(5.0), + MedianMinutesToMergeCopilotReviewed: Ptr(7.0), + }, + }, + {Day: "2026-03-06", DailyActiveUsers: Int(7)}, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.DownloadPeriodicMetrics returned %+v, want %+v", got, want) + } + + mux.HandleFunc("/path/to/periodic/error", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + if _, _, err := client.Copilot.DownloadPeriodicMetrics(ctx, client.BaseURL.String()+"path/to/periodic/error"); err == nil { + t.Error("Copilot.DownloadPeriodicMetrics expected error but got none") + } + if _, _, err := client.Copilot.DownloadPeriodicMetrics(ctx, "\n"); err == nil { + t.Error("Copilot.DownloadPeriodicMetrics expected error for invalid URL, got none") + } + if _, _, err := client.Copilot.DownloadPeriodicMetrics(ctx, "invalid-scheme://test"); err == nil { + t.Error("Copilot.DownloadPeriodicMetrics expected error for invalid scheme, got none") + } + + mux.HandleFunc("/path/to/periodic/badjson", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{invalid`) + }) + if _, _, err := client.Copilot.DownloadPeriodicMetrics(ctx, client.BaseURL.String()+"path/to/periodic/badjson"); err == nil { + t.Error("Copilot.DownloadPeriodicMetrics expected error for bad JSON, got none") + } +} + +func TestCopilotService_DownloadUserDailyMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/path/to/users-daily", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"user_id":1,"user_login":"alice","day":"2026-04-01","user_initiated_interaction_count":5,"chat_panel_edit_mode":2,"used_chat":true,"used_cli":true,"used_copilot_code_review_active":true,"totals_by_cli":{"session_count":2,"request_count":2,"prompt_count":1,"last_known_cli_version":{"sampled_at":"2026-04-01T12:30:00Z","cli_version":"1.0.8"}},"totals_by_ide":[{"ide":"vscode","user_initiated_interaction_count":5,"last_known_plugin_version":{"sampled_at":"2026-04-01T12:00:00Z","plugin":"copilot","plugin_version":"1.0.0"},"last_known_ide_version":{"sampled_at":"2026-04-01T12:00:00Z","ide_version":"1.90"}}]} +{"user_id":2,"user_login":"bob","day":"2026-04-01","used_agent":true,"used_copilot_code_review_passive":true} +`) + }) + + ctx := t.Context() + url := client.BaseURL.String() + "path/to/users-daily" + got, resp, err := client.Copilot.DownloadUserDailyMetrics(ctx, url) + if err != nil { + t.Errorf("Copilot.DownloadUserDailyMetrics returned error: %v", err) + } + if resp.StatusCode != http.StatusOK { + t.Errorf("Copilot.DownloadUserDailyMetrics returned status code: %v", resp.StatusCode) + } + + want := []*CopilotUserDailyMetrics{ + { + UserID: 1, + UserLogin: "alice", + Day: "2026-04-01", + UserInitiatedInteractionCount: Int(5), + CopilotMetricsChatPanel: CopilotMetricsChatPanel{ + ChatPanelEditMode: Int(2), + }, + UsedChat: Bool(true), + UsedCLI: Bool(true), + UsedCopilotCodeReviewActive: Bool(true), + TotalsByCLI: &CopilotMetricsCLI{ + SessionCount: Int(2), + RequestCount: Int(2), + PromptCount: Int(1), + LastKnownCLIVersion: &CopilotMetricsCLIVersion{ + SampledAt: &Timestamp{time.Date(2026, 4, 1, 12, 30, 0, 0, time.UTC)}, + CLIVersion: "1.0.8", + }, + }, + TotalsByIDE: []*CopilotUserMetricsIDE{ + { + IDE: "vscode", + UserInitiatedInteractionCount: Int(5), + LastKnownPluginVersion: &CopilotUserMetricsPluginVersion{ + SampledAt: &Timestamp{time.Date(2026, 4, 1, 12, 0, 0, 0, time.UTC)}, + Plugin: "copilot", + PluginVersion: "1.0.0", + }, + LastKnownIDEVersion: &CopilotUserMetricsIDEVersion{ + SampledAt: &Timestamp{time.Date(2026, 4, 1, 12, 0, 0, 0, time.UTC)}, + IDEVersion: "1.90", + }, + }, + }, + }, + { + UserID: 2, + UserLogin: "bob", + Day: "2026-04-01", + UsedAgent: Bool(true), + UsedCopilotCodeReviewPassive: Bool(true), + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.DownloadUserDailyMetrics returned %+v, want %+v", got, want) + } + + // Empty body parses to a nil slice (no records). + mux.HandleFunc("/path/to/users-daily/empty", func(_ http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + gotEmpty, _, err := client.Copilot.DownloadUserDailyMetrics(ctx, client.BaseURL.String()+"path/to/users-daily/empty") + if err != nil { + t.Errorf("Copilot.DownloadUserDailyMetrics empty body returned error: %v", err) + } + if gotEmpty != nil { + t.Errorf("Copilot.DownloadUserDailyMetrics empty body returned %+v, want nil", gotEmpty) + } + + mux.HandleFunc("/path/to/users-daily/error", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + if _, _, err := client.Copilot.DownloadUserDailyMetrics(ctx, client.BaseURL.String()+"path/to/users-daily/error"); err == nil { + t.Error("Copilot.DownloadUserDailyMetrics expected error but got none") + } + if _, _, err := client.Copilot.DownloadUserDailyMetrics(ctx, "\n"); err == nil { + t.Error("Copilot.DownloadUserDailyMetrics expected error for invalid URL, got none") + } + if _, _, err := client.Copilot.DownloadUserDailyMetrics(ctx, "invalid-scheme://test"); err == nil { + t.Error("Copilot.DownloadUserDailyMetrics expected error for invalid scheme, got none") + } + + // A malformed line causes the stream decode to fail. + mux.HandleFunc("/path/to/users-daily/badjson", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, "{\"user_id\":1,\"day\":\"2026-04-01\"}\n{bad\n") + }) + if _, _, err := client.Copilot.DownloadUserDailyMetrics(ctx, client.BaseURL.String()+"path/to/users-daily/badjson"); err == nil { + t.Error("Copilot.DownloadUserDailyMetrics expected error for bad JSON, got none") + } +} + +func TestCopilotService_DownloadUserPeriodicMetrics(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/path/to/users-periodic", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `{"report_start_day":"2026-03-05","report_end_day":"2026-04-01","day":"2026-03-05","user_id":1,"user_login":"alice","user_initiated_interaction_count":3,"used_copilot_code_review_active":true} +{"report_start_day":"2026-03-05","report_end_day":"2026-04-01","day":"2026-03-06","user_id":1,"user_login":"alice","used_cli":true,"used_copilot_code_review_passive":true,"used_copilot_coding_agent":true,"totals_by_cli":{"session_count":1,"request_count":3,"prompt_count":2,"token_usage":{"avg_tokens_per_request":1200.5,"output_tokens_sum":2400,"prompt_tokens_sum":1201}}} +`) + }) + + ctx := t.Context() + url := client.BaseURL.String() + "path/to/users-periodic" + got, resp, err := client.Copilot.DownloadUserPeriodicMetrics(ctx, url) + if err != nil { + t.Errorf("Copilot.DownloadUserPeriodicMetrics returned error: %v", err) + } + if resp.StatusCode != http.StatusOK { + t.Errorf("Copilot.DownloadUserPeriodicMetrics returned status code: %v", resp.StatusCode) + } + + want := []*CopilotUserPeriodicMetrics{ + { + ReportStartDay: "2026-03-05", + ReportEndDay: "2026-04-01", + Day: "2026-03-05", + UserID: 1, + UserLogin: "alice", + UserInitiatedInteractionCount: Int(3), + UsedCopilotCodeReviewActive: Bool(true), + }, + { + ReportStartDay: "2026-03-05", + ReportEndDay: "2026-04-01", + Day: "2026-03-06", + UserID: 1, + UserLogin: "alice", + UsedCLI: Bool(true), + UsedCopilotCodeReviewPassive: Bool(true), + UsedCopilotCodingAgent: Bool(true), + TotalsByCLI: &CopilotMetricsCLI{ + SessionCount: Int(1), + RequestCount: Int(3), + PromptCount: Int(2), + TokenUsage: &CopilotMetricsCLITokenUsage{ + AvgTokensPerRequest: Ptr(1200.5), + OutputTokensSum: Int(2400), + PromptTokensSum: Int(1201), + }, + }, + }, + } + + if !cmp.Equal(got, want) { + t.Errorf("Copilot.DownloadUserPeriodicMetrics returned %+v, want %+v", got, want) + } + + // Empty body parses to a nil slice (no records). + mux.HandleFunc("/path/to/users-periodic/empty", func(_ http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + }) + gotEmpty, _, err := client.Copilot.DownloadUserPeriodicMetrics(ctx, client.BaseURL.String()+"path/to/users-periodic/empty") + if err != nil { + t.Errorf("Copilot.DownloadUserPeriodicMetrics empty body returned error: %v", err) + } + if gotEmpty != nil { + t.Errorf("Copilot.DownloadUserPeriodicMetrics empty body returned %+v, want nil", gotEmpty) + } + + mux.HandleFunc("/path/to/users-periodic/error", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + w.WriteHeader(http.StatusNotFound) + }) + if _, _, err := client.Copilot.DownloadUserPeriodicMetrics(ctx, client.BaseURL.String()+"path/to/users-periodic/error"); err == nil { + t.Error("Copilot.DownloadUserPeriodicMetrics expected error but got none") + } + if _, _, err := client.Copilot.DownloadUserPeriodicMetrics(ctx, "\n"); err == nil { + t.Error("Copilot.DownloadUserPeriodicMetrics expected error for invalid URL, got none") + } + if _, _, err := client.Copilot.DownloadUserPeriodicMetrics(ctx, "invalid-scheme://test"); err == nil { + t.Error("Copilot.DownloadUserPeriodicMetrics expected error for invalid scheme, got none") + } + + mux.HandleFunc("/path/to/users-periodic/badjson", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, "{not json\n") + }) + if _, _, err := client.Copilot.DownloadUserPeriodicMetrics(ctx, client.BaseURL.String()+"path/to/users-periodic/badjson"); err == nil { + t.Error("Copilot.DownloadUserPeriodicMetrics expected error for bad JSON, got none") + } +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 52a8b098559..612c0e7b519 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8198,6 +8198,214 @@ func (c *CopilotCodeReviewRuleParameters) GetReviewOnPush() bool { return c.ReviewOnPush } +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetDailyActiveCLIUsers returns the DailyActiveCLIUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetDailyActiveCLIUsers() int { + if c == nil || c.DailyActiveCLIUsers == nil { + return 0 + } + return *c.DailyActiveCLIUsers +} + +// GetDailyActiveCopilotCloudAgentUsers returns the DailyActiveCopilotCloudAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetDailyActiveCopilotCloudAgentUsers() int { + if c == nil || c.DailyActiveCopilotCloudAgentUsers == nil { + return 0 + } + return *c.DailyActiveCopilotCloudAgentUsers +} + +// GetDailyActiveUsers returns the DailyActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetDailyActiveUsers() int { + if c == nil || c.DailyActiveUsers == nil { + return 0 + } + return *c.DailyActiveUsers +} + +// GetDay returns the Day field. +func (c *CopilotDailyMetrics) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetMonthlyActiveAgentUsers returns the MonthlyActiveAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveAgentUsers() int { + if c == nil || c.MonthlyActiveAgentUsers == nil { + return 0 + } + return *c.MonthlyActiveAgentUsers +} + +// GetMonthlyActiveChatUsers returns the MonthlyActiveChatUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveChatUsers() int { + if c == nil || c.MonthlyActiveChatUsers == nil { + return 0 + } + return *c.MonthlyActiveChatUsers +} + +// GetMonthlyActiveCopilotCloudAgentUsers returns the MonthlyActiveCopilotCloudAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveCopilotCloudAgentUsers() int { + if c == nil || c.MonthlyActiveCopilotCloudAgentUsers == nil { + return 0 + } + return *c.MonthlyActiveCopilotCloudAgentUsers +} + +// GetMonthlyActiveUsers returns the MonthlyActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetMonthlyActiveUsers() int { + if c == nil || c.MonthlyActiveUsers == nil { + return 0 + } + return *c.MonthlyActiveUsers +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetPullRequests returns the PullRequests field. +func (c *CopilotDailyMetrics) GetPullRequests() *CopilotMetricsPullRequests { + if c == nil { + return nil + } + return c.PullRequests +} + +// GetTotalsByCLI returns the TotalsByCLI field. +func (c *CopilotDailyMetrics) GetTotalsByCLI() *CopilotMetricsCLI { + if c == nil { + return nil + } + return c.TotalsByCLI +} + +// GetTotalsByFeature returns the TotalsByFeature slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByFeature() []*CopilotMetricsFeature { + if c == nil || c.TotalsByFeature == nil { + return nil + } + return c.TotalsByFeature +} + +// GetTotalsByIDE returns the TotalsByIDE slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByIDE() []*CopilotMetricsIDE { + if c == nil || c.TotalsByIDE == nil { + return nil + } + return c.TotalsByIDE +} + +// GetTotalsByLanguageFeature returns the TotalsByLanguageFeature slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByLanguageFeature() []*CopilotMetricsLanguageFeature { + if c == nil || c.TotalsByLanguageFeature == nil { + return nil + } + return c.TotalsByLanguageFeature +} + +// GetTotalsByLanguageModel returns the TotalsByLanguageModel slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByLanguageModel() []*CopilotMetricsLanguageModel { + if c == nil || c.TotalsByLanguageModel == nil { + return nil + } + return c.TotalsByLanguageModel +} + +// GetTotalsByModelFeature returns the TotalsByModelFeature slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByModelFeature() []*CopilotMetricsModelFeature { + if c == nil || c.TotalsByModelFeature == nil { + return nil + } + return c.TotalsByModelFeature +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetWeeklyActiveCopilotCloudAgentUsers returns the WeeklyActiveCopilotCloudAgentUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetWeeklyActiveCopilotCloudAgentUsers() int { + if c == nil || c.WeeklyActiveCopilotCloudAgentUsers == nil { + return 0 + } + return *c.WeeklyActiveCopilotCloudAgentUsers +} + +// GetWeeklyActiveUsers returns the WeeklyActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotDailyMetrics) GetWeeklyActiveUsers() int { + if c == nil || c.WeeklyActiveUsers == nil { + return 0 + } + return *c.WeeklyActiveUsers +} + // GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. func (c *CopilotDailyMetricsReport) GetDownloadLinks() []string { if c == nil || c.DownloadLinks == nil { @@ -8654,196 +8862,1084 @@ func (c *CopilotMetrics) GetTotalEngagedUsers() int { return *c.TotalEngagedUsers } -// GetSince returns the Since field if it's non-nil, zero value otherwise. -func (c *CopilotMetricsListOptions) GetSince() time.Time { - if c == nil || c.Since == nil { - return time.Time{} +// GetChatPanelAgentMode returns the ChatPanelAgentMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelAgentMode() int { + if c == nil || c.ChatPanelAgentMode == nil { + return 0 } - return *c.Since + return *c.ChatPanelAgentMode } -// GetUntil returns the Until field if it's non-nil, zero value otherwise. -func (c *CopilotMetricsListOptions) GetUntil() time.Time { - if c == nil || c.Until == nil { - return time.Time{} +// GetChatPanelAskMode returns the ChatPanelAskMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelAskMode() int { + if c == nil || c.ChatPanelAskMode == nil { + return 0 } - return *c.Until + return *c.ChatPanelAskMode } -// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. -func (c *CopilotMetricsReport) GetDownloadLinks() []string { - if c == nil || c.DownloadLinks == nil { - return nil +// GetChatPanelCustomMode returns the ChatPanelCustomMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelCustomMode() int { + if c == nil || c.ChatPanelCustomMode == nil { + return 0 } - return c.DownloadLinks + return *c.ChatPanelCustomMode } -// GetReportEndDay returns the ReportEndDay field. -func (c *CopilotMetricsReport) GetReportEndDay() string { - if c == nil { - return "" +// GetChatPanelEditMode returns the ChatPanelEditMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelEditMode() int { + if c == nil || c.ChatPanelEditMode == nil { + return 0 } - return c.ReportEndDay + return *c.ChatPanelEditMode } -// GetReportStartDay returns the ReportStartDay field. -func (c *CopilotMetricsReport) GetReportStartDay() string { - if c == nil { - return "" +// GetChatPanelUnknownMode returns the ChatPanelUnknownMode field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsChatPanel) GetChatPanelUnknownMode() int { + if c == nil || c.ChatPanelUnknownMode == nil { + return 0 } - return c.ReportStartDay + return *c.ChatPanelUnknownMode } -// GetDay returns the Day field. -func (c *CopilotMetricsReportOptions) GetDay() string { +// GetLastKnownCLIVersion returns the LastKnownCLIVersion field. +func (c *CopilotMetricsCLI) GetLastKnownCLIVersion() *CopilotMetricsCLIVersion { if c == nil { - return "" + return nil } - return c.Day + return c.LastKnownCLIVersion } -// GetCopilotChat returns the CopilotChat field. -func (c *CopilotOrganizationDetails) GetCopilotChat() string { - if c == nil { - return "" +// GetPromptCount returns the PromptCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLI) GetPromptCount() int { + if c == nil || c.PromptCount == nil { + return 0 } - return c.CopilotChat + return *c.PromptCount } -// GetPublicCodeSuggestions returns the PublicCodeSuggestions field. -func (c *CopilotOrganizationDetails) GetPublicCodeSuggestions() string { - if c == nil { - return "" +// GetRequestCount returns the RequestCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLI) GetRequestCount() int { + if c == nil || c.RequestCount == nil { + return 0 } - return c.PublicCodeSuggestions + return *c.RequestCount } -// GetSeatBreakdown returns the SeatBreakdown field. -func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { +// GetSessionCount returns the SessionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLI) GetSessionCount() int { + if c == nil || c.SessionCount == nil { + return 0 + } + return *c.SessionCount +} + +// GetTokenUsage returns the TokenUsage field. +func (c *CopilotMetricsCLI) GetTokenUsage() *CopilotMetricsCLITokenUsage { if c == nil { return nil } - return c.SeatBreakdown + return c.TokenUsage } -// GetSeatManagementSetting returns the SeatManagementSetting field. -func (c *CopilotOrganizationDetails) GetSeatManagementSetting() string { +// GetAvgTokensPerRequest returns the AvgTokensPerRequest field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLITokenUsage) GetAvgTokensPerRequest() float64 { + if c == nil || c.AvgTokensPerRequest == nil { + return 0 + } + return *c.AvgTokensPerRequest +} + +// GetOutputTokensSum returns the OutputTokensSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLITokenUsage) GetOutputTokensSum() int { + if c == nil || c.OutputTokensSum == nil { + return 0 + } + return *c.OutputTokensSum +} + +// GetPromptTokensSum returns the PromptTokensSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLITokenUsage) GetPromptTokensSum() int { + if c == nil || c.PromptTokensSum == nil { + return 0 + } + return *c.PromptTokensSum +} + +// GetCLIVersion returns the CLIVersion field. +func (c *CopilotMetricsCLIVersion) GetCLIVersion() string { if c == nil { return "" } - return c.SeatManagementSetting + return c.CLIVersion } -// GetActiveThisCycle returns the ActiveThisCycle field. -func (c *CopilotSeatBreakdown) GetActiveThisCycle() int { - if c == nil { +// GetSampledAt returns the SampledAt field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCLIVersion) GetSampledAt() Timestamp { + if c == nil || c.SampledAt == nil { + return Timestamp{} + } + return *c.SampledAt +} + +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { return 0 } - return c.ActiveThisCycle + return *c.CodeAcceptanceActivityCount } -// GetAddedThisCycle returns the AddedThisCycle field. -func (c *CopilotSeatBreakdown) GetAddedThisCycle() int { - if c == nil { +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { return 0 } - return c.AddedThisCycle + return *c.CodeGenerationActivityCount } -// GetInactiveThisCycle returns the InactiveThisCycle field. -func (c *CopilotSeatBreakdown) GetInactiveThisCycle() int { - if c == nil { +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { return 0 } - return c.InactiveThisCycle + return *c.LOCAddedSum } -// GetPendingCancellation returns the PendingCancellation field. -func (c *CopilotSeatBreakdown) GetPendingCancellation() int { - if c == nil { +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { return 0 } - return c.PendingCancellation + return *c.LOCDeletedSum } -// GetPendingInvitation returns the PendingInvitation field. -func (c *CopilotSeatBreakdown) GetPendingInvitation() int { - if c == nil { +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { return 0 } - return c.PendingInvitation + return *c.LOCSuggestedToAddSum } -// GetTotal returns the Total field. -func (c *CopilotSeatBreakdown) GetTotal() int { - if c == nil { +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsCodeActivity) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { return 0 } - return c.Total + return *c.LOCSuggestedToDeleteSum } -// GetAssignee returns the Assignee field. -func (c *CopilotSeatDetails) GetAssignee() any { +// GetFeature returns the Feature field. +func (c *CopilotMetricsFeature) GetFeature() string { if c == nil { - return nil + return "" } - return c.Assignee + return c.Feature } -// GetAssigningTeam returns the AssigningTeam field. -func (c *CopilotSeatDetails) GetAssigningTeam() *Team { - if c == nil { - return nil +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsFeature) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 } - return c.AssigningTeam + return *c.UserInitiatedInteractionCount } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetCreatedAt() Timestamp { - if c == nil || c.CreatedAt == nil { - return Timestamp{} +// GetIDE returns the IDE field. +func (c *CopilotMetricsIDE) GetIDE() string { + if c == nil { + return "" } - return *c.CreatedAt + return c.IDE } -// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetLastActivityAt() Timestamp { - if c == nil || c.LastActivityAt == nil { - return Timestamp{} +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsIDE) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 } - return *c.LastActivityAt + return *c.UserInitiatedInteractionCount } -// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetLastActivityEditor() string { - if c == nil || c.LastActivityEditor == nil { +// GetFeature returns the Feature field. +func (c *CopilotMetricsLanguageFeature) GetFeature() string { + if c == nil { return "" } - return *c.LastActivityEditor + return c.Feature } -// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetPendingCancellationDate() string { - if c == nil || c.PendingCancellationDate == nil { +// GetLanguage returns the Language field. +func (c *CopilotMetricsLanguageFeature) GetLanguage() string { + if c == nil { return "" } - return *c.PendingCancellationDate + return c.Language } -// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetPlanType() string { - if c == nil || c.PlanType == nil { +// GetLanguage returns the Language field. +func (c *CopilotMetricsLanguageModel) GetLanguage() string { + if c == nil { return "" } - return *c.PlanType + return c.Language } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { - if c == nil || c.UpdatedAt == nil { - return Timestamp{} +// GetModel returns the Model field. +func (c *CopilotMetricsLanguageModel) GetModel() string { + if c == nil { + return "" } - return *c.UpdatedAt + return c.Model +} + +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) GetSince() time.Time { + if c == nil || c.Since == nil { + return time.Time{} + } + return *c.Since +} + +// GetUntil returns the Until field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) GetUntil() time.Time { + if c == nil || c.Until == nil { + return time.Time{} + } + return *c.Until +} + +// GetFeature returns the Feature field. +func (c *CopilotMetricsModelFeature) GetFeature() string { + if c == nil { + return "" + } + return c.Feature +} + +// GetModel returns the Model field. +func (c *CopilotMetricsModelFeature) GetModel() string { + if c == nil { + return "" + } + return c.Model +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsModelFeature) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetMedianMinutesToMerge returns the MedianMinutesToMerge field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetMedianMinutesToMerge() float64 { + if c == nil || c.MedianMinutesToMerge == nil { + return 0 + } + return *c.MedianMinutesToMerge +} + +// GetMedianMinutesToMergeCopilotAuthored returns the MedianMinutesToMergeCopilotAuthored field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetMedianMinutesToMergeCopilotAuthored() float64 { + if c == nil || c.MedianMinutesToMergeCopilotAuthored == nil { + return 0 + } + return *c.MedianMinutesToMergeCopilotAuthored +} + +// GetMedianMinutesToMergeCopilotReviewed returns the MedianMinutesToMergeCopilotReviewed field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetMedianMinutesToMergeCopilotReviewed() float64 { + if c == nil || c.MedianMinutesToMergeCopilotReviewed == nil { + return 0 + } + return *c.MedianMinutesToMergeCopilotReviewed +} + +// GetTotalAppliedSuggestions returns the TotalAppliedSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalAppliedSuggestions() int { + if c == nil || c.TotalAppliedSuggestions == nil { + return 0 + } + return *c.TotalAppliedSuggestions +} + +// GetTotalCopilotAppliedSuggestions returns the TotalCopilotAppliedSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCopilotAppliedSuggestions() int { + if c == nil || c.TotalCopilotAppliedSuggestions == nil { + return 0 + } + return *c.TotalCopilotAppliedSuggestions +} + +// GetTotalCopilotSuggestions returns the TotalCopilotSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCopilotSuggestions() int { + if c == nil || c.TotalCopilotSuggestions == nil { + return 0 + } + return *c.TotalCopilotSuggestions +} + +// GetTotalCreated returns the TotalCreated field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCreated() int { + if c == nil || c.TotalCreated == nil { + return 0 + } + return *c.TotalCreated +} + +// GetTotalCreatedByCopilot returns the TotalCreatedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalCreatedByCopilot() int { + if c == nil || c.TotalCreatedByCopilot == nil { + return 0 + } + return *c.TotalCreatedByCopilot +} + +// GetTotalMerged returns the TotalMerged field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalMerged() int { + if c == nil || c.TotalMerged == nil { + return 0 + } + return *c.TotalMerged +} + +// GetTotalMergedCreatedByCopilot returns the TotalMergedCreatedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalMergedCreatedByCopilot() int { + if c == nil || c.TotalMergedCreatedByCopilot == nil { + return 0 + } + return *c.TotalMergedCreatedByCopilot +} + +// GetTotalMergedReviewedByCopilot returns the TotalMergedReviewedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalMergedReviewedByCopilot() int { + if c == nil || c.TotalMergedReviewedByCopilot == nil { + return 0 + } + return *c.TotalMergedReviewedByCopilot +} + +// GetTotalReviewed returns the TotalReviewed field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalReviewed() int { + if c == nil || c.TotalReviewed == nil { + return 0 + } + return *c.TotalReviewed +} + +// GetTotalReviewedByCopilot returns the TotalReviewedByCopilot field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalReviewedByCopilot() int { + if c == nil || c.TotalReviewedByCopilot == nil { + return 0 + } + return *c.TotalReviewedByCopilot +} + +// GetTotalSuggestions returns the TotalSuggestions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsPullRequests) GetTotalSuggestions() int { + if c == nil || c.TotalSuggestions == nil { + return 0 + } + return *c.TotalSuggestions +} + +// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise. +func (c *CopilotMetricsReport) GetDownloadLinks() []string { + if c == nil || c.DownloadLinks == nil { + return nil + } + return c.DownloadLinks +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotMetricsReport) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotMetricsReport) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetDay returns the Day field. +func (c *CopilotMetricsReportOptions) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetCopilotChat returns the CopilotChat field. +func (c *CopilotOrganizationDetails) GetCopilotChat() string { + if c == nil { + return "" + } + return c.CopilotChat +} + +// GetPublicCodeSuggestions returns the PublicCodeSuggestions field. +func (c *CopilotOrganizationDetails) GetPublicCodeSuggestions() string { + if c == nil { + return "" + } + return c.PublicCodeSuggestions +} + +// GetSeatBreakdown returns the SeatBreakdown field. +func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { + if c == nil { + return nil + } + return c.SeatBreakdown +} + +// GetSeatManagementSetting returns the SeatManagementSetting field. +func (c *CopilotOrganizationDetails) GetSeatManagementSetting() string { + if c == nil { + return "" + } + return c.SeatManagementSetting +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotPeriodicMetrics) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDayTotals returns the DayTotals slice if it's non-nil, nil otherwise. +func (c *CopilotPeriodicMetrics) GetDayTotals() []*CopilotDailyMetrics { + if c == nil || c.DayTotals == nil { + return nil + } + return c.DayTotals +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotPeriodicMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotPeriodicMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotPeriodicMetrics) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotPeriodicMetrics) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetActiveThisCycle returns the ActiveThisCycle field. +func (c *CopilotSeatBreakdown) GetActiveThisCycle() int { + if c == nil { + return 0 + } + return c.ActiveThisCycle +} + +// GetAddedThisCycle returns the AddedThisCycle field. +func (c *CopilotSeatBreakdown) GetAddedThisCycle() int { + if c == nil { + return 0 + } + return c.AddedThisCycle +} + +// GetInactiveThisCycle returns the InactiveThisCycle field. +func (c *CopilotSeatBreakdown) GetInactiveThisCycle() int { + if c == nil { + return 0 + } + return c.InactiveThisCycle +} + +// GetPendingCancellation returns the PendingCancellation field. +func (c *CopilotSeatBreakdown) GetPendingCancellation() int { + if c == nil { + return 0 + } + return c.PendingCancellation +} + +// GetPendingInvitation returns the PendingInvitation field. +func (c *CopilotSeatBreakdown) GetPendingInvitation() int { + if c == nil { + return 0 + } + return c.PendingInvitation +} + +// GetTotal returns the Total field. +func (c *CopilotSeatBreakdown) GetTotal() int { + if c == nil { + return 0 + } + return c.Total +} + +// GetAssignee returns the Assignee field. +func (c *CopilotSeatDetails) GetAssignee() any { + if c == nil { + return nil + } + return c.Assignee +} + +// GetAssigningTeam returns the AssigningTeam field. +func (c *CopilotSeatDetails) GetAssigningTeam() *Team { + if c == nil { + return nil + } + return c.AssigningTeam +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityAt() Timestamp { + if c == nil || c.LastActivityAt == nil { + return Timestamp{} + } + return *c.LastActivityAt +} + +// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityEditor() string { + if c == nil || c.LastActivityEditor == nil { + return "" + } + return *c.LastActivityEditor +} + +// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPendingCancellationDate() string { + if c == nil || c.PendingCancellationDate == nil { + return "" + } + return *c.PendingCancellationDate +} + +// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPlanType() string { + if c == nil || c.PlanType == nil { + return "" + } + return *c.PlanType +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetDay returns the Day field. +func (c *CopilotUserDailyMetrics) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetTotalsByCLI returns the TotalsByCLI field. +func (c *CopilotUserDailyMetrics) GetTotalsByCLI() *CopilotMetricsCLI { + if c == nil { + return nil + } + return c.TotalsByCLI +} + +// GetTotalsByFeature returns the TotalsByFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByFeature() []*CopilotMetricsFeature { + if c == nil || c.TotalsByFeature == nil { + return nil + } + return c.TotalsByFeature +} + +// GetTotalsByIDE returns the TotalsByIDE slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByIDE() []*CopilotUserMetricsIDE { + if c == nil || c.TotalsByIDE == nil { + return nil + } + return c.TotalsByIDE +} + +// GetTotalsByLanguageFeature returns the TotalsByLanguageFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByLanguageFeature() []*CopilotMetricsLanguageFeature { + if c == nil || c.TotalsByLanguageFeature == nil { + return nil + } + return c.TotalsByLanguageFeature +} + +// GetTotalsByLanguageModel returns the TotalsByLanguageModel slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByLanguageModel() []*CopilotMetricsLanguageModel { + if c == nil || c.TotalsByLanguageModel == nil { + return nil + } + return c.TotalsByLanguageModel +} + +// GetTotalsByModelFeature returns the TotalsByModelFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserDailyMetrics) GetTotalsByModelFeature() []*CopilotMetricsModelFeature { + if c == nil || c.TotalsByModelFeature == nil { + return nil + } + return c.TotalsByModelFeature +} + +// GetUsedAgent returns the UsedAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedAgent() bool { + if c == nil || c.UsedAgent == nil { + return false + } + return *c.UsedAgent +} + +// GetUsedChat returns the UsedChat field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedChat() bool { + if c == nil || c.UsedChat == nil { + return false + } + return *c.UsedChat +} + +// GetUsedCLI returns the UsedCLI field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCLI() bool { + if c == nil || c.UsedCLI == nil { + return false + } + return *c.UsedCLI +} + +// GetUsedCopilotCodeReviewActive returns the UsedCopilotCodeReviewActive field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCopilotCodeReviewActive() bool { + if c == nil || c.UsedCopilotCodeReviewActive == nil { + return false + } + return *c.UsedCopilotCodeReviewActive +} + +// GetUsedCopilotCodeReviewPassive returns the UsedCopilotCodeReviewPassive field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCopilotCodeReviewPassive() bool { + if c == nil || c.UsedCopilotCodeReviewPassive == nil { + return false + } + return *c.UsedCopilotCodeReviewPassive +} + +// GetUsedCopilotCodingAgent returns the UsedCopilotCodingAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUsedCopilotCodingAgent() bool { + if c == nil || c.UsedCopilotCodingAgent == nil { + return false + } + return *c.UsedCopilotCodingAgent +} + +// GetUserID returns the UserID field. +func (c *CopilotUserDailyMetrics) GetUserID() int { + if c == nil { + return 0 + } + return c.UserID +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetUserLogin returns the UserLogin field. +func (c *CopilotUserDailyMetrics) GetUserLogin() string { + if c == nil { + return "" + } + return c.UserLogin +} + +// GetIDE returns the IDE field. +func (c *CopilotUserMetricsIDE) GetIDE() string { + if c == nil { + return "" + } + return c.IDE +} + +// GetLastKnownIDEVersion returns the LastKnownIDEVersion field. +func (c *CopilotUserMetricsIDE) GetLastKnownIDEVersion() *CopilotUserMetricsIDEVersion { + if c == nil { + return nil + } + return c.LastKnownIDEVersion +} + +// GetLastKnownPluginVersion returns the LastKnownPluginVersion field. +func (c *CopilotUserMetricsIDE) GetLastKnownPluginVersion() *CopilotUserMetricsPluginVersion { + if c == nil { + return nil + } + return c.LastKnownPluginVersion +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserMetricsIDE) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetIDEVersion returns the IDEVersion field. +func (c *CopilotUserMetricsIDEVersion) GetIDEVersion() string { + if c == nil { + return "" + } + return c.IDEVersion +} + +// GetSampledAt returns the SampledAt field if it's non-nil, zero value otherwise. +func (c *CopilotUserMetricsIDEVersion) GetSampledAt() Timestamp { + if c == nil || c.SampledAt == nil { + return Timestamp{} + } + return *c.SampledAt +} + +// GetPlugin returns the Plugin field. +func (c *CopilotUserMetricsPluginVersion) GetPlugin() string { + if c == nil { + return "" + } + return c.Plugin +} + +// GetPluginVersion returns the PluginVersion field. +func (c *CopilotUserMetricsPluginVersion) GetPluginVersion() string { + if c == nil { + return "" + } + return c.PluginVersion +} + +// GetSampledAt returns the SampledAt field if it's non-nil, zero value otherwise. +func (c *CopilotUserMetricsPluginVersion) GetSampledAt() Timestamp { + if c == nil || c.SampledAt == nil { + return Timestamp{} + } + return *c.SampledAt +} + +// GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetCodeAcceptanceActivityCount() int { + if c == nil || c.CodeAcceptanceActivityCount == nil { + return 0 + } + return *c.CodeAcceptanceActivityCount +} + +// GetCodeGenerationActivityCount returns the CodeGenerationActivityCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetCodeGenerationActivityCount() int { + if c == nil || c.CodeGenerationActivityCount == nil { + return 0 + } + return *c.CodeGenerationActivityCount +} + +// GetDay returns the Day field. +func (c *CopilotUserPeriodicMetrics) GetDay() string { + if c == nil { + return "" + } + return c.Day +} + +// GetEnterpriseID returns the EnterpriseID field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetEnterpriseID() string { + if c == nil || c.EnterpriseID == nil { + return "" + } + return *c.EnterpriseID +} + +// GetLOCAddedSum returns the LOCAddedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCAddedSum() int { + if c == nil || c.LOCAddedSum == nil { + return 0 + } + return *c.LOCAddedSum +} + +// GetLOCDeletedSum returns the LOCDeletedSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCDeletedSum() int { + if c == nil || c.LOCDeletedSum == nil { + return 0 + } + return *c.LOCDeletedSum +} + +// GetLOCSuggestedToAddSum returns the LOCSuggestedToAddSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCSuggestedToAddSum() int { + if c == nil || c.LOCSuggestedToAddSum == nil { + return 0 + } + return *c.LOCSuggestedToAddSum +} + +// GetLOCSuggestedToDeleteSum returns the LOCSuggestedToDeleteSum field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetLOCSuggestedToDeleteSum() int { + if c == nil || c.LOCSuggestedToDeleteSum == nil { + return 0 + } + return *c.LOCSuggestedToDeleteSum +} + +// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetOrganizationID() string { + if c == nil || c.OrganizationID == nil { + return "" + } + return *c.OrganizationID +} + +// GetReportEndDay returns the ReportEndDay field. +func (c *CopilotUserPeriodicMetrics) GetReportEndDay() string { + if c == nil { + return "" + } + return c.ReportEndDay +} + +// GetReportStartDay returns the ReportStartDay field. +func (c *CopilotUserPeriodicMetrics) GetReportStartDay() string { + if c == nil { + return "" + } + return c.ReportStartDay +} + +// GetTotalsByCLI returns the TotalsByCLI field. +func (c *CopilotUserPeriodicMetrics) GetTotalsByCLI() *CopilotMetricsCLI { + if c == nil { + return nil + } + return c.TotalsByCLI +} + +// GetTotalsByFeature returns the TotalsByFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByFeature() []*CopilotMetricsFeature { + if c == nil || c.TotalsByFeature == nil { + return nil + } + return c.TotalsByFeature +} + +// GetTotalsByIDE returns the TotalsByIDE slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByIDE() []*CopilotUserMetricsIDE { + if c == nil || c.TotalsByIDE == nil { + return nil + } + return c.TotalsByIDE +} + +// GetTotalsByLanguageFeature returns the TotalsByLanguageFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByLanguageFeature() []*CopilotMetricsLanguageFeature { + if c == nil || c.TotalsByLanguageFeature == nil { + return nil + } + return c.TotalsByLanguageFeature +} + +// GetTotalsByLanguageModel returns the TotalsByLanguageModel slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByLanguageModel() []*CopilotMetricsLanguageModel { + if c == nil || c.TotalsByLanguageModel == nil { + return nil + } + return c.TotalsByLanguageModel +} + +// GetTotalsByModelFeature returns the TotalsByModelFeature slice if it's non-nil, nil otherwise. +func (c *CopilotUserPeriodicMetrics) GetTotalsByModelFeature() []*CopilotMetricsModelFeature { + if c == nil || c.TotalsByModelFeature == nil { + return nil + } + return c.TotalsByModelFeature +} + +// GetUsedAgent returns the UsedAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedAgent() bool { + if c == nil || c.UsedAgent == nil { + return false + } + return *c.UsedAgent +} + +// GetUsedChat returns the UsedChat field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedChat() bool { + if c == nil || c.UsedChat == nil { + return false + } + return *c.UsedChat +} + +// GetUsedCLI returns the UsedCLI field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCLI() bool { + if c == nil || c.UsedCLI == nil { + return false + } + return *c.UsedCLI +} + +// GetUsedCopilotCodeReviewActive returns the UsedCopilotCodeReviewActive field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCopilotCodeReviewActive() bool { + if c == nil || c.UsedCopilotCodeReviewActive == nil { + return false + } + return *c.UsedCopilotCodeReviewActive +} + +// GetUsedCopilotCodeReviewPassive returns the UsedCopilotCodeReviewPassive field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCopilotCodeReviewPassive() bool { + if c == nil || c.UsedCopilotCodeReviewPassive == nil { + return false + } + return *c.UsedCopilotCodeReviewPassive +} + +// GetUsedCopilotCodingAgent returns the UsedCopilotCodingAgent field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUsedCopilotCodingAgent() bool { + if c == nil || c.UsedCopilotCodingAgent == nil { + return false + } + return *c.UsedCopilotCodingAgent +} + +// GetUserID returns the UserID field. +func (c *CopilotUserPeriodicMetrics) GetUserID() int { + if c == nil { + return 0 + } + return c.UserID +} + +// GetUserInitiatedInteractionCount returns the UserInitiatedInteractionCount field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetUserInitiatedInteractionCount() int { + if c == nil || c.UserInitiatedInteractionCount == nil { + return 0 + } + return *c.UserInitiatedInteractionCount +} + +// GetUserLogin returns the UserLogin field. +func (c *CopilotUserPeriodicMetrics) GetUserLogin() string { + if c == nil { + return "" + } + return c.UserLogin } // GetAzureSubscription returns the AzureSubscription field if it's non-nil, zero value otherwise. diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index df9a0703a54..c10a2c30182 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10524,6 +10524,283 @@ func TestCopilotCodeReviewRuleParameters_GetReviewOnPush(tt *testing.T) { c.GetReviewOnPush() } +func TestCopilotDailyMetrics_GetCodeAcceptanceActivityCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{CodeAcceptanceActivityCount: &zeroValue} + c.GetCodeAcceptanceActivityCount() + c = &CopilotDailyMetrics{} + c.GetCodeAcceptanceActivityCount() + c = nil + c.GetCodeAcceptanceActivityCount() +} + +func TestCopilotDailyMetrics_GetCodeGenerationActivityCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{CodeGenerationActivityCount: &zeroValue} + c.GetCodeGenerationActivityCount() + c = &CopilotDailyMetrics{} + c.GetCodeGenerationActivityCount() + c = nil + c.GetCodeGenerationActivityCount() +} + +func TestCopilotDailyMetrics_GetDailyActiveCLIUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{DailyActiveCLIUsers: &zeroValue} + c.GetDailyActiveCLIUsers() + c = &CopilotDailyMetrics{} + c.GetDailyActiveCLIUsers() + c = nil + c.GetDailyActiveCLIUsers() +} + +func TestCopilotDailyMetrics_GetDailyActiveCopilotCloudAgentUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{DailyActiveCopilotCloudAgentUsers: &zeroValue} + c.GetDailyActiveCopilotCloudAgentUsers() + c = &CopilotDailyMetrics{} + c.GetDailyActiveCopilotCloudAgentUsers() + c = nil + c.GetDailyActiveCopilotCloudAgentUsers() +} + +func TestCopilotDailyMetrics_GetDailyActiveUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{DailyActiveUsers: &zeroValue} + c.GetDailyActiveUsers() + c = &CopilotDailyMetrics{} + c.GetDailyActiveUsers() + c = nil + c.GetDailyActiveUsers() +} + +func TestCopilotDailyMetrics_GetDay(tt *testing.T) { + tt.Parallel() + c := &CopilotDailyMetrics{} + c.GetDay() + c = nil + c.GetDay() +} + +func TestCopilotDailyMetrics_GetEnterpriseID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotDailyMetrics{EnterpriseID: &zeroValue} + c.GetEnterpriseID() + c = &CopilotDailyMetrics{} + c.GetEnterpriseID() + c = nil + c.GetEnterpriseID() +} + +func TestCopilotDailyMetrics_GetLOCAddedSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{LOCAddedSum: &zeroValue} + c.GetLOCAddedSum() + c = &CopilotDailyMetrics{} + c.GetLOCAddedSum() + c = nil + c.GetLOCAddedSum() +} + +func TestCopilotDailyMetrics_GetLOCDeletedSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{LOCDeletedSum: &zeroValue} + c.GetLOCDeletedSum() + c = &CopilotDailyMetrics{} + c.GetLOCDeletedSum() + c = nil + c.GetLOCDeletedSum() +} + +func TestCopilotDailyMetrics_GetLOCSuggestedToAddSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{LOCSuggestedToAddSum: &zeroValue} + c.GetLOCSuggestedToAddSum() + c = &CopilotDailyMetrics{} + c.GetLOCSuggestedToAddSum() + c = nil + c.GetLOCSuggestedToAddSum() +} + +func TestCopilotDailyMetrics_GetLOCSuggestedToDeleteSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{LOCSuggestedToDeleteSum: &zeroValue} + c.GetLOCSuggestedToDeleteSum() + c = &CopilotDailyMetrics{} + c.GetLOCSuggestedToDeleteSum() + c = nil + c.GetLOCSuggestedToDeleteSum() +} + +func TestCopilotDailyMetrics_GetMonthlyActiveAgentUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{MonthlyActiveAgentUsers: &zeroValue} + c.GetMonthlyActiveAgentUsers() + c = &CopilotDailyMetrics{} + c.GetMonthlyActiveAgentUsers() + c = nil + c.GetMonthlyActiveAgentUsers() +} + +func TestCopilotDailyMetrics_GetMonthlyActiveChatUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{MonthlyActiveChatUsers: &zeroValue} + c.GetMonthlyActiveChatUsers() + c = &CopilotDailyMetrics{} + c.GetMonthlyActiveChatUsers() + c = nil + c.GetMonthlyActiveChatUsers() +} + +func TestCopilotDailyMetrics_GetMonthlyActiveCopilotCloudAgentUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{MonthlyActiveCopilotCloudAgentUsers: &zeroValue} + c.GetMonthlyActiveCopilotCloudAgentUsers() + c = &CopilotDailyMetrics{} + c.GetMonthlyActiveCopilotCloudAgentUsers() + c = nil + c.GetMonthlyActiveCopilotCloudAgentUsers() +} + +func TestCopilotDailyMetrics_GetMonthlyActiveUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{MonthlyActiveUsers: &zeroValue} + c.GetMonthlyActiveUsers() + c = &CopilotDailyMetrics{} + c.GetMonthlyActiveUsers() + c = nil + c.GetMonthlyActiveUsers() +} + +func TestCopilotDailyMetrics_GetOrganizationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotDailyMetrics{OrganizationID: &zeroValue} + c.GetOrganizationID() + c = &CopilotDailyMetrics{} + c.GetOrganizationID() + c = nil + c.GetOrganizationID() +} + +func TestCopilotDailyMetrics_GetPullRequests(tt *testing.T) { + tt.Parallel() + c := &CopilotDailyMetrics{} + c.GetPullRequests() + c = nil + c.GetPullRequests() +} + +func TestCopilotDailyMetrics_GetTotalsByCLI(tt *testing.T) { + tt.Parallel() + c := &CopilotDailyMetrics{} + c.GetTotalsByCLI() + c = nil + c.GetTotalsByCLI() +} + +func TestCopilotDailyMetrics_GetTotalsByFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsFeature{} + c := &CopilotDailyMetrics{TotalsByFeature: zeroValue} + c.GetTotalsByFeature() + c = &CopilotDailyMetrics{} + c.GetTotalsByFeature() + c = nil + c.GetTotalsByFeature() +} + +func TestCopilotDailyMetrics_GetTotalsByIDE(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsIDE{} + c := &CopilotDailyMetrics{TotalsByIDE: zeroValue} + c.GetTotalsByIDE() + c = &CopilotDailyMetrics{} + c.GetTotalsByIDE() + c = nil + c.GetTotalsByIDE() +} + +func TestCopilotDailyMetrics_GetTotalsByLanguageFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsLanguageFeature{} + c := &CopilotDailyMetrics{TotalsByLanguageFeature: zeroValue} + c.GetTotalsByLanguageFeature() + c = &CopilotDailyMetrics{} + c.GetTotalsByLanguageFeature() + c = nil + c.GetTotalsByLanguageFeature() +} + +func TestCopilotDailyMetrics_GetTotalsByLanguageModel(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsLanguageModel{} + c := &CopilotDailyMetrics{TotalsByLanguageModel: zeroValue} + c.GetTotalsByLanguageModel() + c = &CopilotDailyMetrics{} + c.GetTotalsByLanguageModel() + c = nil + c.GetTotalsByLanguageModel() +} + +func TestCopilotDailyMetrics_GetTotalsByModelFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsModelFeature{} + c := &CopilotDailyMetrics{TotalsByModelFeature: zeroValue} + c.GetTotalsByModelFeature() + c = &CopilotDailyMetrics{} + c.GetTotalsByModelFeature() + c = nil + c.GetTotalsByModelFeature() +} + +func TestCopilotDailyMetrics_GetUserInitiatedInteractionCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotDailyMetrics{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotDailyMetrics_GetWeeklyActiveCopilotCloudAgentUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{WeeklyActiveCopilotCloudAgentUsers: &zeroValue} + c.GetWeeklyActiveCopilotCloudAgentUsers() + c = &CopilotDailyMetrics{} + c.GetWeeklyActiveCopilotCloudAgentUsers() + c = nil + c.GetWeeklyActiveCopilotCloudAgentUsers() +} + +func TestCopilotDailyMetrics_GetWeeklyActiveUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotDailyMetrics{WeeklyActiveUsers: &zeroValue} + c.GetWeeklyActiveUsers() + c = &CopilotDailyMetrics{} + c.GetWeeklyActiveUsers() + c = nil + c.GetWeeklyActiveUsers() +} + func TestCopilotDailyMetricsReport_GetDownloadLinks(tt *testing.T) { tt.Parallel() zeroValue := []string{} @@ -11028,223 +11305,1357 @@ func TestCopilotMetrics_GetTotalEngagedUsers(tt *testing.T) { c.GetTotalEngagedUsers() } -func TestCopilotMetricsListOptions_GetSince(tt *testing.T) { +func TestCopilotMetricsChatPanel_GetChatPanelAgentMode(tt *testing.T) { tt.Parallel() - var zeroValue time.Time - c := &CopilotMetricsListOptions{Since: &zeroValue} - c.GetSince() - c = &CopilotMetricsListOptions{} - c.GetSince() + var zeroValue int + c := &CopilotMetricsChatPanel{ChatPanelAgentMode: &zeroValue} + c.GetChatPanelAgentMode() + c = &CopilotMetricsChatPanel{} + c.GetChatPanelAgentMode() c = nil - c.GetSince() + c.GetChatPanelAgentMode() } -func TestCopilotMetricsListOptions_GetUntil(tt *testing.T) { +func TestCopilotMetricsChatPanel_GetChatPanelAskMode(tt *testing.T) { tt.Parallel() - var zeroValue time.Time - c := &CopilotMetricsListOptions{Until: &zeroValue} - c.GetUntil() - c = &CopilotMetricsListOptions{} - c.GetUntil() + var zeroValue int + c := &CopilotMetricsChatPanel{ChatPanelAskMode: &zeroValue} + c.GetChatPanelAskMode() + c = &CopilotMetricsChatPanel{} + c.GetChatPanelAskMode() c = nil - c.GetUntil() + c.GetChatPanelAskMode() } -func TestCopilotMetricsReport_GetDownloadLinks(tt *testing.T) { +func TestCopilotMetricsChatPanel_GetChatPanelCustomMode(tt *testing.T) { tt.Parallel() - zeroValue := []string{} - c := &CopilotMetricsReport{DownloadLinks: zeroValue} - c.GetDownloadLinks() - c = &CopilotMetricsReport{} - c.GetDownloadLinks() + var zeroValue int + c := &CopilotMetricsChatPanel{ChatPanelCustomMode: &zeroValue} + c.GetChatPanelCustomMode() + c = &CopilotMetricsChatPanel{} + c.GetChatPanelCustomMode() c = nil - c.GetDownloadLinks() + c.GetChatPanelCustomMode() } -func TestCopilotMetricsReport_GetReportEndDay(tt *testing.T) { +func TestCopilotMetricsChatPanel_GetChatPanelEditMode(tt *testing.T) { tt.Parallel() - c := &CopilotMetricsReport{} - c.GetReportEndDay() + var zeroValue int + c := &CopilotMetricsChatPanel{ChatPanelEditMode: &zeroValue} + c.GetChatPanelEditMode() + c = &CopilotMetricsChatPanel{} + c.GetChatPanelEditMode() c = nil - c.GetReportEndDay() + c.GetChatPanelEditMode() } -func TestCopilotMetricsReport_GetReportStartDay(tt *testing.T) { +func TestCopilotMetricsChatPanel_GetChatPanelUnknownMode(tt *testing.T) { tt.Parallel() - c := &CopilotMetricsReport{} - c.GetReportStartDay() + var zeroValue int + c := &CopilotMetricsChatPanel{ChatPanelUnknownMode: &zeroValue} + c.GetChatPanelUnknownMode() + c = &CopilotMetricsChatPanel{} + c.GetChatPanelUnknownMode() c = nil - c.GetReportStartDay() + c.GetChatPanelUnknownMode() } -func TestCopilotMetricsReportOptions_GetDay(tt *testing.T) { +func TestCopilotMetricsCLI_GetLastKnownCLIVersion(tt *testing.T) { tt.Parallel() - c := &CopilotMetricsReportOptions{} - c.GetDay() + c := &CopilotMetricsCLI{} + c.GetLastKnownCLIVersion() c = nil - c.GetDay() + c.GetLastKnownCLIVersion() } -func TestCopilotOrganizationDetails_GetCopilotChat(tt *testing.T) { +func TestCopilotMetricsCLI_GetPromptCount(tt *testing.T) { tt.Parallel() - c := &CopilotOrganizationDetails{} - c.GetCopilotChat() + var zeroValue int + c := &CopilotMetricsCLI{PromptCount: &zeroValue} + c.GetPromptCount() + c = &CopilotMetricsCLI{} + c.GetPromptCount() c = nil - c.GetCopilotChat() + c.GetPromptCount() } -func TestCopilotOrganizationDetails_GetPublicCodeSuggestions(tt *testing.T) { +func TestCopilotMetricsCLI_GetRequestCount(tt *testing.T) { tt.Parallel() - c := &CopilotOrganizationDetails{} - c.GetPublicCodeSuggestions() + var zeroValue int + c := &CopilotMetricsCLI{RequestCount: &zeroValue} + c.GetRequestCount() + c = &CopilotMetricsCLI{} + c.GetRequestCount() c = nil - c.GetPublicCodeSuggestions() + c.GetRequestCount() } -func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { +func TestCopilotMetricsCLI_GetSessionCount(tt *testing.T) { tt.Parallel() - c := &CopilotOrganizationDetails{} - c.GetSeatBreakdown() + var zeroValue int + c := &CopilotMetricsCLI{SessionCount: &zeroValue} + c.GetSessionCount() + c = &CopilotMetricsCLI{} + c.GetSessionCount() c = nil - c.GetSeatBreakdown() + c.GetSessionCount() } -func TestCopilotOrganizationDetails_GetSeatManagementSetting(tt *testing.T) { +func TestCopilotMetricsCLI_GetTokenUsage(tt *testing.T) { tt.Parallel() - c := &CopilotOrganizationDetails{} - c.GetSeatManagementSetting() + c := &CopilotMetricsCLI{} + c.GetTokenUsage() c = nil - c.GetSeatManagementSetting() + c.GetTokenUsage() } -func TestCopilotSeatBreakdown_GetActiveThisCycle(tt *testing.T) { +func TestCopilotMetricsCLITokenUsage_GetAvgTokensPerRequest(tt *testing.T) { tt.Parallel() - c := &CopilotSeatBreakdown{} - c.GetActiveThisCycle() + var zeroValue float64 + c := &CopilotMetricsCLITokenUsage{AvgTokensPerRequest: &zeroValue} + c.GetAvgTokensPerRequest() + c = &CopilotMetricsCLITokenUsage{} + c.GetAvgTokensPerRequest() c = nil - c.GetActiveThisCycle() + c.GetAvgTokensPerRequest() } -func TestCopilotSeatBreakdown_GetAddedThisCycle(tt *testing.T) { +func TestCopilotMetricsCLITokenUsage_GetOutputTokensSum(tt *testing.T) { tt.Parallel() - c := &CopilotSeatBreakdown{} - c.GetAddedThisCycle() + var zeroValue int + c := &CopilotMetricsCLITokenUsage{OutputTokensSum: &zeroValue} + c.GetOutputTokensSum() + c = &CopilotMetricsCLITokenUsage{} + c.GetOutputTokensSum() c = nil - c.GetAddedThisCycle() + c.GetOutputTokensSum() } -func TestCopilotSeatBreakdown_GetInactiveThisCycle(tt *testing.T) { +func TestCopilotMetricsCLITokenUsage_GetPromptTokensSum(tt *testing.T) { tt.Parallel() - c := &CopilotSeatBreakdown{} - c.GetInactiveThisCycle() + var zeroValue int + c := &CopilotMetricsCLITokenUsage{PromptTokensSum: &zeroValue} + c.GetPromptTokensSum() + c = &CopilotMetricsCLITokenUsage{} + c.GetPromptTokensSum() c = nil - c.GetInactiveThisCycle() + c.GetPromptTokensSum() } -func TestCopilotSeatBreakdown_GetPendingCancellation(tt *testing.T) { +func TestCopilotMetricsCLIVersion_GetCLIVersion(tt *testing.T) { tt.Parallel() - c := &CopilotSeatBreakdown{} - c.GetPendingCancellation() + c := &CopilotMetricsCLIVersion{} + c.GetCLIVersion() c = nil - c.GetPendingCancellation() + c.GetCLIVersion() } -func TestCopilotSeatBreakdown_GetPendingInvitation(tt *testing.T) { +func TestCopilotMetricsCLIVersion_GetSampledAt(tt *testing.T) { tt.Parallel() - c := &CopilotSeatBreakdown{} - c.GetPendingInvitation() + var zeroValue Timestamp + c := &CopilotMetricsCLIVersion{SampledAt: &zeroValue} + c.GetSampledAt() + c = &CopilotMetricsCLIVersion{} + c.GetSampledAt() c = nil - c.GetPendingInvitation() + c.GetSampledAt() } -func TestCopilotSeatBreakdown_GetTotal(tt *testing.T) { +func TestCopilotMetricsCodeActivity_GetCodeAcceptanceActivityCount(tt *testing.T) { tt.Parallel() - c := &CopilotSeatBreakdown{} - c.GetTotal() + var zeroValue int + c := &CopilotMetricsCodeActivity{CodeAcceptanceActivityCount: &zeroValue} + c.GetCodeAcceptanceActivityCount() + c = &CopilotMetricsCodeActivity{} + c.GetCodeAcceptanceActivityCount() c = nil - c.GetTotal() + c.GetCodeAcceptanceActivityCount() } -func TestCopilotSeatDetails_GetAssignee(tt *testing.T) { +func TestCopilotMetricsCodeActivity_GetCodeGenerationActivityCount(tt *testing.T) { tt.Parallel() - c := &CopilotSeatDetails{} - c.GetAssignee() + var zeroValue int + c := &CopilotMetricsCodeActivity{CodeGenerationActivityCount: &zeroValue} + c.GetCodeGenerationActivityCount() + c = &CopilotMetricsCodeActivity{} + c.GetCodeGenerationActivityCount() c = nil - c.GetAssignee() + c.GetCodeGenerationActivityCount() } -func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { +func TestCopilotMetricsCodeActivity_GetLOCAddedSum(tt *testing.T) { tt.Parallel() - c := &CopilotSeatDetails{} - c.GetAssigningTeam() + var zeroValue int + c := &CopilotMetricsCodeActivity{LOCAddedSum: &zeroValue} + c.GetLOCAddedSum() + c = &CopilotMetricsCodeActivity{} + c.GetLOCAddedSum() c = nil - c.GetAssigningTeam() + c.GetLOCAddedSum() } -func TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) { +func TestCopilotMetricsCodeActivity_GetLOCDeletedSum(tt *testing.T) { tt.Parallel() - var zeroValue Timestamp - c := &CopilotSeatDetails{CreatedAt: &zeroValue} - c.GetCreatedAt() - c = &CopilotSeatDetails{} - c.GetCreatedAt() + var zeroValue int + c := &CopilotMetricsCodeActivity{LOCDeletedSum: &zeroValue} + c.GetLOCDeletedSum() + c = &CopilotMetricsCodeActivity{} + c.GetLOCDeletedSum() c = nil - c.GetCreatedAt() + c.GetLOCDeletedSum() } -func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { +func TestCopilotMetricsCodeActivity_GetLOCSuggestedToAddSum(tt *testing.T) { tt.Parallel() - var zeroValue Timestamp - c := &CopilotSeatDetails{LastActivityAt: &zeroValue} - c.GetLastActivityAt() - c = &CopilotSeatDetails{} - c.GetLastActivityAt() + var zeroValue int + c := &CopilotMetricsCodeActivity{LOCSuggestedToAddSum: &zeroValue} + c.GetLOCSuggestedToAddSum() + c = &CopilotMetricsCodeActivity{} + c.GetLOCSuggestedToAddSum() c = nil - c.GetLastActivityAt() + c.GetLOCSuggestedToAddSum() } -func TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) { +func TestCopilotMetricsCodeActivity_GetLOCSuggestedToDeleteSum(tt *testing.T) { tt.Parallel() - var zeroValue string - c := &CopilotSeatDetails{LastActivityEditor: &zeroValue} - c.GetLastActivityEditor() - c = &CopilotSeatDetails{} - c.GetLastActivityEditor() + var zeroValue int + c := &CopilotMetricsCodeActivity{LOCSuggestedToDeleteSum: &zeroValue} + c.GetLOCSuggestedToDeleteSum() + c = &CopilotMetricsCodeActivity{} + c.GetLOCSuggestedToDeleteSum() c = nil - c.GetLastActivityEditor() + c.GetLOCSuggestedToDeleteSum() } -func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { +func TestCopilotMetricsFeature_GetFeature(tt *testing.T) { tt.Parallel() - var zeroValue string - c := &CopilotSeatDetails{PendingCancellationDate: &zeroValue} - c.GetPendingCancellationDate() - c = &CopilotSeatDetails{} - c.GetPendingCancellationDate() + c := &CopilotMetricsFeature{} + c.GetFeature() c = nil - c.GetPendingCancellationDate() + c.GetFeature() } -func TestCopilotSeatDetails_GetPlanType(tt *testing.T) { +func TestCopilotMetricsFeature_GetUserInitiatedInteractionCount(tt *testing.T) { tt.Parallel() - var zeroValue string - c := &CopilotSeatDetails{PlanType: &zeroValue} + var zeroValue int + c := &CopilotMetricsFeature{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotMetricsFeature{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotMetricsIDE_GetIDE(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsIDE{} + c.GetIDE() + c = nil + c.GetIDE() +} + +func TestCopilotMetricsIDE_GetUserInitiatedInteractionCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsIDE{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotMetricsIDE{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotMetricsLanguageFeature_GetFeature(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsLanguageFeature{} + c.GetFeature() + c = nil + c.GetFeature() +} + +func TestCopilotMetricsLanguageFeature_GetLanguage(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsLanguageFeature{} + c.GetLanguage() + c = nil + c.GetLanguage() +} + +func TestCopilotMetricsLanguageModel_GetLanguage(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsLanguageModel{} + c.GetLanguage() + c = nil + c.GetLanguage() +} + +func TestCopilotMetricsLanguageModel_GetModel(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsLanguageModel{} + c.GetModel() + c = nil + c.GetModel() +} + +func TestCopilotMetricsListOptions_GetSince(tt *testing.T) { + tt.Parallel() + var zeroValue time.Time + c := &CopilotMetricsListOptions{Since: &zeroValue} + c.GetSince() + c = &CopilotMetricsListOptions{} + c.GetSince() + c = nil + c.GetSince() +} + +func TestCopilotMetricsListOptions_GetUntil(tt *testing.T) { + tt.Parallel() + var zeroValue time.Time + c := &CopilotMetricsListOptions{Until: &zeroValue} + c.GetUntil() + c = &CopilotMetricsListOptions{} + c.GetUntil() + c = nil + c.GetUntil() +} + +func TestCopilotMetricsModelFeature_GetFeature(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsModelFeature{} + c.GetFeature() + c = nil + c.GetFeature() +} + +func TestCopilotMetricsModelFeature_GetModel(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsModelFeature{} + c.GetModel() + c = nil + c.GetModel() +} + +func TestCopilotMetricsModelFeature_GetUserInitiatedInteractionCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsModelFeature{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotMetricsModelFeature{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotMetricsPullRequests_GetMedianMinutesToMerge(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsPullRequests{MedianMinutesToMerge: &zeroValue} + c.GetMedianMinutesToMerge() + c = &CopilotMetricsPullRequests{} + c.GetMedianMinutesToMerge() + c = nil + c.GetMedianMinutesToMerge() +} + +func TestCopilotMetricsPullRequests_GetMedianMinutesToMergeCopilotAuthored(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsPullRequests{MedianMinutesToMergeCopilotAuthored: &zeroValue} + c.GetMedianMinutesToMergeCopilotAuthored() + c = &CopilotMetricsPullRequests{} + c.GetMedianMinutesToMergeCopilotAuthored() + c = nil + c.GetMedianMinutesToMergeCopilotAuthored() +} + +func TestCopilotMetricsPullRequests_GetMedianMinutesToMergeCopilotReviewed(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsPullRequests{MedianMinutesToMergeCopilotReviewed: &zeroValue} + c.GetMedianMinutesToMergeCopilotReviewed() + c = &CopilotMetricsPullRequests{} + c.GetMedianMinutesToMergeCopilotReviewed() + c = nil + c.GetMedianMinutesToMergeCopilotReviewed() +} + +func TestCopilotMetricsPullRequests_GetTotalAppliedSuggestions(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalAppliedSuggestions: &zeroValue} + c.GetTotalAppliedSuggestions() + c = &CopilotMetricsPullRequests{} + c.GetTotalAppliedSuggestions() + c = nil + c.GetTotalAppliedSuggestions() +} + +func TestCopilotMetricsPullRequests_GetTotalCopilotAppliedSuggestions(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalCopilotAppliedSuggestions: &zeroValue} + c.GetTotalCopilotAppliedSuggestions() + c = &CopilotMetricsPullRequests{} + c.GetTotalCopilotAppliedSuggestions() + c = nil + c.GetTotalCopilotAppliedSuggestions() +} + +func TestCopilotMetricsPullRequests_GetTotalCopilotSuggestions(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalCopilotSuggestions: &zeroValue} + c.GetTotalCopilotSuggestions() + c = &CopilotMetricsPullRequests{} + c.GetTotalCopilotSuggestions() + c = nil + c.GetTotalCopilotSuggestions() +} + +func TestCopilotMetricsPullRequests_GetTotalCreated(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalCreated: &zeroValue} + c.GetTotalCreated() + c = &CopilotMetricsPullRequests{} + c.GetTotalCreated() + c = nil + c.GetTotalCreated() +} + +func TestCopilotMetricsPullRequests_GetTotalCreatedByCopilot(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalCreatedByCopilot: &zeroValue} + c.GetTotalCreatedByCopilot() + c = &CopilotMetricsPullRequests{} + c.GetTotalCreatedByCopilot() + c = nil + c.GetTotalCreatedByCopilot() +} + +func TestCopilotMetricsPullRequests_GetTotalMerged(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalMerged: &zeroValue} + c.GetTotalMerged() + c = &CopilotMetricsPullRequests{} + c.GetTotalMerged() + c = nil + c.GetTotalMerged() +} + +func TestCopilotMetricsPullRequests_GetTotalMergedCreatedByCopilot(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalMergedCreatedByCopilot: &zeroValue} + c.GetTotalMergedCreatedByCopilot() + c = &CopilotMetricsPullRequests{} + c.GetTotalMergedCreatedByCopilot() + c = nil + c.GetTotalMergedCreatedByCopilot() +} + +func TestCopilotMetricsPullRequests_GetTotalMergedReviewedByCopilot(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalMergedReviewedByCopilot: &zeroValue} + c.GetTotalMergedReviewedByCopilot() + c = &CopilotMetricsPullRequests{} + c.GetTotalMergedReviewedByCopilot() + c = nil + c.GetTotalMergedReviewedByCopilot() +} + +func TestCopilotMetricsPullRequests_GetTotalReviewed(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalReviewed: &zeroValue} + c.GetTotalReviewed() + c = &CopilotMetricsPullRequests{} + c.GetTotalReviewed() + c = nil + c.GetTotalReviewed() +} + +func TestCopilotMetricsPullRequests_GetTotalReviewedByCopilot(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalReviewedByCopilot: &zeroValue} + c.GetTotalReviewedByCopilot() + c = &CopilotMetricsPullRequests{} + c.GetTotalReviewedByCopilot() + c = nil + c.GetTotalReviewedByCopilot() +} + +func TestCopilotMetricsPullRequests_GetTotalSuggestions(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsPullRequests{TotalSuggestions: &zeroValue} + c.GetTotalSuggestions() + c = &CopilotMetricsPullRequests{} + c.GetTotalSuggestions() + c = nil + c.GetTotalSuggestions() +} + +func TestCopilotMetricsReport_GetDownloadLinks(tt *testing.T) { + tt.Parallel() + zeroValue := []string{} + c := &CopilotMetricsReport{DownloadLinks: zeroValue} + c.GetDownloadLinks() + c = &CopilotMetricsReport{} + c.GetDownloadLinks() + c = nil + c.GetDownloadLinks() +} + +func TestCopilotMetricsReport_GetReportEndDay(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsReport{} + c.GetReportEndDay() + c = nil + c.GetReportEndDay() +} + +func TestCopilotMetricsReport_GetReportStartDay(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsReport{} + c.GetReportStartDay() + c = nil + c.GetReportStartDay() +} + +func TestCopilotMetricsReportOptions_GetDay(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsReportOptions{} + c.GetDay() + c = nil + c.GetDay() +} + +func TestCopilotOrganizationDetails_GetCopilotChat(tt *testing.T) { + tt.Parallel() + c := &CopilotOrganizationDetails{} + c.GetCopilotChat() + c = nil + c.GetCopilotChat() +} + +func TestCopilotOrganizationDetails_GetPublicCodeSuggestions(tt *testing.T) { + tt.Parallel() + c := &CopilotOrganizationDetails{} + c.GetPublicCodeSuggestions() + c = nil + c.GetPublicCodeSuggestions() +} + +func TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) { + tt.Parallel() + c := &CopilotOrganizationDetails{} + c.GetSeatBreakdown() + c = nil + c.GetSeatBreakdown() +} + +func TestCopilotOrganizationDetails_GetSeatManagementSetting(tt *testing.T) { + tt.Parallel() + c := &CopilotOrganizationDetails{} + c.GetSeatManagementSetting() + c = nil + c.GetSeatManagementSetting() +} + +func TestCopilotPeriodicMetrics_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CopilotPeriodicMetrics{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CopilotPeriodicMetrics{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCopilotPeriodicMetrics_GetDayTotals(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotDailyMetrics{} + c := &CopilotPeriodicMetrics{DayTotals: zeroValue} + c.GetDayTotals() + c = &CopilotPeriodicMetrics{} + c.GetDayTotals() + c = nil + c.GetDayTotals() +} + +func TestCopilotPeriodicMetrics_GetEnterpriseID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotPeriodicMetrics{EnterpriseID: &zeroValue} + c.GetEnterpriseID() + c = &CopilotPeriodicMetrics{} + c.GetEnterpriseID() + c = nil + c.GetEnterpriseID() +} + +func TestCopilotPeriodicMetrics_GetOrganizationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotPeriodicMetrics{OrganizationID: &zeroValue} + c.GetOrganizationID() + c = &CopilotPeriodicMetrics{} + c.GetOrganizationID() + c = nil + c.GetOrganizationID() +} + +func TestCopilotPeriodicMetrics_GetReportEndDay(tt *testing.T) { + tt.Parallel() + c := &CopilotPeriodicMetrics{} + c.GetReportEndDay() + c = nil + c.GetReportEndDay() +} + +func TestCopilotPeriodicMetrics_GetReportStartDay(tt *testing.T) { + tt.Parallel() + c := &CopilotPeriodicMetrics{} + c.GetReportStartDay() + c = nil + c.GetReportStartDay() +} + +func TestCopilotSeatBreakdown_GetActiveThisCycle(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatBreakdown{} + c.GetActiveThisCycle() + c = nil + c.GetActiveThisCycle() +} + +func TestCopilotSeatBreakdown_GetAddedThisCycle(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatBreakdown{} + c.GetAddedThisCycle() + c = nil + c.GetAddedThisCycle() +} + +func TestCopilotSeatBreakdown_GetInactiveThisCycle(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatBreakdown{} + c.GetInactiveThisCycle() + c = nil + c.GetInactiveThisCycle() +} + +func TestCopilotSeatBreakdown_GetPendingCancellation(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatBreakdown{} + c.GetPendingCancellation() + c = nil + c.GetPendingCancellation() +} + +func TestCopilotSeatBreakdown_GetPendingInvitation(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatBreakdown{} + c.GetPendingInvitation() + c = nil + c.GetPendingInvitation() +} + +func TestCopilotSeatBreakdown_GetTotal(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatBreakdown{} + c.GetTotal() + c = nil + c.GetTotal() +} + +func TestCopilotSeatDetails_GetAssignee(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatDetails{} + c.GetAssignee() + c = nil + c.GetAssignee() +} + +func TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) { + tt.Parallel() + c := &CopilotSeatDetails{} + c.GetAssigningTeam() + c = nil + c.GetAssigningTeam() +} + +func TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CopilotSeatDetails{CreatedAt: &zeroValue} + c.GetCreatedAt() + c = &CopilotSeatDetails{} + c.GetCreatedAt() + c = nil + c.GetCreatedAt() +} + +func TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CopilotSeatDetails{LastActivityAt: &zeroValue} + c.GetLastActivityAt() + c = &CopilotSeatDetails{} + c.GetLastActivityAt() + c = nil + c.GetLastActivityAt() +} + +func TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotSeatDetails{LastActivityEditor: &zeroValue} + c.GetLastActivityEditor() + c = &CopilotSeatDetails{} + c.GetLastActivityEditor() + c = nil + c.GetLastActivityEditor() +} + +func TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotSeatDetails{PendingCancellationDate: &zeroValue} + c.GetPendingCancellationDate() + c = &CopilotSeatDetails{} + c.GetPendingCancellationDate() + c = nil + c.GetPendingCancellationDate() +} + +func TestCopilotSeatDetails_GetPlanType(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotSeatDetails{PlanType: &zeroValue} c.GetPlanType() c = &CopilotSeatDetails{} c.GetPlanType() c = nil - c.GetPlanType() + c.GetPlanType() +} + +func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CopilotSeatDetails{UpdatedAt: &zeroValue} + c.GetUpdatedAt() + c = &CopilotSeatDetails{} + c.GetUpdatedAt() + c = nil + c.GetUpdatedAt() +} + +func TestCopilotUserDailyMetrics_GetCodeAcceptanceActivityCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{CodeAcceptanceActivityCount: &zeroValue} + c.GetCodeAcceptanceActivityCount() + c = &CopilotUserDailyMetrics{} + c.GetCodeAcceptanceActivityCount() + c = nil + c.GetCodeAcceptanceActivityCount() +} + +func TestCopilotUserDailyMetrics_GetCodeGenerationActivityCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{CodeGenerationActivityCount: &zeroValue} + c.GetCodeGenerationActivityCount() + c = &CopilotUserDailyMetrics{} + c.GetCodeGenerationActivityCount() + c = nil + c.GetCodeGenerationActivityCount() +} + +func TestCopilotUserDailyMetrics_GetDay(tt *testing.T) { + tt.Parallel() + c := &CopilotUserDailyMetrics{} + c.GetDay() + c = nil + c.GetDay() +} + +func TestCopilotUserDailyMetrics_GetEnterpriseID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotUserDailyMetrics{EnterpriseID: &zeroValue} + c.GetEnterpriseID() + c = &CopilotUserDailyMetrics{} + c.GetEnterpriseID() + c = nil + c.GetEnterpriseID() +} + +func TestCopilotUserDailyMetrics_GetLOCAddedSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{LOCAddedSum: &zeroValue} + c.GetLOCAddedSum() + c = &CopilotUserDailyMetrics{} + c.GetLOCAddedSum() + c = nil + c.GetLOCAddedSum() } -func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { +func TestCopilotUserDailyMetrics_GetLOCDeletedSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{LOCDeletedSum: &zeroValue} + c.GetLOCDeletedSum() + c = &CopilotUserDailyMetrics{} + c.GetLOCDeletedSum() + c = nil + c.GetLOCDeletedSum() +} + +func TestCopilotUserDailyMetrics_GetLOCSuggestedToAddSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{LOCSuggestedToAddSum: &zeroValue} + c.GetLOCSuggestedToAddSum() + c = &CopilotUserDailyMetrics{} + c.GetLOCSuggestedToAddSum() + c = nil + c.GetLOCSuggestedToAddSum() +} + +func TestCopilotUserDailyMetrics_GetLOCSuggestedToDeleteSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{LOCSuggestedToDeleteSum: &zeroValue} + c.GetLOCSuggestedToDeleteSum() + c = &CopilotUserDailyMetrics{} + c.GetLOCSuggestedToDeleteSum() + c = nil + c.GetLOCSuggestedToDeleteSum() +} + +func TestCopilotUserDailyMetrics_GetOrganizationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotUserDailyMetrics{OrganizationID: &zeroValue} + c.GetOrganizationID() + c = &CopilotUserDailyMetrics{} + c.GetOrganizationID() + c = nil + c.GetOrganizationID() +} + +func TestCopilotUserDailyMetrics_GetTotalsByCLI(tt *testing.T) { + tt.Parallel() + c := &CopilotUserDailyMetrics{} + c.GetTotalsByCLI() + c = nil + c.GetTotalsByCLI() +} + +func TestCopilotUserDailyMetrics_GetTotalsByFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsFeature{} + c := &CopilotUserDailyMetrics{TotalsByFeature: zeroValue} + c.GetTotalsByFeature() + c = &CopilotUserDailyMetrics{} + c.GetTotalsByFeature() + c = nil + c.GetTotalsByFeature() +} + +func TestCopilotUserDailyMetrics_GetTotalsByIDE(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotUserMetricsIDE{} + c := &CopilotUserDailyMetrics{TotalsByIDE: zeroValue} + c.GetTotalsByIDE() + c = &CopilotUserDailyMetrics{} + c.GetTotalsByIDE() + c = nil + c.GetTotalsByIDE() +} + +func TestCopilotUserDailyMetrics_GetTotalsByLanguageFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsLanguageFeature{} + c := &CopilotUserDailyMetrics{TotalsByLanguageFeature: zeroValue} + c.GetTotalsByLanguageFeature() + c = &CopilotUserDailyMetrics{} + c.GetTotalsByLanguageFeature() + c = nil + c.GetTotalsByLanguageFeature() +} + +func TestCopilotUserDailyMetrics_GetTotalsByLanguageModel(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsLanguageModel{} + c := &CopilotUserDailyMetrics{TotalsByLanguageModel: zeroValue} + c.GetTotalsByLanguageModel() + c = &CopilotUserDailyMetrics{} + c.GetTotalsByLanguageModel() + c = nil + c.GetTotalsByLanguageModel() +} + +func TestCopilotUserDailyMetrics_GetTotalsByModelFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsModelFeature{} + c := &CopilotUserDailyMetrics{TotalsByModelFeature: zeroValue} + c.GetTotalsByModelFeature() + c = &CopilotUserDailyMetrics{} + c.GetTotalsByModelFeature() + c = nil + c.GetTotalsByModelFeature() +} + +func TestCopilotUserDailyMetrics_GetUsedAgent(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserDailyMetrics{UsedAgent: &zeroValue} + c.GetUsedAgent() + c = &CopilotUserDailyMetrics{} + c.GetUsedAgent() + c = nil + c.GetUsedAgent() +} + +func TestCopilotUserDailyMetrics_GetUsedChat(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserDailyMetrics{UsedChat: &zeroValue} + c.GetUsedChat() + c = &CopilotUserDailyMetrics{} + c.GetUsedChat() + c = nil + c.GetUsedChat() +} + +func TestCopilotUserDailyMetrics_GetUsedCLI(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserDailyMetrics{UsedCLI: &zeroValue} + c.GetUsedCLI() + c = &CopilotUserDailyMetrics{} + c.GetUsedCLI() + c = nil + c.GetUsedCLI() +} + +func TestCopilotUserDailyMetrics_GetUsedCopilotCodeReviewActive(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserDailyMetrics{UsedCopilotCodeReviewActive: &zeroValue} + c.GetUsedCopilotCodeReviewActive() + c = &CopilotUserDailyMetrics{} + c.GetUsedCopilotCodeReviewActive() + c = nil + c.GetUsedCopilotCodeReviewActive() +} + +func TestCopilotUserDailyMetrics_GetUsedCopilotCodeReviewPassive(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserDailyMetrics{UsedCopilotCodeReviewPassive: &zeroValue} + c.GetUsedCopilotCodeReviewPassive() + c = &CopilotUserDailyMetrics{} + c.GetUsedCopilotCodeReviewPassive() + c = nil + c.GetUsedCopilotCodeReviewPassive() +} + +func TestCopilotUserDailyMetrics_GetUsedCopilotCodingAgent(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserDailyMetrics{UsedCopilotCodingAgent: &zeroValue} + c.GetUsedCopilotCodingAgent() + c = &CopilotUserDailyMetrics{} + c.GetUsedCopilotCodingAgent() + c = nil + c.GetUsedCopilotCodingAgent() +} + +func TestCopilotUserDailyMetrics_GetUserID(tt *testing.T) { + tt.Parallel() + c := &CopilotUserDailyMetrics{} + c.GetUserID() + c = nil + c.GetUserID() +} + +func TestCopilotUserDailyMetrics_GetUserInitiatedInteractionCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserDailyMetrics{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotUserDailyMetrics{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotUserDailyMetrics_GetUserLogin(tt *testing.T) { + tt.Parallel() + c := &CopilotUserDailyMetrics{} + c.GetUserLogin() + c = nil + c.GetUserLogin() +} + +func TestCopilotUserMetricsIDE_GetIDE(tt *testing.T) { + tt.Parallel() + c := &CopilotUserMetricsIDE{} + c.GetIDE() + c = nil + c.GetIDE() +} + +func TestCopilotUserMetricsIDE_GetLastKnownIDEVersion(tt *testing.T) { + tt.Parallel() + c := &CopilotUserMetricsIDE{} + c.GetLastKnownIDEVersion() + c = nil + c.GetLastKnownIDEVersion() +} + +func TestCopilotUserMetricsIDE_GetLastKnownPluginVersion(tt *testing.T) { + tt.Parallel() + c := &CopilotUserMetricsIDE{} + c.GetLastKnownPluginVersion() + c = nil + c.GetLastKnownPluginVersion() +} + +func TestCopilotUserMetricsIDE_GetUserInitiatedInteractionCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserMetricsIDE{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotUserMetricsIDE{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotUserMetricsIDEVersion_GetIDEVersion(tt *testing.T) { + tt.Parallel() + c := &CopilotUserMetricsIDEVersion{} + c.GetIDEVersion() + c = nil + c.GetIDEVersion() +} + +func TestCopilotUserMetricsIDEVersion_GetSampledAt(tt *testing.T) { tt.Parallel() var zeroValue Timestamp - c := &CopilotSeatDetails{UpdatedAt: &zeroValue} - c.GetUpdatedAt() - c = &CopilotSeatDetails{} - c.GetUpdatedAt() + c := &CopilotUserMetricsIDEVersion{SampledAt: &zeroValue} + c.GetSampledAt() + c = &CopilotUserMetricsIDEVersion{} + c.GetSampledAt() c = nil - c.GetUpdatedAt() + c.GetSampledAt() +} + +func TestCopilotUserMetricsPluginVersion_GetPlugin(tt *testing.T) { + tt.Parallel() + c := &CopilotUserMetricsPluginVersion{} + c.GetPlugin() + c = nil + c.GetPlugin() +} + +func TestCopilotUserMetricsPluginVersion_GetPluginVersion(tt *testing.T) { + tt.Parallel() + c := &CopilotUserMetricsPluginVersion{} + c.GetPluginVersion() + c = nil + c.GetPluginVersion() +} + +func TestCopilotUserMetricsPluginVersion_GetSampledAt(tt *testing.T) { + tt.Parallel() + var zeroValue Timestamp + c := &CopilotUserMetricsPluginVersion{SampledAt: &zeroValue} + c.GetSampledAt() + c = &CopilotUserMetricsPluginVersion{} + c.GetSampledAt() + c = nil + c.GetSampledAt() +} + +func TestCopilotUserPeriodicMetrics_GetCodeAcceptanceActivityCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{CodeAcceptanceActivityCount: &zeroValue} + c.GetCodeAcceptanceActivityCount() + c = &CopilotUserPeriodicMetrics{} + c.GetCodeAcceptanceActivityCount() + c = nil + c.GetCodeAcceptanceActivityCount() +} + +func TestCopilotUserPeriodicMetrics_GetCodeGenerationActivityCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{CodeGenerationActivityCount: &zeroValue} + c.GetCodeGenerationActivityCount() + c = &CopilotUserPeriodicMetrics{} + c.GetCodeGenerationActivityCount() + c = nil + c.GetCodeGenerationActivityCount() +} + +func TestCopilotUserPeriodicMetrics_GetDay(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetDay() + c = nil + c.GetDay() +} + +func TestCopilotUserPeriodicMetrics_GetEnterpriseID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotUserPeriodicMetrics{EnterpriseID: &zeroValue} + c.GetEnterpriseID() + c = &CopilotUserPeriodicMetrics{} + c.GetEnterpriseID() + c = nil + c.GetEnterpriseID() +} + +func TestCopilotUserPeriodicMetrics_GetLOCAddedSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{LOCAddedSum: &zeroValue} + c.GetLOCAddedSum() + c = &CopilotUserPeriodicMetrics{} + c.GetLOCAddedSum() + c = nil + c.GetLOCAddedSum() +} + +func TestCopilotUserPeriodicMetrics_GetLOCDeletedSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{LOCDeletedSum: &zeroValue} + c.GetLOCDeletedSum() + c = &CopilotUserPeriodicMetrics{} + c.GetLOCDeletedSum() + c = nil + c.GetLOCDeletedSum() +} + +func TestCopilotUserPeriodicMetrics_GetLOCSuggestedToAddSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{LOCSuggestedToAddSum: &zeroValue} + c.GetLOCSuggestedToAddSum() + c = &CopilotUserPeriodicMetrics{} + c.GetLOCSuggestedToAddSum() + c = nil + c.GetLOCSuggestedToAddSum() +} + +func TestCopilotUserPeriodicMetrics_GetLOCSuggestedToDeleteSum(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{LOCSuggestedToDeleteSum: &zeroValue} + c.GetLOCSuggestedToDeleteSum() + c = &CopilotUserPeriodicMetrics{} + c.GetLOCSuggestedToDeleteSum() + c = nil + c.GetLOCSuggestedToDeleteSum() +} + +func TestCopilotUserPeriodicMetrics_GetOrganizationID(tt *testing.T) { + tt.Parallel() + var zeroValue string + c := &CopilotUserPeriodicMetrics{OrganizationID: &zeroValue} + c.GetOrganizationID() + c = &CopilotUserPeriodicMetrics{} + c.GetOrganizationID() + c = nil + c.GetOrganizationID() +} + +func TestCopilotUserPeriodicMetrics_GetReportEndDay(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetReportEndDay() + c = nil + c.GetReportEndDay() +} + +func TestCopilotUserPeriodicMetrics_GetReportStartDay(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetReportStartDay() + c = nil + c.GetReportStartDay() +} + +func TestCopilotUserPeriodicMetrics_GetTotalsByCLI(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetTotalsByCLI() + c = nil + c.GetTotalsByCLI() +} + +func TestCopilotUserPeriodicMetrics_GetTotalsByFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsFeature{} + c := &CopilotUserPeriodicMetrics{TotalsByFeature: zeroValue} + c.GetTotalsByFeature() + c = &CopilotUserPeriodicMetrics{} + c.GetTotalsByFeature() + c = nil + c.GetTotalsByFeature() +} + +func TestCopilotUserPeriodicMetrics_GetTotalsByIDE(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotUserMetricsIDE{} + c := &CopilotUserPeriodicMetrics{TotalsByIDE: zeroValue} + c.GetTotalsByIDE() + c = &CopilotUserPeriodicMetrics{} + c.GetTotalsByIDE() + c = nil + c.GetTotalsByIDE() +} + +func TestCopilotUserPeriodicMetrics_GetTotalsByLanguageFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsLanguageFeature{} + c := &CopilotUserPeriodicMetrics{TotalsByLanguageFeature: zeroValue} + c.GetTotalsByLanguageFeature() + c = &CopilotUserPeriodicMetrics{} + c.GetTotalsByLanguageFeature() + c = nil + c.GetTotalsByLanguageFeature() +} + +func TestCopilotUserPeriodicMetrics_GetTotalsByLanguageModel(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsLanguageModel{} + c := &CopilotUserPeriodicMetrics{TotalsByLanguageModel: zeroValue} + c.GetTotalsByLanguageModel() + c = &CopilotUserPeriodicMetrics{} + c.GetTotalsByLanguageModel() + c = nil + c.GetTotalsByLanguageModel() +} + +func TestCopilotUserPeriodicMetrics_GetTotalsByModelFeature(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsModelFeature{} + c := &CopilotUserPeriodicMetrics{TotalsByModelFeature: zeroValue} + c.GetTotalsByModelFeature() + c = &CopilotUserPeriodicMetrics{} + c.GetTotalsByModelFeature() + c = nil + c.GetTotalsByModelFeature() +} + +func TestCopilotUserPeriodicMetrics_GetUsedAgent(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserPeriodicMetrics{UsedAgent: &zeroValue} + c.GetUsedAgent() + c = &CopilotUserPeriodicMetrics{} + c.GetUsedAgent() + c = nil + c.GetUsedAgent() +} + +func TestCopilotUserPeriodicMetrics_GetUsedChat(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserPeriodicMetrics{UsedChat: &zeroValue} + c.GetUsedChat() + c = &CopilotUserPeriodicMetrics{} + c.GetUsedChat() + c = nil + c.GetUsedChat() +} + +func TestCopilotUserPeriodicMetrics_GetUsedCLI(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserPeriodicMetrics{UsedCLI: &zeroValue} + c.GetUsedCLI() + c = &CopilotUserPeriodicMetrics{} + c.GetUsedCLI() + c = nil + c.GetUsedCLI() +} + +func TestCopilotUserPeriodicMetrics_GetUsedCopilotCodeReviewActive(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserPeriodicMetrics{UsedCopilotCodeReviewActive: &zeroValue} + c.GetUsedCopilotCodeReviewActive() + c = &CopilotUserPeriodicMetrics{} + c.GetUsedCopilotCodeReviewActive() + c = nil + c.GetUsedCopilotCodeReviewActive() +} + +func TestCopilotUserPeriodicMetrics_GetUsedCopilotCodeReviewPassive(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserPeriodicMetrics{UsedCopilotCodeReviewPassive: &zeroValue} + c.GetUsedCopilotCodeReviewPassive() + c = &CopilotUserPeriodicMetrics{} + c.GetUsedCopilotCodeReviewPassive() + c = nil + c.GetUsedCopilotCodeReviewPassive() +} + +func TestCopilotUserPeriodicMetrics_GetUsedCopilotCodingAgent(tt *testing.T) { + tt.Parallel() + var zeroValue bool + c := &CopilotUserPeriodicMetrics{UsedCopilotCodingAgent: &zeroValue} + c.GetUsedCopilotCodingAgent() + c = &CopilotUserPeriodicMetrics{} + c.GetUsedCopilotCodingAgent() + c = nil + c.GetUsedCopilotCodingAgent() +} + +func TestCopilotUserPeriodicMetrics_GetUserID(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetUserID() + c = nil + c.GetUserID() +} + +func TestCopilotUserPeriodicMetrics_GetUserInitiatedInteractionCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotUserPeriodicMetrics{UserInitiatedInteractionCount: &zeroValue} + c.GetUserInitiatedInteractionCount() + c = &CopilotUserPeriodicMetrics{} + c.GetUserInitiatedInteractionCount() + c = nil + c.GetUserInitiatedInteractionCount() +} + +func TestCopilotUserPeriodicMetrics_GetUserLogin(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetUserLogin() + c = nil + c.GetUserLogin() } func TestCostCenter_GetAzureSubscription(tt *testing.T) { diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index b6e457d4df1..488bca48d4a 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -550,4 +550,8 @@ var skipServiceMethod = map[string]bool{ "BillingService.GetPackagesBilling": true, "BillingService.GetStorageBilling": true, "CopilotService.DownloadCopilotMetrics": true, + "CopilotService.DownloadDailyMetrics": true, + "CopilotService.DownloadPeriodicMetrics": true, + "CopilotService.DownloadUserDailyMetrics": true, + "CopilotService.DownloadUserPeriodicMetrics": true, } diff --git a/tools/structfield/structfield.go b/tools/structfield/structfield.go index ad5570091d4..fc4241d286a 100644 --- a/tools/structfield/structfield.go +++ b/tools/structfield/structfield.go @@ -411,7 +411,7 @@ func tagNameToPascal(tagName string) (want, alternate string) { // Common Go initialisms that should be all caps. var initialisms = map[string]bool{ "API": true, "ASCII": true, "AWS": true, - "CAA": true, "CAS": true, "CNAME": true, "CPU": true, + "CAA": true, "CAS": true, "CLI": true, "CNAME": true, "CPU": true, "CSS": true, "CWE": true, "CVE": true, "CVSS": true, "DN": true, "DNS": true, "EOF": true, "EPSS": true, @@ -420,7 +420,7 @@ var initialisms = map[string]bool{ "ID": true, "IDE": true, "IDP": true, "IP": true, "JIT": true, "JSON": true, "OIDC": true, - "LDAP": true, "LFS": true, "LHS": true, + "LDAP": true, "LFS": true, "LHS": true, "LOC": true, "MD5": true, "MS": true, "MX": true, "NPM": true, "NTP": true, "NVD": true, "OID": true, "OS": true,