Skip to content

Commit a057dbf

Browse files
authored
feat(tem): add support for filter in webhooks (#2106)
1 parent 60b1daf commit a057dbf

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

api/tem/v1alpha1/tem_sdk.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,9 @@ type WebhookEvent struct {
829829
// ProjectID: ID of the Webhook Event Project.
830830
ProjectID string `json:"project_id"`
831831

832+
// DomainID: ID of the webhook event domain.
833+
DomainID string `json:"domain_id"`
834+
832835
// Type: type of the Webhook Event.
833836
// Default value: unknown_type
834837
Type WebhookEventType `json:"type"`
@@ -1180,6 +1183,24 @@ type ListWebhookEventsRequest struct {
11801183

11811184
// PageSize: requested page size. Value must be between 1 and 100.
11821185
PageSize *uint32 `json:"-"`
1186+
1187+
// EmailID: ID of the email linked to the events.
1188+
EmailID *string `json:"-"`
1189+
1190+
// EventTypes: list of event types linked to the events.
1191+
EventTypes []WebhookEventType `json:"-"`
1192+
1193+
// Statuses: list of event statuses.
1194+
Statuses []WebhookEventStatus `json:"-"`
1195+
1196+
// ProjectID: ID of the webhook Project.
1197+
ProjectID *string `json:"-"`
1198+
1199+
// OrganizationID: ID of the webhook Organization.
1200+
OrganizationID *string `json:"-"`
1201+
1202+
// DomainID: ID of the domain to watch for triggering events.
1203+
DomainID *string `json:"-"`
11831204
}
11841205

11851206
// ListWebhookEventsResponse: list webhook events response.
@@ -1851,6 +1872,12 @@ func (s *API) ListWebhookEvents(req *ListWebhookEventsRequest, opts ...scw.Reque
18511872
parameter.AddToQuery(query, "order_by", req.OrderBy)
18521873
parameter.AddToQuery(query, "page", req.Page)
18531874
parameter.AddToQuery(query, "page_size", req.PageSize)
1875+
parameter.AddToQuery(query, "email_id", req.EmailID)
1876+
parameter.AddToQuery(query, "event_types", req.EventTypes)
1877+
parameter.AddToQuery(query, "statuses", req.Statuses)
1878+
parameter.AddToQuery(query, "project_id", req.ProjectID)
1879+
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
1880+
parameter.AddToQuery(query, "domain_id", req.DomainID)
18541881

18551882
if fmt.Sprint(req.Region) == "" {
18561883
return nil, errors.New("field Region cannot be empty in request")

0 commit comments

Comments
 (0)