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

Code before:
	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"`
}

// Scan represents the common fields for a secret scanning scan.
type Scan 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 {
	Scan
	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 []*Scan `json:"incremental_scans"`
	// Information on backfill scan performed by secret scanning on the repository.
	BackfillScans []*Scan `json:"backfill_scans"`
	// Information on pattern update scan performed by secret scanning on the repository.
	PatternUpdateScans []*Scan `json:"pattern_update_scans"`
	// Information on custom pattern backfill scan performed by secret scanning on the repository.
	CustomPatternBackfills []*CustomPatternScan `json:"custom_pattern_backfill_scans"`
}

// 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
func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise)
	u, err := addOptions(u, opts)

Review comment (suggestion):
To be consistent with the rest of this repo, let's please use pointers when we use `omitempty`:

```suggestion
	PatternSlug  *string `json:"pattern_slug,omitempty"`
	PatternScope *string `json:"pattern_scope,omitempty"`
```

Code after:
	// 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
//
//meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts
func (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/secret-scanning/alerts", enterprise)