Repository: google/go-github
File: github/secret_scanning.go (Go)

Code before:
	Reason string `json:"reason"`
	// PlaceholderID is an identifier used for the bypass request.
	// GitHub Secret Scanning provides you with a unique PlaceholderID associated with that specific blocked push.
	PlaceholderID string `json:"placeholder_id"`
}

// PushProtectionBypass represents the response from CreatePushProtectionBypass.
type PushProtectionBypass struct {
	// The reason for bypassing push protection.
	Reason string `json:"reason"`
	// The time that the bypass will expire in ISO 8601 format.
	ExpireAt *Timestamp `json:"expire_at"`
	// The token type this bypass is for.
	TokenType string `json:"token_type"`
}

// SecretsScan represents the common fields for a secret scanning scan.
type SecretsScan struct {
	Type        string     `json:"type"`
	Status      string     `json:"status"`
	CompletedAt *Timestamp `json:"completed_at,omitempty"`
	StartedAt   *Timestamp `json:"started_at,omitempty"`
}

// CustomPatternScan represents a scan with an associated custom pattern.
type CustomPatternScan struct {
	SecretsScan
	PatternSlug  *string `json:"pattern_slug,omitempty"`
	PatternScope *string `json:"pattern_scope,omitempty"`
}

// SecretScanningHistory is the top-level struct for the secret scanning API response.
type SecretScanningHistory struct {
	// Information on incremental scan performed by secret scanning on the repository.
	IncrementalScans []*SecretsScan `json:"incremental_scans,omitempty"`
	// Information on backfill scan performed by secret scanning on the repository.
	BackfillScans []*SecretsScan `json:"backfill_scans,omitempty"`
	// Information on pattern update scan performed by secret scanning on the repository.
	PatternUpdateScans []*SecretsScan `json:"pattern_update_scans,omitempty"`
	// Information on custom pattern backfill scan performed by secret scanning on the repository.
	CustomPatternBackfillScans []*CustomPatternScan `json:"custom_pattern_backfill_scans,omitempty"`
}

// ListAlertsForEnterprise lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.
//
// To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or
// security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager.
//
// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts

Review comment (suggestion):
```suggestion
type CustomPatternBackfillScan struct {
```

Code after:
	// Can be one of: false_positive, used_in_tests, will_fix_later
	Reason string `json:"reason"`
	// PlaceholderID is an identifier used for the bypass request.
	// GitHub Secret Scanning provides you with a unique PlaceholderID associated with that specific blocked push.
	PlaceholderID string `json:"placeholder_id"`
}

// PushProtectionBypass represents the response from CreatePushProtectionBypass.
type PushProtectionBypass struct {
	// The reason for bypassing push protection.
	Reason string `json:"reason"`
	// The time that the bypass will expire in ISO 8601 format.
	ExpireAt *Timestamp `json:"expire_at"`
	// The token type this bypass is for.
	TokenType string `json:"token_type"`
}

// SecretsScan represents the common fields for a secret scanning scan.
type SecretsScan struct {
	Type        string     `json:"type"`
	Status      string     `json:"status"`
	CompletedAt *Timestamp `json:"completed_at,omitempty"`
	StartedAt   *Timestamp `json:"started_at,omitempty"`
}

// CustomPatternBackfillScan represents a scan with an associated custom pattern.
type CustomPatternBackfillScan struct {
	SecretsScan
	PatternSlug  *string `json:"pattern_slug,omitempty"`
	PatternScope *string `json:"pattern_scope,omitempty"`
}

// SecretScanningScanHistory is the top-level struct for the secret scanning API response.
type SecretScanningScanHistory struct {
	// Information on incremental scan performed by secret scanning on the repository.
	IncrementalScans []*SecretsScan `json:"incremental_scans,omitempty"`
	// Information on backfill scan performed by secret scanning on the repository.
	BackfillScans []*SecretsScan `json:"backfill_scans,omitempty"`
	// Information on pattern update scan performed by secret scanning on the repository.
	PatternUpdateScans []*SecretsScan `json:"pattern_update_scans,omitempty"`
	// Information on custom pattern backfill scan performed by secret scanning on the repository.
	CustomPatternBackfillScans []*CustomPatternBackfillScan `json:"custom_pattern_backfill_scans,omitempty"`
}

// ListAlertsForEnterprise lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.
//
// To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or
// security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager.
//
// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise
//