Skip to content

Commit aabed5e

Browse files
committed
refactor: rename clients.APIInterface() to clients.API()
1 parent 192ab46 commit aabed5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+155
-158
lines changed

cmd/app/link.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func LinkExistingApp(ctx context.Context, clients *shared.ClientFactory, app *ty
225225
}
226226

227227
appIDs := []string{app.AppID}
228-
_, err = clients.APIInterface().GetAppStatus(ctx, auth.Token, appIDs, app.TeamID)
228+
_, err = clients.API().GetAppStatus(ctx, auth.Token, appIDs, app.TeamID)
229229
if err != nil {
230230
return err
231231
}

cmd/collaborators/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func runAddCommandFunc(ctx context.Context, clients *shared.ClientFactory, cmd *
8585
if err != nil {
8686
return err
8787
}
88-
err = clients.APIInterface().AddCollaborator(ctx, selection.Auth.Token, selection.App.AppID, slackUser)
88+
err = clients.API().AddCollaborator(ctx, selection.Auth.Token, selection.App.AppID, slackUser)
8989
if err != nil {
9090
if clients.Config.WithExperimentOn(experiment.ReadOnlyAppCollaborators) && strings.Contains(err.Error(), "user_already_owner") {
9191
cmd.Println()

cmd/collaborators/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func runListCommand(cmd *cobra.Command, clients *shared.ClientFactory) error {
6666
if err = cmdutil.AppExists(app, selection.Auth); err != nil {
6767
return err
6868
}
69-
collaborators, err := clients.APIInterface().ListCollaborators(ctx, selection.Auth.Token, app.AppID)
69+
collaborators, err := clients.API().ListCollaborators(ctx, selection.Auth.Token, app.AppID)
7070
if err != nil {
7171
return slackerror.Wrap(err, "Error listing collaborators")
7272
}

cmd/collaborators/remove.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func runRemoveCommandFunc(ctx context.Context, clients *shared.ClientFactory, cm
7070
if err = cmdutil.AppExists(selection.App, selection.Auth); err != nil {
7171
return err
7272
}
73-
warnings, err := clients.APIInterface().RemoveCollaborator(ctx, selection.Auth.Token, selection.App.AppID, slackUser)
73+
warnings, err := clients.API().RemoveCollaborator(ctx, selection.Auth.Token, selection.App.AppID, slackUser)
7474
if err != nil {
7575
return err
7676
}
@@ -120,7 +120,7 @@ func promptCollaboratorsRemoveSlackUserPrompts(
120120
slackUser types.SlackUser,
121121
err error,
122122
) {
123-
collaborators, err := clients.APIInterface().ListCollaborators(ctx, selection.Auth.Token, selection.App.AppID)
123+
collaborators, err := clients.API().ListCollaborators(ctx, selection.Auth.Token, selection.App.AppID)
124124
if err != nil {
125125
return types.SlackUser{}, err
126126
}

cmd/collaborators/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func runUpdateCommand(cmd *cobra.Command, clients *shared.ClientFactory, args []
108108
return err
109109
}
110110

111-
err = clients.APIInterface().UpdateCollaborator(ctx, selection.Auth.Token, app.AppID, slackUser)
111+
err = clients.API().UpdateCollaborator(ctx, selection.Auth.Token, app.AppID, slackUser)
112112
if err != nil {
113113
return slackerror.Wrap(err, "Error updating collaborator")
114114
}

cmd/datastore/bulk_put.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func startBulkPutImport(ctx context.Context, clients *shared.ClientFactory, cmd
302302
}
303303

304304
query.Items = currentBatch
305-
bulkPutResult, err := clients.APIInterface().AppsDatastoreBulkPut(ctx, token, query)
305+
bulkPutResult, err := clients.API().AppsDatastoreBulkPut(ctx, token, query)
306306
if err != nil {
307307
if len(err.(*slackerror.Error).Details) == 0 {
308308
return err

cmd/datastore/count.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func runCountCommandFunc(
135135
}
136136

137137
// Perform the count
138-
countResult, err := clients.APIInterface().AppsDatastoreCount(ctx, selection.Auth.Token, count)
138+
countResult, err := clients.API().AppsDatastoreCount(ctx, selection.Auth.Token, count)
139139
if err != nil {
140140
return err
141141
}

cmd/datastore/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ func startQueryExport(ctx context.Context, clients *shared.ClientFactory, cmd *c
409409
}
410410

411411
query.Limit = maxItemsToRead
412-
queryResult, err := clients.APIInterface().AppsDatastoreQuery(ctx, token, query)
412+
queryResult, err := clients.API().AppsDatastoreQuery(ctx, token, query)
413413
if err != nil {
414414
return err
415415
}

cmd/doctor/check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func checkCLICreds(ctx context.Context, clients *shared.ClientFactory) (Section,
301301
// the call. This results in incorrectly deeming tokens invalid if using multiple workspaces
302302
// with different API hosts. (cc: @mbrooks)
303303
clients.Config.APIHostResolved = clients.AuthInterface().ResolveAPIHost(ctx, clients.Config.APIHostFlag, &authInfo)
304-
_, err := clients.APIInterface().ValidateSession(ctx, authInfo.Token)
304+
_, err := clients.API().ValidateSession(ctx, authInfo.Token)
305305
if err != nil {
306306
validitySection.Value = "Invalid"
307307
}

cmd/env/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func runEnvAddCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, arg
127127
variableValue = args[1]
128128
}
129129

130-
err = clients.APIInterface().AddVariable(
130+
err = clients.API().AddVariable(
131131
ctx,
132132
selection.Auth.Token,
133133
selection.App.AppID,

0 commit comments

Comments
 (0)