Skip to content

Commit

Permalink
Export of inner _Event fields
Browse files Browse the repository at this point in the history
  • Loading branch information
james2791 committed Feb 1, 2024
1 parent 6489feb commit ca1100c
Showing 1 changed file with 42 additions and 16 deletions.
58 changes: 42 additions & 16 deletions buildkite/webhook_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package buildkite
// agentEvent is a wrapper for an agent event notification
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events
type agentEvent struct {
type AgentEvent struct {
Event *string `json:"event"`
Agent *Agent `json:"agent"`
Sender *User `json:"sender"`
Expand All @@ -12,32 +12,42 @@ type agentEvent struct {
// AgentConnectedEvent is triggered when an agent has connected to the API
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events
type AgentConnectedEvent agentEvent
type AgentConnectedEvent struct {
AgentEvent
}

// AgentDisconnectedEvent is triggered when an agent has disconnected.
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events
type AgentDisconnectedEvent agentEvent
type AgentDisconnectedEvent struct {
AgentEvent
}

// AgentLostEvent is triggered when an agent has been marked as lost.
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events
type AgentLostEvent agentEvent
type AgentLostEvent struct {
AgentEvent
}

// AgentStoppedEvent is triggered when an agent has stopped.
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events
type AgentStoppedEvent agentEvent
type AgentStoppedEvent struct {
AgentEvent
}

// AgentStoppingEvent is triggered when an agent is stopping.
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/agent-events
type AgentStoppingEvent agentEvent
type AgentStoppingEvent struct {
AgentEvent
}

// buildEvent is a wrapper for a build event notification
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events
type buildEvent struct {
type BuildEvent struct {
Event *string `json:"event"`
Build *Build `json:"build"`
Pipeline *Pipeline `json:"pipeline"`
Expand All @@ -47,27 +57,35 @@ type buildEvent struct {
// BuildFailingEvent is triggered when a build enters a failing state
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events
type BuildFailingEvent buildEvent
type BuildFailingEvent struct {
BuildEvent
}

// BuildFinishedEvent is triggered when a build finishes
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events
type BuildFinishedEvent buildEvent
type BuildFinishedEvent struct {
BuildEvent
}

// BuildRunningEvent is triggered when a build starts running
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events
type BuildRunningEvent buildEvent
type BuildRunningEvent struct {
BuildEvent
}

// BuildScheduledEvent is triggered when a build is scheduled
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/build-events
type BuildScheduledEvent buildEvent
type BuildScheduledEvent struct {
BuildEvent
}

// jobEvent is a wrapper for a job event notification
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events
type jobEvent struct {
type JobEvent struct {
Event *string `json:"event"`
Build *Build `json:"build"`
Job *Job `json:"job"`
Expand All @@ -78,22 +96,30 @@ type jobEvent struct {
// JobActivatedEvent is triggered when a job is activated
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events
type JobActivatedEvent jobEvent
type JobActivatedEvent struct {
JobEvent
}

// JobFinishedEvent is triggered when a job is finished
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events
type JobFinishedEvent jobEvent
type JobFinishedEvent struct {
JobEvent
}

// JobScheduledEvent is triggered when a job is scheduled
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events
type JobScheduledEvent jobEvent
type JobScheduledEvent struct {
JobEvent
}

// JobStartedEvent is triggered when a job is started
//
// Buildkite API docs: https://buildkite.com/docs/apis/webhooks/job-events
type JobStartedEvent jobEvent
type JobStartedEvent struct {
JobEvent
}

// PingEvent is triggered when a webhook notification setting is changed
//
Expand Down

0 comments on commit ca1100c

Please sign in to comment.