Documentation
¶
Index ¶
- Constants
- func CreateSDKClient(init SDKClientInit) *hookdeckclient.Client
- func IsNotFoundError(err error) bool
- type APIError
- type CIClient
- type CLITelemetry
- type Client
- func (c *Client) CancelEvent(ctx context.Context, eventID string) error
- func (c *Client) CountConnections(ctx context.Context, params map[string]string) (*ConnectionCountResponse, error)
- func (c *Client) CountDestinations(ctx context.Context, params map[string]string) (*DestinationCountResponse, error)
- func (c *Client) CountIssues(ctx context.Context, params map[string]string) (*IssueCountResponse, error)
- func (c *Client) CountSources(ctx context.Context, params map[string]string) (*SourceCountResponse, error)
- func (c *Client) CountTransformations(ctx context.Context, params map[string]string) (*TransformationCountResponse, error)
- func (c *Client) CreateCIClient(input CreateCIClientInput) (CIClient, error)
- func (c *Client) CreateConnection(ctx context.Context, req *ConnectionCreateRequest) (*Connection, error)
- func (c *Client) CreateDestination(ctx context.Context, req *DestinationCreateRequest) (*Destination, error)
- func (c *Client) CreateGuestUser(input CreateGuestUserInput) (GuestUser, error)
- func (c *Client) CreateSession(input CreateSessionInput) (Session, error)
- func (c *Client) CreateSource(ctx context.Context, req *SourceCreateRequest) (*Source, error)
- func (c *Client) CreateTransformation(ctx context.Context, req *TransformationCreateRequest) (*Transformation, error)
- func (c *Client) DeleteConnection(ctx context.Context, id string) error
- func (c *Client) DeleteDestination(ctx context.Context, id string) error
- func (c *Client) DeleteSource(ctx context.Context, id string) error
- func (c *Client) DeleteTransformation(ctx context.Context, id string) error
- func (c *Client) DisableConnection(ctx context.Context, id string) (*Connection, error)
- func (c *Client) DisableDestination(ctx context.Context, id string) (*Destination, error)
- func (c *Client) DisableSource(ctx context.Context, id string) (*Source, error)
- func (c *Client) DismissIssue(ctx context.Context, id string) (*Issue, error)
- func (c *Client) EnableConnection(ctx context.Context, id string) (*Connection, error)
- func (c *Client) EnableDestination(ctx context.Context, id string) (*Destination, error)
- func (c *Client) EnableSource(ctx context.Context, id string) (*Source, error)
- func (c *Client) Get(ctx context.Context, path string, params string, configure func(*http.Request)) (*http.Response, error)
- func (c *Client) GetAttempt(ctx context.Context, id string) (*EventAttempt, error)
- func (c *Client) GetConnection(ctx context.Context, id string) (*Connection, error)
- func (c *Client) GetDestination(ctx context.Context, id string, params map[string]string) (*Destination, error)
- func (c *Client) GetEvent(ctx context.Context, id string, params map[string]string) (*Event, error)
- func (c *Client) GetEventRawBody(ctx context.Context, eventID string) ([]byte, error)
- func (c *Client) GetIssue(ctx context.Context, id string) (*Issue, error)
- func (c *Client) GetRequest(ctx context.Context, id string, params map[string]string) (*Request, error)
- func (c *Client) GetRequestEvents(ctx context.Context, requestID string, params map[string]string) (*EventListResponse, error)
- func (c *Client) GetRequestIgnoredEvents(ctx context.Context, requestID string, params map[string]string) (*EventListResponse, error)
- func (c *Client) GetRequestRawBody(ctx context.Context, requestID string) ([]byte, error)
- func (c *Client) GetSource(ctx context.Context, id string, params map[string]string) (*Source, error)
- func (c *Client) GetTransformation(ctx context.Context, id string) (*Transformation, error)
- func (c *Client) GetTransformationExecution(ctx context.Context, transformationID, executionID string) (*TransformationExecution, error)
- func (c *Client) ListAttempts(ctx context.Context, params map[string]string) (*EventAttemptListResponse, error)
- func (c *Client) ListConnections(ctx context.Context, params map[string]string) (*ConnectionListResponse, error)
- func (c *Client) ListDestinations(ctx context.Context, params map[string]string) (*DestinationListResponse, error)
- func (c *Client) ListEvents(ctx context.Context, params map[string]string) (*EventListResponse, error)
- func (c *Client) ListIssues(ctx context.Context, params map[string]string) (*IssueListResponse, error)
- func (c *Client) ListProjects() ([]Project, error)
- func (c *Client) ListRequests(ctx context.Context, params map[string]string) (*RequestListResponse, error)
- func (c *Client) ListSources(ctx context.Context, params map[string]string) (*SourceListResponse, error)
- func (c *Client) ListTransformationExecutions(ctx context.Context, transformationID string, params map[string]string) (*TransformationExecutionListResponse, error)
- func (c *Client) ListTransformations(ctx context.Context, params map[string]string) (*TransformationListResponse, error)
- func (c *Client) MuteEvent(ctx context.Context, eventID string) error
- func (c *Client) PauseConnection(ctx context.Context, id string) (*Connection, error)
- func (c *Client) PerformRequest(ctx context.Context, req *http.Request) (*http.Response, error)
- func (c *Client) PollForAPIKeyWithKey(apiKey string, interval time.Duration, maxAttempts int) (*PollAPIKeyResponse, error)
- func (c *Client) Post(ctx context.Context, path string, data []byte, configure func(*http.Request)) (*http.Response, error)
- func (c *Client) Put(ctx context.Context, path string, data []byte, configure func(*http.Request)) (*http.Response, error)
- func (c *Client) QueryAttemptMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) QueryEventMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) QueryEventsByIssue(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) QueryEventsPendingTimeseries(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) QueryQueueDepth(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) QueryRequestMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) QueryTransformationMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
- func (c *Client) RetryEvent(ctx context.Context, eventID string) error
- func (c *Client) RetryRequest(ctx context.Context, requestID string, body *RequestRetryRequest) error
- func (c *Client) RunTransformation(ctx context.Context, req *TransformationRunRequest) (*TransformationRunResponse, error)
- func (c *Client) StartGuestLogin(deviceName string) (*GuestSession, error)
- func (c *Client) StartLogin(deviceName string) (*LoginSession, error)
- func (c *Client) UnpauseConnection(ctx context.Context, id string) (*Connection, error)
- func (c *Client) UpdateClient(clientID string, input UpdateClientInput) error
- func (c *Client) UpdateConnection(ctx context.Context, id string, req *ConnectionCreateRequest) (*Connection, error)
- func (c *Client) UpdateDestination(ctx context.Context, id string, req *DestinationUpdateRequest) (*Destination, error)
- func (c *Client) UpdateIssue(ctx context.Context, id string, req *IssueUpdateRequest) (*Issue, error)
- func (c *Client) UpdateSource(ctx context.Context, id string, req *SourceUpdateRequest) (*Source, error)
- func (c *Client) UpdateTransformation(ctx context.Context, id string, req *TransformationUpdateRequest) (*Transformation, error)
- func (c *Client) UpsertConnection(ctx context.Context, req *ConnectionCreateRequest) (*Connection, error)
- func (c *Client) UpsertDestination(ctx context.Context, req *DestinationCreateRequest) (*Destination, error)
- func (c *Client) UpsertSource(ctx context.Context, req *SourceCreateRequest) (*Source, error)
- func (c *Client) UpsertTransformation(ctx context.Context, req *TransformationCreateRequest) (*Transformation, error)
- func (c *Client) ValidateAPIKey() (*ValidateAPIKeyResponse, error)
- type Connection
- type ConnectionCountResponse
- type ConnectionCreateRequest
- type ConnectionListResponse
- type CreateCIClientInput
- type CreateGuestUserInput
- type CreateSessionInput
- type Destination
- type DestinationCountResponse
- type DestinationCreateInput
- type DestinationCreateRequest
- type DestinationListResponse
- type DestinationUpdateRequest
- type ErrorResponse
- type Event
- type EventAttempt
- type EventAttemptListResponse
- type EventData
- type EventListResponse
- type GuestSession
- type GuestUser
- type Issue
- type IssueCountResponse
- type IssueListResponse
- type IssueStatus
- type IssueType
- type IssueUpdateRequest
- type LoginSession
- type MetricDataPoint
- type MetricsQueryParams
- type MetricsResponse
- type PaginationResponse
- type PollAPIKeyResponse
- type Project
- type Request
- type RequestData
- type RequestListResponse
- type RequestRetryRequest
- type Rule
- type SDKClientInit
- type Session
- type SessionFilters
- type Source
- type SourceCountResponse
- type SourceCreateInput
- type SourceCreateRequest
- type SourceListResponse
- type SourceUpdateRequest
- type Transformation
- type TransformationCountResponse
- type TransformationCreateRequest
- type TransformationExecution
- type TransformationExecutionListResponse
- type TransformationListResponse
- type TransformationRunRequest
- type TransformationRunRequestInput
- type TransformationRunResponse
- type TransformationUpdateRequest
- type UpdateClientInput
- type ValidateAPIKeyResponse
Constants ¶
const APIPathPrefix = "/2025-07-01"
APIPathPrefix is the versioned path prefix for all REST API requests. Used by connections, sources, destinations, events, auth, etc. Change in one place when the API version is updated.
const DefaultAPIBaseURL = "https://api.hookdeck.com"
DefaultAPIBaseURL is the default base URL for API requests
const DefaultConsoleBaseURL = "https://console.hookdeck.com"
const DefaultDashboardBaseURL = "https://dashboard.hookdeck.com"
DefaultDashboardBaseURL is the default base URL for dashboard requests
const DefaultDashboardURL = "https://dashboard.hookdeck.com"
DefaultDashboardURL is the default base URL for web links
const DefaultProfileName = "default"
const DefaultWebsocektURL = "wss://ws.hookdeck.com"
Variables ¶
This section is empty.
Functions ¶
func CreateSDKClient ¶
func CreateSDKClient(init SDKClientInit) *hookdeckclient.Client
func IsNotFoundError ¶ added in v1.8.1
IsNotFoundError reports whether the error is an API 404 Not Found response.
Types ¶
type APIError ¶ added in v1.8.1
APIError is a structured error returned by the Hookdeck API. It preserves the HTTP status code so callers can distinguish between different error types (e.g. 404 Not Found vs 500 Server Error) without resorting to string matching.
type CIClient ¶
type CIClient struct {
Claimed bool `json:"claimed"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
OrganizationName string `json:"organization_name"`
OrganizationID string `json:"organization_id"`
ProjectID string `json:"team_id"`
ProjectName string `json:"team_name"`
ProjectMode string `json:"team_mode"`
APIKey string `json:"key"`
ClientID string `json:"client_id"`
}
type CLITelemetry ¶
type CLITelemetry struct {
CommandPath string `json:"command_path"`
DeviceName string `json:"device_name"`
GeneratedResource bool `json:"generated_resource"`
}
CLITelemetry is the structure that holds telemetry data sent to Hookdeck in API requests.
func GetTelemetryInstance ¶
func GetTelemetryInstance() *CLITelemetry
GetTelemetryInstance returns the CLITelemetry instance (initializing it first if necessary).
func (*CLITelemetry) SetCommandContext ¶
func (t *CLITelemetry) SetCommandContext(cmd *cobra.Command)
SetCommandContext sets the telemetry values for the command being executed.
func (*CLITelemetry) SetDeviceName ¶
func (t *CLITelemetry) SetDeviceName(deviceName string)
SetDeviceName puts the device name into telemetry
type Client ¶
type Client struct {
// The base URL (protocol + hostname) used for all requests sent by this
// client.
BaseURL *url.URL
// API key used to authenticate requests sent by this client. If left
// empty, the `Authorization` header will be omitted.
APIKey string
ProjectID string
// When this is enabled, request and response headers will be printed to
// stdout.
Verbose bool
// When this is enabled, HTTP 429 (rate limit) errors will be logged at
// DEBUG level instead of ERROR level. Useful for polling scenarios where
// rate limiting is expected.
SuppressRateLimitErrors bool
// contains filtered or unexported fields
}
Client is the API client used to sent requests to Hookdeck.
func (*Client) CancelEvent ¶ added in v1.8.0
CancelEvent cancels an event by ID (PUT /events/{id}/cancel; no request body)
func (*Client) CountConnections ¶ added in v1.2.0
func (c *Client) CountConnections(ctx context.Context, params map[string]string) (*ConnectionCountResponse, error)
CountConnections counts connections matching the given filters
func (*Client) CountDestinations ¶ added in v1.8.0
func (c *Client) CountDestinations(ctx context.Context, params map[string]string) (*DestinationCountResponse, error)
CountDestinations counts destinations matching the given filters
func (*Client) CountIssues ¶
func (c *Client) CountIssues(ctx context.Context, params map[string]string) (*IssueCountResponse, error)
CountIssues counts issues matching the given filters.
func (*Client) CountSources ¶ added in v1.8.0
func (c *Client) CountSources(ctx context.Context, params map[string]string) (*SourceCountResponse, error)
CountSources counts sources matching the given filters
func (*Client) CountTransformations ¶ added in v1.8.0
func (c *Client) CountTransformations(ctx context.Context, params map[string]string) (*TransformationCountResponse, error)
CountTransformations counts transformations matching the given filters
func (*Client) CreateCIClient ¶
func (c *Client) CreateCIClient(input CreateCIClientInput) (CIClient, error)
func (*Client) CreateConnection ¶ added in v0.5.1
func (c *Client) CreateConnection(ctx context.Context, req *ConnectionCreateRequest) (*Connection, error)
CreateConnection creates a new connection
func (*Client) CreateDestination ¶ added in v1.8.0
func (c *Client) CreateDestination(ctx context.Context, req *DestinationCreateRequest) (*Destination, error)
CreateDestination creates a new destination
func (*Client) CreateGuestUser ¶
func (c *Client) CreateGuestUser(input CreateGuestUserInput) (GuestUser, error)
func (*Client) CreateSession ¶
func (c *Client) CreateSession(input CreateSessionInput) (Session, error)
func (*Client) CreateSource ¶ added in v0.5.1
CreateSource creates a new source
func (*Client) CreateTransformation ¶ added in v1.8.0
func (c *Client) CreateTransformation(ctx context.Context, req *TransformationCreateRequest) (*Transformation, error)
CreateTransformation creates a new transformation
func (*Client) DeleteConnection ¶ added in v1.2.0
DeleteConnection deletes a connection
func (*Client) DeleteDestination ¶ added in v1.8.0
DeleteDestination deletes a destination
func (*Client) DeleteSource ¶ added in v1.8.0
DeleteSource deletes a source
func (*Client) DeleteTransformation ¶ added in v1.8.0
DeleteTransformation deletes a transformation
func (*Client) DisableConnection ¶ added in v1.2.0
DisableConnection disables a connection
func (*Client) DisableDestination ¶ added in v1.8.0
DisableDestination disables a destination
func (*Client) DisableSource ¶ added in v1.8.0
DisableSource disables a source
func (*Client) DismissIssue ¶
DismissIssue dismisses an issue (DELETE /issues/{id}).
func (*Client) EnableConnection ¶ added in v1.2.0
EnableConnection enables a connection
func (*Client) EnableDestination ¶ added in v1.8.0
EnableDestination enables a destination
func (*Client) EnableSource ¶ added in v1.8.0
EnableSource enables a source
func (*Client) GetAttempt ¶ added in v1.8.0
GetAttempt retrieves a single attempt by ID
func (*Client) GetConnection ¶ added in v1.2.0
GetConnection retrieves a single connection by ID
func (*Client) GetDestination ¶ added in v1.7.1
func (c *Client) GetDestination(ctx context.Context, id string, params map[string]string) (*Destination, error)
GetDestination retrieves a single destination by ID
func (*Client) GetEventRawBody ¶ added in v1.8.0
GetEventRawBody returns the raw body of an event (GET /events/{id}/raw_body)
func (*Client) GetRequest ¶ added in v1.8.0
func (c *Client) GetRequest(ctx context.Context, id string, params map[string]string) (*Request, error)
GetRequest retrieves a single request by ID
func (*Client) GetRequestEvents ¶ added in v1.8.0
func (c *Client) GetRequestEvents(ctx context.Context, requestID string, params map[string]string) (*EventListResponse, error)
GetRequestEvents returns the list of events for a request (GET /requests/{id}/events)
func (*Client) GetRequestIgnoredEvents ¶ added in v1.8.0
func (c *Client) GetRequestIgnoredEvents(ctx context.Context, requestID string, params map[string]string) (*EventListResponse, error)
GetRequestIgnoredEvents returns the list of ignored events for a request (GET /requests/{id}/ignored_events)
func (*Client) GetRequestRawBody ¶ added in v1.8.0
GetRequestRawBody returns the raw body of a request (GET /requests/{id}/raw_body)
func (*Client) GetSource ¶ added in v1.8.0
func (c *Client) GetSource(ctx context.Context, id string, params map[string]string) (*Source, error)
GetSource retrieves a single source by ID
func (*Client) GetTransformation ¶ added in v1.8.0
GetTransformation retrieves a single transformation by ID
func (*Client) GetTransformationExecution ¶ added in v1.8.0
func (c *Client) GetTransformationExecution(ctx context.Context, transformationID, executionID string) (*TransformationExecution, error)
GetTransformationExecution retrieves a single execution by transformation ID and execution ID
func (*Client) ListAttempts ¶ added in v1.8.0
func (c *Client) ListAttempts(ctx context.Context, params map[string]string) (*EventAttemptListResponse, error)
ListAttempts retrieves attempts for an event (params: event_id required; order_by, dir, limit, next, prev)
func (*Client) ListConnections ¶ added in v1.2.0
func (c *Client) ListConnections(ctx context.Context, params map[string]string) (*ConnectionListResponse, error)
ListConnections retrieves a list of connections with optional filters
func (*Client) ListDestinations ¶ added in v1.8.0
func (c *Client) ListDestinations(ctx context.Context, params map[string]string) (*DestinationListResponse, error)
ListDestinations retrieves a list of destinations with optional filters
func (*Client) ListEvents ¶ added in v1.8.0
func (c *Client) ListEvents(ctx context.Context, params map[string]string) (*EventListResponse, error)
ListEvents retrieves events with optional filters (params: webhook_id, status, source_id, destination_id, limit, order_by, dir, next, prev, etc.)
func (*Client) ListIssues ¶
func (c *Client) ListIssues(ctx context.Context, params map[string]string) (*IssueListResponse, error)
ListIssues retrieves issues with optional filters.
func (*Client) ListProjects ¶
func (*Client) ListRequests ¶ added in v1.8.0
func (c *Client) ListRequests(ctx context.Context, params map[string]string) (*RequestListResponse, error)
ListRequests retrieves requests with optional filters
func (*Client) ListSources ¶ added in v0.5.1
func (c *Client) ListSources(ctx context.Context, params map[string]string) (*SourceListResponse, error)
ListSources retrieves a list of sources with optional filters
func (*Client) ListTransformationExecutions ¶ added in v1.8.0
func (c *Client) ListTransformationExecutions(ctx context.Context, transformationID string, params map[string]string) (*TransformationExecutionListResponse, error)
ListTransformationExecutions lists executions for a transformation
func (*Client) ListTransformations ¶ added in v1.8.0
func (c *Client) ListTransformations(ctx context.Context, params map[string]string) (*TransformationListResponse, error)
ListTransformations retrieves a list of transformations with optional filters
func (*Client) MuteEvent ¶ added in v1.8.0
MuteEvent mutes an event by ID (PUT /events/{id}/mute; no request body)
func (*Client) PauseConnection ¶ added in v1.2.0
PauseConnection pauses a connection
func (*Client) PerformRequest ¶
PerformRequest sends a request to Hookdeck and returns the response.
func (*Client) PollForAPIKeyWithKey ¶ added in v1.4.0
func (c *Client) PollForAPIKeyWithKey(apiKey string, interval time.Duration, maxAttempts int) (*PollAPIKeyResponse, error)
PollForAPIKeyWithKey polls for login completion using a CLI API key (for interactive login)
func (*Client) QueryAttemptMetrics ¶ added in v1.9.0
func (c *Client) QueryAttemptMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryAttemptMetrics returns attempt metrics (GET /metrics/attempts).
func (*Client) QueryEventMetrics ¶ added in v1.9.0
func (c *Client) QueryEventMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryEventMetrics returns event metrics (GET /metrics/events).
func (*Client) QueryEventsByIssue ¶ added in v1.9.0
func (c *Client) QueryEventsByIssue(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryEventsByIssue returns events grouped by issue (GET /metrics/events-by-issue).
func (*Client) QueryEventsPendingTimeseries ¶ added in v1.9.0
func (c *Client) QueryEventsPendingTimeseries(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryEventsPendingTimeseries returns events pending timeseries (GET /metrics/events-pending-timeseries).
func (*Client) QueryQueueDepth ¶ added in v1.9.0
func (c *Client) QueryQueueDepth(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryQueueDepth returns queue depth metrics (GET /metrics/queue-depth).
func (*Client) QueryRequestMetrics ¶ added in v1.9.0
func (c *Client) QueryRequestMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryRequestMetrics returns request metrics (GET /metrics/requests).
func (*Client) QueryTransformationMetrics ¶ added in v1.9.0
func (c *Client) QueryTransformationMetrics(ctx context.Context, params MetricsQueryParams) (MetricsResponse, error)
QueryTransformationMetrics returns transformation metrics (GET /metrics/transformations).
func (*Client) RetryEvent ¶ added in v1.4.0
RetryEvent retries an event by ID (POST /events/{id}/retry; no request body)
func (*Client) RetryRequest ¶ added in v1.8.0
func (c *Client) RetryRequest(ctx context.Context, requestID string, body *RequestRetryRequest) error
RetryRequest retries a request by ID. Pass nil or empty WebhookIDs to retry on all connections; otherwise only for the given connection IDs.
func (*Client) RunTransformation ¶ added in v1.8.0
func (c *Client) RunTransformation(ctx context.Context, req *TransformationRunRequest) (*TransformationRunResponse, error)
RunTransformation runs transformation code (test run) via PUT /transformations/run
func (*Client) StartGuestLogin ¶ added in v1.4.0
func (c *Client) StartGuestLogin(deviceName string) (*GuestSession, error)
StartGuestLogin initiates a guest login flow and returns a session to wait for completion
func (*Client) StartLogin ¶ added in v1.4.0
func (c *Client) StartLogin(deviceName string) (*LoginSession, error)
StartLogin initiates the login flow and returns a session to wait for completion
func (*Client) UnpauseConnection ¶ added in v1.2.0
UnpauseConnection unpauses a connection
func (*Client) UpdateClient ¶ added in v1.4.0
func (c *Client) UpdateClient(clientID string, input UpdateClientInput) error
UpdateClient updates a CLI client's device name
func (*Client) UpdateConnection ¶ added in v1.8.0
func (c *Client) UpdateConnection(ctx context.Context, id string, req *ConnectionCreateRequest) (*Connection, error)
UpdateConnection updates an existing connection by ID Uses PUT /connections/{id} endpoint
func (*Client) UpdateDestination ¶ added in v1.8.0
func (c *Client) UpdateDestination(ctx context.Context, id string, req *DestinationUpdateRequest) (*Destination, error)
UpdateDestination updates an existing destination by ID
func (*Client) UpdateIssue ¶
func (c *Client) UpdateIssue(ctx context.Context, id string, req *IssueUpdateRequest) (*Issue, error)
UpdateIssue updates an issue's status.
func (*Client) UpdateSource ¶ added in v1.8.0
func (c *Client) UpdateSource(ctx context.Context, id string, req *SourceUpdateRequest) (*Source, error)
UpdateSource updates an existing source by ID
func (*Client) UpdateTransformation ¶ added in v1.8.0
func (c *Client) UpdateTransformation(ctx context.Context, id string, req *TransformationUpdateRequest) (*Transformation, error)
UpdateTransformation updates an existing transformation by ID
func (*Client) UpsertConnection ¶ added in v1.2.0
func (c *Client) UpsertConnection(ctx context.Context, req *ConnectionCreateRequest) (*Connection, error)
UpsertConnection creates or updates a connection by name Uses PUT /connections endpoint with name as the unique identifier
func (*Client) UpsertDestination ¶ added in v1.8.0
func (c *Client) UpsertDestination(ctx context.Context, req *DestinationCreateRequest) (*Destination, error)
UpsertDestination creates or updates a destination by name
func (*Client) UpsertSource ¶ added in v1.8.0
UpsertSource creates or updates a source by name
func (*Client) UpsertTransformation ¶ added in v1.8.0
func (c *Client) UpsertTransformation(ctx context.Context, req *TransformationCreateRequest) (*Transformation, error)
UpsertTransformation creates or updates a transformation by name
func (*Client) ValidateAPIKey ¶ added in v1.4.0
func (c *Client) ValidateAPIKey() (*ValidateAPIKeyResponse, error)
ValidateAPIKey validates an API key and returns user/project information
type Connection ¶ added in v0.5.1
type Connection struct {
ID string `json:"id"`
Name *string `json:"name"`
FullName *string `json:"full_name"`
Description *string `json:"description"`
TeamID string `json:"team_id"`
Destination *Destination `json:"destination"`
Source *Source `json:"source"`
Rules []Rule `json:"rules"`
DisabledAt *time.Time `json:"disabled_at"`
PausedAt *time.Time `json:"paused_at"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Connection represents a Hookdeck connection
type ConnectionCountResponse ¶ added in v1.2.0
type ConnectionCountResponse struct {
Count int `json:"count"`
}
ConnectionCountResponse represents the response from counting connections
type ConnectionCreateRequest ¶ added in v1.2.0
type ConnectionCreateRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
SourceID *string `json:"source_id,omitempty"`
DestinationID *string `json:"destination_id,omitempty"`
Source *SourceCreateInput `json:"source,omitempty"`
Destination *DestinationCreateInput `json:"destination,omitempty"`
Rules []Rule `json:"rules,omitempty"`
}
ConnectionCreateRequest represents the request to create a connection
type ConnectionListResponse ¶ added in v1.2.0
type ConnectionListResponse struct {
Models []Connection `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
ConnectionListResponse represents the response from listing connections
type CreateCIClientInput ¶
type CreateCIClientInput struct {
DeviceName string `json:"device_name"`
}
type CreateGuestUserInput ¶
type CreateGuestUserInput struct {
DeviceName string `json:"device_name"`
}
type CreateSessionInput ¶
type CreateSessionInput struct {
ConnectionIds []string `json:"webhook_ids"`
Filters *SessionFilters `json:"filters,omitempty"`
}
type Destination ¶ added in v0.5.1
type Destination struct {
ID string `json:"id"`
TeamID string `json:"team_id"`
Name string `json:"name"`
Description *string `json:"description"`
Type string `json:"type"`
Config map[string]interface{} `json:"config"`
DisabledAt *time.Time `json:"disabled_at"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Destination represents a Hookdeck destination
func (*Destination) GetCLIPath ¶ added in v1.2.0
func (d *Destination) GetCLIPath() *string
GetCLIPath returns the CLI path from config for CLI-type destinations For CLI destinations, the path is stored in config.path according to the OpenAPI spec
func (*Destination) GetHTTPURL ¶ added in v1.2.0
func (d *Destination) GetHTTPURL() *string
GetHTTPURL returns the HTTP URL from config for HTTP-type destinations For HTTP destinations, the URL is stored in config.url according to the OpenAPI spec
func (*Destination) SetCLIPath ¶ added in v1.2.0
func (d *Destination) SetCLIPath(path string)
SetCLIPath sets the CLI path in config for CLI-type destinations
type DestinationCountResponse ¶ added in v1.8.0
type DestinationCountResponse struct {
Count int `json:"count"`
}
DestinationCountResponse represents the response from counting destinations
type DestinationCreateInput ¶ added in v1.2.0
type DestinationCreateInput struct {
Name string `json:"name"`
Type string `json:"type"`
Description *string `json:"description,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
DestinationCreateInput represents input for creating a destination inline
type DestinationCreateRequest ¶ added in v1.2.0
type DestinationCreateRequest struct {
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
DestinationCreateRequest is the request body for create and upsert (POST/PUT /destinations). API requires name. Type and Config are used for HTTP/CLI/MOCK_API destinations.
type DestinationListResponse ¶ added in v1.8.0
type DestinationListResponse struct {
Models []Destination `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
DestinationListResponse represents the response from listing destinations
type DestinationUpdateRequest ¶ added in v1.8.0
type DestinationUpdateRequest struct {
Name string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
DestinationUpdateRequest is the request body for update (PUT /destinations/{id}). API has no required fields; only include fields that are being updated.
type ErrorResponse ¶
type Event ¶ added in v1.8.0
type Event struct {
ID string `json:"id"`
Status string `json:"status"`
WebhookID string `json:"webhook_id"`
SourceID string `json:"source_id"`
DestinationID string `json:"destination_id"`
RequestID string `json:"request_id"`
Attempts int `json:"attempts"`
ResponseStatus *int `json:"response_status,omitempty"`
ErrorCode *string `json:"error_code,omitempty"`
CliID *string `json:"cli_id,omitempty"`
EventDataID *string `json:"event_data_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
SuccessfulAt *time.Time `json:"successful_at,omitempty"`
LastAttemptAt *time.Time `json:"last_attempt_at,omitempty"`
NextAttemptAt *time.Time `json:"next_attempt_at,omitempty"`
Data *EventData `json:"data,omitempty"`
TeamID string `json:"team_id"`
}
Event represents a Hookdeck event (processed webhook delivery)
type EventAttempt ¶ added in v1.8.0
type EventAttempt struct {
ID string `json:"id"`
TeamID string `json:"team_id"`
EventID string `json:"event_id"`
DestinationID string `json:"destination_id"`
ResponseStatus *int `json:"response_status,omitempty"`
AttemptNumber int `json:"attempt_number"`
Trigger string `json:"trigger"`
ErrorCode *string `json:"error_code,omitempty"`
Body interface{} `json:"body,omitempty"` // API may return string or object
RequestedURL string `json:"requested_url"`
HTTPMethod string `json:"http_method"`
BulkRetryID *string `json:"bulk_retry_id,omitempty"`
Status string `json:"status"`
SuccessfulAt *time.Time `json:"successful_at,omitempty"`
DeliveredAt *time.Time `json:"delivered_at,omitempty"`
}
EventAttempt represents a single delivery attempt for an event
type EventAttemptListResponse ¶ added in v1.8.0
type EventAttemptListResponse struct {
Models []EventAttempt `json:"models"`
Pagination PaginationResponse `json:"pagination"`
Count *int `json:"count,omitempty"`
}
EventAttemptListResponse is the response from listing attempts (EventAttemptPaginatedResult)
type EventData ¶ added in v1.8.0
type EventData struct {
Headers map[string]interface{} `json:"headers,omitempty"`
Body interface{} `json:"body,omitempty"`
Path string `json:"path,omitempty"`
ParsedQuery map[string]interface{} `json:"parsed_query,omitempty"`
}
EventData holds optional request snapshot on the event
type EventListResponse ¶ added in v1.8.0
type EventListResponse struct {
Models []Event `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
EventListResponse is the response from listing events
type GuestSession ¶ added in v1.4.0
type GuestSession struct {
BrowserURL string
GuestURL string
// contains filtered or unexported fields
}
GuestSession represents an in-progress guest login flow
func (*GuestSession) WaitForAPIKey ¶ added in v1.4.0
func (s *GuestSession) WaitForAPIKey(interval time.Duration, maxAttempts int) (*PollAPIKeyResponse, error)
WaitForAPIKey polls until the user completes login and returns the API key response
type Issue ¶
type Issue struct {
ID string `json:"id"`
TeamID string `json:"team_id"`
Status IssueStatus `json:"status"`
Type IssueType `json:"type"`
OpenedAt time.Time `json:"opened_at"`
FirstSeenAt time.Time `json:"first_seen_at"`
LastSeenAt time.Time `json:"last_seen_at"`
DismissedAt *time.Time `json:"dismissed_at,omitempty"`
AggregationKeys map[string]interface{} `json:"aggregation_keys"`
Reference map[string]interface{} `json:"reference"`
Data map[string]interface{} `json:"data,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Issue represents a Hookdeck issue.
type IssueCountResponse ¶
type IssueCountResponse struct {
Count int `json:"count"`
}
IssueCountResponse represents the response from counting issues.
type IssueListResponse ¶
type IssueListResponse struct {
Models []Issue `json:"models"`
Pagination PaginationResponse `json:"pagination"`
Count *int `json:"count,omitempty"`
}
IssueListResponse represents the response from listing issues.
type IssueStatus ¶
type IssueStatus string
IssueStatus represents the status of an issue.
const ( IssueStatusOpened IssueStatus = "OPENED" IssueStatusIgnored IssueStatus = "IGNORED" IssueStatusAcknowledged IssueStatus = "ACKNOWLEDGED" IssueStatusResolved IssueStatus = "RESOLVED" )
type IssueUpdateRequest ¶
type IssueUpdateRequest struct {
Status IssueStatus `json:"status"`
}
IssueUpdateRequest is the request body for PUT /issues/{id}.
type LoginSession ¶ added in v1.4.0
type LoginSession struct {
BrowserURL string
// contains filtered or unexported fields
}
LoginSession represents an in-progress login flow
func (*LoginSession) WaitForAPIKey ¶ added in v1.4.0
func (s *LoginSession) WaitForAPIKey(interval time.Duration, maxAttempts int) (*PollAPIKeyResponse, error)
WaitForAPIKey polls until the user completes login and returns the API key response
type MetricDataPoint ¶ added in v1.9.0
type MetricDataPoint struct {
TimeBucket *string `json:"time_bucket,omitempty"`
Dimensions map[string]interface{} `json:"dimensions,omitempty"`
Metrics map[string]float64 `json:"metrics,omitempty"`
}
MetricDataPoint is a single metric data point with time bucket, dimensions, and metrics. All metrics endpoints return an array of MetricDataPoint.
type MetricsQueryParams ¶ added in v1.9.0
type MetricsQueryParams struct {
Start string // required, ISO 8601
End string // required, ISO 8601
Granularity string // e.g. 1h, 5m, 1d (pattern: \d+(s|m|h|d|w|M))
Measures []string
Dimensions []string
SourceID string
DestinationID string
ConnectionID string // sent as filters[webhook_id]
Status string // e.g. SUCCESSFUL, FAILED
IssueID string // sent as filters[issue_id]; required for events-by-issue
}
MetricsQueryParams holds shared query parameters for all metrics endpoints. Start and End are required (ISO 8601 date-time). ConnectionID is mapped to API webhook_id in the CLI layer.
type MetricsResponse ¶ added in v1.9.0
type MetricsResponse = []MetricDataPoint
MetricsResponse is the response from any of the metrics GET endpoints.
type PaginationResponse ¶ added in v1.2.0
type PaginationResponse struct {
OrderBy string `json:"order_by"`
Dir string `json:"dir"`
Limit int `json:"limit"`
Next *string `json:"next"`
Prev *string `json:"prev"`
}
PaginationResponse represents pagination metadata
type PollAPIKeyResponse ¶ added in v1.4.0
type PollAPIKeyResponse struct {
Claimed bool `json:"claimed"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
UserEmail string `json:"user_email"`
OrganizationName string `json:"organization_name"`
OrganizationID string `json:"organization_id"`
ProjectID string `json:"team_id"`
ProjectName string `json:"team_name"`
ProjectMode string `json:"team_mode"`
APIKey string `json:"key"`
ClientID string `json:"client_id"`
}
PollAPIKeyResponse returns the data of the polling client login
type Request ¶ added in v1.8.0
type Request struct {
ID string `json:"id"`
SourceID string `json:"source_id"`
Verified bool `json:"verified"`
RejectionCause *string `json:"rejection_cause,omitempty"`
EventsCount int `json:"events_count"`
CliEventsCount int `json:"cli_events_count"`
IgnoredCount int `json:"ignored_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
IngestedAt *time.Time `json:"ingested_at,omitempty"`
OriginalEventDataID *string `json:"original_event_data_id,omitempty"`
Data *RequestData `json:"data,omitempty"`
TeamID string `json:"team_id"`
}
Request represents a raw inbound webhook received by a source
type RequestData ¶ added in v1.8.0
type RequestData struct {
Headers map[string]interface{} `json:"headers,omitempty"`
Body interface{} `json:"body,omitempty"`
Path string `json:"path,omitempty"`
ParsedQuery map[string]interface{} `json:"parsed_query,omitempty"`
}
RequestData holds optional request snapshot
type RequestListResponse ¶ added in v1.8.0
type RequestListResponse struct {
Models []Request `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
RequestListResponse is the response from listing requests
type RequestRetryRequest ¶ added in v1.8.0
type RequestRetryRequest struct {
WebhookIDs []string `json:"webhook_ids,omitempty"`
}
RequestRetryRequest is the body for POST /requests/{id}/retry. WebhookIDs limits retry to those connections; omit or empty for all.
type Rule ¶ added in v1.2.0
type Rule map[string]interface{}
Rule represents a connection rule (union type)
type SDKClientInit ¶
type SessionFilters ¶ added in v1.1.0
type SessionFilters struct {
Body *json.RawMessage `json:"body,omitempty"`
Headers *json.RawMessage `json:"headers,omitempty"`
Query *json.RawMessage `json:"query,omitempty"`
Path *json.RawMessage `json:"path,omitempty"`
}
type Source ¶ added in v0.5.1
type Source struct {
ID string `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
URL string `json:"url"`
Type string `json:"type"`
Config map[string]interface{} `json:"config"`
DisabledAt *time.Time `json:"disabled_at"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Source represents a Hookdeck source
type SourceCountResponse ¶ added in v1.8.0
type SourceCountResponse struct {
Count int `json:"count"`
}
SourceCountResponse represents the response from counting sources
type SourceCreateInput ¶ added in v1.2.0
type SourceCreateInput struct {
Name string `json:"name"`
Type string `json:"type"`
Description *string `json:"description,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
SourceCreateInput is the payload for a source when nested inside another request (e.g. ConnectionCreateRequest.Source). Single responsibility: inline source definition. Source has type and config.auth (same shape as standalone source create).
type SourceCreateRequest ¶ added in v1.2.0
type SourceCreateRequest struct {
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
SourceCreateRequest is the request body for create and upsert (POST/PUT /sources). API requires name for both. Same shape as SourceCreateInput but for direct /sources endpoints.
type SourceListResponse ¶ added in v1.8.0
type SourceListResponse struct {
Models []Source `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
SourceListResponse represents the response from listing sources
type SourceUpdateRequest ¶ added in v1.8.0
type SourceUpdateRequest struct {
Name string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
Config map[string]interface{} `json:"config,omitempty"`
}
SourceUpdateRequest is the request body for update (PUT /sources/{id}). API has no required fields; only include fields that are being updated.
type Transformation ¶ added in v1.8.0
type Transformation struct {
ID string `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
Env map[string]string `json:"env,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Transformation represents a Hookdeck transformation
type TransformationCountResponse ¶ added in v1.8.0
type TransformationCountResponse struct {
Count int `json:"count"`
}
TransformationCountResponse represents the response from counting transformations
type TransformationCreateRequest ¶ added in v1.8.0
type TransformationCreateRequest struct {
Name string `json:"name"`
Code string `json:"code"`
Env map[string]string `json:"env,omitempty"`
}
TransformationCreateRequest is the request body for create and upsert (POST/PUT /transformations). API requires name and code for both.
type TransformationExecution ¶ added in v1.8.0
type TransformationExecution struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
}
TransformationExecution represents a single transformation execution
type TransformationExecutionListResponse ¶ added in v1.8.0
type TransformationExecutionListResponse struct {
Models []TransformationExecution `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
TransformationExecutionListResponse represents the response from listing executions
type TransformationListResponse ¶ added in v1.8.0
type TransformationListResponse struct {
Models []Transformation `json:"models"`
Pagination PaginationResponse `json:"pagination"`
}
TransformationListResponse represents the response from listing transformations
type TransformationRunRequest ¶ added in v1.8.0
type TransformationRunRequest struct {
Code string `json:"code,omitempty"`
TransformationID string `json:"transformation_id,omitempty"`
WebhookID string `json:"webhook_id,omitempty"`
Env map[string]string `json:"env,omitempty"`
Request *TransformationRunRequestInput `json:"request,omitempty"`
}
TransformationRunRequest is the request body for PUT /transformations/run. Either Code or TransformationID must be set. Request.Headers is required (can be empty object).
type TransformationRunRequestInput ¶ added in v1.8.0
type TransformationRunRequestInput struct {
Headers map[string]string `json:"headers"`
Body interface{} `json:"body,omitempty"`
Path string `json:"path,omitempty"`
Query string `json:"query,omitempty"`
ParsedQuery map[string]interface{} `json:"parsed_query,omitempty"`
}
TransformationRunRequestInput is the "request" object for run (required headers; optional body, path, query).
type TransformationRunResponse ¶ added in v1.8.0
type TransformationRunResponse struct {
RequestID string `json:"request_id,omitempty"`
TransformationID string `json:"transformation_id,omitempty"`
ExecutionID string `json:"execution_id,omitempty"`
Request *TransformationRunRequestInput `json:"request,omitempty"`
}
TransformationRunResponse is the response from PUT /transformations/run. Matches OpenAPI schema TransformationExecutorOutput.
type TransformationUpdateRequest ¶ added in v1.8.0
type TransformationUpdateRequest struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Env map[string]string `json:"env,omitempty"`
}
TransformationUpdateRequest is the request body for update (PUT /transformations/{id}). API supports partial update; only include fields that are being updated.
type UpdateClientInput ¶ added in v1.4.0
type UpdateClientInput struct {
DeviceName string `json:"device_name"`
}
UpdateClientInput represents the input for updating a CLI client
type ValidateAPIKeyResponse ¶ added in v1.4.0
type ValidateAPIKeyResponse struct {
UserID string `json:"user_id"`
UserName string `json:"user_name"`
UserEmail string `json:"user_email"`
OrganizationName string `json:"organization_name"`
OrganizationID string `json:"organization_id"`
ProjectID string `json:"team_id"`
ProjectName string `json:"team_name_no_org"`
ProjectMode string `json:"team_mode"`
ClientID string `json:"client_id"`
}
ValidateAPIKeyResponse returns the user and team associated with a key