Skip to content

Commit

Permalink
Add cancel prediction endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmettokgoz committed Feb 22, 2024
1 parent b0335b6 commit 0e52d08
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions prediction.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,12 @@ func (r *Client) GetPrediction(ctx context.Context, id string) (*Prediction, err
}
return prediction, nil
}

func (r *Client) CancelPrediction(ctx context.Context, id string) (*Prediction, error) {
prediction := &Prediction{}
err := r.fetch(ctx, "POST", fmt.Sprintf("/predictions/%s/cancel", id), nil, prediction)
if err != nil {
return nil, fmt.Errorf("failed to cancel prediction: %w", err)
}
return prediction, nil
}

0 comments on commit 0e52d08

Please sign in to comment.