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

Code before:
	// See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization
	ListOptions
}

// SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method.
type SecretScanningAlertUpdateOptions struct {
	// State is required and sets the state of the secret scanning alert.
	// Can be either "open" or "resolved".
	// You must provide resolution when you set the state to "resolved".
	State string `json:"state"`

	// Required when the state is "resolved" and represents the reason for resolving the alert.
	// Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests".
	Resolution *string `json:"resolution,omitempty"`

	// An optional comment when closing an alert.
	ResolutionComment *string `json:"resolution_comment,omitempty"`
}

// PushProtectionBypassRequest represents the parameters for CreatePushProtectionBypass.
type PushProtectionBypassRequest struct {
	Reason        string `json:"reason"`
	PlaceholderID string `json:"placeholder_id"`
}

// PushProtectionBypass represents the responses from CreatePushProtectionBypass.
type PushProtectionBypass struct {
	Reason    string     `json:"reason"`
	ExpireAt  *Timestamp `json:"expire_at"`
	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"`
	StartedAt   *Timestamp `json:"started_at"`
}

// 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"`
}

// SecretScanningResponse is the top-level struct for the secret scanning API response.
type SecretScanningResponse struct {
	IncrementalScans       []*Scan              `json:"incremental_scans"`
	BackfillScans          []*Scan              `json:"backfill_scans"`

Review comment (suggestion):
```suggestion
// PushProtectionBypass represents the response from CreatePushProtectionBypass.
```

Code after:
	// See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization
	ListOptions
}

// SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method.
type SecretScanningAlertUpdateOptions struct {
	// State is required and sets the state of the secret scanning alert.
	// Can be either "open" or "resolved".
	// You must provide resolution when you set the state to "resolved".
	State string `json:"state"`

	// Required when the state is "resolved" and represents the reason for resolving the alert.
	// Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests".
	Resolution *string `json:"resolution,omitempty"`

	// An optional comment when closing an alert.
	ResolutionComment *string `json:"resolution_comment,omitempty"`
}

// PushProtectionBypassRequest represents the parameters for CreatePushProtectionBypass.
type PushProtectionBypassRequest struct {
	// The reason for bypassing push protection.
	// 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"`