From ca1100c0c81f681cb74549505f8fadc71ad8855e Mon Sep 17 00:00:00 2001 From: James Sammut <juma2791@gmail.com> Date: Thu, 1 Feb 2024 12:31:26 +1100 Subject: [PATCH] Export of inner _Event fields --- buildkite/webhook_events.go | 58 +++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/buildkite/webhook_events.go b/buildkite/webhook_events.go index f10ad929..2f0507a8 100644 --- a/buildkite/webhook_events.go +++ b/buildkite/webhook_events.go @@ -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"` @@ -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"` @@ -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"` @@ -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 //