diff --git a/github/github-accessors.go b/github/github-accessors.go index 4a32702755a..8530cd914bc 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -24686,6 +24686,14 @@ func (s *SecretScanningAlert) GetHTMLURL() string { return *s.HTMLURL } +// GetIsBase64Encoded returns the IsBase64Encoded field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetIsBase64Encoded() bool { + if s == nil || s.IsBase64Encoded == nil { + return false + } + return *s.IsBase64Encoded +} + // GetLocationsURL returns the LocationsURL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetLocationsURL() string { if s == nil || s.LocationsURL == nil { @@ -24694,6 +24702,14 @@ func (s *SecretScanningAlert) GetLocationsURL() string { return *s.LocationsURL } +// GetMultiRepo returns the MultiRepo field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetMultiRepo() bool { + if s == nil || s.MultiRepo == nil { + return false + } + return *s.MultiRepo +} + // GetNumber returns the Number field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetNumber() int { if s == nil || s.Number == nil { @@ -24702,6 +24718,14 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetPubliclyLeaked returns the PubliclyLeaked field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPubliclyLeaked() bool { + if s == nil || s.PubliclyLeaked == nil { + return false + } + return *s.PubliclyLeaked +} + // GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetPushProtectionBypassed() bool { if s == nil || s.PushProtectionBypassed == nil { @@ -24726,6 +24750,38 @@ func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User { return s.PushProtectionBypassedBy } +// GetPushProtectionBypassRequestComment returns the PushProtectionBypassRequestComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestComment() string { + if s == nil || s.PushProtectionBypassRequestComment == nil { + return "" + } + return *s.PushProtectionBypassRequestComment +} + +// GetPushProtectionBypassRequestHTMLURL returns the PushProtectionBypassRequestHTMLURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestHTMLURL() string { + if s == nil || s.PushProtectionBypassRequestHTMLURL == nil { + return "" + } + return *s.PushProtectionBypassRequestHTMLURL +} + +// GetPushProtectionBypassRequestReviewer returns the PushProtectionBypassRequestReviewer field. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewer() *User { + if s == nil { + return nil + } + return s.PushProtectionBypassRequestReviewer +} + +// GetPushProtectionBypassRequestReviewerComment returns the PushProtectionBypassRequestReviewerComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment() string { + if s == nil || s.PushProtectionBypassRequestReviewerComment == nil { + return "" + } + return *s.PushProtectionBypassRequestReviewerComment +} + // GetRepository returns the Repository field. func (s *SecretScanningAlert) GetRepository() *Repository { if s == nil { @@ -24814,6 +24870,14 @@ func (s *SecretScanningAlert) GetURL() string { return *s.URL } +// GetValidity returns the Validity field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetValidity() string { + if s == nil || s.Validity == nil { + return "" + } + return *s.Validity +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertEvent) GetAction() string { if s == nil || s.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9efb190b522..8b85e063f4d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -31785,6 +31785,17 @@ func TestSecretScanningAlert_GetHTMLURL(tt *testing.T) { s.GetHTMLURL() } +func TestSecretScanningAlert_GetIsBase64Encoded(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{IsBase64Encoded: &zeroValue} + s.GetIsBase64Encoded() + s = &SecretScanningAlert{} + s.GetIsBase64Encoded() + s = nil + s.GetIsBase64Encoded() +} + func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) { tt.Parallel() var zeroValue string @@ -31796,6 +31807,17 @@ func TestSecretScanningAlert_GetLocationsURL(tt *testing.T) { s.GetLocationsURL() } +func TestSecretScanningAlert_GetMultiRepo(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{MultiRepo: &zeroValue} + s.GetMultiRepo() + s = &SecretScanningAlert{} + s.GetMultiRepo() + s = nil + s.GetMultiRepo() +} + func TestSecretScanningAlert_GetNumber(tt *testing.T) { tt.Parallel() var zeroValue int @@ -31807,6 +31829,17 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) { s.GetNumber() } +func TestSecretScanningAlert_GetPubliclyLeaked(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SecretScanningAlert{PubliclyLeaked: &zeroValue} + s.GetPubliclyLeaked() + s = &SecretScanningAlert{} + s.GetPubliclyLeaked() + s = nil + s.GetPubliclyLeaked() +} + func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) { tt.Parallel() var zeroValue bool @@ -31837,6 +31870,47 @@ func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) { s.GetPushProtectionBypassedBy() } +func TestSecretScanningAlert_GetPushProtectionBypassRequestComment(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{PushProtectionBypassRequestComment: &zeroValue} + s.GetPushProtectionBypassRequestComment() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassRequestComment() + s = nil + s.GetPushProtectionBypassRequestComment() +} + +func TestSecretScanningAlert_GetPushProtectionBypassRequestHTMLURL(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{PushProtectionBypassRequestHTMLURL: &zeroValue} + s.GetPushProtectionBypassRequestHTMLURL() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassRequestHTMLURL() + s = nil + s.GetPushProtectionBypassRequestHTMLURL() +} + +func TestSecretScanningAlert_GetPushProtectionBypassRequestReviewer(tt *testing.T) { + tt.Parallel() + s := &SecretScanningAlert{} + s.GetPushProtectionBypassRequestReviewer() + s = nil + s.GetPushProtectionBypassRequestReviewer() +} + +func TestSecretScanningAlert_GetPushProtectionBypassRequestReviewerComment(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{PushProtectionBypassRequestReviewerComment: &zeroValue} + s.GetPushProtectionBypassRequestReviewerComment() + s = &SecretScanningAlert{} + s.GetPushProtectionBypassRequestReviewerComment() + s = nil + s.GetPushProtectionBypassRequestReviewerComment() +} + func TestSecretScanningAlert_GetRepository(tt *testing.T) { tt.Parallel() s := &SecretScanningAlert{} @@ -31952,6 +32026,17 @@ func TestSecretScanningAlert_GetURL(tt *testing.T) { s.GetURL() } +func TestSecretScanningAlert_GetValidity(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SecretScanningAlert{Validity: &zeroValue} + s.GetValidity() + s = &SecretScanningAlert{} + s.GetValidity() + s = nil + s.GetValidity() +} + func TestSecretScanningAlertEvent_GetAction(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/secret_scanning.go b/github/secret_scanning.go index 4eeeba3df78..ad2312d0b2c 100644 --- a/github/secret_scanning.go +++ b/github/secret_scanning.go @@ -16,24 +16,32 @@ 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"` - 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"` + 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"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. @@ -72,6 +80,12 @@ type SecretScanningAlertListOptions struct { // Valid options are active, inactive, and unknown. Validity string `url:"validity,omitempty"` + // A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false. + IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"` + + // A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false. + IsMultiRepo bool `url:"is_multi_repo,omitempty"` + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. Direction string `url:"direction,omitempty"`