@@ -141,6 +141,9 @@ type Workspaces interface {
141
141
142
142
// AddTagBindings adds or modifies the value of existing tag binding keys for a workspace.
143
143
AddTagBindings (ctx context.Context , workspaceID string , options WorkspaceAddTagBindingsOptions ) ([]* TagBinding , error )
144
+
145
+ // DeleteAllTagBindings removes all tag bindings for a workspace.
146
+ DeleteAllTagBindings (ctx context.Context , workspaceID string ) error
144
147
}
145
148
146
149
// workspaces implements Workspaces.
@@ -829,6 +832,32 @@ func (s *workspaces) AddTagBindings(ctx context.Context, workspaceID string, opt
829
832
return response .Items , err
830
833
}
831
834
835
+ // DeleteAllTagBindings removes all tag bindings associated with a workspace.
836
+ // This method will not remove any inherited tag bindings, which must be
837
+ // explicitly removed from the parent project.
838
+ func (s * workspaces ) DeleteAllTagBindings (ctx context.Context , workspaceID string ) error {
839
+ if ! validStringID (& workspaceID ) {
840
+ return ErrInvalidWorkspaceID
841
+ }
842
+
843
+ type aliasOpts struct {
844
+ Type string `jsonapi:"primary,workspaces"`
845
+ TagBindings []* TagBinding `jsonapi:"relation,tag-bindings"`
846
+ }
847
+
848
+ opts := & aliasOpts {
849
+ TagBindings : []* TagBinding {},
850
+ }
851
+
852
+ u := fmt .Sprintf ("workspaces/%s" , url .PathEscape (workspaceID ))
853
+ req , err := s .client .NewRequest ("PATCH" , u , opts )
854
+ if err != nil {
855
+ return err
856
+ }
857
+
858
+ return req .Do (ctx , nil )
859
+ }
860
+
832
861
// Create is used to create a new workspace.
833
862
func (s * workspaces ) Create (ctx context.Context , organization string , options WorkspaceCreateOptions ) (* Workspace , error ) {
834
863
if ! validStringID (& organization ) {
0 commit comments