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

Code before:
	RunnerGroupID          *int64                  `json:"runner_group_id,omitempty"`
	RunnerGroupName        *string                 `json:"runner_group_name,omitempty"`
	RunnerID               *int64                  `json:"runner_id,omitempty"`
	RunnerLabels           []string                `json:"runner_labels,omitempty"`
	RunnerName             *string                 `json:"runner_name,omitempty"`
	RunNumber              *int64                  `json:"run_number,omitempty"`
	SecretsPassed          []string                `json:"secrets_passed,omitempty"`
	SourceVersion          *string                 `json:"source_version,omitempty"`
	StartedAt              *Timestamp              `json:"started_at,omitempty"`
	TargetLogin            *string                 `json:"target_login,omitempty"`
	TargetVersion          *string                 `json:"target_version,omitempty"`
	Team                   *string                 `json:"team,omitempty"`
	Timestamp              *Timestamp              `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).
	TokenID                *int64                  `json:"token_id,omitempty"`
	TokenScopes            *string                 `json:"token_scopes,omitempty"`
	Topic                  *string                 `json:"topic,omitempty"`
	TransportProtocolName  *string                 `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data.
	TransportProtocol      *int                    `json:"transport_protocol,omitempty"`      // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data.
	TriggerID              *int64                  `json:"trigger_id,omitempty"`
	User                   *string                 `json:"user,omitempty"` // The user that was affected by the action performed (if available).
	UserAgent              *string                 `json:"user_agent,omitempty"`
	Visibility             *string                 `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`.
	WorkflowID             *int64                  `json:"workflow_id,omitempty"`
	WorkflowRunID          *int64                  `json:"workflow_run_id,omitempty"`

	AuditEntryData `json:"data,omitempty"`
}

// Some audit entries have additional information stuffed into a `data` field.
type AuditEntryData struct {
	OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change
}

// GetAuditLog gets the audit-log entries for an organization.
//
// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization
func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) {
	u := fmt.Sprintf("orgs/%v/audit-log", org)
	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var auditEntries []*AuditEntry
	resp, err := s.client.Do(ctx, req, &auditEntries)
	if err != nil {

Review comment (suggestion):
```suggestion
	Data  *AuditEntryData `json:"data,omitempty"`
```

Code after:
	RunnerGroupID          *int64                  `json:"runner_group_id,omitempty"`
	RunnerGroupName        *string                 `json:"runner_group_name,omitempty"`
	RunnerID               *int64                  `json:"runner_id,omitempty"`
	RunnerLabels           []string                `json:"runner_labels,omitempty"`
	RunnerName             *string                 `json:"runner_name,omitempty"`
	RunNumber              *int64                  `json:"run_number,omitempty"`
	SecretsPassed          []string                `json:"secrets_passed,omitempty"`
	SourceVersion          *string                 `json:"source_version,omitempty"`
	StartedAt              *Timestamp              `json:"started_at,omitempty"`
	TargetLogin            *string                 `json:"target_login,omitempty"`
	TargetVersion          *string                 `json:"target_version,omitempty"`
	Team                   *string                 `json:"team,omitempty"`
	Timestamp              *Timestamp              `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).
	TokenID                *int64                  `json:"token_id,omitempty"`
	TokenScopes            *string                 `json:"token_scopes,omitempty"`
	Topic                  *string                 `json:"topic,omitempty"`
	TransportProtocolName  *string                 `json:"transport_protocol_name,omitempty"` // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data.
	TransportProtocol      *int                    `json:"transport_protocol,omitempty"`      // The type of protocol (for example, HTTP=1 or SSH=2) used to transfer Git data.
	TriggerID              *int64                  `json:"trigger_id,omitempty"`
	User                   *string                 `json:"user,omitempty"` // The user that was affected by the action performed (if available).
	UserAgent              *string                 `json:"user_agent,omitempty"`
	Visibility             *string                 `json:"visibility,omitempty"` // The repository visibility, for example `public` or `private`.
	WorkflowID             *int64                  `json:"workflow_id,omitempty"`
	WorkflowRunID          *int64                  `json:"workflow_run_id,omitempty"`

	Data *AuditEntryData `json:"data,omitempty"`
}

// AuditEntryData represents additional information stuffed into a `data` field.
type AuditEntryData struct {
	OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change
}

// GetAuditLog gets the audit-log entries for an organization.
//
// GitHub API docs: https://docs.github.com/en/rest/orgs/orgs#get-the-audit-log-for-an-organization
func (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) {
	u := fmt.Sprintf("orgs/%v/audit-log", org)
	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var auditEntries []*AuditEntry
	resp, err := s.client.Do(ctx, req, &auditEntries)
	if err != nil {