@@ -11,6 +11,49 @@ import (
1111 "time"
1212)
1313
14+ // Source represents a Hookdeck source
15+ type Source struct {
16+ ID string `json:"id"`
17+ Name string `json:"name"`
18+ Description * string `json:"description"`
19+ URL string `json:"url"`
20+ Type string `json:"type"`
21+ Config map [string ]interface {} `json:"config"`
22+ DisabledAt * time.Time `json:"disabled_at"`
23+ UpdatedAt time.Time `json:"updated_at"`
24+ CreatedAt time.Time `json:"created_at"`
25+ }
26+
27+ // SourceCreateInput represents input for creating a source inline
28+ type SourceCreateInput struct {
29+ Name string `json:"name"`
30+ Type string `json:"type"`
31+ Description * string `json:"description,omitempty"`
32+ Config map [string ]interface {} `json:"config,omitempty"`
33+ }
34+
35+ // Destination represents a Hookdeck destination
36+ type Destination struct {
37+ ID string `json:"id"`
38+ Name string `json:"name"`
39+ Description * string `json:"description"`
40+ URL * string `json:"url"`
41+ Type string `json:"type"`
42+ CliPath * string `json:"cli_path"`
43+ Config map [string ]interface {} `json:"config"`
44+ DisabledAt * time.Time `json:"disabled_at"`
45+ UpdatedAt time.Time `json:"updated_at"`
46+ CreatedAt time.Time `json:"created_at"`
47+ }
48+
49+ // DestinationCreateInput represents input for creating a destination inline
50+ type DestinationCreateInput struct {
51+ Name string `json:"name"`
52+ Type string `json:"type"`
53+ Description * string `json:"description,omitempty"`
54+ Config map [string ]interface {} `json:"config,omitempty"`
55+ }
56+
1457// Connection represents a Hookdeck connection
1558type Connection struct {
1659 ID string `json:"id"`
@@ -74,7 +117,7 @@ func (c *Client) ListConnections(ctx context.Context, params map[string]string)
74117 queryParams .Add (k , v )
75118 }
76119
77- resp , err := c .Get (ctx , "/2025-07 -01/connections" , queryParams .Encode (), nil )
120+ resp , err := c .Get (ctx , "/2024-03 -01/connections" , queryParams .Encode (), nil )
78121 if err != nil {
79122 return nil , err
80123 }
@@ -90,7 +133,7 @@ func (c *Client) ListConnections(ctx context.Context, params map[string]string)
90133
91134// GetConnection retrieves a single connection by ID
92135func (c * Client ) GetConnection (ctx context.Context , id string ) (* Connection , error ) {
93- resp , err := c .Get (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s" , id ), "" , nil )
136+ resp , err := c .Get (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s" , id ), "" , nil )
94137 if err != nil {
95138 return nil , err
96139 }
@@ -111,7 +154,7 @@ func (c *Client) CreateConnection(ctx context.Context, req *ConnectionCreateRequ
111154 return nil , fmt .Errorf ("failed to marshal connection request: %w" , err )
112155 }
113156
114- resp , err := c .Post (ctx , "/2025-07 -01/connections" , data , nil )
157+ resp , err := c .Post (ctx , "/2024-03 -01/connections" , data , nil )
115158 if err != nil {
116159 return nil , err
117160 }
@@ -132,7 +175,7 @@ func (c *Client) UpdateConnection(ctx context.Context, id string, req *Connectio
132175 return nil , fmt .Errorf ("failed to marshal connection update request: %w" , err )
133176 }
134177
135- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s" , id ), data , nil )
178+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s" , id ), data , nil )
136179 if err != nil {
137180 return nil , err
138181 }
@@ -148,7 +191,7 @@ func (c *Client) UpdateConnection(ctx context.Context, id string, req *Connectio
148191
149192// DeleteConnection deletes a connection
150193func (c * Client ) DeleteConnection (ctx context.Context , id string ) error {
151- url := fmt .Sprintf ("/2025-07 -01/connections/%s" , id )
194+ url := fmt .Sprintf ("/2024-03 -01/connections/%s" , id )
152195 req , err := c .newRequest (ctx , "DELETE" , url , nil )
153196 if err != nil {
154197 return err
@@ -165,7 +208,7 @@ func (c *Client) DeleteConnection(ctx context.Context, id string) error {
165208
166209// EnableConnection enables a connection
167210func (c * Client ) EnableConnection (ctx context.Context , id string ) (* Connection , error ) {
168- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s/enable" , id ), []byte ("{}" ), nil )
211+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s/enable" , id ), []byte ("{}" ), nil )
169212 if err != nil {
170213 return nil , err
171214 }
@@ -181,7 +224,7 @@ func (c *Client) EnableConnection(ctx context.Context, id string) (*Connection,
181224
182225// DisableConnection disables a connection
183226func (c * Client ) DisableConnection (ctx context.Context , id string ) (* Connection , error ) {
184- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s/disable" , id ), []byte ("{}" ), nil )
227+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s/disable" , id ), []byte ("{}" ), nil )
185228 if err != nil {
186229 return nil , err
187230 }
@@ -197,7 +240,7 @@ func (c *Client) DisableConnection(ctx context.Context, id string) (*Connection,
197240
198241// PauseConnection pauses a connection
199242func (c * Client ) PauseConnection (ctx context.Context , id string ) (* Connection , error ) {
200- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s/pause" , id ), []byte ("{}" ), nil )
243+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s/pause" , id ), []byte ("{}" ), nil )
201244 if err != nil {
202245 return nil , err
203246 }
@@ -213,7 +256,7 @@ func (c *Client) PauseConnection(ctx context.Context, id string) (*Connection, e
213256
214257// UnpauseConnection unpauses a connection
215258func (c * Client ) UnpauseConnection (ctx context.Context , id string ) (* Connection , error ) {
216- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s/unpause" , id ), []byte ("{}" ), nil )
259+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s/unpause" , id ), []byte ("{}" ), nil )
217260 if err != nil {
218261 return nil , err
219262 }
@@ -229,7 +272,7 @@ func (c *Client) UnpauseConnection(ctx context.Context, id string) (*Connection,
229272
230273// ArchiveConnection archives a connection
231274func (c * Client ) ArchiveConnection (ctx context.Context , id string ) (* Connection , error ) {
232- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s/archive" , id ), []byte ("{}" ), nil )
275+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s/archive" , id ), []byte ("{}" ), nil )
233276 if err != nil {
234277 return nil , err
235278 }
@@ -245,7 +288,7 @@ func (c *Client) ArchiveConnection(ctx context.Context, id string) (*Connection,
245288
246289// UnarchiveConnection unarchives a connection
247290func (c * Client ) UnarchiveConnection (ctx context.Context , id string ) (* Connection , error ) {
248- resp , err := c .Put (ctx , fmt .Sprintf ("/2025-07 -01/connections/%s/unarchive" , id ), []byte ("{}" ), nil )
291+ resp , err := c .Put (ctx , fmt .Sprintf ("/2024-03 -01/connections/%s/unarchive" , id ), []byte ("{}" ), nil )
249292 if err != nil {
250293 return nil , err
251294 }
@@ -266,7 +309,7 @@ func (c *Client) CountConnections(ctx context.Context, params map[string]string)
266309 queryParams .Add (k , v )
267310 }
268311
269- resp , err := c .Get (ctx , "/2025-07 -01/connections/count" , queryParams .Encode (), nil )
312+ resp , err := c .Get (ctx , "/2024-03 -01/connections/count" , queryParams .Encode (), nil )
270313 if err != nil {
271314 return nil , err
272315 }
0 commit comments