File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ func (s RequestStatus) String() string {
4343 }
4444}
4545
46- // Log - stination defines where particular request was going with
47- // output ID and additional stats
46+ // Log - received webhook event
4847type Log struct {
4948 ID string `json:"id"`
5049 CreatedAt time.Time `json:"created_at"`
@@ -174,3 +173,27 @@ func (api *API) GetWebhookLog(id string) (*Log, error) {
174173
175174 return & webhookLog , nil
176175}
176+
177+ // WebhookLogsUpdateRequest is used to update Webhook Relay request if used
178+ // for example with WebSocket transponder (it becomes client's responsibility
179+ // to do this action). Response information must be sent within 10 seconds
180+ // of receiving the webhook.
181+ type WebhookLogsUpdateRequest struct {
182+ ID string `json:"id"`
183+ StatusCode int `json:"status_code"`
184+ ResponseBody []byte `json:"response_body"`
185+ ResponseHeaders Headers `json:"response_headers" `
186+ Status RequestStatus `json:"status"`
187+ Retries int `json:"retries"`
188+ }
189+
190+ // UpdateWebhookLog - update webhook log response body, headers and status code.
191+ func (api * API ) UpdateWebhookLog (updateRequest * WebhookLogsUpdateRequest ) error {
192+
193+ _ , err := api .makeRequest (http .MethodPut , "/logs/" + updateRequest .ID , updateRequest )
194+ if err != nil {
195+ return errors .Wrap (err , errMakeRequestError )
196+ }
197+
198+ return nil
199+ }
You can’t perform that action at this time.
0 commit comments