Skip to content

Commit

Permalink
[Internal] cleanup old API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchy committed Aug 27, 2024
1 parent 5eeef23 commit c53a84e
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions sharing/resource_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

type SharesAPI struct {
client *common.DatabricksClient
context context.Context
}

func NewSharesAPI(ctx context.Context, m any) SharesAPI {
return SharesAPI{m.(*common.DatabricksClient), context.WithValue(ctx, common.Api, common.API_2_1)}
}

const (
ShareAdd = "ADD"
ShareRemove = "REMOVE"
Expand Down Expand Up @@ -102,18 +93,6 @@ func (si *ShareInfo) suppressCDFEnabledDiff() {
}
}

func (a SharesAPI) get(name string) (si ShareInfo, err error) {
err = a.client.Get(a.context, "/unity-catalog/shares/"+name+"?include_shared_data=true", nil, &si)
return
}

func (a SharesAPI) update(name string, su sharing.UpdateShare) error {
if len(su.Updates) == 0 {
return nil
}
return a.client.Patch(a.context, "/unity-catalog/shares/"+name, su)
}

func (si ShareInfo) shareChanges(action string) sharing.UpdateShare {
var changes []sharing.SharedDataObjectUpdate
for _, obj := range si.Objects {
Expand Down

0 comments on commit c53a84e

Please sign in to comment.