Skip to content

Commit 91dd88f

Browse files
committed
Add cancel to deployment run interface
1 parent b352292 commit 91dd88f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stack_deployment_runs.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type StackDeploymentRuns interface {
1717
Read(ctx context.Context, stackDeploymentRunID string) (*StackDeploymentRun, error)
1818
ReadWithOptions(ctx context.Context, stackDeploymentRunID string, options *StackDeploymentRunReadOptions) (*StackDeploymentRun, error)
1919
ApproveAllPlans(ctx context.Context, deploymentRunID string) error
20+
Cancel(ctx context.Context, stackDeploymentRunID string) error
2021
}
2122

2223
// stackDeploymentRuns implements StackDeploymentRuns.
@@ -120,6 +121,15 @@ func (s stackDeploymentRuns) ApproveAllPlans(ctx context.Context, stackDeploymen
120121
return req.Do(ctx, nil)
121122
}
122123

124+
func (s stackDeploymentRuns) Cancel(ctx context.Context, stackDeploymentRunID string) error {
125+
req, err := s.client.NewRequest("POST", fmt.Sprintf("stack-deployment-runs/%s/cancel", url.PathEscape(stackDeploymentRunID)), nil)
126+
if err != nil {
127+
return err
128+
}
129+
130+
return req.Do(ctx, nil)
131+
}
132+
123133
func (o *StackDeploymentRunReadOptions) valid() error {
124134
for _, include := range o.Include {
125135
switch include {

0 commit comments

Comments
 (0)