diff --git a/github/github-accessors.go b/github/github-accessors.go index fadc89d6983..b9d8bcf7e65 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -24902,6 +24902,22 @@ func (s *SecretScanningAlert) GetCreatedAt() Timestamp { return *s.CreatedAt } +// GetFirstLocationDetected returns the FirstLocationDetected field. +func (s *SecretScanningAlert) GetFirstLocationDetected() *SecretScanningAlertLocationDetails { + if s == nil { + return nil + } + return s.FirstLocationDetected +} + +// GetHasMoreLocations returns the HasMoreLocations field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetHasMoreLocations() bool { + if s == nil || s.HasMoreLocations == nil { + return false + } + return *s.HasMoreLocations +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetHTMLURL() string { if s == nil || s.HTMLURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1dda229dd87..f6a191ee0f8 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -32079,6 +32079,25 @@ func TestSecretScanningAlert_GetCreatedAt(tt *testing.T) { s.GetCreatedAt() } +func TestSecretScanningAlert_GetFirstLocationDetected(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlert{} + s.GetFirstLocationDetected() + s = nil + s.GetFirstLocationDetected() +} + +func TestSecretScanningAlert_GetHasMoreLocations(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{HasMoreLocations: &zeroValue} + s.GetHasMoreLocations() + s = &SecretScanningAlert{} + s.GetHasMoreLocations() + s = nil + s.GetHasMoreLocations() +} + func TestSecretScanningAlert_GetHTMLURL(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/secret_scanning.go b/github/secret_scanning.go index ad2312d0b2c..f75800f6e0b 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -16,32 +16,34 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` - Secret *string `json:"secret,omitempty"` - Repository *Repository `json:"repository,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"` - MultiRepo *bool `json:"multi_repo,omitempty"` - PubliclyLeaked *bool `json:"publicly_leaked,omitempty"` - PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` - PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` - PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` - ResolutionComment *string `json:"resolution_comment,omitempty"` - PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"` - PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"` - PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"` - PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"` - Validity *string `json:"validity,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + FirstLocationDetected *SecretScanningAlertLocationDetails `json:"first_location_detected,omitempty"` + HasMoreLocations *bool `json:"has_more_locations,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"` + MultiRepo *bool `json:"multi_repo,omitempty"` + PubliclyLeaked *bool `json:"publicly_leaked,omitempty"` + PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` + PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` + PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` + ResolutionComment *string `json:"resolution_comment,omitempty"` + PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"` + PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"` + PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"` + PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"` + Validity *string `json:"validity,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert.