diff --git a/github/copilot.go b/github/copilot.go index 29265542b41..f00235ce48d 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -1024,6 +1024,44 @@ type CopilotMetricsThirdPartyAgent struct { SessionCount *int `json:"session_count,omitempty"` } +// CopilotMetricsAIAdoptionPhase represents a user's AI adoption phase classification +// in a Copilot usage metrics report. +// +// Phase assignment uses a trailing 28-day engagement window and may change day to day. +// Version identifies the classification model (for example, "v1"). +// +// GitHub API docs: https://docs.github.com/en/copilot/reference/copilot-usage-metrics/copilot-usage-metrics#ai-adoption-phase-fields +type CopilotMetricsAIAdoptionPhase struct { + PhaseNumber int `json:"phase_number"` + Phase string `json:"phase"` + Version string `json:"version"` +} + +// CopilotMetricsAIAdoptionPhaseTotals represents aggregated per-phase averages in an +// enterprise or organization Copilot usage metrics report. +// +// Aggregated metrics report the average per user within each phase rather than the sum, +// except TotalEngagedUsers and TotalPullRequestsMerged. +// +// GitHub API docs: https://docs.github.com/en/copilot/reference/copilot-usage-metrics/copilot-usage-metrics#ai-adoption-phase-fields +type CopilotMetricsAIAdoptionPhaseTotals struct { + Phase string `json:"phase"` + PhaseNumber int `json:"phase_number"` + TotalEngagedUsers *int `json:"total_engaged_users,omitempty"` + AvgUserInitiatedInteractions *float64 `json:"avg_user_initiated_interactions,omitempty"` + AvgCodeGenerationActivities *float64 `json:"avg_code_generation_activities,omitempty"` + AvgCodeAcceptanceActivities *float64 `json:"avg_code_acceptance_activities,omitempty"` + AvgLOCAdded *float64 `json:"avg_loc_added,omitempty"` + AvgLOCDeleted *float64 `json:"avg_loc_deleted,omitempty"` + AvgPullRequestsReviewed *float64 `json:"avg_pull_requests_reviewed,omitempty"` + AvgPullRequestsCreated *float64 `json:"avg_pull_requests_created,omitempty"` + AvgPullRequestsMerged *float64 `json:"avg_pull_requests_merged,omitempty"` + TotalPullRequestsMerged *int `json:"total_pull_requests_merged,omitempty"` + AvgPullRequestsMedianMinutesToMerge *float64 `json:"avg_pull_requests_median_minutes_to_merge,omitempty"` + AvgPullRequestsMinutesToReview *float64 `json:"avg_pull_requests_minutes_to_review,omitempty"` + AvgPullRequestsReviewCycles *float64 `json:"avg_pull_requests_review_cycles,omitempty"` +} + // CopilotDailyMetrics represents the payload downloaded from a 1-day Copilot usage metrics report. type CopilotDailyMetrics struct { Day string `json:"day"` @@ -1040,20 +1078,21 @@ type CopilotDailyMetrics struct { 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"` - TotalsBy3rdPartyAgent []*CopilotMetricsThirdPartyAgent `json:"totals_by_3rd_party_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"` - PullRequests *CopilotMetricsPullRequests `json:"pull_requests,omitempty"` + 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"` + TotalsBy3rdPartyAgent []*CopilotMetricsThirdPartyAgent `json:"totals_by_3rd_party_agent,omitempty"` + TotalsByAIAdoptionPhase []*CopilotMetricsAIAdoptionPhaseTotals `json:"totals_by_ai_adoption_phase,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) @@ -1094,12 +1133,13 @@ type CopilotUserMetricsIDE struct { // 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"` + 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"` + AICreditsUsed *float64 `json:"ai_credits_used,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"` @@ -1110,6 +1150,7 @@ type CopilotUserDailyMetrics struct { TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` TotalsBy3rdPartyAgent []*CopilotMetricsThirdPartyAgent `json:"totals_by_3rd_party_agent,omitempty"` + AIAdoptionPhase *CopilotMetricsAIAdoptionPhase `json:"ai_adoption_phase,omitempty"` UsedAgent *bool `json:"used_agent,omitempty"` UsedChat *bool `json:"used_chat,omitempty"` UsedCLI *bool `json:"used_cli,omitempty"` @@ -1126,14 +1167,15 @@ type CopilotUserDailyMetrics struct { // 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"` + 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"` + AICreditsUsed *float64 `json:"ai_credits_used,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"` @@ -1144,6 +1186,7 @@ type CopilotUserPeriodicMetrics struct { TotalsByModelFeature []*CopilotMetricsModelFeature `json:"totals_by_model_feature,omitempty"` TotalsByCLI *CopilotMetricsCLI `json:"totals_by_cli,omitempty"` TotalsBy3rdPartyAgent []*CopilotMetricsThirdPartyAgent `json:"totals_by_3rd_party_agent,omitempty"` + AIAdoptionPhase *CopilotMetricsAIAdoptionPhase `json:"ai_adoption_phase,omitempty"` UsedAgent *bool `json:"used_agent,omitempty"` UsedChat *bool `json:"used_chat,omitempty"` UsedCLI *bool `json:"used_cli,omitempty"` diff --git a/github/copilot_test.go b/github/copilot_test.go index fae2e446da8..2fa1e6f2d73 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -3072,6 +3072,25 @@ func TestCopilotService_DownloadDailyMetrics(t *testing.T) { "session_count": 3 } ], + "totals_by_ai_adoption_phase": [ + { + "phase": "Phase 1", + "phase_number": 1, + "total_engaged_users": 4, + "avg_user_initiated_interactions": 1.5, + "avg_code_generation_activities": 2.0, + "avg_code_acceptance_activities": 1.0, + "avg_loc_added": 22.0, + "avg_loc_deleted": 0.0, + "avg_pull_requests_reviewed": 0.5, + "avg_pull_requests_created": 1.0, + "avg_pull_requests_merged": 1.0, + "total_pull_requests_merged": 4, + "avg_pull_requests_median_minutes_to_merge": 2.5, + "avg_pull_requests_minutes_to_review": 1.5, + "avg_pull_requests_review_cycles": 1.0 + } + ], "loc_added_sum": 100, "pull_requests": { "total_reviewed": 1, @@ -3137,6 +3156,25 @@ func TestCopilotService_DownloadDailyMetrics(t *testing.T) { SessionCount: Ptr(3), }, }, + TotalsByAIAdoptionPhase: []*CopilotMetricsAIAdoptionPhaseTotals{ + { + Phase: "Phase 1", + PhaseNumber: 1, + TotalEngagedUsers: Ptr(4), + AvgUserInitiatedInteractions: Ptr(1.5), + AvgCodeGenerationActivities: Ptr(2.0), + AvgCodeAcceptanceActivities: Ptr(1.0), + AvgLOCAdded: Ptr(22.0), + AvgLOCDeleted: Ptr(0.0), + AvgPullRequestsReviewed: Ptr(0.5), + AvgPullRequestsCreated: Ptr(1.0), + AvgPullRequestsMerged: Ptr(1.0), + TotalPullRequestsMerged: Ptr(4), + AvgPullRequestsMedianMinutesToMerge: Ptr(2.5), + AvgPullRequestsMinutesToReview: Ptr(1.5), + AvgPullRequestsReviewCycles: Ptr(1.0), + }, + }, LOCAddedSum: Ptr(100), PullRequests: &CopilotMetricsPullRequests{ TotalReviewed: Ptr(1), @@ -3284,7 +3322,7 @@ func TestCopilotService_DownloadUserDailyMetrics(t *testing.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":`+refTimeStr(1136178000)+`,"cli_version":"1.0.8"}},"totals_by_ide":[{"ide":"vscode","user_initiated_interaction_count":5,"last_known_plugin_version":{"sampled_at":`+refTimeStr(1136178001)+`,"plugin":"copilot","plugin_version":"1.0.0"},"last_known_ide_version":{"sampled_at":`+refTimeStr(1136178002)+`,"ide_version":"1.90"}}],"totals_by_3rd_party_agent":[{"agent_name":"Claude","agent_id":"claude","user_initiated_interaction_count":2}]} + fmt.Fprint(w, `{"user_id":1,"user_login":"alice","day":"2026-04-01","ai_credits_used":12.5,"user_initiated_interaction_count":5,"chat_panel_edit_mode":2,"used_chat":true,"used_cli":true,"used_copilot_code_review_active":true,"ai_adoption_phase":{"phase":"Phase 2","phase_number":2,"version":"v1"},"totals_by_cli":{"session_count":2,"request_count":2,"prompt_count":1,"last_known_cli_version":{"sampled_at":`+refTimeStr(1136178000)+`,"cli_version":"1.0.8"}},"totals_by_ide":[{"ide":"vscode","user_initiated_interaction_count":5,"last_known_plugin_version":{"sampled_at":`+refTimeStr(1136178001)+`,"plugin":"copilot","plugin_version":"1.0.0"},"last_known_ide_version":{"sampled_at":`+refTimeStr(1136178002)+`,"ide_version":"1.90"}}],"totals_by_3rd_party_agent":[{"agent_name":"Claude","agent_id":"claude","user_initiated_interaction_count":2}]} {"user_id":2,"user_login":"bob","day":"2026-04-01","used_agent":true,"used_copilot_code_review_passive":true} `) }) @@ -3304,6 +3342,7 @@ func TestCopilotService_DownloadUserDailyMetrics(t *testing.T) { UserID: 1, UserLogin: "alice", Day: "2026-04-01", + AICreditsUsed: Ptr(12.5), UserInitiatedInteractionCount: Ptr(5), CopilotMetricsChatPanel: CopilotMetricsChatPanel{ ChatPanelEditMode: Ptr(2), @@ -3311,6 +3350,11 @@ func TestCopilotService_DownloadUserDailyMetrics(t *testing.T) { UsedChat: Ptr(true), UsedCLI: Ptr(true), UsedCopilotCodeReviewActive: Ptr(true), + AIAdoptionPhase: &CopilotMetricsAIAdoptionPhase{ + Phase: "Phase 2", + PhaseNumber: 2, + Version: "v1", + }, TotalsByCLI: &CopilotMetricsCLI{ SessionCount: Ptr(2), RequestCount: Ptr(2), @@ -3398,7 +3442,7 @@ func TestCopilotService_DownloadUserPeriodicMetrics(t *testing.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} + 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","ai_credits_used":3.25,"user_initiated_interaction_count":3,"used_copilot_code_review_active":true,"ai_adoption_phase":{"phase":"Phase 1","phase_number":1,"version":"v1"}} {"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}}} `) }) @@ -3420,8 +3464,14 @@ func TestCopilotService_DownloadUserPeriodicMetrics(t *testing.T) { Day: "2026-03-05", UserID: 1, UserLogin: "alice", + AICreditsUsed: Ptr(3.25), UserInitiatedInteractionCount: Ptr(3), UsedCopilotCodeReviewActive: Ptr(true), + AIAdoptionPhase: &CopilotMetricsAIAdoptionPhase{ + Phase: "Phase 1", + PhaseNumber: 1, + Version: "v1", + }, }, { ReportStartDay: "2026-03-05", diff --git a/github/github-accessors.go b/github/github-accessors.go index 25587473e22..a7e67bc3b29 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9238,6 +9238,14 @@ func (c *CopilotDailyMetrics) GetTotalsBy3rdPartyAgent() []*CopilotMetricsThirdP return c.TotalsBy3rdPartyAgent } +// GetTotalsByAIAdoptionPhase returns the TotalsByAIAdoptionPhase slice if it's non-nil, nil otherwise. +func (c *CopilotDailyMetrics) GetTotalsByAIAdoptionPhase() []*CopilotMetricsAIAdoptionPhaseTotals { + if c == nil || c.TotalsByAIAdoptionPhase == nil { + return nil + } + return c.TotalsByAIAdoptionPhase +} + // GetTotalsByCLI returns the TotalsByCLI field. func (c *CopilotDailyMetrics) GetTotalsByCLI() *CopilotMetricsCLI { if c == nil { @@ -9766,6 +9774,150 @@ func (c *CopilotMetrics) GetTotalEngagedUsers() int { return *c.TotalEngagedUsers } +// GetPhase returns the Phase field. +func (c *CopilotMetricsAIAdoptionPhase) GetPhase() string { + if c == nil { + return "" + } + return c.Phase +} + +// GetPhaseNumber returns the PhaseNumber field. +func (c *CopilotMetricsAIAdoptionPhase) GetPhaseNumber() int { + if c == nil { + return 0 + } + return c.PhaseNumber +} + +// GetVersion returns the Version field. +func (c *CopilotMetricsAIAdoptionPhase) GetVersion() string { + if c == nil { + return "" + } + return c.Version +} + +// GetAvgCodeAcceptanceActivities returns the AvgCodeAcceptanceActivities field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgCodeAcceptanceActivities() float64 { + if c == nil || c.AvgCodeAcceptanceActivities == nil { + return 0 + } + return *c.AvgCodeAcceptanceActivities +} + +// GetAvgCodeGenerationActivities returns the AvgCodeGenerationActivities field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgCodeGenerationActivities() float64 { + if c == nil || c.AvgCodeGenerationActivities == nil { + return 0 + } + return *c.AvgCodeGenerationActivities +} + +// GetAvgLOCAdded returns the AvgLOCAdded field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgLOCAdded() float64 { + if c == nil || c.AvgLOCAdded == nil { + return 0 + } + return *c.AvgLOCAdded +} + +// GetAvgLOCDeleted returns the AvgLOCDeleted field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgLOCDeleted() float64 { + if c == nil || c.AvgLOCDeleted == nil { + return 0 + } + return *c.AvgLOCDeleted +} + +// GetAvgPullRequestsCreated returns the AvgPullRequestsCreated field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgPullRequestsCreated() float64 { + if c == nil || c.AvgPullRequestsCreated == nil { + return 0 + } + return *c.AvgPullRequestsCreated +} + +// GetAvgPullRequestsMedianMinutesToMerge returns the AvgPullRequestsMedianMinutesToMerge field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgPullRequestsMedianMinutesToMerge() float64 { + if c == nil || c.AvgPullRequestsMedianMinutesToMerge == nil { + return 0 + } + return *c.AvgPullRequestsMedianMinutesToMerge +} + +// GetAvgPullRequestsMerged returns the AvgPullRequestsMerged field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgPullRequestsMerged() float64 { + if c == nil || c.AvgPullRequestsMerged == nil { + return 0 + } + return *c.AvgPullRequestsMerged +} + +// GetAvgPullRequestsMinutesToReview returns the AvgPullRequestsMinutesToReview field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgPullRequestsMinutesToReview() float64 { + if c == nil || c.AvgPullRequestsMinutesToReview == nil { + return 0 + } + return *c.AvgPullRequestsMinutesToReview +} + +// GetAvgPullRequestsReviewCycles returns the AvgPullRequestsReviewCycles field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgPullRequestsReviewCycles() float64 { + if c == nil || c.AvgPullRequestsReviewCycles == nil { + return 0 + } + return *c.AvgPullRequestsReviewCycles +} + +// GetAvgPullRequestsReviewed returns the AvgPullRequestsReviewed field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgPullRequestsReviewed() float64 { + if c == nil || c.AvgPullRequestsReviewed == nil { + return 0 + } + return *c.AvgPullRequestsReviewed +} + +// GetAvgUserInitiatedInteractions returns the AvgUserInitiatedInteractions field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetAvgUserInitiatedInteractions() float64 { + if c == nil || c.AvgUserInitiatedInteractions == nil { + return 0 + } + return *c.AvgUserInitiatedInteractions +} + +// GetPhase returns the Phase field. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetPhase() string { + if c == nil { + return "" + } + return c.Phase +} + +// GetPhaseNumber returns the PhaseNumber field. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetPhaseNumber() int { + if c == nil { + return 0 + } + return c.PhaseNumber +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetTotalEngagedUsers() int { + if c == nil || c.TotalEngagedUsers == nil { + return 0 + } + return *c.TotalEngagedUsers +} + +// GetTotalPullRequestsMerged returns the TotalPullRequestsMerged field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsAIAdoptionPhaseTotals) GetTotalPullRequestsMerged() int { + if c == nil || c.TotalPullRequestsMerged == nil { + return 0 + } + return *c.TotalPullRequestsMerged +} + // GetChatPanelAgentMode returns the ChatPanelAgentMode field if it's non-nil, zero value otherwise. func (c *CopilotMetricsChatPanel) GetChatPanelAgentMode() int { if c == nil || c.ChatPanelAgentMode == nil { @@ -10406,6 +10558,22 @@ func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetAIAdoptionPhase returns the AIAdoptionPhase field. +func (c *CopilotUserDailyMetrics) GetAIAdoptionPhase() *CopilotMetricsAIAdoptionPhase { + if c == nil { + return nil + } + return c.AIAdoptionPhase +} + +// GetAICreditsUsed returns the AICreditsUsed field if it's non-nil, zero value otherwise. +func (c *CopilotUserDailyMetrics) GetAICreditsUsed() float64 { + if c == nil || c.AICreditsUsed == nil { + return 0 + } + return *c.AICreditsUsed +} + // GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. func (c *CopilotUserDailyMetrics) GetCodeAcceptanceActivityCount() int { if c == nil || c.CodeAcceptanceActivityCount == nil { @@ -10678,6 +10846,22 @@ func (c *CopilotUserMetricsPluginVersion) GetSampledAt() Timestamp { return *c.SampledAt } +// GetAIAdoptionPhase returns the AIAdoptionPhase field. +func (c *CopilotUserPeriodicMetrics) GetAIAdoptionPhase() *CopilotMetricsAIAdoptionPhase { + if c == nil { + return nil + } + return c.AIAdoptionPhase +} + +// GetAICreditsUsed returns the AICreditsUsed field if it's non-nil, zero value otherwise. +func (c *CopilotUserPeriodicMetrics) GetAICreditsUsed() float64 { + if c == nil || c.AICreditsUsed == nil { + return 0 + } + return *c.AICreditsUsed +} + // GetCodeAcceptanceActivityCount returns the CodeAcceptanceActivityCount field if it's non-nil, zero value otherwise. func (c *CopilotUserPeriodicMetrics) GetCodeAcceptanceActivityCount() int { if c == nil || c.CodeAcceptanceActivityCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9d8632a71d8..529e6ee668d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11792,6 +11792,17 @@ func TestCopilotDailyMetrics_GetTotalsBy3rdPartyAgent(tt *testing.T) { c.GetTotalsBy3rdPartyAgent() } +func TestCopilotDailyMetrics_GetTotalsByAIAdoptionPhase(tt *testing.T) { + tt.Parallel() + zeroValue := []*CopilotMetricsAIAdoptionPhaseTotals{} + c := &CopilotDailyMetrics{TotalsByAIAdoptionPhase: zeroValue} + c.GetTotalsByAIAdoptionPhase() + c = &CopilotDailyMetrics{} + c.GetTotalsByAIAdoptionPhase() + c = nil + c.GetTotalsByAIAdoptionPhase() +} + func TestCopilotDailyMetrics_GetTotalsByCLI(tt *testing.T) { tt.Parallel() c := &CopilotDailyMetrics{} @@ -12392,6 +12403,189 @@ func TestCopilotMetrics_GetTotalEngagedUsers(tt *testing.T) { c.GetTotalEngagedUsers() } +func TestCopilotMetricsAIAdoptionPhase_GetPhase(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsAIAdoptionPhase{} + c.GetPhase() + c = nil + c.GetPhase() +} + +func TestCopilotMetricsAIAdoptionPhase_GetPhaseNumber(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsAIAdoptionPhase{} + c.GetPhaseNumber() + c = nil + c.GetPhaseNumber() +} + +func TestCopilotMetricsAIAdoptionPhase_GetVersion(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsAIAdoptionPhase{} + c.GetVersion() + c = nil + c.GetVersion() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgCodeAcceptanceActivities(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgCodeAcceptanceActivities: &zeroValue} + c.GetAvgCodeAcceptanceActivities() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgCodeAcceptanceActivities() + c = nil + c.GetAvgCodeAcceptanceActivities() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgCodeGenerationActivities(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgCodeGenerationActivities: &zeroValue} + c.GetAvgCodeGenerationActivities() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgCodeGenerationActivities() + c = nil + c.GetAvgCodeGenerationActivities() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgLOCAdded(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgLOCAdded: &zeroValue} + c.GetAvgLOCAdded() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgLOCAdded() + c = nil + c.GetAvgLOCAdded() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgLOCDeleted(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgLOCDeleted: &zeroValue} + c.GetAvgLOCDeleted() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgLOCDeleted() + c = nil + c.GetAvgLOCDeleted() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgPullRequestsCreated(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgPullRequestsCreated: &zeroValue} + c.GetAvgPullRequestsCreated() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgPullRequestsCreated() + c = nil + c.GetAvgPullRequestsCreated() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgPullRequestsMedianMinutesToMerge(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgPullRequestsMedianMinutesToMerge: &zeroValue} + c.GetAvgPullRequestsMedianMinutesToMerge() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgPullRequestsMedianMinutesToMerge() + c = nil + c.GetAvgPullRequestsMedianMinutesToMerge() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgPullRequestsMerged(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgPullRequestsMerged: &zeroValue} + c.GetAvgPullRequestsMerged() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgPullRequestsMerged() + c = nil + c.GetAvgPullRequestsMerged() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgPullRequestsMinutesToReview(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgPullRequestsMinutesToReview: &zeroValue} + c.GetAvgPullRequestsMinutesToReview() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgPullRequestsMinutesToReview() + c = nil + c.GetAvgPullRequestsMinutesToReview() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgPullRequestsReviewCycles(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgPullRequestsReviewCycles: &zeroValue} + c.GetAvgPullRequestsReviewCycles() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgPullRequestsReviewCycles() + c = nil + c.GetAvgPullRequestsReviewCycles() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgPullRequestsReviewed(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgPullRequestsReviewed: &zeroValue} + c.GetAvgPullRequestsReviewed() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgPullRequestsReviewed() + c = nil + c.GetAvgPullRequestsReviewed() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetAvgUserInitiatedInteractions(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotMetricsAIAdoptionPhaseTotals{AvgUserInitiatedInteractions: &zeroValue} + c.GetAvgUserInitiatedInteractions() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetAvgUserInitiatedInteractions() + c = nil + c.GetAvgUserInitiatedInteractions() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetPhase(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetPhase() + c = nil + c.GetPhase() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetPhaseNumber(tt *testing.T) { + tt.Parallel() + c := &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetPhaseNumber() + c = nil + c.GetPhaseNumber() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetTotalEngagedUsers(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsAIAdoptionPhaseTotals{TotalEngagedUsers: &zeroValue} + c.GetTotalEngagedUsers() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetTotalEngagedUsers() + c = nil + c.GetTotalEngagedUsers() +} + +func TestCopilotMetricsAIAdoptionPhaseTotals_GetTotalPullRequestsMerged(tt *testing.T) { + tt.Parallel() + var zeroValue int + c := &CopilotMetricsAIAdoptionPhaseTotals{TotalPullRequestsMerged: &zeroValue} + c.GetTotalPullRequestsMerged() + c = &CopilotMetricsAIAdoptionPhaseTotals{} + c.GetTotalPullRequestsMerged() + c = nil + c.GetTotalPullRequestsMerged() +} + func TestCopilotMetricsChatPanel_GetChatPanelAgentMode(tt *testing.T) { tt.Parallel() var zeroValue int @@ -13182,6 +13376,25 @@ func TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) { c.GetUpdatedAt() } +func TestCopilotUserDailyMetrics_GetAIAdoptionPhase(tt *testing.T) { + tt.Parallel() + c := &CopilotUserDailyMetrics{} + c.GetAIAdoptionPhase() + c = nil + c.GetAIAdoptionPhase() +} + +func TestCopilotUserDailyMetrics_GetAICreditsUsed(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotUserDailyMetrics{AICreditsUsed: &zeroValue} + c.GetAICreditsUsed() + c = &CopilotUserDailyMetrics{} + c.GetAICreditsUsed() + c = nil + c.GetAICreditsUsed() +} + func TestCopilotUserDailyMetrics_GetCodeAcceptanceActivityCount(tt *testing.T) { tt.Parallel() var zeroValue int @@ -13526,6 +13739,25 @@ func TestCopilotUserMetricsPluginVersion_GetSampledAt(tt *testing.T) { c.GetSampledAt() } +func TestCopilotUserPeriodicMetrics_GetAIAdoptionPhase(tt *testing.T) { + tt.Parallel() + c := &CopilotUserPeriodicMetrics{} + c.GetAIAdoptionPhase() + c = nil + c.GetAIAdoptionPhase() +} + +func TestCopilotUserPeriodicMetrics_GetAICreditsUsed(tt *testing.T) { + tt.Parallel() + var zeroValue float64 + c := &CopilotUserPeriodicMetrics{AICreditsUsed: &zeroValue} + c.GetAICreditsUsed() + c = &CopilotUserPeriodicMetrics{} + c.GetAICreditsUsed() + c = nil + c.GetAICreditsUsed() +} + func TestCopilotUserPeriodicMetrics_GetCodeAcceptanceActivityCount(tt *testing.T) { tt.Parallel() var zeroValue int