Skip to content

Commit

Permalink
Update from OpenAPI (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx authored Mar 8, 2023
1 parent e54da35 commit 3adcf9c
Show file tree
Hide file tree
Showing 28 changed files with 455 additions and 833 deletions.
2 changes: 1 addition & 1 deletion account_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func TestMwsAccLogDelivery(t *testing.T) {
}
creds, err := a.Credentials.Create(ctx, deployment.CreateCredentialRequest{
CredentialsName: RandomName("sdk-"),
AwsCredentials: deployment.AwsCredentials{
StsRole: &deployment.StsRole{
AwsCredentials: deployment.CreateCredentialAwsCredentials{
StsRole: &deployment.CreateCredentialStsRole{
RoleArn: GetEnvOrSkipTest(t, "TEST_LOGDELIVERY_ARN"),
},
},
Expand Down
32 changes: 0 additions & 32 deletions internal/dbsql_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package internal

import (
"strconv"
"testing"

"github.com/databricks/databricks-sdk-go/service/sql"
Expand Down Expand Up @@ -105,37 +104,6 @@ func TestAccAlerts(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, len(all), len(names))
assert.Equal(t, alert.Id, names[byId.Name])

schedule, err := w.Alerts.CreateSchedule(ctx, sql.CreateRefreshSchedule{
AlertId: alert.Id,
Cron: "5 4 * * *",
DataSourceId: srcs[0].Id,
})
require.NoError(t, err)
defer w.Alerts.DeleteScheduleByAlertIdAndScheduleId(ctx, alert.Id, schedule.Id)

schedules, err := w.Alerts.ListSchedulesByAlertId(ctx, alert.Id)
require.NoError(t, err)
assert.True(t, len(schedules) >= 1)

me, err := w.CurrentUser.Me(ctx)
require.NoError(t, err)

userId, err := strconv.ParseInt(me.Id, 10, 64)
require.NoError(t, err)

sub, err := w.Alerts.Subscribe(ctx, sql.CreateSubscription{
AlertId: alert.Id,
UserId: userId,
})
require.NoError(t, err)

allSubs, err := w.Alerts.GetSubscriptionsByAlertId(ctx, alert.Id)
require.NoError(t, err)
assert.True(t, len(allSubs) >= 1)

err = w.Alerts.UnsubscribeByAlertIdAndSubscriptionId(ctx, alert.Id, sub.Id)
require.NoError(t, err)
}

func TestAccDashboards(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions internal/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func TestMwsAccCredentials(t *testing.T) {
}
role, err := a.Credentials.Create(ctx, deployment.CreateCredentialRequest{
CredentialsName: RandomName("sdk-"),
AwsCredentials: deployment.AwsCredentials{
StsRole: &deployment.StsRole{
AwsCredentials: deployment.CreateCredentialAwsCredentials{
StsRole: &deployment.CreateCredentialStsRole{
RoleArn: GetEnvOrSkipTest(t, "TEST_CROSSACCOUNT_ARN"),
},
},
Expand Down Expand Up @@ -217,8 +217,8 @@ func TestMwsAccWorkspaces(t *testing.T) {
// See https://github.com/databricks/terraform-provider-databricks/issues/1424
role, err := a.Credentials.Create(ctx, deployment.CreateCredentialRequest{
CredentialsName: RandomName("go-sdk-"),
AwsCredentials: deployment.AwsCredentials{
StsRole: &deployment.StsRole{
AwsCredentials: deployment.CreateCredentialAwsCredentials{
StsRole: &deployment.CreateCredentialStsRole{
RoleArn: GetEnvOrSkipTest(t, "TEST_CROSSACCOUNT_ARN"),
},
},
Expand All @@ -244,8 +244,8 @@ func TestMwsAccWorkspaces(t *testing.T) {

updateRole, err := a.Credentials.Create(ctx, deployment.CreateCredentialRequest{
CredentialsName: RandomName("go-sdk-"),
AwsCredentials: deployment.AwsCredentials{
StsRole: &deployment.StsRole{
AwsCredentials: deployment.CreateCredentialAwsCredentials{
StsRole: &deployment.CreateCredentialStsRole{
RoleArn: GetEnvOrSkipTest(t, "TEST_CROSSACCOUNT_ARN"),
},
},
Expand Down
30 changes: 14 additions & 16 deletions service/clusters/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions service/clusters/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/dbfs/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/dbfs/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3adcf9c

Please sign in to comment.